:root {
  --bg: #0E0E10;
  --text: #EFEFF1;
  --muted: #ADADB8;
  --dim: #8B8B96;
  --cell: #18181B;
  --cell-now: #1F1F23;
  --cell-selected: #2E2E36;
  --cell-hover: #26262C;
  --chip: #26262C;
  --track: #3A3A44;
  --live: #E8251B;
  --brand: #FF5A36;
  --line: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Figtree, 'Helvetica Neue', Arial, sans-serif; }
a { color: var(--text); }
a:hover { color: #FFFFFF; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
[hidden] { display: none !important; }

/* header */
.top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.brand-word { font-weight: 800; font-size: 23px; letter-spacing: -0.04em; color: #FFFFFF; }
.brand-tv { padding: 1px 5px; border-radius: 4px; background: var(--brand); color: var(--bg); font-weight: 800; font-size: 11px; letter-spacing: 0.02em; }
.spacer { flex: 1; }
.discord { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 6px; background: #5865F2; color: #FFFFFF; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.discord:hover { background: #4752C4; color: #FFFFFF; }

/* selected program */
.hero { display: flex; flex-wrap: wrap; gap: 32px; padding: 28px 32px 24px; }
.hero-media { flex: 3 1 760px; min-width: 300px; display: flex; flex-direction: column; }
.screen-box { position: relative; }
.screen { display: block; position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
@supports not (aspect-ratio: 16 / 9) {  /* Chromium < 88 (most TV browsers): the old padding trick */
  .screen { height: 0; padding-top: 56.25%; }
}
.mute { position: absolute; right: 64px; bottom: 12px; z-index: 4; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(14, 14, 16, 0.6); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.2s ease; }
.screen-box:hover .mute { opacity: 1; }
.mute:focus-visible { opacity: 1; }  /* its own rule: browsers without :focus-visible drop the whole rule it is in */
.mute:hover { background: rgba(14, 14, 16, 0.85); }
.mute.fs { right: 12px; }  /* the full-screen button, on the mute button's right */
/* the guide's video full screen: the box fills the screen, the video fits inside it and is no longer a link. Prefixed and
   unprefixed rules stay apart: a browser that lacks one drops a whole rule that names it. */
.screen-box:fullscreen { width: 100%; height: 100%; background: #000; }
.screen-box:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.screen-box:fullscreen .screen { height: 100%; padding-top: 0; aspect-ratio: auto; border-radius: 0; pointer-events: none; }
.screen-box:-webkit-full-screen .screen { height: 100%; padding-top: 0; aspect-ratio: auto; border-radius: 0; pointer-events: none; }
.screen-box:fullscreen .player video, .screen-box:fullscreen .player img { object-fit: contain; }
.screen-box:-webkit-full-screen .player video, .screen-box:-webkit-full-screen .player img { object-fit: contain; }
@media (hover: none) { .mute { opacity: 1; } }  /* touch screens have no hover */
.screen-cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-live { position: absolute; top: 12px; left: 12px; padding: 3px 7px; border-radius: 3px; background: var(--live); color: #FFFFFF; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; z-index: 3; }
.screen-note { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(14, 14, 16, 0.72); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; text-align: center; padding: 24px; z-index: 3; }
.hero-info { flex: 2 1 380px; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.chan-line { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.chan-line img { height: 32px; width: auto; display: block; }
.vsep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.2); }
.chan-number { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero h1 { margin: 4px 0 0; font-size: 36px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.episode { margin: 0; font-size: 16px; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rating { padding: 1px 5px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px; font-size: 11px; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.blurb { margin: 2px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 560px; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.solid { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 6px; background: #FFFFFF; color: var(--bg); font-weight: 700; font-size: 15px; text-decoration: none; border: none; cursor: pointer; }
.solid:hover { background: #E4E4EA; color: var(--bg); }

/* guide */
.guide { padding: 0 32px 40px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.chip { padding: 8px 14px; border-radius: 6px; border: none; background: var(--chip); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.grid-scroll { overflow-x: auto; }
.grid { min-width: 960px; position: relative; }
.row { display: flex; height: 72px; border-bottom: 1px solid var(--line); }
.row > :first-child { flex: 0 0 200px; }
.row > :last-child { flex: 1 1 0; min-width: 0; }
.row.head { height: 40px; align-items: center; border-bottom-color: rgba(255, 255, 255, 0.08); }
.today { font-size: 14px; font-weight: 700; padding-left: 4px; }
.timeline { position: relative; height: 40px; }
.tick { position: absolute; top: 12px; padding-left: 8px; font-size: 13px; font-weight: 600; color: var(--muted); border-left: 1px solid rgba(255, 255, 255, 0.12); line-height: 16px; }
.now-label { position: absolute; top: 9px; transform: translateX(-50%); padding: 2px 6px; border-radius: 3px; background: var(--live); color: #FFFFFF; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; z-index: 2; }
.now-line { position: absolute; top: 40px; bottom: 0; width: 2px; background: var(--live); z-index: 1; pointer-events: none; }
.chan { display: flex; align-items: center; gap: 12px; padding-left: 4px; text-decoration: none; }
.chan-logo { flex: none; width: 112px; height: 48px; display: flex; align-items: center; justify-content: center; }
.chan-logo img { max-width: 108px; max-height: 42px; display: block; }
.chan-logo span { font-weight: 800; font-size: 15px; }
.chan .num { font-size: 14px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.lane { position: relative; }
.cell { position: absolute; top: 4px; bottom: 4px; padding: 0 12px; border-radius: 4px; border: 1px solid transparent; background: var(--cell); color: var(--text); text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 3px; overflow: hidden; }
.cell:hover { background: var(--cell-hover); }
.cell.now { background: var(--cell-now); }
.cell.selected { background: var(--cell-selected); border-color: #FFFFFF; }
.cell-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.past .cell-title { color: var(--muted); }
.cell-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.tag-new { padding: 0 4px; border-radius: 2px; background: var(--track); color: var(--text); font-size: 10px; font-weight: 800; letter-spacing: 0.04em; }
.empty { padding: 48px 32px; color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 720px; }
.empty code { color: var(--text); }

/* the live player: two stacked videos, the next clip loaded in the hidden one */
.player { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #000; }
.player video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; }
.player video.on { opacity: 1; }
.player img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* watch page */
.watch { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; overflow: hidden; }
.watch .player video { object-fit: contain; }
.bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 18px 24px; z-index: 4; transition: opacity 0.3s; }
.bar.top-bar { top: 0; background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); }
.bar.bottom-bar { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.watch.idle .bar { opacity: 0; }
.ctl { width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; font-weight: 700; }
.ctl.wide { width: auto; padding: 0 14px; border-radius: 22px; }
.ctl:hover { background: rgba(255, 255, 255, 0.12); }
.bar img { height: 30px; width: auto; }
.bar .titles { display: flex; flex-direction: column; min-width: 0; }
.bar .titles strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .titles span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ch-num { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.unmute { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; }
.clip-info { font-size: 13px; color: var(--muted); }

/* errors a script hit, shown on the page (compat.js): TV browsers have no developer tools */
.compat-error { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10; padding: 12px 16px; border-radius: 6px; background: #3A1512; color: #FFFFFF; font-size: 14px; line-height: 1.4; }

/* flexbox gap needs Chromium 84: older browsers (compat.js sets html.no-flexgap) get margins instead */
.no-flexgap .top > * + *, .no-flexgap .bar > * + * { margin-left: 12px; }
.no-flexgap .brand > * + * { margin-left: 6px; }
.no-flexgap .hero > * + * { margin-left: 32px; }
.no-flexgap .hero-info > * + * { margin-top: 10px; }
.no-flexgap .chan-line > * + *, .no-flexgap .actions > * + * { margin-left: 10px; }
.no-flexgap .meta > * + *, .no-flexgap .filters > * + *, .no-flexgap .solid > * + *, .no-flexgap .discord > * + * { margin-left: 8px; }
.no-flexgap .chan > * + * { margin-left: 12px; }
.no-flexgap .cell-title > * + *, .no-flexgap .cell-sub > * + *, .no-flexgap .live-pill > * + * { margin-left: 6px; }

@media (max-width: 720px) {
  .top, .hero, .guide { padding-left: 16px; padding-right: 16px; }
  .discord span { display: none; }  /* the logo alone on a phone */
  .discord { padding: 10px 12px; }
  .hero h1 { font-size: 28px; }
  .bar { padding: 12px 16px; gap: 8px; }
}
