/* Blazingflix app — design system "Ember"
   Tokens → base → shell → components → screens → motion. Dark is default; light via [data-theme="light"]. */

:root {
  color-scheme: dark;
  --accent: #f9af12;
  --accent-hi: #ffc83d;
  --ember: #ff6a3a;
  --grad: linear-gradient(135deg, #ffd04a 0%, #ffa11a 48%, #ff6a3a 100%);
  --on-grad: #1b1100;
  --bg: #0a0a10;
  --bg-2: #0f0f17;
  --surface: #15151f;
  --surface-2: #1e1e2a;
  --surface-3: #292937;
  --text: #f5f4fa;
  --muted: #9d9cb0;
  --line: rgba(255,255,255,.09);
  --glass: rgba(24,24,34,.62);
  --glass-strong: rgba(18,18,26,.86);
  --scrim: rgba(4,4,8,.66);
  --on-media: #fff;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 26px;
  --rail: 92px;
  --pad: clamp(16px, 2.6vw, 40px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --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-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] {
  color-scheme: light;
  --accent: #c47600;
  --accent-hi: #a86300;
  --bg: #f4f2ec;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #f1eee6;
  --surface-3: #e5e1d6;
  --text: #17150f;
  --muted: #625e53;
  --line: rgba(20,16,0,.12);
  --glass: rgba(255,255,255,.7);
  --glass-strong: rgba(255,255,255,.92);
  --scrim: rgba(20,16,0,.42);
  --shadow: 0 18px 44px rgba(60,40,0,.16);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* No visible scrollbars anywhere; scrolling still works by touch, wheel and keyboard. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html { min-width: 320px; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); overscroll-behavior-y: none; }
body, button, input { font: inherit; }
button, a, input, [data-open-id] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

/* ───────── App shell ───────── */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 0 18px; border-right: 1px solid var(--line); background: var(--bg-2); }
.rail .brand { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 16px; background: var(--surface); }
.rail .brand img { width: 28px; height: 32px; object-fit: contain; }
.rail-link { position: relative; display: grid; justify-items: center; gap: 4px; width: 68px; padding: 10px 0 9px; border-radius: 16px; color: var(--muted); font-size: 11px; font-weight: 700; transition: color .2s, background .2s; }
.rail-link:hover { color: var(--text); background: var(--surface); }
.rail-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.rail-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 26px; margin-top: -13px; border-radius: 0 4px 4px 0; background: var(--grad); }
.rail-link[aria-current="page"] .i { color: var(--accent); }
.rail-spacer { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: var(--glass); color: inherit; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .18s var(--ease), background .2s, border-color .2s; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(.92); }
.theme-toggle .i-moon, :root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

.stage { min-width: 0; padding-bottom: 48px; }
.topbar { position: sticky; z-index: 40; top: 0; display: flex; align-items: center; gap: 14px; padding: calc(14px + var(--safe-top)) var(--pad) 12px; transition: background .25s, box-shadow .25s; }
.topbar.is-scrolled { background: var(--glass-strong); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.topbar .brand-m { display: none; }
.cat-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pills a { flex: none; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--muted); font-size: 14px; font-weight: 700; transition: color .2s, background .2s, border-color .2s, transform .15s; }
.cat-pills a:hover { color: var(--text); }
.cat-pills a:active { transform: scale(.95); }
.cat-pills a[aria-current="page"] { border-color: transparent; background: var(--text); color: var(--bg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-pill { display: flex; align-items: center; gap: 10px; min-width: 220px; height: 46px; padding: 0 18px 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--muted); font-size: 14px; font-weight: 600; }
.search-pill kbd { margin-left: auto; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; font: 700 11px/1.5 inherit; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--grad); color: var(--on-grad); font-weight: 800; font-size: 16px; text-transform: uppercase; }
.avatar--guest { border: 1px solid var(--line); background: var(--glass); color: var(--text); }

.top-progress { position: fixed; z-index: 200; inset: 0 auto auto 0; width: 0; height: 3px; background: var(--grad); opacity: 0; transition: width .35s var(--ease), opacity .25s; }
.top-progress.is-loading { width: 78%; opacity: 1; }
#app { min-height: 70vh; outline: none; }

.tabbar { display: none; }

body.player-route .rail, body.player-route .topbar, body.player-route .tabbar, body.player-route .top-progress { display: none; }
body.player-route .app { display: block; }
body.player-route { overflow: hidden; }

/* ───────── Buttons ───────── */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 24px; border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; transition: transform .18s var(--ease), filter .2s, background .2s, border-color .2s; }
.button:active { transform: scale(.96); }
.button-light, .button-gold { background: var(--grad); color: var(--on-grad); box-shadow: 0 8px 26px rgba(255,138,30,.28); }
.button-light:hover, .button-gold:hover { filter: brightness(1.07); }
.button-outline { border-color: var(--line); background: var(--glass); color: var(--text); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.button-outline:hover { border-color: var(--accent); }
.hero .button-outline, .episode-view .button-outline { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.12); color: #fff; }
.button .i { width: 20px; height: 20px; }
.addtolist[data-in-list="Yes"] .i-off, .addtolist:not([data-in-list="Yes"]) .i-on { display: none; }
.addtolist[data-in-list="Yes"] { border-color: var(--accent); color: var(--accent); }
.addtolist.icon-btn { width: 50px; height: 50px; }
.hero .addtolist[data-in-list="Yes"] { color: var(--accent-hi); }
.addtolist.is-pop .i { animation: pop .4s var(--ease); }
@keyframes pop { 0% { transform: scale(.5); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ───────── Hero ───────── */
.hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(430px, 44vw, 580px); margin: 0 var(--pad); padding: clamp(26px, 4vw, 56px); border-radius: var(--r-lg); overflow: hidden; isolation: isolate; background: var(--surface); color: var(--on-media); }
.hero-bg { position: absolute; z-index: -2; inset: 0; background: var(--hero-image) center 22%/cover no-repeat; transform: scale(1.02); transition: opacity .5s ease; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(8,8,14,.94) 0%, rgba(8,8,14,.72) 34%, rgba(8,8,14,.08) 72%), linear-gradient(0deg, rgba(8,8,14,.9) 0%, transparent 55%); }
.hero-copy { width: min(100%, 560px); transition: opacity .28s ease, transform .35s var(--ease); }
.hero.is-swapping .hero-copy { opacity: 0; transform: translateY(8px); }
.hero.is-swapping .hero-bg { opacity: .35; }
.hero-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-kicker .kicker { padding: 5px 11px; border-radius: 999px; background: var(--grad); color: var(--on-grad); }
.hero-kicker [data-hero-genre] { color: rgba(255,255,255,.82); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.9rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 16px 0 12px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.86); }
.hero-meta .score { color: var(--accent-hi); font-weight: 800; }
.hero-meta [data-hero-rating] { padding: 1px 7px; border: 1px solid rgba(255,255,255,.4); border-radius: 5px; font-size: 12px; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-meta [data-hero-rating]:empty { display: none; }
.hero-plot { display: -webkit-box; max-width: 52ch; overflow: hidden; color: rgba(255,255,255,.84); font-size: clamp(14px, 1.1vw, 17px); line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.hero-credit { position: absolute; right: clamp(24px, 3vw, 48px); bottom: clamp(26px, 3vw, 44px); display: grid; gap: 6px; max-width: 30%; color: rgba(255,255,255,.7); text-align: right; font-size: 12px; line-height: 1.5; }
.hero-credit b { color: #fff; font-size: 10px; letter-spacing: .12em; margin-right: 4px; }
.hero-empty { min-height: 340px; }
.hero-empty h1 { font-size: 2.4rem; }

/* ───────── Rows & posters ───────── */
.content-row { margin: 34px 0 0; padding: 0 var(--pad); }
.row-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.row-heading h2, .page-heading h1 { font-size: clamp(19px, 1.7vw, 24px); font-weight: 800; letter-spacing: -.02em; }
.row-heading p, .page-heading p:not(.eyebrow) { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 500; }
.carousel-controls { display: flex; gap: 8px; }
.carousel-controls button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 22px; line-height: 1; transition: background .2s, transform .15s; }
.carousel-controls button:hover { background: var(--surface-3); }
.carousel-controls button:active { transform: scale(.9); }
.carousel { display: flex; gap: 14px; margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none; }
.carousel::-webkit-scrollbar { display: none; }
.poster-card { position: relative; flex: 0 0 clamp(138px, 11.5vw, 188px); min-width: 0; scroll-snap-align: start; }
.poster-link { position: relative; display: block; overflow: hidden; border-radius: var(--r); aspect-ratio: 2/3; background: var(--surface-2); box-shadow: 0 6px 20px rgba(0,0,0,.28); transition: transform .28s var(--ease), box-shadow .28s; }
.poster-link img { width: 100%; height: 100%; object-fit: cover; }
.poster-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.poster-link:active { transform: scale(.965); }
@media (hover: hover) and (pointer: fine) {
  .poster-link:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 16px 36px rgba(0,0,0,.45); }
  .carousel-controls { opacity: 0; transition: opacity .2s; }
  .row-heading:hover .carousel-controls, .carousel-controls:focus-within { opacity: 1; }
}
.movie-thumb { cursor: pointer; }
.movie-thumb.active-thumb { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--r); }
.poster-rating { position: absolute; left: 8px; bottom: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; border-radius: 999px; background: rgba(8,8,14,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 11px; font-weight: 800; }
.poster-rating span:first-child { color: var(--accent-hi); }
.poster-title { display: none; margin-top: 8px; font-size: 13px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-grid .poster-title, .browse-grid .poster-title { display: block; }

.carousel--ranked { gap: 6px; }
.carousel--ranked .poster-card { flex-basis: clamp(172px, 15vw, 224px); padding-left: 52px; }
.rank { position: absolute; z-index: 0; left: 0; bottom: -4px; font-size: clamp(100px, 9vw, 132px); font-weight: 900; line-height: .8; letter-spacing: -.1em; color: var(--bg); -webkit-text-stroke: 3px var(--accent); pointer-events: none; user-select: none; }
.carousel--ranked .poster-link { z-index: 1; }

.resume-row .carousel { gap: 14px; }
.resume-card { flex: 0 0 clamp(250px, 24vw, 330px); }
.resume-card .poster-link { aspect-ratio: 16/9; }
.resume-card .poster-link::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(0,0,0,.65), transparent 55%); }
.resume-play { position: absolute; z-index: 2; left: 50%; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; }
.resume-progress { position: absolute; z-index: 2; inset: auto 12px 10px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.resume-progress i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }
.resume-meta { margin-top: 9px; }
.resume-meta strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-meta span { color: var(--muted); font-size: 12px; font-weight: 600; }
.resume-remove { position: absolute; z-index: 4; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(8,8,14,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.resume-remove .i { width: 16px; height: 16px; }

.page-heading { padding: 34px var(--pad) 4px; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading h1 { font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.03em; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 11vw, 176px), 1fr)); gap: 22px 14px; }
.poster-grid .poster-card, .browse-grid .poster-card { flex: none; }
.paginated-list { margin-top: 22px; }
.load-more { display: flex; margin: 30px auto 0; }
.load-more[disabled] { opacity: .6; }
.empty-state { grid-column: 1 / -1; padding: 40px var(--pad); color: var(--muted); text-align: center; }

.ranked-list { display: grid; gap: 12px; padding: 0 var(--pad); margin-top: 22px; counter-reset: rank; }
.ranked-item { display: grid; grid-template-columns: 62px 84px minmax(0,1fr); align-items: center; gap: 14px; padding: 12px 18px 12px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: background .2s, transform .18s var(--ease); }
.ranked-item:hover { background: var(--surface-2); }
.ranked-item:active { transform: scale(.985); }
.ranked-item .num { justify-self: center; font-size: 46px; font-weight: 900; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px var(--accent); }
.ranked-item .poster-card { flex: none; }
.ranked-item .poster-link { border-radius: 10px; box-shadow: none; }
.ranked-item h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.ranked-item p { margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-item .badge { display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
@media (min-width: 900px) { .ranked-list { grid-template-columns: 1fr 1fr; } }

/* ───────── Search ───────── */
.search-browser { padding: 6px var(--pad) 40px; }
.search-bar { position: sticky; top: calc(var(--safe-top) + 64px); z-index: 20; max-width: 880px; margin: 0 auto 18px; }
.search-bar .field { position: relative; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); transition: border-color .2s; }
.search-bar .field:focus-within { border-color: var(--accent); }
.search-bar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: inherit; font-size: 18px; font-weight: 600; outline: none; }
.search-bar input::placeholder { color: var(--muted); font-weight: 500; }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar .clear { display: none; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-3); }
.search-bar .clear .i { width: 14px; height: 14px; }
.search-bar .field.has-value .clear { display: grid; }
.genre-nav { display: flex; gap: 8px; max-width: 1400px; margin: 0 auto 8px; padding: 4px 0 10px; overflow-x: auto; scrollbar-width: none; }
.genre-nav::-webkit-scrollbar { display: none; }
.genre-nav button { flex: none; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 700; transition: all .2s; }
.genre-nav button:hover { color: var(--text); }
.genre-nav button.is-active { border-color: transparent; background: var(--text); color: var(--bg); }
.recent-searches { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 1400px; margin: 0 auto 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.recent-searches:empty { display: none; }
.recent-searches a button, .recent-searches > button { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font-size: 13px; font-weight: 600; }
.recent-searches > button { border: 0; color: var(--accent); font-weight: 800; }
.search-results { max-width: 1400px; margin: 0 auto; }
.search-label { margin: 6px 0 14px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 11vw, 176px), 1fr)); gap: 22px 14px; transition: opacity .15s; }
.browse-grid.is-loading { opacity: .4; }
.browse-sentinel { height: 1px; }

/* ───────── Notice / auth / account ───────── */
.notice-card { max-width: 640px; margin: clamp(40px, 9vh, 100px) auto; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.notice-card h1, .notice-card h2 { margin-bottom: 10px; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.02em; }
.notice-card p { color: var(--muted); line-height: 1.7; }
.notice-card .button { margin-top: 18px; }
.notice-card a:not(.button) { color: var(--accent); font-weight: 700; }
.form-error { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255,92,92,.14); color: #ff8e8e; font-size: 14px; font-weight: 600; }
.success-message { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(80,200,120,.14); color: #6fdc92; font-size: 14px; font-weight: 600; }
:root[data-theme="light"] .form-error { color: #9b1c1c; }
:root[data-theme="light"] .success-message { color: #14602d; }

.auth-page { display: grid; place-items: center; min-height: calc(100dvh - 90px); padding: 20px var(--pad) 60px; background: radial-gradient(60% 50% at 50% 0%, rgba(255,138,30,.18), transparent 70%); }
.auth-card { width: min(100%, 440px); padding: clamp(26px, 5vw, 38px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.auth-logo { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 20px; border-radius: 18px; background: var(--surface-2); }
.auth-logo img { width: 32px; height: 36px; object-fit: contain; }
.auth-card h1 { margin: 8px 0 0; font-size: 28px; letter-spacing: -.03em; }
.auth-card .lede { margin-top: 8px; color: var(--muted); font-size: 14px; }
.auth-card form { display: grid; gap: 14px; margin-top: 24px; }
.auth-card label, .profile-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-card input, .profile-form input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); color: var(--text); font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; outline: none; transition: border-color .2s; }
.auth-card input:focus, .profile-form input:focus { border-color: var(--accent); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 52px; }
.pass-wrap button { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.auth-card .button { width: 100%; margin-top: 6px; }
.auth-card .swap { margin-top: 22px; color: var(--muted); font-size: 14px; text-align: center; }
.auth-card .swap a { color: var(--accent); font-weight: 800; }

.account-page { max-width: 760px; margin: 10px auto 0; padding: 0 var(--pad); display: grid; gap: 16px; }
.account-head { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); }
.account-head .avatar { width: 68px; height: 68px; font-size: 26px; }
.account-head h1 { font-size: 24px; letter-spacing: -.02em; }
.account-head p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.status-pill { display: inline-block; margin-top: 8px; padding: 4px 11px; border-radius: 999px; background: var(--surface-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-pill.is-premium { background: var(--grad); color: var(--on-grad); }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.panel h2 { font-size: 17px; letter-spacing: -.01em; }
.panel p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.panel .button { margin-top: 16px; }
.panel--premium { background: radial-gradient(120% 140% at 0 0, rgba(255,138,30,.2), transparent 60%), var(--surface); border-color: rgba(255,170,40,.35); }
.profile-form { display: grid; gap: 14px; }
.profile-form input[readonly] { color: var(--muted); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 16px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font-size: 15px; font-weight: 700; text-align: left; }
.settings-row:first-child { border-top: 0; }
.settings-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-row .i { color: var(--muted); }

/* ───────── Details: sheet (mobile) + modal (desktop) ───────── */
.sheet-backdrop { position: fixed; z-index: 90; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s ease; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet-backdrop[hidden], .details-sheet[hidden] { display: none; }
body.sheet-open, body.dialog-open { overflow: hidden; }
.details-sheet { position: fixed; z-index: 91; inset: auto 0 0; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(0,0,0,.5); transform: translateY(100%); transition: transform .36s var(--ease); will-change: transform; }
.details-sheet.is-open { transform: translateY(0); }
.details-sheet.is-dragging { transition: none; }
.sheet-handle { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 30px; padding: 0; border: 0; background: none; touch-action: none; cursor: grab; }
.sheet-handle::after { content: ""; position: absolute; top: 10px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 5px; background: rgba(255,255,255,.55); }
.sheet-content { overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + var(--safe-bottom)); }
.sheet-cover { position: relative; height: 210px; border-radius: 28px 28px 0 0; background: var(--cover) center 28%/cover no-repeat, var(--surface-2); touch-action: none; }
.sheet-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--surface) 2%, transparent 70%); }
.sheet-head { position: relative; display: flex; align-items: flex-end; gap: 16px; margin: -78px 20px 0; }
.sheet-poster { flex: none; width: 98px; aspect-ratio: 2/3; object-fit: cover; border-radius: 14px; background: var(--surface-3); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.sheet-head > div { min-width: 0; padding-bottom: 4px; }
.sheet-head .kicker { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sheet-head h2 { margin-top: 4px; font-size: clamp(22px, 5.6vw, 30px); line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.sheet-meta .score { color: var(--accent); font-weight: 800; }
.sheet-meta .pill { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 20px 0; }
.sheet-actions > :first-child:nth-last-child(n+2) { grid-column: 1 / -1; }
.sheet-actions .button { width: 100%; }
.sheet-copy { margin: 18px 20px 0; color: var(--text); font-size: 15px; line-height: 1.65; opacity: .9; }
.sheet-facts { display: grid; gap: 10px; margin: 16px 20px 0; font-size: 13px; line-height: 1.5; }
.sheet-facts div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; }
.sheet-facts dt { color: var(--muted); font-weight: 700; }
.sheet-facts dd { margin: 0; font-weight: 600; }
.sheet-more { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 20px 0; padding: 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 800; }

dialog { color: var(--text); }
.info-dialog, .episodes-dialog { padding: 0; border: 1px solid var(--line); background: var(--surface); }
.info-dialog:not([open]), .episodes-dialog:not([open]), .trailer-dialog:not([open]) { display: none; }
.info-dialog::backdrop, .episodes-dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.info-dialog { width: min(94vw, 760px); max-width: none; max-height: 90dvh; overflow: auto; border-radius: var(--r-lg); box-shadow: var(--shadow); animation: dialog-in .32s var(--ease) both; }
.info-dialog .sheet-cover { height: 280px; border-radius: 0; }
.title-modal .sheet-head { margin-inline: 32px; }
.title-modal .sheet-poster { width: 124px; }
.title-modal .sheet-actions { grid-template-columns: auto auto auto; justify-content: start; margin-inline: 32px; }
.title-modal .sheet-actions > :first-child:nth-last-child(n+2) { grid-column: auto; }
.title-modal .sheet-copy, .title-modal .sheet-facts, .title-modal .sheet-more { margin-inline: 32px; }
.title-modal .sheet-more { margin-bottom: 30px; }
.dialog-close { position: absolute; z-index: 6; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(8,8,14,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.dialog-close .i { width: 18px; height: 18px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.detail-page { position: relative; }
.detail-page .detail-cover { height: 300px; background: var(--detail-image) center 25%/cover no-repeat; }
.detail-page .detail-cover::after { content: ""; display: block; height: 100%; background: linear-gradient(0deg, var(--surface), transparent 75%); }
.detail-page-copy { position: relative; margin-top: -100px; padding: 0 clamp(20px, 4vw, 36px) 32px; }
.detail-page h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.03em; line-height: 1.1; }
.detail-meta { margin-top: 10px; color: var(--accent); font-size: 14px; font-weight: 700; }
.detail-page-copy > p { margin-top: 14px; color: var(--text); opacity: .88; line-height: 1.7; }
.detail-page-copy .hero-actions { margin-top: 20px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--accent); font-weight: 700; }
.info-dialog .back-link { display: none; }
.detail-page .eyebrow { margin-bottom: 8px; }

.trailer-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.trailer-dialog::backdrop { background: #000; }
.trailer-frame { position: absolute; inset: 50% 0 auto; transform: translateY(-50%); aspect-ratio: 16/9; max-height: 100%; margin: 0 auto; width: min(100%, calc(100dvh * 16 / 9)); }
.trailer-frame iframe { width: 100%; height: 100%; border: 0; }
.trailer-dialog .dialog-close { top: calc(14px + var(--safe-top)); }

/* ───────── Episodes ───────── */
.episodes-dialog { width: min(96vw, 1180px); max-width: none; height: min(88dvh, 720px); max-height: none; overflow: hidden; border-radius: var(--r-lg); box-shadow: var(--shadow); animation: dialog-in .32s var(--ease) both; }
.episodes-body, .episodes-body > .episode-view { height: 100%; }
.episodes-body > .notice-card { margin: 60px 24px; }
.episode-view { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: min(88dvh, 720px); overflow: hidden; background: #08080e var(--ep-image) center / cover no-repeat; color: #fff; isolation: isolate; }
.episode-view::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,8,14,.95) 0%, rgba(8,8,14,.6) 48%, rgba(8,8,14,.1) 100%), linear-gradient(0deg, rgba(8,8,14,.96) 0%, transparent 50%); }
.ep-hero { padding: 20px clamp(18px, 3vw, 40px) 0; }
.ep-back { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px 9px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-weight: 700; font-size: 13px; }
.ep-copy { max-width: 560px; padding-top: 5vh; }
.ep-seasons { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--grad); color: var(--on-grad); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ep-title { margin: 14px 0 8px; font-size: clamp(28px, 4vw, 46px); line-height: 1.05; letter-spacing: -.035em; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); }
.ep-meta .genre-chip { color: rgba(255,255,255,.7); }
.ep-line { margin: 18px 0 6px; font-size: 17px; font-weight: 800; }
.ep-line span { margin-left: 6px; color: rgba(255,255,255,.65); font-size: 14px; font-weight: 500; }
.ep-plot { margin: 0 0 18px; min-height: 22px; color: rgba(255,255,255,.86); line-height: 1.55; }
.ep-more { padding: 0; border: 0; background: none; color: var(--accent-hi); font-weight: 800; font-size: 12px; }
.ep-hero .hero-actions { margin: 0; }
.ep-panel { padding: 0 clamp(18px, 3vw, 40px) 22px; }
.ep-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.ep-tabs button { flex: none; padding: 8px 16px; border: 0; border-radius: 999px; background: rgba(255,255,255,.13); color: #fff; font-size: 13px; font-weight: 800; transition: background .2s, color .2s; }
.ep-tabs button.is-active { background: #fff; color: #08080e; }
.ep-strip-wrap { display: flex; align-items: center; gap: 8px; }
.ep-strip { display: flex; flex: 1; gap: 10px; min-width: 0; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.ep-strip::-webkit-scrollbar { display: none; }
.ep-card { position: relative; flex: 0 0 calc((100% - 40px) / 5); scroll-snap-align: start; aspect-ratio: 16/9; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: #111; color: #fff; transition: border-color .2s, transform .18s var(--ease); }
.ep-card:active { transform: scale(.96); }
.ep-card img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.ep-card span { position: absolute; inset: auto 0 0; padding: 18px 10px 8px; background: linear-gradient(0deg, rgba(0,0,0,.9), transparent); font-size: 12px; font-weight: 800; text-align: left; }
.ep-card.is-active { border-color: var(--accent); }
.ep-card.is-active img, .ep-card:hover img { opacity: 1; }
.ep-arrow { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; line-height: 1; }
.ep-full { position: absolute; z-index: 4; inset: 30% clamp(18px, 8vw, 120px) auto; padding: 22px 46px 22px 22px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(10,10,16,.96); }
.ep-full p { line-height: 1.6; }
.ep-full button { position: absolute; top: 8px; right: 12px; border: 0; background: none; color: #fff; font-size: 24px; }

/* ───────── Player ───────── */
.player-screen { position: fixed; z-index: 120; inset: 0; display: flex; flex-direction: column; background: #000; color: #fff; padding: var(--safe-top) 0 var(--safe-bottom); }
.player-toolbar { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 18px; background: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.4)); }
.player-back { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px 0 10px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 14px; font-weight: 800; }
.player-toolbar h1 { font-size: 16px; letter-spacing: -.01em; }
.player-toolbar p { margin-top: 2px; color: rgba(255,255,255,.62); font-size: 12px; font-weight: 600; }
.landscape-hint { display: none; color: rgba(255,255,255,.55); font-size: 12px; }
.player-episode-controls { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px; background: #0c0c12; }
.player-episode-controls a { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 13px; font-weight: 800; }
.player-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #000; }
.player-unavailable { display: grid; flex: 1; place-items: center; color: rgba(255,255,255,.6); }
.player-runtime-warning { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 90vw; color: #ffce75; font-size: 12px; text-align: center; }

/* ───────── Feedback: toast, install, skeleton, errors ───────── */
.toast { position: fixed; z-index: 300; left: 50%; bottom: calc(26px + var(--safe-bottom)); display: flex; align-items: center; gap: 12px; max-width: min(92vw, 480px); padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); font-size: 14px; font-weight: 700; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 800; }
.install-banner { position: fixed; z-index: 70; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; }
.install-banner[hidden] { display: none; }
.install-banner button { padding: 6px 10px; border: 0; background: none; color: var(--accent); font-weight: 800; }
.install-banner button:last-child { color: var(--muted); font-size: 20px; }

.skeleton, .sk { border-radius: var(--r); background: linear-gradient(100deg, var(--surface) 20%, var(--surface-3) 40%, var(--surface) 60%) 0 0/220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.sk-hero { height: clamp(380px, 44vw, 560px); margin: 0 var(--pad); border-radius: var(--r-lg); }
.sk-row { display: flex; gap: 14px; margin: 34px var(--pad) 0; overflow: hidden; }
.sk-row i { flex: none; width: clamp(138px, 11.5vw, 188px); aspect-ratio: 2/3; border-radius: var(--r); background: inherit; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-3) 40%, var(--surface) 60%) 0 0/220% 100%; animation: shimmer 1.3s linear infinite; }
.navigation-error { max-width: 560px; margin: 40px auto; padding: 20px; border: 1px solid rgba(255,92,92,.4); border-radius: var(--r); background: rgba(255,92,92,.08); }
.navigation-error p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.navigation-error button, .navigation-error a { margin-right: 14px; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 800; }

/* ───────── Page transitions ───────── */
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
::view-transition-old(root) { animation: 140ms ease-in both vt-out; }
::view-transition-new(root) { animation: 280ms var(--ease) both vt-in; }

/* ───────── Tablet ───────── */
@media (max-width: 1100px) {
  .hero-credit { display: none; }
  .search-pill { min-width: 0; }
  .search-pill span, .search-pill kbd { display: none; }
  .search-pill { width: 46px; padding: 0; justify-content: center; }
}

/* ───────── Phone: native tab layout ───────── */
@media (max-width: 760px) {
  :root { --pad: 16px; --rail: 0px; }
  .app { display: block; }
  .rail { display: none; }
  .stage { padding-bottom: calc(var(--tabbar-h) + 36px + var(--safe-bottom)); }
  .topbar { gap: 10px; padding-bottom: 10px; }
  .topbar .brand-m { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--surface); }
  .topbar .brand-m img { width: 22px; height: 26px; object-fit: contain; }
  .cat-pills { flex: 1; }
  .cat-pills a { padding: 8px 15px; font-size: 13px; }
  .topbar-actions { display: none; }
  .hero { min-height: min(72svh, 560px); padding: 22px 20px 22px; border-radius: 26px; }
  .hero-bg { background-position: center top; }
  .hero::after { background: linear-gradient(0deg, rgba(8,8,14,.96) 4%, rgba(8,8,14,.7) 36%, rgba(8,8,14,.06) 78%); }
  .hero-copy { width: 100%; }
  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
  .hero-meta { margin: 12px 0 10px; font-size: 13px; }
  .hero-plot { font-size: 14px; -webkit-line-clamp: 2; }
  .hero-actions { display: grid; grid-template-columns: 1fr 50px 50px; gap: 8px; margin-top: 18px; }
  .hero-actions .button-light { grid-column: 1; }
  .hero-actions [data-open-trailer] { display: none; }
  .content-row { margin-top: 28px; }
  .carousel { gap: 10px; }
  .poster-card { flex-basis: clamp(116px, 33vw, 150px); }
  .carousel-controls { display: none; }
  .poster-link { border-radius: 14px; }
  .carousel--ranked .poster-card { flex-basis: clamp(150px, 42vw, 180px); padding-left: 44px; }
  .resume-card { flex-basis: min(72vw, 290px); }
  .poster-grid, .browse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .page-heading { padding-top: 14px; }
  .search-bar { top: calc(var(--safe-top) + 58px); }
  .search-bar .field { height: 54px; }
  .search-bar input { font-size: 17px; }
  .ranked-item { grid-template-columns: 44px 72px minmax(0,1fr); gap: 12px; }
  .ranked-item .num { font-size: 36px; }
  .notice-card { margin: 24px var(--pad); }
  .auth-page { min-height: calc(100svh - 150px); padding-top: 4px; }
  .account-head { padding: 18px; }
  .title-modal .sheet-actions { grid-template-columns: 1fr 1fr; }
  .info-dialog { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; animation: sheet-up .36s var(--ease) both; }
  .info-dialog .sheet-cover { height: 220px; }
  .episodes-dialog { width: 100%; height: 94dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; animation: sheet-up .36s var(--ease) both; }
  .episodes-dialog .episode-view { overflow-y: auto; }
  .ep-copy { padding-top: 3vh; }
  .ep-card { flex-basis: 44%; }
  .ep-arrow { display: none; }
  .ep-hero .hero-actions { display: flex; }
  .ep-hero .hero-actions > span { flex: 1; }
  .ep-hero .hero-actions > span .button { width: 100%; }
  .player-toolbar { min-height: 56px; padding: 8px 12px; }
  .player-toolbar h1 { font-size: 14px; }
  .player-back span { display: none; }
  .player-toolbar { flex-wrap: wrap; }
  .landscape-hint { flex-basis: 100%; margin: -2px 0 0 2px; font-size: 11px; }
  .player-back { padding: 0 12px; }
  .toast { bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); }
  .install-banner { left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); }
  body.sheet-open .tabbar, body.dialog-open .tabbar { transform: translateY(140%); }

  .tabbar { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); padding: 6px; border: 1px solid var(--line); border-radius: 24px; background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); box-shadow: var(--shadow); transition: transform .35s var(--ease); }
  .tabbar a { position: relative; display: grid; align-content: center; justify-items: center; gap: 3px; border-radius: 18px; color: var(--muted); font-size: 10.5px; font-weight: 800; transition: color .2s; }
  .tabbar a::before { content: ""; position: absolute; inset: 2px 8px; z-index: -1; border-radius: 16px; background: var(--surface-3); opacity: 0; transform: scale(.7); transition: opacity .25s, transform .3s var(--ease); }
  .tabbar a:active { transform: scale(.94); }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"]::before { opacity: 1; transform: none; }
  .tabbar a[aria-current="page"] .i { color: var(--accent); }
  .tabbar .i { width: 23px; height: 23px; }
}
/* Rotate hint: phones held upright only; never on desktop or in landscape. */
@media (max-width: 760px) and (orientation: portrait) {
  .landscape-hint { display: block; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

@media (max-width: 380px) {
  .poster-card { flex-basis: 112px; }
  .hero-actions { grid-template-columns: 1fr 46px 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ───────── TV mode (Android TV / Google TV, remote control) ───────── */
html.tv { --pad: 48px; cursor: none; font-size: 118%; }
html.tv * { cursor: none !important; }
html.tv .tabbar, html.tv .brand-m, html.tv .install-banner, html.tv .carousel-controls, html.tv .search-pill kbd, html.tv .landscape-hint { display: none !important; }
html.tv .stage { padding-inline: 48px; padding-block: 27px; }
html.tv :focus { outline: none; }
html.tv a:focus-visible, html.tv button:focus-visible, html.tv input:focus-visible, html.tv [tabindex="0"]:focus-visible,
html.tv a:focus, html.tv button:focus, html.tv input:focus { outline: 4px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 8px rgba(255,255,255,.18), 0 12px 40px rgba(0,0,0,.6); }
html.tv .poster-link:focus, html.tv .button:focus, html.tv .icon-btn:focus, html.tv .cat-pills a:focus, html.tv .rail-link:focus,
html.tv .genre-nav button:focus, html.tv .ranked-item a:focus { transform: scale(1.06); z-index: 5; transition: transform .15s ease; }
html.tv .player-frame:focus { outline-offset: -4px; }

/* Link your TV */
.code-input { text-transform: uppercase; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: .4em; padding-left: calc(.4em + 14px); }
.link-code-show { margin-top: 18px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); text-align: center; font-size: 30px; font-weight: 800; letter-spacing: .35em; color: var(--accent, #f9af12); }
