/* Marquee — cinematic dark theme with a left rail.
   Single deliberate dark look: theatre-black ground, marquee-bulb gold accent, on-air red for live. */
:root {
  --bg: #0b0a0c; --rail: #08070a; --surface: #141216; --raised: #1b181e; --line: #1f1c22; --line-2: #2a262d;
  --fg: #f3efe9; --fg-2: #d9d3cb; --muted: #a39d96; --dim: #6e6870;
  --accent: #e9b949; --accent-ink: #1b1405; --accent-soft: rgba(233, 185, 73, .15);
  --live: #ff5a4f; --ok: #7fc8a0;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail-w: 112px; --pad: 48px; --radius: 8px; --ppm: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.solid { fill: currentColor; stroke: none; }
.mono, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.display { font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; line-height: .9; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { display: flex; height: 100%; }
.rail { flex: none; width: var(--rail-w); background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: calc(24px + env(safe-area-inset-top, 0px)) 0 20px; overflow-y: auto; scrollbar-width: none; }
.rail-logo { display: grid; place-items: center; margin-bottom: 18px; text-decoration: none; }
.bulbs { display: grid; grid-template-columns: repeat(3, 7px); gap: 5px; padding: 8px; border: 2px solid var(--accent); border-radius: 6px; }
.bulbs i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bulb 2.4s infinite; }
.bulbs i:nth-child(even) { opacity: .45; animation-delay: 1.2s; }
@keyframes bulb { 50% { opacity: .45; } }
.rail-items { display: flex; flex-direction: column; gap: 4px; }
.rail-item { position: relative; width: 92px; padding: 10px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; font-size: 12px; line-height: 1.2; text-align: center; font-weight: 600; color: var(--muted); }
.rail-item svg { width: 24px; height: 24px; stroke-width: 1.8; }
.rail-item:hover { color: var(--fg); background: var(--raised); }
.rail-item[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.rail-item .dot { position: absolute; top: 9px; right: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px var(--rail); }
.rail-profile { margin-top: auto; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: var(--raised); font-weight: 800; }
.main { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; outline: none; scroll-behavior: smooth; }
.view { min-height: 100%; }
.page { padding: calc(32px + env(safe-area-inset-top, 0px)) var(--pad) 56px; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font: 900 56px/0.9 var(--display); text-transform: uppercase; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .tools { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.clock { font-weight: 600; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 6px; border: 1px solid rgba(243, 239, 233, .3); background: rgba(11, 10, 12, .45); color: var(--fg); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--fg); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.danger { color: var(--live); border-color: rgba(255, 90, 79, .5); }
.btn.icon { padding: 13px; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; padding: 4px 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chip { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .n { opacity: .6; margin-left: 6px; font-weight: 500; }
.sep { width: 1px; height: 24px; background: var(--line-2); flex: none; align-self: center; }
.input, .select { background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 14px; min-width: 0; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; }
.search-input { width: 320px; max-width: 100%; border-radius: 999px; padding-left: 40px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23a39d96' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 14px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 600; }
.badge { padding: 2px 7px; border: 1px solid #4a454e; border-radius: 4px; font-size: 12px; font-weight: 700; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--live); }
.live-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: bulb 1.6s infinite; }
.live-pill { padding: 4px 9px; border-radius: 4px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.rating { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }
.rating svg { width: 13px; height: 13px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 560px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: #16202a; }
.hero-art, .backdrop-art { position: absolute; inset: 0; background-size: cover; background-position: center 20%; transition: opacity .8s ease; }
.hero::after, .detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 10%, rgba(11, 10, 12, .55) 50%, rgba(11, 10, 12, .05) 85%), linear-gradient(0deg, var(--bg) 0%, rgba(11, 10, 12, 0) 45%); pointer-events: none; }
.hero-body { position: relative; z-index: 1; padding: 0 var(--pad) 44px; max-width: 700px; display: flex; flex-direction: column; gap: 16px; }
.hero-title { font: 900 clamp(56px, 7vw, 104px)/0.88 var(--display); text-transform: uppercase; }
.hero-meta, .meta { display: flex; gap: 10px; font-size: 14px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.hero-meta .dotsep::before, .meta .dotsep::before { content: "·"; color: var(--dim); }
.hero p, .clamp3 { margin: 0; font-size: 17px; line-height: 1.6; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-top { position: absolute; z-index: 2; top: calc(26px + env(safe-area-inset-top, 0px)); right: var(--pad); display: flex; gap: 16px; align-items: center; }
.hero-dots { position: absolute; z-index: 2; right: var(--pad); bottom: 48px; display: flex; gap: 8px; }
.hero-dots button { width: 12px; height: 4px; border-radius: 2px; border: 0; padding: 0; background: rgba(243, 239, 233, .3); }
.hero-dots button[aria-current="true"] { width: 28px; background: var(--accent); }
.progress-line { height: 3px; width: 320px; max-width: 100%; background: rgba(243, 239, 233, .2); border-radius: 2px; }
.progress-line i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ---------- Rows & tiles ---------- */
.rows { display: flex; flex-direction: column; gap: 36px; padding: 8px var(--pad) 56px; }
.shelf { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shelf-head { display: flex; align-items: baseline; gap: 14px; }
.shelf-head h2, .h2 { font: 800 28px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.shelf-head .count { font-size: 13px; color: var(--muted); }
.shelf-head .more { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: 0; color: var(--accent); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 6 * 14px) / 7); gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 4px; }
.strip.wide { grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 16px; }
.tile { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-snap-align: start; }
.tile:focus-visible .art { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile > span, .t-sub { display: block; }
.art, .art-fallback, .face { display: block; }
.art { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface); transition: transform .18s ease, box-shadow .18s ease; }
.art.wide { aspect-ratio: 16 / 9; border-radius: 8px; }
.tile:hover .art { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .5); }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art.logo img { object-fit: contain; padding: 14% 18%; }
.art-fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 12px; background: hsl(var(--h) 30% 16%); overflow: hidden; }
.art-fallback::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; right: -18%; top: 12%; background: hsl(calc(var(--h) + 30) 45% 45%); }
.art-fallback span { position: relative; font: 900 21px/.95 var(--display); text-transform: uppercase; word-break: break-word; }
.art.wide .art-fallback { align-items: center; justify-content: center; text-align: center; }
.art.wide .art-fallback::before { width: 40%; right: -8%; top: -30%; opacity: .5; }
.tag-tl { position: absolute; left: 10px; top: 10px; z-index: 1; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 8px; border-radius: 4px; background: rgba(11, 10, 12, .7); max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-tr { position: absolute; right: 8px; top: 8px; z-index: 1; color: var(--accent); filter: drop-shadow(0 1px 2px #000); }
.tag-tr svg { width: 20px; height: 20px; }
.tag-br { position: absolute; right: 8px; bottom: 10px; z-index: 1; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(11, 10, 12, .75); }
.bar-b { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .5); z-index: 1; }
.bar-b i { display: block; height: 100%; background: var(--accent); }
.bar-b.live i { background: var(--live); }
.t-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sentinel { height: 1px; }
.empty { border: 1px dashed var(--line-2); border-radius: 12px; padding: 32px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.empty h2 { color: var(--fg); font: 800 30px/1 var(--display); text-transform: uppercase; }

/* ---------- Live list ---------- */
.split { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.split > .side { flex: 1 1 220px; max-width: 260px; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.split > .content { flex: 999 1 560px; min-width: 0; }
.side button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.side button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side button:hover { color: var(--fg); background: var(--surface); }
.side button[aria-pressed="true"] { background: var(--raised); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.side .n { font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.side .side-title { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 14px 12px 6px; }
.chan-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chan { display: grid; grid-template-columns: 52px 76px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; }
.chan:last-child { border-bottom: 0; }
.chan:hover, .chan:focus-visible { background: var(--raised); }
.chan .cnum { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.logo-box { position: relative; height: 44px; border-radius: 6px; background: var(--bg); overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.logo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #1b181e; }
.chan-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; align-items: center; }
.chan-now { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar { height: 3px; background: var(--line-2); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--live); }
.icon-btn { border: 0; background: none; color: var(--muted); width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); color: var(--fg); }
.icon-btn.on { color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.cu-badge { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--accent); border: 1px solid rgba(233, 185, 73, .5); padding: 1px 5px; border-radius: 3px; }

/* ---------- Guide ---------- */
.g-preview { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 32px; align-items: center; }
.g-preview .art { aspect-ratio: 16 / 9; border-radius: 10px; }
.g-preview h2 { font: 900 52px/.95 var(--display); text-transform: uppercase; }
.g-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: #121014; max-height: calc(100vh - 420px); min-height: 360px; position: relative; scrollbar-width: thin; }
.g-grid { position: relative; display: grid; grid-template-columns: 220px max-content; }
.g-corner, .g-chan { position: sticky; left: 0; z-index: 3; background: #121014; border-right: 1px solid var(--line); }
.g-corner { top: 0; z-index: 5; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.g-times { position: sticky; top: 0; z-index: 4; height: 44px; display: flex; background: #121014; border-bottom: 1px solid var(--line); }
.g-times span { flex: none; width: calc(30 * var(--ppm)); padding: 13px 10px; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.g-chan { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); border-top: 0; border-left: 0; text-align: left; color: var(--fg); }
.g-chan:hover { background: var(--surface); }
.g-chan .cnum { font-size: 12px; color: var(--muted); width: 28px; flex: none; font-variant-numeric: tabular-nums; }
.g-chan .logo-box { width: 48px; height: 32px; flex: none; font-size: 10px; }
.g-chan .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row { position: relative; height: 72px; border-bottom: 1px solid var(--line); }
.g-prog { position: absolute; top: 6px; bottom: 6px; border: 0; border-radius: 6px; padding: 0 12px; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; background: var(--raised); color: var(--fg); }
.g-prog:hover { background: #26222a; }
.g-prog.past { color: var(--muted); background: #161418; }
.g-prog.now { background: #2a2520; box-shadow: inset 3px 0 0 var(--accent); }
.g-prog.sel { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.g-prog b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog small { font-size: 12px; opacity: .8; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.g-prog .cu { font-size: 10px; font-weight: 800; }
.g-empty { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 14px; font-size: 13px; color: var(--dim); }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 2; pointer-events: none; }

/* ---------- Games & locals ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.game-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.game-title.small { font-size: 19px; }
.game.is-live { border-color: rgba(255, 90, 79, .45); box-shadow: inset 3px 0 0 var(--live); }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.game-when { font-size: 13px; font-weight: 700; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.game-title { font: 800 26px/1.02 var(--display); text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.game-sub { font-size: 13px; color: var(--muted); }
.game-ch { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 10px 5px 5px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 600; }
.ch-btn:hover { border-color: var(--accent); }
.ch-btn .logo-box { width: 34px; height: 24px; font-size: 9px; flex: none; }
.ch-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-btn.more { padding: 5px 10px; color: var(--accent); }
.strip.games-strip { grid-auto-columns: minmax(320px, calc((100% - 2 * 16px) / 3)); gap: 16px; }
.filters { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.filters .label { min-width: 70px; }
.filter-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.filter-row .chips { flex: 1; min-width: 0; }
.nets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.net { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left; color: var(--fg); transition: transform .15s, border-color .15s; }
.net:hover, .net:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.net-hero { position: relative; height: 120px; display: grid; place-items: center; background: radial-gradient(120% 140% at 30% 0%, color-mix(in srgb, var(--net) 70%, #fff 12%), var(--net) 55%, color-mix(in srgb, var(--net) 60%, #000)); }
.net-hero img { position: absolute; inset: 18px 28px; width: calc(100% - 56px); height: calc(100% - 36px); object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.net-hero img + .live-dot, .net-hero .live-dot { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(255,90,79,.25); }
.net-word { font: 900 44px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; color: #fff; opacity: .92; }
.net-hero:has(img) .net-word { visibility: hidden; }
.net-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.net-call { font-size: 15px; font-weight: 800; color: var(--accent); letter-spacing: .06em; }
.net-call .muted { font-weight: 600; letter-spacing: 0; }
.net-now { font-weight: 700; }
.tag-na { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(11,10,12,.85); color: var(--fg-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tile.na .art { filter: grayscale(.85) brightness(.6); }
.na-btn { opacity: .75; cursor: default; border-style: dashed; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.market-pick { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Detail ---------- */
.detail-hero { position: relative; overflow: hidden; padding: calc(80px + env(safe-area-inset-top, 0px)) var(--pad) 40px; min-height: 540px; display: flex; align-items: flex-end; background: #16202a; }
.detail-hero > .wrap { position: relative; z-index: 1; display: flex; gap: 36px; align-items: flex-end; flex-wrap: wrap; width: 100%; }
.back-link { position: absolute; z-index: 2; top: calc(24px + env(safe-area-inset-top, 0px)); left: var(--pad); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg-2); background: none; border: 0; padding: 0; }
.back-link svg { width: 18px; height: 18px; }
.poster { flex: none; width: 220px; }
.poster .art { box-shadow: 0 20px 50px rgba(0, 0, 0, .6); border-radius: 8px; }
.detail-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.detail-title { font: 900 clamp(52px, 6.4vw, 92px)/.88 var(--display); text-transform: uppercase; }
.credits-line { font-size: 14px; color: var(--muted); line-height: 1.6; }
.credits-line b { color: var(--fg-2); font-weight: 600; }
.detail-body { display: flex; flex-wrap: wrap; gap: 40px; padding: 8px var(--pad) 0; }
.detail-body > section { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.about { flex: 1 1 320px; min-width: 0; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.about dl { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; font-size: 14px; }
.about dt { color: var(--muted); }
.about dd { margin: 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--fg-2); }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; padding: 0 0 12px; border: 0; background: none; font: 800 22px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }
.eps { display: flex; flex-direction: column; gap: 6px; }
.ep { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 12px; border-radius: 10px; border: 0; background: none; text-align: left; color: var(--fg); }
.ep:hover, .ep.current { background: #17151a; }
.ep .art { aspect-ratio: 16 / 9; }
.ep .n { font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep .ttl { font-weight: 700; font-size: 17px; }
.ep .d { font-size: 14px; line-height: 1.5; color: #c3bdb5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep .st { font-size: 13px; font-weight: 700; white-space: nowrap; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.person .face { width: 100%; max-width: 120px; aspect-ratio: 1; border-radius: 50%; background: var(--raised); overflow: hidden; display: grid; place-items: center; font: 800 28px var(--display); color: var(--dim); }
.person .face img { width: 100%; height: 100%; object-fit: cover; }
.person b { font-size: 14px; }
.person span { font-size: 13px; color: var(--muted); }

/* ---------- Modal & menus ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(4, 3, 5, .75); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.modal.wide { width: min(880px, 100%); }
.modal h2 { font: 900 34px/1 var(--display); text-transform: uppercase; }
.modal p { margin: 0; color: var(--fg-2); }
.modal .close { position: absolute; right: 12px; top: 12px; }
.menu { position: fixed; z-index: 90; min-width: 230px; max-height: 60vh; overflow-y: auto; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 2px; }
.menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 6px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.menu button:hover, .menu button:focus-visible { background: var(--line-2); }
.menu button[aria-checked="true"]::after { content: "✓"; color: var(--accent); }
.menu .menu-title { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--dim); padding: 8px 12px 4px; text-transform: uppercase; }
.menu form { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.menu input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; }
.toasts { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: flex; gap: 14px; align-items: center; max-width: 420px; animation: toastIn .25s ease; }
.toast button { border: 0; background: var(--bg); color: var(--fg); padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 13px; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.loading { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(11, 10, 12, .85); }
.loading > div { display: flex; flex-direction: column; align-items: center; gap: 16px; font-weight: 600; }
.loading small { color: var(--muted); font-weight: 500; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Settings & onboarding ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.panel h2 { font: 800 26px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; max-height: 320px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; }
.cat-list label { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 5px 4px; }
.cat-list input { accent-color: var(--accent); width: 16px; height: 16px; }
.welcome { min-height: 100%; display: grid; place-items: center; padding: 40px 16px; background: radial-gradient(1200px 600px at 70% 10%, #1d2a33 0%, var(--bg) 60%); }
.welcome-card { width: min(620px, 100%); display: flex; flex-direction: column; gap: 22px; }
.welcome-card h1 { font: 900 clamp(56px, 9vw, 96px)/.88 var(--display); text-transform: uppercase; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 7px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--fg); }
.profiles { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 12px; border: 0; background: none; color: var(--fg-2); font-weight: 700; font-size: 16px; }
.profile-card .av { width: 120px; height: 120px; border-radius: 16px; display: grid; place-items: center; font: 900 54px var(--display); color: var(--accent-ink); }
.profile-card:hover .av, .profile-card:focus-visible .av { outline: 3px solid var(--fg); outline-offset: 4px; }
.find-results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.find-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.find-row:last-child { border-bottom: 0; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 70; background: #000; color: var(--fg); overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.p-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .92) 88%); pointer-events: none; transition: opacity .35s; }
.p-top, .p-bottom { position: absolute; left: 0; right: 0; transition: opacity .35s, transform .35s; }
.p-top { top: 0; padding: calc(24px + env(safe-area-inset-top, 0px)) 36px 0; display: flex; align-items: flex-start; gap: 18px; }
.p-bottom { bottom: 0; padding: 0 36px calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.player.idle { cursor: none; }
.player.idle .p-top, .player.idle .p-bottom, .player.idle .p-scrim { opacity: 0; pointer-events: none; }
.player.idle .p-bottom { transform: translateY(16px); }
.p-logo { width: 64px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; background: var(--raised); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.p-logo:empty { display: none; }
.p-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.p-info { flex: 1; min-width: 0; }
.p-title-row { display: flex; align-items: center; gap: 12px; }
.p-info h2 { font: 900 34px/1 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-info p { margin: 4px 0 0; color: var(--fg-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-actions, .p-right { display: flex; gap: 10px; align-items: center; }
.p-right { margin-left: auto; }
.pbtn { border: 0; background: rgba(255, 255, 255, .12); color: var(--fg); display: inline-grid; place-items: center; }
.pbtn:hover { background: rgba(255, 255, 255, .22); }
.pbtn.round { width: 46px; height: 46px; border-radius: 50%; }
.pbtn.round.big { width: 62px; height: 62px; background: var(--accent); color: var(--accent-ink); }
.pbtn.square { width: 44px; height: 40px; border-radius: 8px; }
.pbtn.text { padding: 0 14px; height: 40px; border-radius: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.pbtn.on { color: var(--accent); }
.pbtn svg { width: 22px; height: 22px; }
.pbtn.big svg { width: 26px; height: 26px; }
.p-strip-head { display: flex; gap: 12px; align-items: baseline; }
.p-strip-head span { font: 800 20px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.p-strip-head small { color: var(--muted); font-size: 13px; }
.p-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.p-card { border: 0; text-align: left; padding: 12px; border-radius: 10px; display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .08); color: var(--fg); min-width: 0; }
.p-card:hover { background: rgba(255, 255, 255, .14); }
.p-card.cur { background: rgba(233, 185, 73, .16); box-shadow: inset 0 0 0 2px var(--accent); }
.p-card .logo-box { width: 52px; height: 36px; flex: none; }
.p-card .tx { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.p-card b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-card small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-timeline { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--fg-2); }
.p-bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); cursor: pointer; }
.p-bar:hover { height: 8px; }
.p-buf, .p-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.p-buf { background: rgba(255, 255, 255, .3); }
.p-fill { background: var(--accent); }
.p-knob { position: absolute; top: 50%; width: 16px; height: 16px; translate: -50% -50%; border-radius: 50%; background: #fff; }
.p-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--live); background: transparent; color: var(--live); font-weight: 800; font-size: 13px; letter-spacing: .06em; }
.live-btn i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.p-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; pointer-events: none; }
.p-msg > div { pointer-events: auto; max-width: 520px; background: rgba(11, 10, 12, .88); border: 1px solid var(--line-2); padding: 22px 26px; border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.p-msg .spin { margin: 0 auto; }
.p-stats { position: absolute; top: 110px; right: 36px; background: rgba(11, 10, 12, .85); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 18px; font: 12px/1.7 var(--mono); color: var(--fg-2); min-width: 240px; }
.p-numpad { position: absolute; top: 110px; left: 50%; translate: -50% 0; font: 900 72px var(--display); background: rgba(11, 10, 12, .8); padding: 8px 28px; border-radius: 12px; color: var(--accent); }

/* ---------- Multiview ---------- */
.multiview { position: fixed; inset: 0; z-index: 75; background: #000; display: flex; flex-direction: column; }
.mv-top { display: flex; align-items: center; gap: 18px; padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px; background: var(--rail); flex-wrap: wrap; }
.mv-top h2 { font: 900 28px var(--display); text-transform: uppercase; }
.mv-layouts { margin-left: auto; display: flex; gap: 6px; }
.mv-layouts button { width: 40px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: none; font-weight: 800; }
.mv-layouts button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.mv-grid { flex: 1; display: grid; gap: 4px; padding: 4px; min-height: 0; }
.mv-grid.l2 { grid-template-columns: 1fr 1fr; }
.mv-grid.l4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-cell { position: relative; background: #0d0c0f; border: 2px solid transparent; border-radius: 6px; overflow: hidden; min-height: 0; }
.mv-cell.active { border-color: var(--accent); }
.mv-cell video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.mv-label { position: absolute; left: 10px; top: 10px; display: flex; gap: 8px; align-items: center; padding: 5px 10px; border-radius: 6px; background: rgba(11, 10, 12, .75); font-size: 13px; font-weight: 700; }
.mv-cell .mv-x { position: absolute; right: 8px; top: 8px; }
.mv-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.mv-audio { position: absolute; right: 10px; bottom: 10px; padding: 4px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --pad: 18px; --rail-w: 0px; }
  body { overflow: auto; }
  .app { flex-direction: column; }
  .rail { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: auto; width: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .rail-logo, .rail-profile { display: none; }
  .rail-items { flex-direction: row; }
  .rail-item { width: 76px; flex: none; font-size: 11px; padding: 7px 2px; }
  .main { padding-bottom: 80px; }
  .strip { grid-auto-columns: 40%; }
  .strip.wide { grid-auto-columns: 78%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .hero { min-height: 460px; }
  .hero-dots { display: none; }
  .page-head h1 { font-size: 42px; }
  .g-preview { grid-template-columns: minmax(0, 1fr); }
  .g-preview h2 { font-size: 36px; }
  .g-grid { grid-template-columns: 120px max-content; }
  .g-chan .logo-box, .g-chan .cnum { display: none; }
  .chan { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .chan .cnum { display: none; }
  .ep { grid-template-columns: 120px minmax(0, 1fr); }
  .ep .st { display: none; }
  .poster { width: 140px; }
  .p-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-top, .p-bottom { padding-inline: 16px; }
  .p-right .pbtn.text { display: none; }
  .split > .side { position: static; max-width: none; max-height: none; flex-direction: row; overflow-x: auto; }
  .split > .side button { flex: none; }
  .side .side-title { display: none; }
  .mv-grid.l2, .mv-grid.l4 { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Matchup graphic ---------- */
.matchup { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 22px 16px 16px; min-height: 150px;
  background: linear-gradient(105deg, color-mix(in srgb, var(--ca) 85%, #000) 0%, color-mix(in srgb, var(--ca) 55%, #0b0a0c) 46%, color-mix(in srgb, var(--cb) 55%, #0b0a0c) 54%, color-mix(in srgb, var(--cb) 85%, #000) 100%); color: #fff; overflow: hidden; }
.matchup::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 90% at 50% 120%, rgba(0,0,0,.45), transparent 70%); pointer-events: none; }
.m-team { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.m-name { font: 800 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.m-score { font: 900 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.m-mid { position: relative; z-index: 1; display: grid; place-items: center; }
.m-vs { font: 900 22px/1 var(--display); padding: 8px 10px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.18); }
.m-clock { font-size: 12px; font-weight: 800; letter-spacing: .06em; padding: 5px 9px; border-radius: 6px; background: rgba(0,0,0,.45); white-space: nowrap; }
.m-sport { position: absolute; left: 10px; top: 8px; z-index: 2; opacity: .8; }
.m-sport svg { width: 20px; height: 20px; }
.m-live { position: absolute; right: 12px; top: 10px; z-index: 2; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 6px; }
.tlogo { position: relative; width: 72px; height: 72px; display: grid; place-items: center; flex: none; }
.tlogo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.45)); }
.tbadge { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--tc); border: 2px solid rgba(255,255,255,.35); font: 900 20px/1 var(--display); color: #fff; letter-spacing: .02em; }
.tlogo:has(img) .tbadge { visibility: hidden; }
.matchup.event { grid-template-columns: 1fr; place-items: center; }
.m-big { position: relative; z-index: 1; opacity: .9; }
.m-big svg { width: 64px; height: 64px; stroke-width: 1.2; }
.matchup.sm { min-height: 0; aspect-ratio: 16 / 9; padding: 12px 10px 10px; border-radius: 10px; }
.matchup.sm .tlogo { width: 56px; height: 56px; }
.matchup.sm .tbadge { font-size: 16px; }
.matchup.sm .m-name { font-size: 12px; }
.matchup.sm .m-vs { font-size: 15px; padding: 6px 8px; }
.matchup.sm .m-big svg { width: 44px; height: 44px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px 16px; }
.tile.rp .t-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.team-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.team-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-size: 13px; font-weight: 700; }
.team-btn:hover, .team-btn.on { border-color: var(--accent); }
.team-btn.on { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.team-btn .tlogo { width: 28px; height: 28px; }
.team-btn .tbadge { font-size: 10px; border-width: 1px; }
@media (max-width: 640px) { .tlogo { width: 56px; height: 56px; } .matchup { min-height: 120px; } }
