/* ==========================================================================
   Glowbit — warm cinema dark theme
   ========================================================================== */
:root {
  --bg: #15110f;
  --bg-2: #1b1613;
  --panel: #211a17;
  --panel-2: #2b231f;
  --panel-3: #362c27;
  --line: #3a302a;
  --text: #f5ece2;
  --muted: #ab9b8c;
  --faint: #7a6c60;
  --amber: #f2a541;
  --coral: #ef6a4c;
  --accent-rgb: 242,165,65;
  --coral-rgb: 239,106,76;
  --grad: linear-gradient(135deg, var(--amber), var(--coral));
  --live: #ff5a4a;
  --ok: #7fc794;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-w: 236px;
  --display: Outfit, "Instrument Sans", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* Anything marked hidden stays hidden, even if a rule below gives it a display (e.g. the player overlays). */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: var(--amber); color: #1b120c; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.mark { display: inline-block; width: 30px; height: 30px; background: url(mark.svg) center / contain no-repeat; flex: none; }
.mark.big { width: 72px; height: 72px; }
.boot { height: 100vh; display: grid; place-items: center; }
.boot .mark { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); opacity: .6; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--panel-3); border-top-color: var(--amber); animation: spin .8s linear infinite; }
.loading { display: grid; place-items: center; padding: 80px 0; }

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 600; cursor: pointer; background: var(--grad); color: #1b120c; white-space: nowrap; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: rgba(255,255,255,.07); color: var(--text); backdrop-filter: blur(8px); }
.btn.ghost:hover { background: rgba(255,255,255,.13); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); cursor: pointer; color: var(--text); flex: none; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn.on { color: var(--amber); }
.icon { width: 20px; height: 20px; flex: none; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* ----------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); font: inherit; transition: border-color .15s; }
.input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); }
.input.code { font: 600 22px/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .18em; text-transform: uppercase; text-align: center; padding: 16px; }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-wrap .input { padding-left: 42px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.error { color: #ffb3a2; background: #2e1a16; border: 1px solid #6b3328; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; }

/* ===================================================================== AUTH */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #0f0c0a; }
.auth-art .reels { position: absolute; inset: -10%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; transform: rotate(-8deg); opacity: .9; }
.auth-art .reel-col { display: flex; flex-direction: column; gap: 16px; animation: drift 60s linear infinite; }
.auth-art .reel-col:nth-child(even) { animation-direction: reverse; margin-top: -120px; }
.auth-art .tile { aspect-ratio: 2/3; border-radius: 12px; }
@keyframes drift { to { transform: translateY(-50%); } }
.auth-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 70% at 30% 60%, transparent, rgba(15,12,10,.6) 60%, #0f0c0a), linear-gradient(90deg, transparent 60%, var(--bg)); }
.auth-art .tagline { position: absolute; left: 48px; bottom: 56px; z-index: 2; max-width: 440px; }
.auth-art .tagline h1 { font: 600 52px/1.02 var(--display); letter-spacing: -.02em; margin: 0 0 14px; }
.auth-art .tagline h1 em { font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art .tagline p { color: var(--muted); margin: 0; font-size: 16px; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 80px); background: var(--bg); }
.auth-box { width: 100%; max-width: 420px; margin: 0 auto; animation: fade-up .35s ease both; }
.auth-brand { display: flex; align-items: center; gap: 12px; font: 600 24px var(--display); margin-bottom: 36px; }
.auth-box h2 { font: 600 30px/1.15 var(--display); margin: 0 0 6px; letter-spacing: -.01em; }
.auth-box .lead { color: var(--muted); margin: 0 0 26px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.seg button { border: 0; background: none; padding: 9px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; margin-bottom: 18px; font-size: 14px; }
.back-link:hover { color: var(--text); }
.server-list { display: flex; flex-direction: column; gap: 10px; }
.server { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; transition: border-color .15s; }
.server.open { border-color: var(--faint); }
.server.ok { border-color: #3d5a45; }
.server.bad { border-color: #6b3328; }
.server-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; cursor: pointer; text-align: left; }
.server-head .dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 700 15px var(--display); background: var(--panel-3); color: var(--amber); flex: none; }
.server-head b { display: block; font-weight: 600; }
.server-head small { color: var(--muted); font-size: 12px; }
.server-head .tog { margin-left: auto; color: var(--faint); transition: transform .2s; }
.server.open .tog { transform: rotate(180deg); }
.server-body { display: none; padding: 0 16px 16px; gap: 10px; flex-direction: column; }
.server.open .server-body { display: flex; }
.server .msg { font-size: 13px; }
.server.ok .msg { color: var(--ok); }
.server.bad .msg { color: #ffb3a2; }

/* ===================================================================== SHELL */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid #241d19; background: var(--bg-2); }
.side .brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 24px; font: 600 22px var(--display); letter-spacing: -.01em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { position: relative; display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.side nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.side nav a.on { color: var(--text); background: linear-gradient(90deg, rgba(var(--accent-rgb),.14), rgba(var(--accent-rgb),0) 80%); }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.side nav a.on .icon { color: var(--amber); }
.side .sep { height: 1px; background: var(--line); margin: 14px 10px; }
.side .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 0 12px 6px; font-weight: 600; }
.acct { margin-top: auto; position: relative; }
.acct-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.acct-btn:hover { border-color: var(--faint); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #1b120c; display: grid; place-items: center; font: 700 15px var(--display); flex: none; }
.acct-btn .who { min-width: 0; flex: 1; }
.acct-btn b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-btn small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; z-index: 40; min-width: 240px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: fade-up .15s ease both; }
.acct .menu { bottom: calc(100% + 8px); left: 0; right: 0; }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover, .menu a:hover { background: rgba(255,255,255,.06); }
.menu .cur { color: var(--amber); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.main { min-width: 0; }
.mobile-top, .tabbar { display: none; }
.page { padding: 28px clamp(16px, 3vw, 40px) 60px; animation: fade-up .25s ease both; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font: 600 32px/1.1 var(--display); margin: 0; letter-spacing: -.015em; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { font: 600 22px var(--display); color: var(--text); margin: 14px 0 6px; }
.empty .icon { width: 40px; height: 40px; color: var(--faint); margin: 0 auto; }

/* ===================================================================== HOME */
.hero { position: relative; min-height: 440px; border-radius: 22px; overflow: hidden; display: flex; align-items: flex-end; margin-bottom: 36px; background: var(--panel); }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; transform: scale(1.03); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(21,17,15,.96) 0%, rgba(21,17,15,.7) 40%, rgba(21,17,15,.1) 75%), linear-gradient(0deg, rgba(21,17,15,.9), transparent 50%); }
.hero .body { position: relative; z-index: 2; padding: 40px; max-width: 600px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin-bottom: 12px; }
.hero h2 { font: 600 clamp(32px, 4vw, 52px)/1.02 var(--display); margin: 0 0 12px; letter-spacing: -.02em; }
.hero p { color: #d8cabd; margin: 0 0 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.meta .star { color: var(--amber); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.row-sec { margin-bottom: 34px; }
.row-sec h3 { display: flex; align-items: baseline; justify-content: space-between; font: 600 21px var(--display); margin: 0 0 14px; }
.row-sec h3 a { font: 500 13px var(--sans); color: var(--muted); }
.row-sec h3 a:hover { color: var(--amber); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 158px; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.strip > * { scroll-snap-align: start; }
.strip.wide { grid-auto-columns: 290px; }

/* ----------------------------------------------------------------- posters */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
.poster { position: relative; cursor: pointer; display: block; text-align: left; background: none; border: 0; padding: 0; }
.poster .art { position: relative; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--panel-2); transition: transform .2s, box-shadow .2s; }
.poster .art img { width: 100%; height: 100%; object-fit: cover; }
.poster:hover .art { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.5), 0 0 0 2px var(--amber); }
.poster .t { margin-top: 9px; font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.poster .badge { position: absolute; top: 8px; left: 8px; background: rgba(15,12,10,.8); backdrop-filter: blur(6px); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--amber); }
.poster .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.5); }
.poster .prog i { display: block; height: 100%; background: var(--grad); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; padding: 14px; text-align: center; font: 600 17px/1.2 var(--display); color: rgba(255,255,255,.85); }
.wide-card .art { aspect-ratio: 16/9; }

/* ----------------------------------------------------------------- toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .input-wrap { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .input { padding-top: 9px; padding-bottom: 9px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.browse { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }
.cats { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding-right: 6px; }
.cats button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.cats button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.cats button.on { color: var(--text); background: var(--panel-2); font-weight: 600; }
.cats button small { color: var(--faint); }
.more { display: flex; justify-content: center; margin-top: 28px; }

/* ===================================================================== LIVE */
.live { display: grid; grid-template-columns: 220px minmax(280px, 360px) 1fr; height: 100vh; }
.live .col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #241d19; }
.live .col-head { padding: 22px 16px 12px; }
.live .col-head h1 { font: 600 26px var(--display); margin: 0 0 12px; }
.live .scroll { overflow-y: auto; flex: 1; padding: 0 8px 20px; }
.live .cats { position: static; max-height: none; padding: 0; }
.chan { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; }
.chan:hover { background: rgba(255,255,255,.04); }
.chan.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--amber); }
.logo { width: 46px; height: 46px; border-radius: 10px; background: #fff1; display: grid; place-items: center; overflow: hidden; flex: none; font: 700 13px var(--display); color: var(--muted); }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.chan .info { min-width: 0; flex: 1; }
.chan b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .num { color: var(--faint); font-size: 12px; width: 26px; text-align: right; flex: none; }
.chan .fav { color: var(--amber); }
.bar { height: 3px; border-radius: 3px; background: var(--panel-3); margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }
.stage { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.screen { position: relative; background: #000; aspect-ratio: 16/9; width: 100%; max-height: 62vh; }
.screen video { width: 100%; height: 100%; background: #000; display: block; }
.screen .over { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); pointer-events: none; padding: 20px; }
.screen .over.err { color: #ffb3a2; }
.now { padding: 20px 24px; }
.now-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.now-head .logo { width: 56px; height: 56px; }
.now-head h2 { font: 600 24px var(--display); margin: 0; }
.now-head .live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--live); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.now-head .tools { margin-left: auto; display: flex; gap: 6px; }
.prog-list { display: flex; flex-direction: column; gap: 2px; }
.prog-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 14px; border-radius: 10px; }
.prog-item.cur { background: var(--panel); }
.prog-item time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.prog-item b { display: block; font-weight: 600; }
.prog-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog-item.cur b::after { content: "NOW"; margin-left: 8px; font-size: 10px; letter-spacing: .1em; color: var(--live); vertical-align: 2px; }

/* ===================================================================== GUIDE */
.guide { --slot: 220px; --chw: 200px; --rowh: 64px; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 170px); background: var(--bg-2); position: relative; }
.g-inner { position: relative; min-width: max-content; }
.g-times { position: sticky; top: 0; z-index: 3; display: flex; background: var(--panel); border-bottom: 1px solid var(--line); height: 42px; }
.g-times .corner { position: sticky; left: 0; z-index: 4; width: var(--chw); flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.g-times .slot { width: var(--slot); flex: none; padding: 0 12px; display: flex; align-items: center; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.g-row { display: flex; height: var(--rowh); border-bottom: 1px solid #2a221e; }
.g-ch { position: sticky; left: 0; z-index: 2; width: var(--chw); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--bg-2); border-right: 1px solid var(--line); cursor: pointer; border-top: 0; border-bottom: 0; border-left: 0; text-align: left; }
.g-ch:hover { background: var(--panel); }
.g-ch .logo { width: 38px; height: 38px; }
.g-ch b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; flex: none; }
.g-prog { position: absolute; top: 5px; bottom: 5px; border-radius: 8px; background: var(--panel); border: 1px solid #332a25; padding: 6px 10px; overflow: hidden; cursor: pointer; text-align: left; color: var(--text); }
.g-prog:hover { background: var(--panel-2); border-color: var(--faint); }
.g-prog.cur { background: linear-gradient(135deg, rgba(var(--accent-rgb),.22), rgba(var(--coral-rgb),.14)); border-color: rgba(var(--accent-rgb),.5); }
.g-prog b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.g-empty { position: absolute; inset: 5px 0; display: flex; align-items: center; padding: 0 14px; color: var(--faint); font-size: 12px; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 1; pointer-events: none; box-shadow: 0 0 12px var(--live); }
.g-now::before { content: ""; position: absolute; top: 34px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--live); }

/* ===================================================================== DETAIL */
.detail { position: relative; min-height: 100vh; }
.detail .backdrop { position: absolute; inset: 0 0 auto; height: 70vh; background-size: cover; background-position: center 20%; }
.detail .backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 2%, rgba(21,17,15,.55) 55%, rgba(21,17,15,.3)), linear-gradient(90deg, rgba(21,17,15,.9), transparent 70%); }
.detail .content { position: relative; z-index: 2; padding: 30px clamp(16px, 3vw, 40px) 60px; }
.detail .top-row { display: flex; gap: 32px; align-items: flex-end; padding-top: 18vh; margin-bottom: 30px; }
.detail .cover { width: 220px; flex: none; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: var(--panel-2); box-shadow: 0 30px 60px rgba(0,0,0,.6); }
.detail .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font: 600 clamp(30px, 4vw, 50px)/1.05 var(--display); margin: 0 0 12px; letter-spacing: -.02em; }
.detail .plot { max-width: 760px; color: #d8cabd; font-size: 16px; margin: 0 0 24px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; max-width: 760px; margin-bottom: 30px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--muted); }
.seasons { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0 18px; padding-bottom: 6px; }
.eps { display: flex; flex-direction: column; gap: 10px; max-width: 980px; }
.ep { display: grid; grid-template-columns: 34px 200px 1fr auto; gap: 18px; align-items: center; padding: 12px; border-radius: var(--radius); cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.ep:hover { background: var(--panel); }
.ep .n { font: 600 20px var(--display); color: var(--faint); text-align: center; }
.ep .thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep b { display: block; font-weight: 600; margin-bottom: 4px; }
.ep p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep .dur { color: var(--faint); font-size: 13px; }
.ep .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.5); }
.ep .prog i { display: block; height: 100%; background: var(--grad); }

/* ===================================================================== PLAYER OVERLAY */
.player { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; animation: fade-up .2s ease both; }
.player video { flex: 1; width: 100%; min-height: 0; background: #000; }
.player .ptop { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 16px 20px 40px; background: linear-gradient(rgba(0,0,0,.75), transparent); transition: opacity .3s; }
.player.idle .ptop { opacity: 0; pointer-events: none; }
.player .ptop h2 { font: 600 20px var(--display); margin: 0; }
.player .ptop small { color: var(--muted); display: block; }
.player .ptop .sp { flex: 1; }
.player .over { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: var(--muted); text-align: center; padding: 20px; }
.player .over.err { color: #ffb3a2; }
.player .next-up { position: absolute; right: 24px; bottom: 90px; z-index: 3; background: rgba(33,26,23,.95); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; align-items: center; max-width: 360px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; background: var(--panel-3); border: 1px solid var(--line); padding: 11px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: fade-up .2s ease both; }

/* ===================================================================== ACCOUNT */
.acc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 30px; }
.acc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.acc-card.cur { border-color: rgba(var(--accent-rgb),.6); }
.acc-card .hd { display: flex; gap: 12px; align-items: center; }
.acc-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.acc-card dt { color: var(--faint); }
.acc-card dd { margin: 0; color: var(--muted); }
.settings { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; max-width: 640px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row small { display: block; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(18px); background: #1b120c; }

/* ===================================================================== RESPONSIVE */
@media (max-width: 1180px) {
  .live { grid-template-columns: minmax(260px, 340px) 1fr; }
  .live .col.cats-col { display: none; }
  .live .cat-select { display: block !important; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .browse { grid-template-columns: 1fr; }
  .browse .cats { display: none; }
  .browse .cat-select { display: block !important; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 12px 16px; background: rgba(21,17,15,.92); backdrop-filter: blur(12px); border-bottom: 1px solid #241d19; }
  .mobile-top .brand { display: flex; align-items: center; gap: 9px; font: 600 19px var(--display); margin-right: auto; }
  .mobile-top .mark { width: 26px; height: 26px; }
  .mobile-top .acct { margin: 0; }
  .mobile-top .menu { top: calc(100% + 8px); bottom: auto; right: 0; left: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(27,22,19,.97); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--amber); }
  .main { padding-bottom: 72px; }
  .page { padding-top: 18px; }
  .page-head h1 { font-size: 26px; }
  .hero { min-height: 360px; }
  .hero .body { padding: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px 12px; }
  .strip { grid-auto-columns: 120px; }
  .strip.wide { grid-auto-columns: 240px; }
  .live { display: flex; flex-direction: column; height: auto; }
  .live .col { border-right: 0; }
  .live .stage { order: -1; position: sticky; top: 57px; z-index: 5; background: var(--bg); }
  .live .stage .prog-list { display: none; }
  .live .now { padding: 12px 16px; }
  .live .now-head { margin-bottom: 0; }
  .live .now-head .logo { width: 40px; height: 40px; }
  .live .now-head h2 { font-size: 18px; }
  .live .col-head h1 { display: none; }
  .live .col-head { padding-top: 12px; }
  .live .scroll { overflow: visible; }
  .guide { --slot: 160px; --chw: 120px; max-height: calc(100vh - 220px); }
  .g-ch b { display: none; }
  .detail .top-row { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 22vh; }
  .detail .cover { width: 130px; }
  .ep { grid-template-columns: 130px 1fr; gap: 12px; }
  .ep .n, .ep .dur { display: none; }
}

/* ===================================================================== APP / TV */
.mark-logo { width: 30px; height: 30px; object-fit: contain; flex: none; border-radius: 7px; }
.auth-brand .mark-logo { width: 40px; height: 40px; }
/* Remote-control focus ring (only shown after an arrow key is used) */
html.tv-nav :focus { outline: 3px solid var(--amber) !important; outline-offset: 3px; }
html.tv-nav .poster:focus { outline: none !important; }
html.tv-nav .poster:focus .art { transform: translateY(-4px) scale(1.04); box-shadow: 0 14px 30px rgba(0,0,0,.5), 0 0 0 3px var(--amber); }
html.tv-nav .chan:focus, html.tv-nav .cats button:focus, html.tv-nav .ep:focus { outline-offset: -3px; background: var(--panel-2); }
html.tv-nav .g-prog:focus, html.tv-nav .g-ch:focus { outline-offset: -3px; }
html.tv-nav video:focus { outline-offset: -3px; }
/* Inside the Android app there is no "open in browser" and no hover. */
.in-app .auth-art { display: none; }
.in-app .auth { grid-template-columns: 1fr; }

/* ===================================================================== REPLAY BUTTON (live) */
.screen-tools { position: absolute; top: 12px; right: 12px; z-index: 3; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.screen.active .screen-tools, .screen:focus-within .screen-tools { opacity: 1; transform: none; pointer-events: auto; }
.replay-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 16px 9px 12px; background: rgba(15,12,10,.78); backdrop-filter: blur(8px); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.replay-btn:hover { background: rgba(15,12,10,.92); }
.replay-btn .icon { color: var(--live); }
.screen:fullscreen { max-height: none; aspect-ratio: auto; background: #000; }
.screen:fullscreen video { height: 100%; }

/* ===================================================================== EPISODE DOWNLOAD */
.ep-row { display: flex; align-items: center; gap: 6px; }
.ep-row .ep { flex: 1; min-width: 0; }
.ep-dl { flex: none; }

/* ===================================================================== VPN (app) */
.vpn-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; color: var(--muted); }
.vpn-btn:hover { border-color: var(--faint); color: var(--text); }
.vpn-btn.on { color: var(--ok); border-color: #3d5a45; background: #1d2a21; }
.vpn-btn.busy .icon { animation: pulse 1s infinite; }
.vpn-btn.err { color: #ffb3a2; border-color: #6b3328; }
.vpn-icon.on { color: var(--ok); }
.vpn-icon.err { color: #ffb3a2; }

/* ===================================================================== MODAL */
.modal { position: fixed; inset: 0; z-index: 150; background: rgba(8,6,5,.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade-up .15s ease both; }
.modal-box { width: min(480px, 100%); max-height: min(640px, 92vh); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-head h3 { font: 600 22px var(--display); margin: 0; }
.modal-body { padding: 6px 18px 18px; overflow-y: auto; }
.region-list { display: flex; flex-direction: column; gap: 2px; }
.region-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 15px; }
.region-opt:hover, .region-opt:focus { background: var(--panel-2); }
.region-opt.on { color: var(--ok); font-weight: 600; }
.region-opt span { font-size: 20px; }
.region-opt[hidden] { display: none; }

/* ===================================================================== DOWNLOADS / REPLAYS (app) */
.dl-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.dl-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.dl-art { width: 64px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--panel-2); display: block; }
.dl-art img { width: 100%; height: 100%; object-fit: cover; }
.dl-art .ph { font-size: 10px; padding: 4px; }
.replay-art { display: grid; place-items: center; aspect-ratio: 1; align-content: center; gap: 2px; color: var(--live); }
.replay-art small { color: var(--muted); font-size: 11px; }
.dl-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-info small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-status { color: var(--faint); font-size: 12px; }
.dl-item.failed .dl-status { color: #ffb3a2; }
.dl-item.done .dl-status { color: var(--ok); }
.dl-item .bar { max-width: 260px; }
.dl-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 820px) { .dl-item { grid-template-columns: 48px 1fr; } .dl-art { width: 48px; } .dl-actions { grid-column: 1 / -1; justify-content: flex-end; } }

/* Highlight colour choices (Account & settings; default set per provider in the dashboard). */
:root[data-accent="green"]  { --amber: #5fd08a; --coral: #2fb37a; --accent-rgb: 95,208,138;  --coral-rgb: 47,179,122; }
:root[data-accent="blue"]   { --amber: #5aa9ff; --coral: #3b7bff; --accent-rgb: 90,169,255;  --coral-rgb: 59,123,255; }
:root[data-accent="pink"]   { --amber: #ff7ab8; --coral: #ff4d8d; --accent-rgb: 255,122,184; --coral-rgb: 255,77,141; }
:root[data-accent="purple"] { --amber: #b48cff; --coral: #8b5cf6; --accent-rgb: 180,140,255; --coral-rgb: 139,92,246; }
:root[data-accent="red"]    { --amber: #ff6b6b; --coral: #e5484d; --accent-rgb: 255,107,107; --coral-rgb: 229,72,77; }

/* Films whose sound is converted on the server have their own controls (seeking restarts the conversion). */
.player .pbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 40px 20px 16px; background: linear-gradient(transparent, rgba(0,0,0,.8)); transition: opacity .3s; }
.player.idle .pbar { opacity: 0; pointer-events: none; }
.player .pbar input[type=range] { flex: 1; accent-color: var(--amber); }
.player .pbar .tm { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); min-width: 48px; text-align: center; }
