/* Inter, bundled (web/fonts/Inter-OFL.txt): the television has no reason to
   fetch a font from the internet before it can draw a word */
@font-face { font-family: "Inter"; src: url("../fonts/inter-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* Aurora — the web version, laid out for a television.

   Everything is drawn on a 1920x1080 stage: Apple's tvOS point grid, and the
   television's real pixels (where 1px = 0.5dp). The stage scales to whatever
   window it is in, so what you test here is what the TV will show.

   Structure from streamXie: every section explains itself, every poster says
   what it is, the Top 10 is a list of cards. Surface from Apple: white
   capsules, items that lift and catch the light when focused, room between
   things. Rows and signals from Netflix: carry on watching, Top 10, red for
   what is new or live. */

/* ---------- themes: change one attribute and the whole app follows ---------- */
:root, [data-theme="teal"] {
  --bg: #080a0f; --bg-2: #0d1017; --surface: #141822; --surface-2: #1b202c; --surface-3: #252b39;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f3f5f9; --text-2: #aab3c2; --text-3: #6e7789;
  --accent: #14d3a8; --accent-ink: #032019; --ring: #14d3a8;
  --signal: #ff3b5c; --gold: #ffd25a;
  --glow: rgba(20,211,168,.22);
}
[data-theme="crimson"] {
  --bg: #090909; --bg-2: #101010; --surface: #181818; --surface-2: #222; --surface-3: #2e2e2e;
  --text: #fff; --text-2: #b8b8b8; --text-3: #777;
  --accent: #e50914; --accent-ink: #fff; --ring: #ffffff; --signal: #e50914; --gold: #ffc53d; --glow: rgba(229,9,20,.35);
}
[data-theme="graphite"] {
  --bg: #000; --bg-2: #0a0a0a; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
  --text: #fff; --text-2: #a1a1a6; --text-3: #6c6c70;
  --accent: #ffffff; --accent-ink: #000; --ring: #ffffff; --signal: #ff453a; --gold: #ffd60a; --glow: rgba(255,255,255,.18);
}
[data-theme="aurora"] {
  --bg: #050a0e; --bg-2: #0a1117; --surface: #0f1820; --surface-2: #16222c; --surface-3: #203039;
  --text: #eef7f5; --text-2: #9fb3b0; --text-3: #607270;
  --accent: #7df7dc; --accent-ink: #052019; --ring: #7df7dc; --signal: #ff5a7a; --gold: #ffd36b; --glow: rgba(125,247,220,.25);
}
[data-theme="violet"] {
  --bg: #0a0812; --bg-2: #100d1a; --surface: #171324; --surface-2: #201a31; --surface-3: #2b2340;
  --text: #f6f3ff; --text-2: #b3a9cc; --text-3: #73698c;
  --accent: #bf7bff; --accent-ink: #1a0630; --ring: #ffffff; --signal: #ff4f8b; --gold: #ffd36b; --glow: rgba(191,123,255,.3);
}

/* Apple's tvOS type, in points = px on this stage. Nothing smaller than 23. */
:root {
  --font: -apple-system, "SF Pro Display", "SF Pro Text", Inter, "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  --t-hero: 92px; --t-title1: 76px; --t-title2: 57px; --t-title3: 48px; --t-head: 38px;
  --t-body: 29px; --t-callout: 27px; --t-caption: 24px; --t-min: 23px;
  --safe-x: 80px; --safe-y: 60px; --gap: 40px;
  --r-card: 18px; --r-wide: 20px;
  --ease: cubic-bezier(.2,.8,.2,1); --dur: .22s;
  --lift: 0 32px 70px rgba(0,0,0,.6), 0 10px 22px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; }
body { font-family: var(--font); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
img { display: block; }
:focus { outline: none; }
.instant * { transition-duration: 0s !important; animation-duration: 0s !important; }
.is-hidden { display: none !important; }

.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--bg); overflow: hidden; transition: background .3s; }
#app { position: absolute; inset: 0; }
/* every screen is drawn into these, so they have to be the screen's size:
   with no height of their own, "100%" inside them meant "as tall as the
   content", and Live TV's lists ran off the bottom without ever moving */
#screen, .screen-root { position: absolute; inset: 0; }

/* ---------- the tab bar ---------- */
.bar { position: absolute; z-index: 30; left: 0; right: 0; top: 0; height: 168px; padding: 0 var(--safe-x); display: flex; align-items: center; gap: 40px;
  background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,0)); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.bar.away { transform: translateY(-110%); opacity: 0; }
.brand { display: flex; align-items: center; gap: 16px; font-size: 36px; font-weight: 700; letter-spacing: -.02em; flex: 0 0 auto; }
.brand i { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 55%, #000)); display: grid; place-items: center; box-shadow: 0 6px 24px var(--glow); }
.brand i::after { content: ""; margin-left: 6px; border-left: 19px solid var(--accent-ink); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.tabs { flex: 1; display: flex; justify-content: center; }
.tabs nav { display: flex; gap: 6px; padding: 8px; border-radius: 999px; background: rgba(28,30,38,.72); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.tab { position: relative; height: 64px; padding: 0 30px; border-radius: 999px; font-size: var(--t-callout); font-weight: 600; color: var(--text-2); display: flex; align-items: center; transition: transform var(--dur) var(--ease), background var(--dur), color var(--dur); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 22px; height: 4px; margin-left: -11px; border-radius: 2px; background: var(--accent); }
.tab:focus { background: #fff; color: #000; transform: scale(1.06); }
.tab:focus::after { background: #000; }
.bar-tools { display: flex; gap: 14px; flex: 0 0 auto; }
.round { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(28,30,38,.72); border: 1px solid var(--line); font-size: 24px; font-weight: 700; transition: transform var(--dur) var(--ease); }
.round svg { width: 28px; height: 28px; }
.round:focus { background: #fff; color: #000; transform: scale(1.1); }
.round.face { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #3a6cff)); color: var(--accent-ink); border: 0; }
.round.face:focus { background: #fff; color: #000; }

/* ---------- pages: content moves to the focus, never the focus to the edge ---------- */
.page { position: absolute; inset: 0; overflow: hidden; }
.scroller { position: absolute; left: 0; right: 0; top: 0; transition: transform .38s var(--ease); will-change: transform; }
section.block { padding-bottom: 64px; }

/* ---------- the hero ---------- */
.hero { position: relative; height: 900px; overflow: hidden; }
.hero .art { position: absolute; inset: 0; }
.hero .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.hero .art img.on { opacity: 1; animation: drift 18s ease-out both; }
.hero .art img.poster-only { object-fit: cover; filter: blur(30px) saturate(1.2); transform: scale(1.2); }
@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 32%, color-mix(in srgb, var(--bg) 0%, transparent) 66%),
  linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 0%, transparent) 42%),
  linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%); }
.hero .copy { position: absolute; z-index: 2; left: var(--safe-x); bottom: 170px; width: 900px; }
.hero .logo { max-width: 640px; max-height: 230px; margin-bottom: 30px; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
.hero h1 { margin: 0 0 22px; font-size: var(--t-hero); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font-size: var(--t-callout); color: var(--text-2); font-weight: 600; margin-bottom: 20px; }
.meta .star { color: var(--gold); }
.meta .dot::before { content: "·"; margin-right: 16px; color: var(--text-3); }
.hero p, .detail p.overview { margin: 0 0 36px; font-size: var(--t-body); line-height: 1.5; color: color-mix(in srgb, var(--text) 82%, transparent); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .pager { position: absolute; z-index: 2; right: var(--safe-x); bottom: 190px; display: flex; gap: 10px; }
.hero .pager i { width: 12px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.3); transition: width .4s var(--ease), background .4s; }
.hero .pager i.on { width: 44px; background: #fff; }

/* ---------- badges ---------- */
.badges { display: flex; gap: 10px; margin-bottom: 24px; }
.badge { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 9px; font-size: var(--t-min); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.b-movie { background: #2f6bff; } .b-series { background: #8b4dff; } .b-anime { background: #ff7a1a; } .b-arabic { background: #0ea57a; }
.b-turkish { background: #d6304a; } .b-live { background: var(--signal); } .b-new { background: var(--signal); } .b-plain { background: rgba(255,255,255,.14); }
.b-live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-right: 8px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- buttons: capsules that turn white when focused, Apple's way ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.btn { height: 80px; padding: 0 44px; border-radius: 999px; display: inline-flex; align-items: center; gap: 16px; white-space: nowrap; font-size: var(--t-body); font-weight: 700;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.1); transition: transform var(--dur) var(--ease), background var(--dur), color var(--dur), box-shadow var(--dur); }
.btn svg { width: 32px; height: 32px; flex: 0 0 auto; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.icon { width: 80px; padding: 0; justify-content: center; }
.btn:focus { background: #fff; color: #000; transform: scale(1.08); box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.6); }
.btn.on svg { color: var(--accent); }
.btn.on:focus svg { color: #000; }
.pressed { transform: scale(.94) !important; transition-duration: .06s !important; }

/* ---------- section headings: what it is, and why it is here ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 var(--safe-x); margin-bottom: 26px; }
.head h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.head p { margin: 8px 0 0; font-size: var(--t-caption); color: var(--text-3); font-weight: 500; }
.head .count { font-size: var(--t-caption); color: var(--text-3); font-family: var(--mono); }

/* ---------- rows ---------- */
.row { position: relative; overflow: hidden; padding: 30px 0 40px; margin: -30px 0 -40px; }
.track { display: flex; gap: var(--gap); padding: 0 var(--safe-x); transition: transform .32s var(--ease); will-change: transform; width: max-content; }

/* the card: lifts, scales and catches the light when focused */
.card { position: relative; flex: 0 0 auto; transition: transform var(--dur) var(--ease); }
.card .art { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--dur);
  background: linear-gradient(115deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.04) 32%, rgba(255,255,255,0) 50%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.card:focus { z-index: 3; }
.card:focus .art { transform: scale(1.09) translateY(-6px); box-shadow: var(--lift), 0 0 0 5px var(--ring), 0 0 60px var(--glow); }
.card:focus .art::after { opacity: 1; }
.card .badge { position: absolute; left: 14px; top: 14px; z-index: 2; height: 32px; padding: 0 12px; font-size: 20px; }
.card .t { margin-top: 18px; font-size: 26px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur), transform var(--dur) var(--ease); }
.card .m { margin-top: 4px; font-size: var(--t-min); color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m .star { color: var(--gold); }
.card:focus .t { color: var(--text); transform: translateY(10px); }
.card:focus .m { transform: translateY(10px); transition: transform var(--dur) var(--ease); }
.no-titles .poster .t, .no-titles .poster .m { opacity: 0; transition: opacity var(--dur); }
.no-titles .poster:focus .t, .no-titles .poster:focus .m { opacity: 1; }
.card .fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: 30px; font-weight: 800; color: var(--text-2); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }

.poster { width: 260px; }
.poster .art { height: 390px; }
.wide { width: 410px; }
.wide .art { height: 231px; }
.wide .flag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 2; background: var(--signal); color: #fff; font-size: 21px; font-weight: 800; padding: 6px 16px; border-radius: 10px 10px 0 0; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.meter { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.25); z-index: 2; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.wide .play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(255,255,255,.92); color: #000; display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity var(--dur), transform var(--dur) var(--ease); }
.wide .play svg { width: 34px; height: 34px; margin-left: 4px; }
.wide:focus .play { opacity: 1; transform: none; }
.wide .left { position: absolute; z-index: 2; right: 14px; top: 14px; font: 700 var(--t-min) var(--mono); padding: 4px 12px; border-radius: 8px; background: rgba(0,0,0,.7); }

/* streamXie's Top 10: a list of cards with a big number */
.top { width: 560px; }
.top .art { height: 240px; display: flex; align-items: center; gap: 24px; padding: 0 30px 0 18px; background: linear-gradient(120deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.top .art::before { content: none; }
.top .n { flex: 0 0 96px; font-size: 150px; font-weight: 900; line-height: .8; letter-spacing: -.08em; text-align: center; align-self: flex-end; margin-bottom: 14px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 15%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .thumb { flex: 0 0 auto; width: 132px; height: 198px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.top .thumb img { width: 100%; height: 100%; object-fit: cover; }
.top .info { min-width: 0; }
.top .info .t { margin: 0 0 8px; font-size: 28px; line-height: 1.2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transform: none !important; }
.top .info .m { transform: none !important; }
.top:focus .art { background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), var(--surface)); }

/* live channels */
.chan { width: 410px; }
.chan .art { height: 231px; display: grid; place-items: center; background: linear-gradient(140deg, var(--surface-2), var(--surface)); }
.chan .art img.logo { position: absolute; inset: 40px; width: calc(100% - 80px); height: calc(100% - 80px); object-fit: contain; }
.chan .mono-logo { font-size: 56px; font-weight: 900; letter-spacing: -.04em; color: var(--text-2); }
.chan .badge { top: auto; bottom: 14px; }
.chan .num { position: absolute; right: 14px; top: 12px; font: 700 var(--t-min) var(--mono); color: var(--text-3); }

/* genre tiles */
.genre { width: 410px; }
.genre .art { height: 200px; display: flex; align-items: flex-end; padding: 26px 30px; }
.genre .art b { position: relative; z-index: 1; font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.see-all { width: 260px; }
.see-all .art { height: 390px; display: grid; place-items: center; background: var(--surface); border: 1px dashed var(--line-2); text-align: center; font-size: 30px; font-weight: 700; color: var(--text-2); padding: 20px; }
.see-all.wide-all { width: 410px; } .see-all.wide-all .art { height: 231px; }

/* ---------- browse (Movies, Series, My List, search results) ---------- */
.page-head { padding: 176px var(--safe-x) 0; }
.page-head h1 { margin: 0; font-size: var(--t-title2); font-weight: 800; letter-spacing: -.03em; }
.page-head p { margin: 8px 0 0; font-size: var(--t-caption); color: var(--text-3); }
.chips { display: flex; gap: 14px; padding: 30px var(--safe-x) 0; }
.chip { flex: 0 0 auto; height: 64px; padding: 0 28px; border-radius: 999px; font-size: var(--t-callout); font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; transition: transform var(--dur) var(--ease); white-space: nowrap; }
.chip.on { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.chip:focus { background: #fff; color: #000; transform: scale(1.08); }
.chips-row { position: relative; overflow: hidden; padding: 20px 0 24px; margin: -20px 0 -24px; }
.chips-row .track { gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(6, 260px); gap: 100px var(--gap); padding: 46px var(--safe-x) 120px; }
.grid .card .t { white-space: nowrap; }
.empty { padding: 100px var(--safe-x); max-width: 1300px; }
.empty h2 { font-size: var(--t-title3); margin: 0 0 16px; letter-spacing: -.02em; }
.empty p { font-size: var(--t-body); color: var(--text-2); margin: 0 0 34px; line-height: 1.5; }
.loading { padding: 80px var(--safe-x); font-size: var(--t-body); color: var(--text-3); }
.skeleton .art { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- the title page ---------- */
.detail .backdrop { position: absolute; inset: 0; }
.detail .backdrop img { width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-out both; }
.detail .backdrop::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, var(--bg) 4%, color-mix(in srgb, var(--bg) 82%, transparent) 36%, color-mix(in srgb, var(--bg) 0%, transparent) 72%),
  linear-gradient(0deg, var(--bg) 6%, color-mix(in srgb, var(--bg) 0%, transparent) 50%); }
/* the backdrop drifts in from 106%, so its section has to clip it or it
   slices through the heading below */
.detail .top-area { position: relative; height: 1000px; overflow: hidden; }
.detail .copy { position: absolute; left: var(--safe-x); top: 150px; width: 1000px; }
.detail .back-btn { position: absolute; z-index: 3; left: var(--safe-x); top: var(--safe-y); height: 64px; padding: 0 30px 0 20px; gap: 10px; font-size: var(--t-callout);
  background: rgba(20,22,30,.6); }
.detail .back-btn svg { width: 28px; height: 28px; }
.detail .back-btn:focus { background: #fff; color: #000; }
.detail .logo { max-width: 680px; max-height: 240px; margin-bottom: 28px; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
.detail h1 { margin: 0 0 22px; font-size: var(--t-title1); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.detail .overview { -webkit-line-clamp: 4 !important; }
.detail .cast { font-size: var(--t-caption); color: var(--text-3); margin: -16px 0 36px; }
.detail .cast b { color: var(--text-2); font-weight: 600; }
.seasons .track { gap: 14px; }
.episode { width: 560px; }
.episode .art { height: 315px; }
.episode .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.episode .o { margin-top: 6px; font-size: var(--t-min); color: var(--text-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: transform var(--dur) var(--ease); }
.episode:focus .o { transform: translateY(10px); }
.episode .ep { position: absolute; z-index: 2; left: 14px; bottom: 14px; font: 700 var(--t-min) var(--mono); padding: 4px 12px; border-radius: 8px; background: rgba(0,0,0,.72); }

/* ---------- Live TV ---------- */
.live-page { display: grid; grid-template-columns: 420px 760px 1fr; gap: 40px; padding: 176px var(--safe-x) var(--safe-y); height: 100%;
  /* one row, the height of the screen: without it the lists grew to fit every
     category, believed they had nothing to scroll, and ran off the bottom */
  grid-template-rows: minmax(0, 1fr); }
.list { position: relative; overflow: hidden; min-height: 0; height: 100%; }
.list .track { flex-direction: column; gap: 10px; padding: 8px 6px; width: auto; }
.cat-item { height: 76px; padding: 0 28px; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; font-size: var(--t-callout); font-weight: 600; color: var(--text-2); transition: transform var(--dur) var(--ease); }
.cat-item.on { color: var(--text); background: var(--surface); }
.cat-item.on::before { content: ""; width: 6px; height: 30px; border-radius: 3px; background: var(--accent); margin: 0 18px 0 -12px; }
.cat-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item:focus { background: #fff; color: #000; transform: scale(1.04); }
.cat-item:focus::before { background: #000; }
.ch-item { height: 112px; padding: 0 24px; border-radius: 20px; display: flex; align-items: center; gap: 24px; transition: transform var(--dur) var(--ease); }
.ch-item .lg { width: 112px; height: 72px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; font-weight: 900; font-size: 30px; color: var(--text-2); }
.ch-item .lg img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.ch-item .n { font: 700 var(--t-min) var(--mono); color: var(--text-3); width: 54px; flex: 0 0 auto; }
.ch-item .nm { font-size: var(--t-body); font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ch-item .now { font-size: var(--t-min); color: var(--text-3); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ch-item .tx { min-width: 0; }
.ch-item.on { background: var(--surface); }
.ch-item:focus { background: #fff; color: #000; transform: scale(1.03); box-shadow: var(--lift); }
.ch-item:focus .now, .ch-item:focus .n { color: #444; }
.preview { align-self: start; }
.preview .screen { position: relative; aspect-ratio: 16/9; border-radius: 22px; overflow: hidden; background: #000; box-shadow: var(--lift); }
.preview .screen video { width: 100%; height: 100%; object-fit: cover; }
.preview .screen .badge { position: absolute; left: 18px; top: 18px; }
.preview h3 { margin: 30px 0 6px; font-size: var(--t-title3); letter-spacing: -.02em; }
.preview p { margin: 0 0 30px; font-size: var(--t-body); color: var(--text-2); }

/* ---------- Search ---------- */
.search-page { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 30px; padding: 176px var(--safe-x) 0; height: 100%; }
.query { height: 96px; max-width: 1100px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 28px; transition: transform var(--dur) var(--ease); }
.query svg { width: 36px; height: 36px; color: var(--text-3); flex: 0 0 auto; }
.query input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 40px; font-weight: 700; }
.query input::placeholder { color: var(--text-3); font-weight: 600; }
.query input::-webkit-search-cancel-button { display: none; }
.query:focus-within { border-color: var(--accent); background: var(--surface-2); transform: scale(1.02); }
/* the results run to the screen's edges, so a focused poster — which grows and
   lifts — has the full safe margin to grow into instead of being cut off */
.results { position: relative; overflow: hidden; height: 100%; margin: 0 calc(-1 * var(--safe-x)); }
.results .grid { grid-template-columns: repeat(6, 260px); padding: 46px var(--safe-x) 120px; }
.results .head { padding: 0 var(--safe-x); }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 460px 1fr; gap: 60px; padding: 176px var(--safe-x) 0; }
.settings .side { display: flex; flex-direction: column; gap: 10px; }
.settings .pane h2 { margin: 0 0 10px; font-size: var(--t-title3); letter-spacing: -.02em; }
.settings .pane > p { margin: 0 0 34px; font-size: var(--t-body); color: var(--text-2); line-height: 1.5; max-width: 1000px; }
.themes { display: grid; grid-template-columns: repeat(5, 230px); gap: 30px; margin-bottom: 44px; }
.theme { height: 200px; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border: 2px solid var(--line); transition: transform var(--dur) var(--ease); }
.theme b { font-size: var(--t-callout); }
.theme .sw { display: flex; gap: 8px; }
.theme .sw i { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); }
.theme.on { border-color: var(--accent); }
.theme:focus { transform: scale(1.07); box-shadow: var(--lift), 0 0 0 5px #fff; }
.toggle { height: 96px; width: 1000px; padding: 0 30px; border-radius: 20px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; font-size: var(--t-body); font-weight: 600; margin-bottom: 14px; transition: transform var(--dur) var(--ease); }
.toggle small { display: block; font-size: var(--t-min); color: var(--text-3); font-weight: 500; margin-top: 4px; }
.toggle .sw { width: 84px; height: 48px; border-radius: 24px; background: var(--surface-3); position: relative; flex: 0 0 auto; transition: background var(--dur); }
.toggle .sw::after { content: ""; position: absolute; left: 6px; top: 6px; width: 36px; height: 36px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); }
.toggle.on .sw { background: var(--accent); }
.toggle.on .sw::after { transform: translateX(36px); }
.toggle:focus { background: #fff; color: #000; transform: scale(1.03); }
.toggle:focus small { color: #555; }
.field { display: block; width: 1000px; margin-bottom: 18px; }
.field span { display: block; font-size: var(--t-min); color: var(--text-3); font-weight: 600; margin: 0 0 10px 6px; }
.field input { width: 100%; height: 88px; padding: 0 28px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); font-size: var(--t-body); transition: transform var(--dur) var(--ease); }
.field input:focus { border-color: #fff; transform: scale(1.02); }
.field input:not([readonly]) { border-color: var(--accent); background: var(--surface-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 1000px; }
.field-row .field { width: auto; }
.note { font-size: var(--t-min); color: var(--text-3); margin: 18px 0 0; max-width: 1000px; line-height: 1.5; }
.error { font-size: var(--t-caption); color: var(--signal); margin: 18px 0 0; }
.shortcuts { display: grid; grid-template-columns: 220px 1fr; gap: 18px 30px; font-size: var(--t-body); max-width: 1100px; }
.shortcuts kbd { justify-self: start; font: 700 var(--t-caption) var(--mono); padding: 8px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.shortcuts span { color: var(--text-2); }

/* ---------- the player ---------- */
.player { position: absolute; inset: 0; z-index: 60; background: #000; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .chrome { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; background:
  linear-gradient(180deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 58%, rgba(0,0,0,.85) 100%); }
.player.show .chrome { opacity: 1; }
.player .ttl { position: absolute; left: var(--safe-x); top: var(--safe-y); right: var(--safe-x); }
.player .ttl small { display: block; font-size: var(--t-caption); color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.player .ttl b { font-size: var(--t-title3); letter-spacing: -.02em; }
.player .bottom { position: absolute; left: var(--safe-x); right: var(--safe-x); bottom: var(--safe-y); }
.timeline { display: flex; align-items: center; gap: 26px; margin-bottom: 34px; font: 700 var(--t-caption) var(--mono); color: var(--text-2); }
.timeline .bar2 { position: relative; flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.22); }
.timeline .bar2 .buf { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: rgba(255,255,255,.28); }
.timeline .bar2 .pos { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--accent); }
.timeline .bar2 .knob { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.timeline .live-tag { color: #fff; }
.controls { display: flex; gap: 18px; align-items: center; }
.controls .grow { flex: 1; }
.player .flash { position: absolute; top: 50%; width: 170px; height: 170px; margin-top: -85px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; text-align: center; font-size: var(--t-caption); font-weight: 800; opacity: 0; transition: opacity .25s; }
.player .flash svg { width: 60px; height: 60px; }
.player .flash.l { left: 300px; } .player .flash.r { right: 300px; } .player .flash.c { left: 50%; margin-left: -85px; }
.player .flash.on { opacity: 1; transition-duration: 0s; }
.player .spinner { position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; margin: -45px; border-radius: 50%; border: 7px solid rgba(255,255,255,.18); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player .msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; font-size: var(--t-body); color: var(--text-2); max-width: 1100px; line-height: 1.5; }
.upnext { position: absolute; right: var(--safe-x); bottom: 200px; width: 620px; padding: 26px; border-radius: 24px; background: rgba(20,22,30,.94); border: 1px solid var(--line-2); box-shadow: var(--lift); }
.upnext small { font-size: var(--t-min); color: var(--text-2); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.upnext b { display: block; font-size: 32px; margin: 8px 0 20px; }
.upnext .ring { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); margin-bottom: 22px; overflow: hidden; }
.upnext .ring i { display: block; height: 100%; background: var(--accent); }

/* ---------- toast, help ---------- */
.toast { position: absolute; z-index: 90; left: 50%; bottom: 70px; transform: translate(-50%, 40px); opacity: 0; padding: 22px 36px; border-radius: 999px; background: rgba(28,30,38,.96); border: 1px solid var(--line-2); font-size: var(--t-body); font-weight: 600; box-shadow: var(--lift); transition: transform .3s var(--ease), opacity .3s; white-space: nowrap; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.dialog { position: absolute; inset: 0; z-index: 80; background: rgba(0,0,0,.72); display: grid; place-items: center; }
.dialog[hidden] { display: none; }
/* the hidden attribute hides, whatever display a class sets (.btn is inline-flex):
   the player's Next and skip buttons were drawn, and reachable by the remote */
[hidden] { display: none !important; }
.dialog .box { width: 1100px; padding: 54px 60px; border-radius: 32px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--lift); }
.dialog h2 { margin: 0 0 30px; font-size: var(--t-title3); letter-spacing: -.02em; }

/* ---------- what TMDB adds to a title ---------- */
.b-cert { background: transparent; border: 2px solid rgba(255,255,255,.55); color: var(--text); }
.b-off { background: rgba(255,255,255,.08); color: var(--text-2); border: 1px dashed var(--line-2); }
.b-online { background: var(--accent); color: var(--accent-ink); top: auto !important; bottom: 14px; }
.meta .soon { color: var(--accent); }
.meta .sc { font-weight: 800; }
.meta .imdb { color: #f5c518; } .meta .rt { color: #ff6b4a; } .meta .mc { color: #66cc33; }
.scores { display: contents; }
.tagline { font-size: var(--t-callout); font-style: italic; color: var(--text-2); margin: -6px 0 18px; }
.detail .cast .sep { display: inline-block; width: 26px; }
.nets { display: flex; gap: 30px; align-items: center; margin: -12px 0 34px; }
.nets img { height: 40px; max-width: 170px; object-fit: contain; filter: brightness(0) invert(1); opacity: .8; }
.person { width: 220px; text-align: center; }
.person .art { width: 220px; height: 220px; border-radius: 50%; }
.person .art .fallback { font-size: 60px; }
.person .t, .person .m { text-align: center; }
.info-card { display: block; width: calc(1920px - 2 * var(--safe-x)); margin: 0 var(--safe-x); padding: 40px 44px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.info-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 60px; }
.info-card dt { font-size: var(--t-min); color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.info-card dd { margin: 0; font-size: var(--t-callout); color: var(--text); line-height: 1.4; }
.info-card .kw { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.info-card .kw span { font-size: var(--t-min); padding: 8px 18px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.info-card:focus { box-shadow: 0 0 0 5px var(--ring), var(--lift); transform: scale(1.01); }
.person-top { height: 1000px; }
.person-top .portrait { position: absolute; right: var(--safe-x); top: 120px; width: 520px; height: 780px; object-fit: cover; border-radius: 32px; box-shadow: var(--lift); }
.person-top .portrait.none { display: grid; place-items: center; background: var(--surface-2); font-size: 160px; font-weight: 800; color: var(--text-3); }
.person-top .copy { width: 1100px; top: 190px; }
.person-top .bio { -webkit-line-clamp: 7 !important; }
.trailer { position: absolute; inset: 0; z-index: 70; background: #000; }
.trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.trailer-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px var(--safe-x) var(--safe-y); display: flex; align-items: center; gap: 24px; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,0)); }
.trailer-bar b { font-size: var(--t-head); } .trailer-bar span { flex: 1; font-size: var(--t-caption); color: var(--text-2); }
.opt-group { margin-bottom: 40px; }
.opt-group > b { display: block; font-size: var(--t-body); margin-bottom: 6px; }
.opt-group > small { display: block; font-size: var(--t-min); color: var(--text-3); margin-bottom: 16px; }
.opt-group .opts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; max-width: 1240px; }

/* at an edge with nowhere to go: a small shake, so the press was heard */
.nudge-x { animation: nudge-x .26s ease; } .nudge-y { animation: nudge-y .26s ease; }
@keyframes nudge-x { 30% { translate: 8px 0; } 60% { translate: -6px 0; } }
@keyframes nudge-y { 30% { translate: 0 8px; } 60% { translate: 0 -6px; } }

/* the television's saved data could not be opened (web/js/boot.js) */
.boot-banner { position: fixed; left: 50%; top: 40px; transform: translateX(-50%); z-index: 1000; width: min(1100px, 90vw); padding: 28px 36px; border-radius: var(--r-wide); background: var(--surface-2); color: var(--text); font: 500 var(--t-callout)/1.35 var(--font); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.boot-banner .actions { display: flex; gap: 16px; margin-top: 18px; }
.boot-banner .detail { margin-top: 14px; color: var(--text-2); font: var(--t-caption)/1.3 var(--mono); }

/* ---------- a phone (web/js/app.js fit(): narrower than 900px) ----------
   The page is 780 stage px wide and as tall as the screen, so the TV sizes
   above come out at phone sizes. Pages and rows scroll under a finger (focus
   never moves them), a tap opens things, and nothing is laid out wider than
   the screen. Only what differs from the TV is here. */
.phone { --safe-x: 28px; --safe-y: 24px; --gap: 22px; --t-hero: 64px; --t-title1: 56px; --t-title2: 48px; --t-title3: 40px; }
.phone body { overflow: hidden; }
.phone .stage { overflow: hidden; }
/* scrolling: the page scrolls, rows scroll sideways */
.phone .page { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.phone .scroller { position: relative; transform: none !important; transition: none; will-change: auto; padding-bottom: 150px; }
.phone .row, .phone .chips-row { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 18px 0 26px; margin: -18px 0 -26px; }
.phone .row::-webkit-scrollbar, .phone .chips-row::-webkit-scrollbar, .phone .page::-webkit-scrollbar { display: none; }
.phone .track { transform: none !important; transition: none; }
/* a tap is not a focus: no lifting, glow or scale that would stick after a tap */
.phone .card:focus .art { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.phone .card:focus .t, .phone .card:focus .m, .phone .episode:focus .o { transform: none; }
.phone .tab:focus, .phone .chip:focus, .phone .cat-item:focus, .phone .ch-item:focus, .phone .toggle:focus, .phone .theme:focus, .phone .query:focus-within, .phone .field input:focus, .phone .info-card:focus { transform: none; }

/* the bar: logo and tools at the top, the tabs along the bottom like a phone app */
.phone .bar { height: 116px; padding: 0 var(--safe-x); gap: 16px; background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(0,0,0,0)); }
.phone .bar.away { transform: none; opacity: 1; }
.phone .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: stretch; }
.phone .tabs nav { flex: 1; justify-content: space-around; gap: 0; padding: 12px 10px 34px; border-radius: 0; border-width: 1px 0 0; background: rgba(12,13,18,.94); backdrop-filter: none; box-shadow: none; }
.phone .tab { height: 76px; padding: 0 16px; font-size: 26px; }
.phone .tab:focus { background: none; color: var(--text); }
.phone .tab.on::after, .phone .tab:focus::after { background: var(--accent); bottom: 4px; }
.phone .bar-tools { margin-left: auto; }

/* Home */
.phone .hero { height: 980px; }
.phone .hero .copy { left: var(--safe-x); right: var(--safe-x); width: auto; bottom: 120px; }
.phone .hero .logo { max-width: 100%; max-height: 180px; }
.phone .hero p { -webkit-line-clamp: 4; font-size: 27px; }
.phone .hero .pager { right: var(--safe-x); bottom: 70px; }
.phone .poster { width: 220px; } .phone .poster .art { height: 330px; }
.phone .wide, .phone .chan, .phone .genre { width: 380px; } .phone .wide .art, .phone .chan .art { height: 214px; }
.phone .top { width: 600px; }
.phone .see-all { width: 220px; } .phone .see-all .art { height: 330px; }

/* Movies, Series, My List, search results: three columns */
.phone .page-head { padding: 136px var(--safe-x) 0; }
.phone .grid, .phone .results .grid { grid-template-columns: repeat(3, 1fr); gap: 46px 18px; padding: 34px var(--safe-x) 170px; }
.phone .grid .poster { width: auto; } .phone .grid .poster .art { height: auto; aspect-ratio: 2/3; }
.phone .empty { padding: 60px var(--safe-x); }
.phone .results { overflow-y: auto; margin: 0 calc(-1 * var(--safe-x)); }

/* a title */
.phone .detail .top-area { height: auto; min-height: 1100px; }
.phone .detail .backdrop { height: 620px; bottom: auto; }
.phone .detail .backdrop::after { background: linear-gradient(0deg, var(--bg) 4%, color-mix(in srgb, var(--bg) 0%, transparent) 70%); }
.phone .detail .copy { position: relative; left: 0; top: 0; width: auto; padding: 440px var(--safe-x) 40px; }
.phone .detail .logo { max-width: 100%; max-height: 170px; }
.phone .detail .back-btn { top: 130px; }
.phone .detail .overview { -webkit-line-clamp: 8 !important; }
.phone .detail .actions, .phone .hero .actions { display: flex; flex-wrap: wrap; gap: 14px; }
.phone .episode { width: 460px; } .phone .episode .art { height: 259px; }
.phone .info-card { width: auto; margin: 0 var(--safe-x); padding: 30px; }
.phone .info-card dl { grid-template-columns: 1fr 1fr; gap: 24px; }
.phone .person-top { height: auto; }
.phone .person-top .portrait { position: relative; right: auto; top: auto; display: block; width: 300px; height: 450px; margin: 140px var(--safe-x) 0; }
.phone .person-top .copy { width: auto; top: 0; padding-top: 30px; }
.phone .nets { flex-wrap: wrap; }

/* Live TV: categories as chips across the top, channels underneath, no side preview */
.phone .live-page { display: flex; flex-direction: column; gap: 18px; padding: 136px 0 0; height: 100%; }
.phone .live-page > .list:first-child { flex: 0 0 auto; height: auto; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.phone .live-page > .list:first-child .track { flex-direction: row; padding: 4px var(--safe-x); width: max-content; }
.phone .cat-item { height: 64px; padding: 0 24px; border-radius: 999px; background: var(--surface); white-space: nowrap; }
.phone .cat-item.on::before { content: none; }
.phone .cat-item.on { background: var(--accent); color: var(--accent-ink); }
.phone .cat-item span { overflow: visible; }
.phone .live-page > .list:nth-child(2) { flex: 1 1 auto; overflow-y: auto; height: auto; padding: 0 var(--safe-x) 170px; }
.phone .live-page > .list:nth-child(2) .track { padding: 0; }
.phone .live-page .preview { display: none; }
.phone .ch-item { height: 104px; }

/* Search */
.phone .search-page { padding: 136px var(--safe-x) 0; }
.phone .query { height: 88px; }
.phone .query input { font-size: 32px; }

/* Settings: one column, and the screen scrolls (it has no page of its own) */
.phone .screen-root:has(> .settings) { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.phone .settings { grid-template-columns: 1fr; gap: 30px; padding: 136px var(--safe-x) 170px; }
.phone .settings .side { flex-direction: row; flex-wrap: wrap; }
.phone .themes { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.phone .theme { height: 150px; }
.phone .toggle, .phone .field, .phone .field-row { width: auto; }
.phone .field-row { grid-template-columns: 1fr; }
.phone .shortcuts { display: none; }
.phone .dialog .box { width: calc(100% - 2 * var(--safe-x)); padding: 36px 30px; }

/* the player: the system's controls, plus a way back */
.phone .player.touch .chrome { opacity: 1; background: none; pointer-events: none; }
.phone .player.touch .ttl, .phone .player.touch .timeline, .phone .player.touch .flash { display: none; }
.phone .player.touch .bottom { left: auto; right: var(--safe-x); top: 120px; bottom: auto; }
.phone .player.touch .controls > :not([data-key="pl:close"]):not([data-key="pl:next"]) { display: none; }
.phone .player.touch .controls .btn { pointer-events: auto; }
.phone .upnext { left: var(--safe-x); right: var(--safe-x); width: auto; bottom: 220px; }

/* watching together: who, and how far apart, over the player */
.party-strip { position: absolute; z-index: 5; left: 50%; top: var(--safe-y); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 28px; border-radius: 999px; background: rgba(20,22,30,.9); border: 1px solid var(--line-2); font-size: var(--t-caption); font-weight: 600; white-space: nowrap; }
.party-strip .btn { height: 52px; padding: 0 20px; font-size: var(--t-min); }
.phone .party-strip { top: 120px; left: var(--safe-x); right: auto; transform: none; max-width: calc(100% - 2 * var(--safe-x) - 160px); white-space: normal; }
