:root {
  --bg: #0b1016; --panel: #141c26; --line: #2a3750; --fg: #e7ecf3; --muted: #9fb0c7;
  --accent: #4f8cff; --accent2: #49d17a; --danger: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { font-weight: 800; letter-spacing: .5px; color: var(--accent); font-size: 20px; }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.loading, .muted { color: var(--muted); }
button { font: inherit; cursor: pointer; border-radius: 10px; border: none; padding: 10px 16px; background: var(--accent); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.activate { max-width: 420px; margin: 8vh auto; text-align: center; }
.activate h1 { margin: 0 0 6px; }
.activate input {
  width: 100%; text-align: center; letter-spacing: 3px; text-transform: uppercase;
  font-size: 22px; padding: 14px; margin: 14px 0; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1520; color: var(--fg);
}
.err { color: var(--danger); min-height: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.chan {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  text-align: center; cursor: pointer; transition: border-color .15s, transform .1s;
}
.chan:hover, .chan:focus { border-color: var(--accent); outline: none; transform: translateY(-2px); }
.chan .logo { width: 100%; height: 72px; object-fit: contain; margin-bottom: 8px; }
.chan .ph { height: 72px; display: grid; place-items: center; color: var(--muted); font-size: 28px; }
.chan .name { font-size: 14px; font-weight: 600; }
.player-wrap { margin-top: 8px; }
video { width: 100%; max-height: 72vh; background: #000; border-radius: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

.search {
  width: 100%; max-width: 420px; margin: 4px 0 16px; padding: 11px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: #0e1520; color: var(--fg); font-size: 15px;
}

.chan { position: relative; }
.fav {
  position: absolute; top: 6px; right: 8px; font-size: 18px; line-height: 1;
  cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); user-select: none;
}
