/* DarkModeTV — premium layout (Netflix-style browsing, ESPN-style sports) */
:root {
  --bg: #07090d;
  --surface: #10141b;
  --surface-2: #171c25;
  --line: rgba(255,255,255,.08);
  --text: #f2f5f8;
  --muted: #8d99a8;
  --accent: #00bfff;
  --live: #ff3b47;
  --gold: #f5c518;
  --green: #2ecc71;
  --gutter: 48px;
  /* card sizes follow the screen width, within sensible limits */
  --poster-w: clamp(104px, 8.6vw, 180px);
  --wide-w: clamp(200px, 17vw, 340px);
  --chan-w: clamp(130px, 11vw, 220px);
  --score-w: clamp(250px, 19vw, 320px);
  --grid-min: clamp(100px, 8.2vw, 170px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll-lock { overflow: hidden; }

/* ==================== LOGIN ==================== */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(0,191,255,.12), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(106,92,255,.12), transparent 60%), var(--bg); }
.login-card { width: min(460px, 100%); background: rgba(16,20,27,.9); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login-card .logo { text-align: center; font-size: 26px; }
.login-card > p { text-align: center; color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; margin-bottom: 18px; }
.seg button { padding: 10px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: #fff; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; }
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.error { margin-top: 14px; padding: 12px; border-radius: 10px; background: rgba(255,59,71,.1); border: 1px solid rgba(255,59,71,.4); color: #ff8a92; font-size: 14px; }
.saved h3 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.saved ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved li { display: flex; gap: 8px; }
.saved .open { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); text-align: left; min-width: 0; }
.saved .open:hover { outline: 1px solid var(--accent); }
.saved .open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved .open small { margin-left: auto; color: var(--muted); font-size: 12px; }
.saved .del { width: 44px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #6a5cff); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }

#loading { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 16px; background: rgba(7,9,13,.92); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== BUTTONS ==================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 24px; border-radius: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.btn.play { background: #fff; color: #000; }
.btn.play:hover { background: #dfe6ee; }
.btn.glass { background: rgba(255,255,255,.14); backdrop-filter: blur(8px); }
.btn.glass:hover { background: rgba(255,255,255,.22); }
.btn.primary { background: var(--accent); color: #001018; width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.07); }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.back-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(7,9,13,.6); backdrop-filter: blur(8px); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.back-btn:hover { border-color: var(--accent); }

/* ==================== NAV ==================== */
nav.top { position: fixed; top: 0; right: 0; left: 0; z-index: 30; display: flex; align-items: center; gap: 28px; padding: 16px var(--gutter);
  background: linear-gradient(180deg, rgba(7,9,13,.92), rgba(7,9,13,0)); transition: background .2s; }
nav.top.solid { background: rgba(7,9,13,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 900; letter-spacing: .5px; font-size: 20px; color: var(--accent); white-space: nowrap; }
.logo span { color: var(--text); }
.tabs { display: flex; gap: 22px; }
.tabs a { color: #c3ccd6; font-weight: 500; font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; font-weight: 700; border-color: var(--accent); }
.tabs a svg { display: none; width: 22px; height: 22px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.search-box { display: flex; align-items: center; gap: 8px; border-radius: 999px; background: rgba(255,255,255,.07); padding: 0 6px 0 0; }
.search-box input { width: 0; padding: 0; border: 0; background: none; outline: none; color: var(--text); transition: width .2s, padding .2s; font-size: 14px; }
.search-box.open input { width: 220px; padding: 0 4px 0 14px; }
.search-box.open { background: rgba(255,255,255,.1); }
.search-box .icon-btn { background: none; }
.chip-prov { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 13px; max-width: 200px; }
.chip-prov span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: 48px; width: 260px; background: #0f141b; border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.menu .acct { padding: 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; line-height: 1.5; }
.menu .acct b { color: var(--text); display: block; font-size: 14px; }
.menu button { width: 100%; text-align: left; padding: 10px; border-radius: 8px; font-size: 14px; }
.menu button:hover { background: var(--surface-2); }
.menu-sec { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.menu .pl { display: flex; align-items: center; gap: 10px; }
.menu .pl span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .pl small { color: var(--muted); font-size: 11px; }
.menu .pl.on { background: rgba(0,191,255,.12); }
.menu .pl.on small { color: var(--accent); }

/* ==================== HERO ==================== */
.hero { position: relative; height: min(78vh, 720px); min-height: 520px; overflow: hidden; background: var(--surface); }
.hero .bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .bg.blur { filter: blur(30px) brightness(.6); transform: scale(1.2); }
.hero::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, rgba(7,9,13,.96) 0%, rgba(7,9,13,.7) 38%, rgba(7,9,13,0) 70%), linear-gradient(0deg, var(--bg) 0%, rgba(7,9,13,0) 35%); }
.hero-body { position: absolute; z-index: 2; left: var(--gutter); bottom: 130px; max-width: 580px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(28px, 4.4vw, 58px); line-height: 1.02; margin: 12px 0 14px; font-weight: 900; letter-spacing: -1.5px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: #c9d2dc; font-size: 14px; }
.meta .rating { color: var(--gold); font-weight: 700; }
.meta .tag { border: 1px solid rgba(255,255,255,.3); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.hero p, .detail-body p.plot { color: #c9d2dc; line-height: 1.55; font-size: 16px; margin: 16px 0 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-empty { position: relative; z-index: 2; padding: 150px var(--gutter) 40px; }
.hero-empty h1 { font-size: 40px; margin: 0 0 8px; }

/* ==================== ROWS ==================== */
.rows { position: relative; z-index: 3; margin-top: -100px; padding-bottom: 60px; }
.rows.flat { margin-top: 0; }
.row { margin: 0 0 34px; }
.row-head { display: flex; align-items: baseline; gap: 14px; padding: 0 var(--gutter); margin-bottom: 10px; }
.row-head h2 { font-size: 20px; margin: 0; font-weight: 700; }
.row-head a { font-size: 13px; color: var(--muted); }
.row-head a:hover { color: var(--accent); }
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px var(--gutter) 14px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; flex: 0 0 auto; }
.row-wrap { position: relative; }
.row-arrow { position: absolute; top: 6px; bottom: 14px; width: 44px; z-index: 4; display: grid; place-items: center; font-size: 26px; background: rgba(7,9,13,.6); opacity: 0; transition: opacity .2s; }
.row-wrap:hover .row-arrow { opacity: 1; }
.row-arrow.l { left: 0; border-radius: 0 8px 8px 0; }
.row-arrow.r { right: 0; border-radius: 8px 0 0 8px; }
@media (hover: none) { .row-arrow { display: none; } }

/* poster (2:3) */
.poster { width: var(--poster-w); display: block; position: relative; cursor: pointer; }
.poster .pimg { position: relative; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), var(--surface)); aspect-ratio: 2/3; transition: transform .2s, box-shadow .2s; }
.poster .pimg img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.poster .pimg .ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; font-size: 14px; color: #c3ccd6; }
.poster:hover .pimg { transform: scale(1.05); box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.poster .badge { position: absolute; z-index: 1; top: 8px; left: 8px; background: var(--accent); color: #001018; font-size: 10px; font-weight: 800; padding: 3px 6px; border-radius: 4px; }
.poster .mine { position: absolute; z-index: 1; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 12px; color: var(--gold); }
.poster .cap { font-size: 13px; font-weight: 600; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .sub .r { color: var(--gold); }
.poster .progress { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; }

/* wide card (16:9) */
.wide { width: var(--wide-w); display: block; cursor: pointer; }
.wide .thumb { position: relative; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), var(--surface)); aspect-ratio: 16/9; transition: transform .2s; }
.wide:hover .thumb { transform: scale(1.04); }
.wide .thumb img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.wide .thumb img.contain { object-fit: contain; padding: 18%; }
.wide .play-ico { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.35); }
.wide:hover .play-ico { opacity: 1; }
.play-ico span { width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; background: rgba(0,0,0,.4); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.progress b { display: block; height: 100%; background: var(--live); }
.wide .t { font-weight: 600; font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* channel tile */
.chan { width: var(--chan-w); aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(145deg, var(--c, var(--surface-2)), var(--surface)); border: 1px solid var(--line); position: relative; display: grid; place-items: center; cursor: pointer; transition: transform .2s, border-color .2s; overflow: hidden; }
.chan:hover { transform: translateY(-3px); border-color: var(--accent); }
.chan img { max-width: 62%; max-height: 52%; object-fit: contain; }
.chan .mark { font-weight: 900; font-size: 18px; letter-spacing: -.3px; text-align: center; padding: 0 12px; line-height: 1.1; }
.chan .nm { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.live-pill { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 4px; letter-spacing: .5px; }
.live-pill.static { position: static; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ESPN-style score card */
.score { width: var(--score-w); border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: border-color .2s, transform .2s; display: block; }
.score:hover { border-color: var(--accent); transform: translateY(-3px); }
.score-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.score-top > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-top .st { color: var(--live); white-space: nowrap; }
.score-top .st.sched { color: var(--accent); }
.score-top .st.fin { color: var(--muted); }
.team { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.team img, .team .ph { width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; }
.team .ph { border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--muted); }
.team .nm { flex: 1; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .pts { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.team.lose .nm, .team.lose .pts { color: var(--muted); }
.watch { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.watch .go { margin-left: auto; color: var(--accent); font-weight: 700; }

/* ==================== PAGES ==================== */
.page { padding: calc(var(--nav-h, 76px) + 16px) var(--gutter) 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; }
.cur-group { margin: 0; font-size: 22px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-group small { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 8px; }
.inline-search { flex: 1 1 220px; max-width: 320px; margin-left: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chips button:hover { border-color: rgba(255,255,255,.3); }
.chips button.on { background: #fff; color: #000; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* group panel */
.with-groups { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.with-groups.groups-hidden { grid-template-columns: minmax(0, 1fr); }
.with-groups.groups-hidden .groups { display: none; }
.groups { position: sticky; top: calc(var(--nav-h, 76px) + 16px); max-height: calc(100vh - var(--nav-h, 76px) - 34px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.groups-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.groups-head h1 { margin: 0; font-size: 26px; font-weight: 800; flex: 1; }
.groups-head .icon-btn { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; }
.g-sec { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 16px 4px 6px; }
.g-sec small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.g-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14px; text-align: left; }
.g-item .gn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-item .gc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.g-item:hover { background: var(--surface-2); }
.g-item.on { background: rgba(0,191,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.g-item .pin { opacity: 0; font-size: 12px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 22px; }
.g-item:hover .pin, .g-item .pin.on { opacity: 1; }
.g-item .pin:hover { background: rgba(255,255,255,.1); }
@media (hover: none) { .g-item .pin { opacity: .5; } }
.g-list { overflow-y: auto; min-height: 60px; flex: 1; margin: 0 -6px; padding: 0 6px; }
.g-none { color: var(--muted); font-size: 13px; padding: 10px; }
.groups-toggle { display: none; padding: 9px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groups-toggle b { color: var(--accent); }
.groups-hidden .groups-toggle { display: inline-block; }
.sheet-close { display: none; }

/* poster grid */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr)); gap: 20px 14px; }
.pgrid .poster { width: auto; }
.sort-row { display: flex; align-items: center; gap: 8px; margin: -4px 0 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.sort-row button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: #c3ccd6; }
.sort-row button.on { background: #fff; color: #000; }
.more-sentinel { height: 40px; }

/* ==================== LIVE TV ==================== */
.live-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 22px; }
.preview-slot { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
.preview-empty { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; text-align: center; gap: 8px; padding: 20px; background: radial-gradient(600px 300px at 50% 40%, rgba(0,191,255,.12), transparent), #05070a; }
.preview-empty b { font-size: 20px; }
.preview-empty span { color: var(--muted); font-size: 14px; }
.upnext { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; overflow: hidden; }
.upnext h4 { margin: 0 0 4px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.upnext .ch-title { font-size: 20px; font-weight: 800; margin: 0 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upnext .it { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.upnext .tm { color: var(--accent); font-weight: 700; font-size: 13px; width: 70px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.upnext .ti { font-weight: 600; font-size: 14px; }
.upnext .de { color: var(--muted); font-size: 12px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upnext .bar { height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; margin-top: 7px; }
.upnext .bar b { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.guide { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.g-times, .g-row { display: grid; grid-template-columns: 250px 1fr; }
.g-times { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; position: relative; }
.g-times .slots { position: relative; height: 36px; }
.g-times .slots span { position: absolute; top: 10px; padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; }
.g-times > div:first-child { padding: 10px 14px; }
.g-body { height: max(420px, calc(100vh - 260px)); overflow-y: auto; position: relative; }
.g-sizer { position: relative; }
.g-row { position: absolute; left: 0; right: 0; height: 64px; border-top: 1px solid var(--line); cursor: pointer; }
.g-row:hover { background: rgba(255,255,255,.025); }
.g-row.on { background: rgba(0,191,255,.07); box-shadow: inset 3px 0 0 var(--accent); }
.g-ch { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-right: 1px solid var(--line); min-width: 0; }
.g-ch .num { color: var(--muted); font-size: 12px; width: 30px; flex: 0 0 30px; font-variant-numeric: tabular-nums; }
.g-ch .lg { width: 52px; height: 34px; flex: 0 0 52px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.g-ch .lg img { max-width: 90%; max-height: 90%; object-fit: contain; }
.g-ch .lg i { font-style: normal; font-weight: 900; font-size: 10px; color: var(--muted); }
.g-ch .cn { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.g-ch .fav { color: var(--muted); font-size: 16px; padding: 4px; }
.g-ch .fav.on { color: var(--gold); }
.g-progs { position: relative; overflow: hidden; }
.prog { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding: 10px 12px; overflow: hidden; }
.prog .pt { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog .pm { color: var(--muted); font-size: 11px; margin-top: 3px; white-space: nowrap; }
.prog.now { background: rgba(0,191,255,.08); }
.prog.now .pbar { height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; margin-top: 7px; }
.prog.now .pbar b { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.prog.none { color: var(--muted); font-size: 12px; display: flex; align-items: center; }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 1; pointer-events: none; }

/* ==================== DETAILS ==================== */
.detail { position: relative; min-height: 100vh; --bd-h: clamp(300px, 52vw, 72vh); }
.detail .bg { position: absolute; top: 0; right: 0; left: 0; width: 100%; height: var(--bd-h); object-fit: cover; }
.detail .bg.blur { filter: blur(30px) brightness(.55); transform: scale(1.15); }
.detail::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: var(--bd-h); z-index: 1;
  background: linear-gradient(90deg, rgba(7,9,13,.97) 0%, rgba(7,9,13,.75) 45%, rgba(7,9,13,.2) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(7,9,13,0) 40%); }
.detail-back { position: relative; z-index: 3; padding: calc(var(--nav-h, 76px) + 12px) var(--gutter) 0; }
.detail-body { position: relative; z-index: 2; display: grid; grid-template-columns: clamp(150px, 16vw, 240px) minmax(0, 1fr); gap: clamp(18px, 2.4vw, 36px); padding: 28px var(--gutter) 30px; max-width: 1240px; }
.detail-body .cover { width: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.7); aspect-ratio: 2/3; object-fit: cover; background: var(--surface); }
.detail-body h1 { font-size: clamp(24px, 3.2vw, 44px); margin: 8px 0 12px; font-weight: 900; letter-spacing: -1px; line-height: 1.05; }
.detail-body p.plot { -webkit-line-clamp: 6; max-width: 680px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; margin: 0 0 26px; max-width: 680px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.seasons { position: relative; z-index: 2; padding: 0 var(--gutter) 60px; max-width: 1240px; }
.seasons .chips { margin-bottom: 14px; }
.ep { display: grid; grid-template-columns: 40px clamp(140px, 16vw, 220px) minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border-radius: 10px; cursor: pointer; width: 100%; text-align: left; }
.ep:hover { background: var(--surface); }
.ep.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.ep .n { font-size: 22px; color: var(--muted); font-weight: 700; text-align: center; }
.ep .th { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); }
.ep .th img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.ep .et { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.ep .et span { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.ep .ed { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==================== SPORTS ==================== */
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.days button { padding: 9px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-align: center; line-height: 1.2; white-space: nowrap; }
.days button small { display: block; color: var(--muted); font-size: 11px; }
.days button.on { border-color: var(--accent); background: rgba(0,191,255,.1); }
.league { margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: .5px; text-transform: uppercase; }
.league small { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--score-w), 100%), 1fr)); gap: 14px; }
.grid .score { width: auto; }
.side-panel { position: fixed; right: 0; top: 0; bottom: 0; width: 400px; max-width: 100%; z-index: 35; background: #0c1016; border-left: 1px solid var(--line); padding: 24px; transform: translateX(105%); transition: transform .25s; overflow-y: auto; }
.side-panel.on { transform: none; box-shadow: -30px 0 80px rgba(0,0,0,.6); }
.side-panel .close { position: absolute; top: 16px; right: 16px; }
.side-panel h3 { margin: 10px 40px 4px 0; font-size: 22px; }
.side-panel .sec { margin-top: 22px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.m { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--surface); margin-top: 10px; cursor: pointer; border: 1px solid transparent; width: 100%; text-align: left; }
.m:hover { border-color: var(--accent); }
.m .lg { width: 52px; height: 34px; flex: 0 0 52px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.m .lg img { max-width: 90%; max-height: 90%; object-fit: contain; }
.m .mn { min-width: 0; flex: 1; }
.m .mn div { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .mn small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.q.best { background: rgba(46,204,113,.15); color: var(--green); }
.q.strong { background: rgba(0,191,255,.15); color: var(--accent); }
.q.poss { background: rgba(255,255,255,.08); color: var(--muted); }

/* ==================== PLAYER ==================== */
#player { position: absolute; z-index: 25; background: #000; overflow: hidden; display: none; }
#player.inline, #player.mini, #player.full { display: block; }
#player.inline { border-radius: 12px; }
#player.mini { position: fixed; right: 20px; bottom: 20px; width: 380px; aspect-ratio: 16/9; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.7); border: 1px solid var(--line); z-index: 40; }
#player.full { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; }
#player .stage { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.p-subs { position: absolute; z-index: 2; left: 50%; bottom: 16%; transform: translateX(-50%); max-width: min(860px, 86%); text-align: center; color: #fff; font-size: clamp(16px, 2.6vw, 30px); line-height: 1.3; white-space: pre-line; text-shadow: 0 1px 2px #000; background: rgba(0,0,0,.62); padding: 2px 8px; pointer-events: none; }
.p-subs:empty { display: none; }
.p-msg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; text-align: center; padding: 24px; color: #c9d2dc; background: rgba(0,0,0,.55); font-size: 15px; pointer-events: none; }
.p-msg .spinner { margin: 0 auto 12px; }
.p-note { position: absolute; z-index: 2; left: 50%; top: 70px; transform: translateX(-50%); max-width: min(560px, 90%); padding: 10px 16px; border-radius: 10px; background: rgba(9,12,17,.92); border: 1px solid var(--line); color: #c9d2dc; font-size: 13px; line-height: 1.45; text-align: center; }
#player.inline .p-note, #player.mini .p-note { display: none; }
.p-ui { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; justify-content: space-between; transition: opacity .25s; background: linear-gradient(180deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,.8) 100%); }
#player.idle .p-ui { opacity: 0; cursor: none; }
.p-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.p-titles { min-width: 0; flex: 1; }
.p-unmute { position: absolute; z-index: 3; left: 50%; bottom: 84px; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(0,0,0,.75); border: 1px solid rgba(255,255,255,.25); font-weight: 700; font-size: 14px; white-space: nowrap; }
#player.inline .p-unmute, #player.mini .p-unmute { bottom: auto; top: 50%; transform: translate(-50%, -50%); font-size: 13px; padding: 8px 14px; }
#p-cc { font-size: 12px; font-weight: 800; letter-spacing: .5px; }
#p-cc.on { background: #fff; color: #000; }
.p-menu { position: absolute; z-index: 4; right: 22px; bottom: 84px; min-width: 220px; max-height: 50%; overflow-y: auto; padding: 6px; border-radius: 12px; background: rgba(9,12,17,.96); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.p-menu h5 { margin: 6px 10px 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.p-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; text-align: left; }
.p-menu button:hover { background: var(--surface-2); }
.p-menu button.on { color: var(--accent); font-weight: 700; }
.p-menu button.on::after { content: "✓"; margin-left: auto; }
video::cue { font-family: Inter, system-ui, sans-serif; font-size: clamp(16px, 2.6vw, 30px); line-height: 1.3; color: #fff; background: rgba(0,0,0,.62); }
.p-fav { width: 44px; height: 44px; flex: 0 0 44px; font-size: 22px; background: rgba(0,0,0,.45); }
.p-fav.on { color: var(--gold); }
.p-title { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { color: #c9d2dc; font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bottom { padding: 0 22px 18px; }
.p-seek { display: flex; align-items: center; gap: 12px; font-size: 12px; font-variant-numeric: tabular-nums; color: #c9d2dc; margin-bottom: 8px; }
.p-seek input { flex: 1; accent-color: var(--live); }
.p-ctrls { display: flex; align-items: center; gap: 8px; }
.p-ctrls .icon-btn { width: 44px; height: 44px; flex-basis: 44px; font-size: 16px; background: rgba(255,255,255,.1); }
.p-ctrls .icon-btn.big { width: 52px; height: 52px; flex-basis: 52px; font-size: 20px; background: #fff; color: #000; }
.p-ctrls .grow { flex: 1; }
.p-ctrls .txt-btn { height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 600; font-size: 13px; white-space: nowrap; }
.p-ctrls .txt-btn:hover, .p-ctrls .icon-btn:hover { background: rgba(255,255,255,.2); }
.p-ctrls input[type=range] { width: 100px; accent-color: #fff; }
/* inline / mini: compact controls */
#player.inline .p-top, #player.mini .p-top { padding: 10px 12px; }
#player.inline .p-title, #player.mini .p-title { font-size: 15px; }
#player.inline .p-bottom, #player.mini .p-bottom { padding: 0 12px 10px; }
#player.inline .p-ctrls .icon-btn, #player.mini .p-ctrls .icon-btn { width: 36px; height: 36px; flex-basis: 36px; font-size: 14px; }
#player.inline .full-only, #player.mini .full-only { display: none !important; }
#player.full .small-only, #player.inline .mini-only { display: none !important; }
#player:not(.mini) .mini-only { display: none !important; }
#player.mini .p-sub, #player.mini .not-mini { display: none !important; }
#player .vod-only, #player .live-only { display: none; }
#player.is-vod .vod-only, #player.is-live .live-only { display: flex; }
#player .p-ctrls .vod-only, #player .p-ctrls .live-only { display: none; }
#player.is-vod .p-ctrls .vod-only, #player.is-live .p-ctrls .live-only { display: grid; }
#player.is-live .p-ctrls .txt-btn.live-only, #player.is-vod .p-ctrls .txt-btn.vod-only { display: inline-flex; align-items: center; }
.p-zap { position: absolute; right: 0; top: 0; bottom: 0; width: 360px; max-width: 85%; background: rgba(9,12,17,.96); border-left: 1px solid var(--line); transform: translateX(105%); transition: transform .25s; display: flex; flex-direction: column; }
.p-zap.on { transform: none; }
.p-zap h4 { margin: 0; padding: 18px; font-size: 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.p-zap .zl { overflow-y: auto; flex: 1; }
.p-zap button.zi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; text-align: left; font-size: 14px; }
.p-zap button.zi:hover { background: var(--surface-2); }
.p-zap button.zi.on { background: rgba(0,191,255,.12); box-shadow: inset 3px 0 0 var(--accent); }
.p-zap .zi .lg { width: 44px; height: 28px; flex: 0 0 44px; border-radius: 5px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.p-zap .zi .lg img { max-width: 90%; max-height: 90%; object-fit: contain; }
.p-zap .zi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-next { position: absolute; right: 22px; bottom: 110px; }

/* phone held upright: picture on top, title + controls underneath */
@media (max-width: 760px) and (orientation: portrait) {
  #player.full { display: flex; flex-direction: column; justify-content: center; background: #05070a; }
  #player.full .p-ui { display: contents; }
  #player.full .p-top { order: 1; padding: calc(10px + env(safe-area-inset-top)) 14px 14px; align-items: flex-start; }
  #player.full .p-title { white-space: normal; font-size: 18px; line-height: 1.25; }
  #player.full .p-sub { white-space: normal; }
  #player.full .stage { order: 2; height: auto; aspect-ratio: 16 / 9; flex: 0 0 auto; }
  #player.full .p-bottom { order: 3; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); }
  #player.full .p-ctrls { flex-wrap: wrap; justify-content: center; row-gap: 12px; }
  #player.full .p-ctrls .grow { flex-basis: 100%; height: 0; }
  #player.full.idle .p-top, #player.full.idle .p-bottom { opacity: 1; }
  #player.full .p-msg { top: auto; bottom: auto; position: relative; order: 2; background: none; padding: 16px 20px; }
  #player.full .p-msg:not(.hidden) + .p-note, #player.full .p-note { top: auto; bottom: 30%; }
  #player.full .p-zap { top: 30%; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .g-times, .g-row { grid-template-columns: 200px 1fr; }
  .live-top { grid-template-columns: 1fr; }
  .upnext { display: none; }
}
@media (max-width: 900px) {
  .with-groups { grid-template-columns: minmax(0, 1fr); }
  .groups { position: fixed; top: 0; right: 0; bottom: 0; left: 0; top: 0; max-height: none; z-index: 45; border-radius: 0; transform: translateY(105%); transition: transform .25s; }
  .groups.open { transform: none; }
  .with-groups.groups-hidden .groups { display: flex; }
  .sheet-close { display: grid; }
  .hide-groups { display: none; }
  .groups-toggle { display: inline-block; }
  .inline-search { max-width: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  nav.top { padding: 10px 16px; gap: 10px; }
  /* app-style bottom tab bar */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(9,12,17,.97); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .tabs a svg { display: block; }
  .tabs a.on { color: var(--accent); }
  #app { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* a blurred parent would trap the fixed tab bar inside the top bar */
  nav.top, nav.top.solid { backdrop-filter: none; }
  nav.top.solid { background: #07090d; }
  .hero .actions { margin-top: 18px; }
  #player.mini { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .chip-prov span { display: none; }
  .chip-prov { padding: 5px; }
  .search-box.open input { width: 110px; }
  .logo { font-size: 17px; }
  .g-times .slots span:nth-child(even) { display: none; }
  .hero { min-height: 480px; height: 72vh; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 8%, rgba(7,9,13,.55) 60%, rgba(7,9,13,.35) 100%); }
  .hero-body { right: 16px; bottom: 110px; }
  .hero p { display: none; }
  .g-times, .g-row { grid-template-columns: 46% 1fr; }
  .g-ch { gap: 8px; padding: 0 8px; }
  .g-ch .num, .g-ch .fav { display: none; }
  .g-ch .lg { width: 40px; flex-basis: 40px; }
  .pgrid { gap: 14px 10px; }
  .pgrid .sub { display: none; }
  .detail { --bd-h: 46vh; }
  .detail-body { grid-template-columns: 1fr; padding-top: 16px; gap: 0; }
  .detail-body p.plot { font-size: 14px; -webkit-line-clamp: 5; margin: 12px 0 16px; }
  .facts { font-size: 13px; margin-bottom: 18px; }
  .meta { font-size: 13px; gap: 8px; }
  .detail .actions, .hero .actions { gap: 10px; }
  .detail .actions .btn, .hero .actions .btn { flex: 1 1 auto; padding: 11px 14px; font-size: 14px; }
  .hero { height: 62vh; min-height: 420px; }
  .detail-body .cover { display: none; }
  .ep { grid-template-columns: 120px 1fr; padding: 10px 0; }
  .ep .n { display: none; }
  .side-panel { width: 100%; }
  #player.mini { width: 220px; right: 10px; bottom: 10px; }
  .p-ctrls input[type=range] { display: none; }
  .p-top { padding: 12px; }
  .p-bottom { padding: 0 12px 12px; }
}
#player.is-live .p-ctrls .live-pill.live-only { display: inline-flex; }

/* sports filters: region rail, sport pills + league picker */
.region-chips { margin-bottom: 10px; }
.region-chips button.on { background: var(--accent); border-color: var(--accent); color: #001018; }
.region-chips button.on .muted { color: rgba(0,16,24,.6); }
.sports-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sports-filters .chips { flex: 1 1 auto; min-width: 0; }
.sports-filters .chips button .muted { font-weight: 500; margin-left: 2px; }
.sports-filters .chips button.on .muted { color: #555; }
.sports-search { max-width: 340px; }
@media (max-width: 760px) { .sports-search { max-width: none; flex: 1 1 100%; } }
.league-pick { flex: 0 1 260px; padding: 8px 12px; font-size: 13px; }
@media (max-width: 760px) { .league-pick { flex: 1 1 100%; } }


/* ==================== ICONS ==================== */
.ic { width: 1.2em; height: 1.2em; flex: 0 0 auto; display: block; }
.btn .ic, .back-btn .ic, .txt-btn .ic, .menu button .ic, .p-unmute .ic, .groups-toggle .ic, .watch .ic { width: 1.15em; height: 1.15em; }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn.big .ic { width: 26px; height: 26px; }
.p-fav .ic { width: 24px; height: 24px; }
.p-ctrls .txt-btn { gap: 6px; }
.p-ctrls .txt-btn [data-icon] .ic { width: 14px; height: 14px; }
.menu button { display: flex; align-items: center; gap: 10px; }
.p-unmute { display: inline-flex; align-items: center; gap: 8px; }
.groups-toggle { display: none; align-items: center; gap: 8px; }
.groups-hidden .groups-toggle { display: inline-flex; }
.g-item .pin .ic { width: 14px; height: 14px; }
.g-ch .fav { display: grid; place-items: center; }
.g-ch .fav .ic { width: 18px; height: 18px; }
.poster .mine .ic { width: 13px; height: 13px; }
.play-ico span .ic { width: 22px; height: 22px; }
.saved .del { display: grid; place-items: center; }
.saved .del .ic { width: 16px; height: 16px; }
.watch .ic { color: var(--muted); }
.score-top .st:not(.sched):not(.fin)::before, .region-chips [data-region="live"]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 6px; vertical-align: 1px; }

/* ==================== SIGN-IN WITH AN ON-SCREEN KEYBOARD ==================== */
#login, #unlock { min-height: 100vh; min-height: 100dvh; }
@media (max-height: 760px) {
  #login, #unlock { place-items: start center !important; padding-top: 20px; padding-bottom: 50vh; }
}

/* ==================== TOUCHSCREENS (Tesla, tablets): bigger, easier to hit ==================== */
@media (pointer: coarse) and (min-width: 900px) {
  body { font-size: 17px; }
  .tabs a { font-size: 17px; padding: 6px 0; }
  .tabs { gap: 30px; }
  .field { padding: 15px 16px; font-size: 18px; }
  .btn { padding: 15px 28px; font-size: 17px; }
  .icon-btn { width: 48px; height: 48px; flex-basis: 48px; }
  .icon-btn .ic { width: 24px; height: 24px; }
  .chips button, .days button, .sort-row button { padding: 11px 18px; font-size: 15px; }
  .g-item { padding: 12px 12px; font-size: 16px; }
  .groups-toggle { padding: 12px 16px; font-size: 16px; }
  .back-btn { padding: 11px 18px 11px 14px; font-size: 16px; }
  .poster .cap { font-size: 15px; }
  .wide .t { font-size: 16px; }
  .row-head h2 { font-size: 23px; }
  .g-ch .cn { font-size: 16px; }
  .prog .pt { font-size: 15px; }
  /* player: YouTube/Netflix-in-the-car sized controls */
  .p-title { font-size: 24px; }
  .p-sub { font-size: 15px; }
  .p-ctrls { gap: 12px; }
  .p-ctrls .icon-btn { width: 60px; height: 60px; flex-basis: 60px; }
  .p-ctrls .icon-btn .ic { width: 28px; height: 28px; }
  .p-ctrls .icon-btn.big { width: 76px; height: 76px; flex-basis: 76px; }
  .p-ctrls .icon-btn.big .ic { width: 34px; height: 34px; }
  .p-ctrls .txt-btn { height: 54px; padding: 0 20px; font-size: 16px; }
  .p-seek { font-size: 15px; }
  .p-seek input { height: 30px; }
  .p-fav { width: 58px; height: 58px; flex-basis: 58px; }
  .p-fav .ic { width: 30px; height: 30px; }
  .back-btn.full-only { padding: 13px 22px 13px 16px; font-size: 18px; }
  .p-menu button { padding: 14px 16px; font-size: 17px; }
  .p-zap button.zi { padding: 14px 20px; font-size: 16px; }
}

/* ==================== OLDER BROWSER ENGINES (no aspect-ratio) ==================== */
@supports not (aspect-ratio: 1 / 1) {
  .poster .pimg { height: 0; padding-top: 150%; }
  .wide .thumb, .ep .th { height: 0; padding-top: 56.25%; }
  .chan { height: calc(var(--chan-w) * 0.5625); }
  .preview-slot { height: 0; padding-top: 56.25%; }
  .detail-body .cover { height: auto; }
  #player.mini { height: 214px; }
  #video-wrap { height: 0; padding-top: 56.25%; }
}
@media (max-width: 900px) { .groups-toggle { display: inline-flex; } }

/* guide time navigation + phone Now/Next rows */
.g-nav { display: flex; align-items: center; gap: 6px; padding: 5px 10px !important; }
.g-nav button { height: 28px; min-width: 32px; padding: 0 8px; border-radius: 8px; background: rgba(255,255,255,.07); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text); }
.g-nav button .ic { width: 14px; height: 14px; }
.g-nav button:disabled { opacity: .3; cursor: default; }
.g-nav .g-now.on { background: var(--accent); color: #001018; }
.prog.compact { padding: 8px 12px; border-left: 0; }
.prog.compact .pn { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog.compact .pn b { color: var(--accent); font-weight: 700; margin-right: 4px; }
.prog.compact.now .pm { display: none; }
@media (max-width: 760px) {
  .g-row { height: 64px; }
  .g-times .slots span { display: inline; }
}
@media (pointer: coarse) and (min-width: 900px) {
  .g-nav button { height: 36px; min-width: 42px; font-size: 14px; }
  .g-nav button .ic { width: 18px; height: 18px; }
}

/* ==================== SETTINGS ==================== */
.settings { max-width: 860px; }
.settings .page-head { gap: 16px; }
.s-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.s-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.s-title h2 { margin: 0; font-size: 20px; }
.s-card > p { font-size: 14px; line-height: 1.5; margin: 8px 0 14px; }
.s-tools { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.s-tools .field { flex: 1 1 220px; }
.s-list { max-height: 60vh; overflow-y: auto; border-top: 1px solid var(--line); }
.s-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.s-row span { min-width: 0; display: grid; gap: 2px; }
.s-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-row small { font-size: 12px; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; flex: 0 0 46px; border-radius: 999px; background: #3a4352; position: relative; cursor: pointer; transition: background .15s; margin: 0; border: 0; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.groups-head a.icon-btn { width: 34px; height: 34px; flex-basis: 34px; }
.groups-head a.icon-btn .ic { width: 16px; height: 16px; }
@media (pointer: coarse) and (min-width: 900px) { .s-row { padding: 16px 6px; } .switch { width: 56px; height: 34px; flex-basis: 56px; } .switch::after { width: 28px; height: 28px; } .switch:checked::after { transform: translateX(22px); } }

/* small player: four corners, draggable */
#player.mini { touch-action: none; cursor: grab; transition: transform .18s ease; }
#player.mini.dragging { transition: none; cursor: grabbing; opacity: .92; }
#player.mini.c-br { right: 20px; bottom: 20px; left: auto; top: auto; }
#player.mini.c-bl { left: 20px; bottom: 20px; right: auto; top: auto; }
#player.mini.c-tr { right: 20px; top: calc(var(--nav-h, 76px) + 12px); left: auto; bottom: auto; }
#player.mini.c-tl { left: 20px; top: calc(var(--nav-h, 76px) + 12px); right: auto; bottom: auto; }
@media (max-width: 760px) {
  #player.mini.c-br, #player.mini.c-bl { bottom: calc(76px + env(safe-area-inset-bottom)); }
  #player.mini.c-br, #player.mini.c-tr { right: 10px; }
  #player.mini.c-bl, #player.mini.c-tl { left: 10px; }
}
#player.mini .p-fav, #player.mini .p-sub { display: none; }
.s-row:not(.g) b { white-space: normal; }
