/* Blazingflix TV — a 10-foot interface. Everything is sized in rem and the root scales with the
   screen width, so the layout looks the same on a 720p, 1080p or 4K television. */

:root {
  --bg: #08080d;
  --bg-2: #101018;
  --surface: #181823;
  --surface-2: #232331;
  --text: #f5f4fa;
  --muted: #a9a8ba;
  --accent: #f9af12;
  --grad: linear-gradient(135deg, #ffd04a 0%, #ffa11a 48%, #ff6a3a 100%);
  --on-grad: #1b1100;
  --pad: 4.5rem;
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: calc(100vw / 120);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: none; cursor: none !important; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { display: none; }
[hidden] { display: none !important; }
html, body { background: var(--bg); min-height: 100%; }
body { font-size: 1.25rem; line-height: 1.45; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; border: 0; background: none; }
img { display: block; }
:focus { outline: none; }

/* ── Top navigation ── */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: 2.4rem; padding: 1.6rem var(--pad) 3.2rem; background: linear-gradient(180deg, rgba(8,8,13,.92), rgba(8,8,13,0)); transition: opacity .25s var(--ease), transform .25s var(--ease); }
body.is-player .nav { display: none; }
.nav-brand { display: flex; align-items: center; gap: .9rem; margin-right: 1.2rem; }
.nav-logo { height: 3.4rem; width: auto; }
.nav-word { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; }
.nav-word b { font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: .4rem; flex: 1; }
.nav-link { padding: .55rem 1.4rem; border-radius: 99rem; font-weight: 700; font-size: 1.3rem; color: var(--muted); transition: background .15s, color .15s, transform .15s var(--ease); }
.nav-link.is-active { color: var(--text); box-shadow: inset 0 -.18rem 0 var(--accent); border-radius: .4rem .4rem 0 0; }
.nav-link:focus, .nav-icon:focus { background: var(--text); color: #0b0b10; transform: scale(1.07); box-shadow: none; border-radius: 99rem; }
.nav-right { display: flex; gap: .6rem; align-items: center; }
.nav-icon { display: inline-flex; align-items: center; gap: .6rem; height: 3.2rem; min-width: 3.2rem; padding: 0 1rem; border-radius: 99rem; font-weight: 700; color: var(--text); transition: background .15s, transform .15s var(--ease); }
.nav-icon svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-avatar { width: 3.2rem; height: 3.2rem; padding: 0; justify-content: center; background: var(--grad); color: var(--on-grad); font-weight: 900; }
.nav-avatar:focus { background: var(--text); }

/* ── Screens ── */
#screen { min-height: 100vh; animation: screen-in .35s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(.8rem); } }
.loading { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 4rem; height: 4rem; border-radius: 50%; border: .35rem solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: grid; place-content: center; justify-items: center; gap: 1.2rem; min-height: 100vh; text-align: center; padding: 0 var(--pad); }
.empty h2 { font-size: 2.6rem; }
.empty p { color: var(--muted); max-width: 40rem; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .8rem; min-height: 3.8rem; padding: 0 2rem; border-radius: .8rem; font-weight: 800; font-size: 1.3rem; background: rgba(255,255,255,.16); color: var(--text); backdrop-filter: blur(8px); transition: transform .15s var(--ease), background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn svg { width: 1.6rem; height: 1.6rem; fill: currentColor; flex: none; }
.btn.primary { background: var(--grad); color: var(--on-grad); }
.btn:focus { background: var(--text); color: #0b0b10; transform: scale(1.08); box-shadow: 0 .8rem 2.4rem rgba(0,0,0,.5), 0 0 0 .25rem rgba(255,255,255,.35); }
.btn.primary:focus { background: var(--grad); color: var(--on-grad); box-shadow: 0 .8rem 2.4rem rgba(0,0,0,.5), 0 0 0 .3rem #fff; }
.btn.is-on { background: rgba(255,255,255,.28); }
.btn.is-on:focus { background: var(--text); }

/* ── Billboard ── */
.billboard { position: relative; height: 64vh; min-height: 38rem; overflow: hidden; }
.bb-bg { position: absolute; inset: 0; background: var(--bg-2); }
.bb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 20%; opacity: 0; transition: opacity .7s ease; }
.bb-img.is-on { opacity: 1; }
.billboard::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8,8,13,.96) 0%, rgba(8,8,13,.78) 30%, rgba(8,8,13,.12) 66%, rgba(8,8,13,0) 100%); }
.billboard::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 1; background: linear-gradient(0deg, var(--bg) 0%, rgba(8,8,13,0) 100%); }
.bb-copy { position: absolute; z-index: 2; left: var(--pad); bottom: 6rem; width: 52rem; display: grid; gap: 1.1rem; transition: opacity .25s ease; }
.bb-copy.is-swapping { opacity: 0; }
.kicker { display: inline-flex; align-items: center; gap: .8rem; font-size: 1.05rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.kicker i { width: .35rem; height: .35rem; border-radius: 50%; background: var(--muted); }
.kicker span:last-child { color: var(--muted); }
.bb-title { font-size: 4.8rem; line-height: 1.02; font-weight: 900; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 .2rem 1.6rem rgba(0,0,0,.5); }
.meta { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-weight: 700; color: #d9d8e6; font-size: 1.25rem; }
.meta .star { color: var(--accent); }
.badge { padding: .05rem .6rem; border: .12rem solid rgba(255,255,255,.55); border-radius: .35rem; font-size: 1.05rem; font-weight: 800; }
.bb-plot { font-size: 1.3rem; color: #e4e3ee; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 46rem; }
.actions { display: flex; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }

/* ── Rows ── */
.rows { position: relative; z-index: 3; margin-top: -4.5rem; padding-bottom: 8rem; }
.row { margin-bottom: 2.2rem; }
.row > h2 { padding: 0 var(--pad); font-size: 1.6rem; font-weight: 800; margin-bottom: .1rem; text-shadow: 0 .1rem .8rem rgba(0,0,0,.6); }
.track { position: relative; display: flex; gap: 1.2rem; overflow-x: hidden; padding: 3.8rem var(--pad) 5.6rem; margin: -.6rem 0 -3.4rem; scroll-behavior: smooth; scroll-padding: 0 var(--pad); }
.card { position: relative; flex: none; display: block; width: 13rem; border-radius: .8rem; transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .8rem; background: var(--surface); }
.card:focus { transform: scale(1.14); z-index: 5; box-shadow: 0 0 0 .22rem #fff, 0 1.4rem 3rem rgba(0,0,0,.65); }
.cap { position: absolute; left: 0; right: 0; top: calc(100% + 1.2rem); font-size: 1.05rem; font-weight: 700; text-align: center; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:focus .cap { opacity: 1; }
.row-wide .card { width: 24rem; background: var(--bg-2); }
.row-wide .card img { aspect-ratio: 16 / 9; border-radius: .8rem .8rem 0 0; }
.row-wide .cap { position: static; opacity: 1; margin-top: 0; padding: .9rem 1.3rem 1.1rem; text-align: left; display: grid; gap: .1rem; font-size: 1.1rem; }
.row-wide .cap small { color: var(--muted); font-weight: 600; font-size: 1rem; }
.row-wide .card:focus .cap { transform: none; }
.progress { position: absolute; left: .9rem; right: .9rem; top: calc(13.5rem - 1.4rem); height: .32rem; border-radius: 99rem; background: rgba(255,255,255,.28); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); }
.play-dot { position: absolute; left: 50%; top: 6.75rem; translate: -50% -50%; width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-items: center; background: rgba(8,8,13,.6); backdrop-filter: blur(6px); }
.play-dot svg { width: 1.8rem; height: 1.8rem; fill: #fff; margin-left: .2rem; }
.row-ranked .card { width: 17rem; display: flex; align-items: flex-end; }
.row-ranked .card img { width: 13rem; flex: none; margin-left: auto; }
.num { position: absolute; left: -.2rem; bottom: -.7rem; font-size: 9rem; line-height: 1; font-weight: 900; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: .22rem rgba(255,255,255,.55); z-index: 0; }
.row-ranked .card img { position: relative; z-index: 1; }
.row-ranked .cap { left: 4rem; top: calc(100% + 1.8rem); }
.row-ranked .card img { transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.row-ranked .card:focus { transform: none; box-shadow: none; }
.row-ranked .card:focus img { transform: scale(1.12); z-index: 5; box-shadow: 0 0 0 .22rem #fff, 0 1.4rem 3rem rgba(0,0,0,.65); }
.soon-tag { position: absolute; left: .6rem; top: .6rem; padding: .15rem .7rem; border-radius: 99rem; background: rgba(8,8,13,.78); font-size: .95rem; font-weight: 800; color: var(--accent); }

/* ── Grid page (My List, search results) ── */
.page { padding: 9.5rem var(--pad) 8rem; }
.page > h1 { font-size: 3rem; font-weight: 900; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(7, 13rem); gap: 3.6rem 1.2rem; padding: 1.6rem 0; }
.grid .card { width: 13rem; }

/* ── Title detail ── */
.detail { position: relative; min-height: 100vh; padding: 11rem var(--pad) 6rem; }
.detail-bg { position: fixed; inset: 0; z-index: -1; background: var(--bg) center / cover no-repeat; }
.detail-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,8,13,.97) 0%, rgba(8,8,13,.82) 38%, rgba(8,8,13,.25) 100%), linear-gradient(0deg, rgba(8,8,13,.95) 0%, rgba(8,8,13,0) 55%); }
.detail-copy { width: 56rem; display: grid; gap: 1.3rem; }
.detail-plot { font-size: 1.3rem; color: #e4e3ee; }
.facts { display: grid; gap: .45rem; color: var(--muted); font-size: 1.15rem; }
.facts b { color: var(--text); font-weight: 700; margin-right: .6rem; }
.detail .row { margin: 3rem calc(var(--pad) * -1) 0; }
.seasons { display: flex; gap: .8rem; padding: 0 var(--pad); margin: .8rem 0 0; }
.chip { padding: .55rem 1.5rem; border-radius: 99rem; background: rgba(255,255,255,.14); font-weight: 800; font-size: 1.15rem; transition: transform .15s var(--ease), background .15s; }
.chip.is-on { background: rgba(255,255,255,.3); }
.chip:focus { background: var(--text); color: #0b0b10; transform: scale(1.08); }
.row-wide.eps .card { width: 26rem; }
.row-wide.eps .progress { top: calc(14.625rem - 1.4rem); }
.row-wide.eps .play-dot { top: 7.3rem; }
.ep-n { color: var(--accent); font-weight: 800; }

/* ── Search ── */
.search { display: grid; grid-template-columns: 31rem 1fr; gap: 4rem; padding: 9rem var(--pad) 6rem; min-height: 100vh; }
.query { height: 4.6rem; display: flex; align-items: center; padding: 0 1.4rem; border-radius: .8rem; background: var(--surface-2); font-size: 1.6rem; font-weight: 700; margin-bottom: 1.4rem; overflow: hidden; white-space: nowrap; }
.query span:empty::before { content: "Search movies and shows"; color: var(--muted); font-weight: 500; }
.query::after { content: ""; width: .14rem; height: 2rem; margin-left: .2rem; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.key { height: 4.2rem; border-radius: .6rem; background: var(--surface); font-weight: 800; font-size: 1.4rem; text-transform: uppercase; transition: transform .12s var(--ease), background .12s, color .12s; }
.key.wide { grid-column: span 2; font-size: 1.1rem; }
.key:focus { background: var(--text); color: #0b0b10; transform: scale(1.12); position: relative; z-index: 2; }
.results h2 { font-size: 1.6rem; margin-bottom: .6rem; }
.results .grid { grid-template-columns: repeat(5, 13rem); }
.results .note { color: var(--muted); font-size: 1.3rem; padding-top: 2rem; }

/* ── Sign-in / account ── */
.center-card { display: grid; place-items: center; min-height: 100vh; padding: 6rem var(--pad); }
.panel { width: 46rem; display: grid; gap: 1.4rem; padding: 3.2rem; border-radius: 1.6rem; background: rgba(24,24,35,.86); backdrop-filter: blur(16px); box-shadow: 0 2rem 6rem rgba(0,0,0,.5); }
.panel h1 { font-size: 2.8rem; font-weight: 900; }
.panel p { color: var(--muted); }
.field { height: 4.4rem; padding: 0 1.3rem; border-radius: .7rem; background: var(--surface-2); font-size: 1.3rem; font-weight: 600; width: 100%; transition: box-shadow .15s, background .15s; }
.field::placeholder { color: var(--muted); font-weight: 500; }
.field:focus { background: #2d2d3d; box-shadow: 0 0 0 .22rem #fff; }
.error { color: #ff8a80; font-weight: 700; min-height: 1.4em; }
.plan { display: inline-block; padding: .15rem .9rem; border-radius: 99rem; background: var(--grad); color: var(--on-grad); font-weight: 900; font-size: 1rem; letter-spacing: .08em; }

/* ── Player ── */
.player { position: fixed; inset: 0; background: #000; z-index: 40; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-hint { position: absolute; left: 50%; bottom: 3rem; translate: -50% 0; z-index: 2; padding: .8rem 1.6rem; border-radius: 99rem; background: rgba(8,8,13,.82); font-weight: 700; font-size: 1.15rem; color: #ddd; pointer-events: none; animation: hint 7s ease forwards; }
@keyframes hint { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ── Toast ── */
#tv-toast { position: fixed; left: 50%; bottom: 3.5rem; translate: -50% 1rem; z-index: 60; padding: .9rem 2rem; border-radius: 99rem; background: rgba(30,30,44,.96); font-weight: 700; font-size: 1.2rem; opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s var(--ease); }
#tv-toast.is-on { opacity: 1; translate: -50% 0; }

.nav-signin { background: var(--grad); color: var(--on-grad); padding: 0 1.6rem; }
.nav-signin:focus { background: var(--text); color: #0b0b10; }
.player-intro { position: absolute; left: 4rem; top: 3rem; z-index: 2; display: grid; gap: .3rem; padding: 1rem 1.8rem; border-radius: 1rem; background: linear-gradient(90deg, rgba(8,8,13,.85), rgba(8,8,13,0)); pointer-events: none; animation: hint 6s ease forwards; }
.player-intro strong { font-size: 2rem; font-weight: 800; }
.player-intro span { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
