:root {
  --bg: #0b1120;
  --panel: #111a2e;
  --panel2: #16213a;
  --border: #24304d;
  --text: #e6edf7;
  --muted: #8ea0bd;
  --accent: #34d399;
  --accent2: #38bdf8;
  --chip: #1c2942;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 64px;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0e1730, #0b1120);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.logo { color: var(--accent); }
.lite-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #052e1a; background: var(--accent); padding: 2px 7px; border-radius: 999px;
}
.tabs { display: flex; gap: 6px; margin-left: 8px; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--chip); border-color: var(--border); }
.fullapp { margin-left: auto; color: var(--accent2); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fullapp:hover { text-decoration: underline; }

/* Off-hours banner */
.offbanner {
  margin: 12px 16px 4px; padding: 10px 14px; border: 1px solid var(--border);
  background: var(--panel); border-radius: var(--radius); color: var(--muted); font-size: 13px;
}
.offbanner .updated { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }

/* Chip rows */
.view { padding: 8px 16px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chiprow.sub { padding-top: 4px; border-top: 1px dashed var(--border); }
.chipgroup { display: flex; flex-wrap: wrap; gap: 8px; margin-right: 18px; }
.chip {
  background: var(--chip); color: var(--muted); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { color: #052e1a; background: var(--accent); border-color: var(--accent); }
.chip.active.alt { color: #04252e; background: var(--accent2); border-color: var(--accent2); }
.chip.surprise { color: #2a1a05; background: #fbbf24; border-color: #f59e0b; margin-left: auto; }
.chip.surprise:hover { filter: brightness(1.08); color: #2a1a05; }

/* Surprise featured player spans the full grid width */
.card.feature { grid-column: 1 / -1; border-color: #f59e0b; }
.card.feature .row { flex-wrap: wrap; }

/* Video grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 6px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.thumbwrap { position: relative; aspect-ratio: 16/9; background: #000; cursor: pointer; }
.thumbwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbwrap .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); opacity: .92;
}
.thumbwrap iframe { width: 100%; height: 100%; border: 0; }
.card .meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.card .title { font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.card .chan { color: var(--accent2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--border); color: var(--muted); }

/* News list */
.newslist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.news {
  display: flex; gap: 12px; align-items: baseline; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.news .src { font-size: 11px; font-weight: 700; color: var(--accent2); min-width: 92px; }
.news .body { flex: 1; min-width: 0; }
.news .head { font-size: 14px; font-weight: 600; }
.news a.head { color: var(--text); text-decoration: none; }
.news a.head:hover { color: var(--accent2); text-decoration: underline; }
.news .sub { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--muted); }
.sym { font-size: 11px; font-weight: 700; color: #052e1a; background: var(--accent); padding: 1px 6px; border-radius: 5px; }

.empty { padding: 40px 12px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }

/* Footer */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #0e1730; border-top: 1px solid var(--border); font-size: 12px;
}
.refresh { background: var(--chip); color: var(--text); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.refresh:hover { border-color: var(--accent); }

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .fullapp { order: 3; }
  .grid { grid-template-columns: 1fr; }
  .news { flex-direction: column; gap: 4px; }
  .news .src { min-width: 0; }
}
