/* CinemaxTube: dark, cinema-style layout (after Plex's free-movies site), red and white brand. Mobile first; scales
   to desktops and TVs. System fonts only, no web-font requests. Touch targets are 44px or larger. */
/* Colour tokens. Dark is the default; the player always stays dark. */
:root, .player {
  color-scheme: dark;
  --bg: #0d0d10; --bg-2: #141418; --bg-elev: #1b1b21; --bg-hover: #24242c;
  --ink: #f5f4f2; --ink-2: #c4c2c8; --ink-3: #8c8a93; --on: #fff;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.16);
  --red: #e5222d; --red-hi: #ff3a3a; --red-soft: rgba(229, 34, 45, 0.16);
  --ok: #4cc38a; --err: #ff6b6b;
  --scrim: 13, 13, 16;                     /* the page colour as r,g,b, for gradients over pictures */
  --inv-bg: #fff; --inv-ink: #111; --inv-ink-3: #555; /* pressed chips, toasts, white buttons */
  --glass: rgba(255, 255, 255, 0.1); --glass-hi: rgba(255, 255, 255, 0.18); --dot: rgba(255, 255, 255, 0.3);
  --avatar: linear-gradient(135deg, #3a1d22, #1d1b22); --avatar-ink: #fff;
  --focus: #fff; --track: rgba(255, 255, 255, 0.16);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}
/* Light theme: bright white, near-black ink, the same red. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --bg-2: #ffffff; --bg-elev: #f1f1f3; --bg-hover: #e7e7ea;
  --ink: #16151a; --ink-2: #46444c; --ink-3: #6b6972; --on: #000;
  --line: rgba(0, 0, 0, 0.09); --line-strong: rgba(0, 0, 0, 0.18);
  --red: #d91c27; --red-hi: #b8121c; --red-soft: rgba(217, 28, 39, 0.1);
  --ok: #1f8a57; --err: #c8282f;
  --scrim: 255, 255, 255;
  --inv-bg: #16151a; --inv-ink: #fff; --inv-ink-3: #b9b7bf;
  --glass: rgba(0, 0, 0, 0.06); --glass-hi: rgba(0, 0, 0, 0.12); --dot: rgba(0, 0, 0, 0.22);
  --avatar: linear-gradient(135deg, #f3d9db, #e7e4ea); --avatar-ink: #5a1a20;
  --focus: #16151a; --track: #c4c2c9;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.28);
}
:root {
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --pad: 16px;
  --card: 300px; /* width of a card in a row */
}
@media (min-width: 700px) { :root { --pad: 28px; --card: 320px; } }
@media (min-width: 1400px) { :root { --pad: 48px; --card: 360px; } }
@media (min-width: 2000px) { :root { --card: 400px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.is-locked { overflow: hidden; }
img, svg, iframe { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 30; padding-top: var(--sat); background: linear-gradient(to bottom, rgba(var(--scrim),.96), rgba(var(--scrim),.82)); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; gap: 0 10px; min-height: 60px; padding: 0 calc(var(--pad) - 8px + var(--sar)) 0 calc(var(--pad) + var(--sal)); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; height: 60px; text-decoration: none; margin-right: auto; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; }
.brand__name { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; color: var(--on); }
.brand__name b { color: var(--red-hi); font-weight: 800; }
.row__title .brand__name { font-size: inherit; letter-spacing: -0.035em; }
.top__back { margin-left: -8px; }
.top__back:not([hidden]) + .tabs { display: none; }
.tabs { display: flex; gap: 2px; order: 3; width: 100%; margin: 0 calc(-1 * (var(--pad) - 8px)); padding: 0 calc(var(--pad) - 8px); }
.tab { flex: 1; min-height: 44px; border: 0; background: none; color: var(--ink-3); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--on); border-bottom-color: var(--red); }
.tab[disabled] { opacity: .4; }
.top__actions { display: flex; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:hover { background: var(--bg-hover); color: var(--on); }
.search { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 14px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); color: var(--ink-3); flex: 1; min-width: 0; position: relative; }
.search:focus-within { border-color: var(--line-strong); background: var(--bg-hover); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__clear { width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-3); border-radius: 50%; display: grid; place-items: center; margin-right: -6px; }
.search__clear svg { width: 16px; height: 16px; }
.top.is-searching .search { display: flex; }
.top.is-searching .brand__name, .top.is-searching .top__searchBtn { display: none; }
@media (min-width: 900px) {
  .top__row { flex-wrap: nowrap; height: 68px; gap: 18px; }
  .brand { margin-right: 6px; }
  .tabs { order: 0; width: auto; margin: 0; padding: 0; gap: 6px; }
  .tab { flex: none; padding: 0 12px; height: 68px; font-size: 16px; border-bottom-width: 3px; }
  .search { display: flex; max-width: 380px; margin-left: auto; }
  .top__back:not([hidden]) + .tabs { display: flex; }
  .top__searchBtn { display: none; }
  .top.is-searching .brand__name { display: inline; }
}

main { padding: 0 calc(var(--pad) + var(--sar)) 32px calc(var(--pad) + var(--sal)); max-width: 1920px; margin: 0 auto; }
.notice { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--bg-elev); color: var(--ink-2); font-size: 13.5px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; min-width: 60px; }
.notice .bar i { display: block; height: 100%; background: var(--red); transition: width .4s; }
.notice.err { color: var(--err); }

/* ---------- Pills (languages, genres, active filters) ---------- */
.langs, .pillrow { display: flex; gap: 8px; overflow-x: auto; padding: 14px var(--pad); margin: 0 calc(-1 * var(--pad)); scroll-padding-inline: var(--pad); scrollbar-width: none; }
.langs::-webkit-scrollbar, .pillrow::-webkit-scrollbar { display: none; }
.langs:empty, .pillrow:empty { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--bg-elev); color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: background .15s; }
.chip:hover { background: var(--bg-hover); }
.chip .n { color: var(--ink-3); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-ink); }
.chip[aria-pressed="true"] .n { color: var(--inv-ink-3); }
.chip--active { background: var(--red-soft); color: var(--on); box-shadow: inset 0 0 0 1px rgba(229,34,45,.5); }
.chip--active .x { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.chip--active .x svg { width: 12px; height: 12px; }
.chip--tool svg { width: 16px; height: 16px; }
.chip__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.langs .chip { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* ---------- Hero (featured film) ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--pad)); height: 470px; overflow: hidden; isolation: isolate; }
.hero__slide { position: absolute; inset: 0; display: flex; align-items: flex-end; isolation: isolate; opacity: 0; transition: opacity .7s ease; }
.hero__slide.is-on { opacity: 1; z-index: 1; }
.hero__bg { position: absolute; inset: 0; z-index: -2; background: #000 center 30% / cover no-repeat; transform: scale(1.04); transition: transform 7.5s ease-out; }
.hero__slide.is-on .hero__bg { transform: scale(1); }
.hero__slide::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 2%, rgba(var(--scrim),.82) 32%, rgba(var(--scrim),.15) 70%, rgba(var(--scrim),.35)), linear-gradient(to right, rgba(var(--scrim),.75), transparent 70%); }
.hero__dots { position: absolute; z-index: 2; left: var(--pad); bottom: 14px; display: flex; gap: 6px; }
.hero__dot { width: 22px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--dot); transition: width .3s, background .3s; }
.hero__dot::before { content: ""; display: block; height: 24px; margin-top: -10px; } /* larger tap area */
.hero__dot[aria-current="true"] { width: 36px; background: var(--red); }
.hero__arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: none; place-items: center; backdrop-filter: blur(6px); }
.hero__arrow svg { width: 22px; height: 22px; }
.hero__arrow:hover { background: rgba(0,0,0,.7); }
.hero__arrow--prev { left: 12px; } .hero__arrow--next { right: 12px; }
@media (hover: hover) and (pointer: fine) { .hero:hover .hero__arrow { display: grid; } }
.hero__body { padding: 160px var(--pad) 40px; max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
.hero__kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-hi); }
.hero__title { font-size: clamp(30px, 6vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.hero__cast { color: var(--ink-2); font-size: 14.5px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (min-width: 900px) {
  .hero { height: min(68vh, 640px); min-height: 480px; }
  .hero__bg { left: 25%; background-position: center; }
  .hero__slide::after { background: linear-gradient(to top, var(--bg) 1%, transparent 35%), linear-gradient(to right, var(--bg) 22%, rgba(var(--scrim),.6) 45%, transparent 75%); }
  .hero__body { padding-bottom: 64px; }
  .hero__dots { bottom: 26px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-size: 16px; font-weight: 700; text-decoration: none; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn--play { background: var(--red); color: #fff; min-width: 190px; }
.btn--play:hover { background: var(--red-hi); }
.btn--light { background: var(--glass); color: var(--on); backdrop-filter: blur(8px); }
.btn--light:hover { background: var(--glass-hi); }
.btn--primary { background: var(--inv-bg); color: var(--inv-ink); }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--on); border-color: var(--ink-3); }
.btn--wide { width: 100%; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Rows (horizontal) ---------- */
.row { margin-top: 26px; }
.row__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.row__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.row__more { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--ink-3); font-size: 14px; font-weight: 600; padding: 6px 2px; min-height: 36px; }
.row__more:hover { color: var(--on); }
.row__more svg { width: 16px; height: 16px; }
.hscroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px var(--pad) 10px; margin: 0 calc(-1 * var(--pad)); scroll-padding-inline: var(--pad); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
/* Touch screens: each swipe settles on a card. Mice and trackpads keep free scrolling. */
@media (pointer: coarse) { .hscroll { scroll-snap-type: x mandatory; } .hscroll > * { scroll-snap-stop: normal; } }
.hscroll .card { width: var(--card); }
@media (max-width: 699px) { .hscroll .card { width: 80vw; max-width: 380px; } } /* one big card and a peek of the next */

/* ---------- Cards ---------- */
.card { position: relative; min-width: 0; }
.card__media { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease, filter .3s; }
.card__dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card__dur:empty { display: none; }
.card__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.card__progress i { display: block; height: 100%; background: var(--red); }
.card__play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(229,34,45,.92); color: #fff; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; }
.card__play svg { width: 24px; height: 24px; margin-left: 3px; }
.card__body { padding: 9px 2px 0; }
.card__title { font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__link { text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.card__meta { color: var(--ink-3); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) {
  .card:hover .card__img { transform: scale(1.05); filter: brightness(.8); }
  .card:hover .card__play { opacity: 1; transform: none; }
}
.card:focus-within .card__media { outline: 2px solid var(--focus); outline-offset: 2px; }
.card__link:focus-visible { outline: none; }
.sk .card__media { background: linear-gradient(90deg, var(--bg-elev), var(--bg-hover), var(--bg-elev)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sk .card__title, .sk .card__meta { height: 12px; border-radius: 6px; background: var(--bg-elev); margin-top: 8px; }
.sk .card__meta { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Stars row */
.star { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 98px; border: 0; background: none; padding: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; }
.star__avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--avatar); color: var(--avatar-ink); font-size: 24px; font-weight: 700; box-shadow: 0 0 0 2px var(--line); }
.star__avatar img { width: 100%; height: 100%; object-fit: cover; }
.star:hover .star__avatar { box-shadow: 0 0 0 2px var(--red); }
.star:hover { color: var(--on); }
.star__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Browse grid ---------- */
.browse__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 22px 0 4px; }
.browse__title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-right: auto; }
.browse__count { color: var(--ink-3); font-size: 14px; width: 100%; order: 3; }
.browse__tools { display: flex; gap: 8px; }
.pillrow--active { padding-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 28px 18px; padding-top: 12px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 10px; } .grid .card__title { font-size: 14px; } }
.sentinel { height: 1px; }
.more { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 0 8px; }
.more .btn { min-width: 200px; }
.more__count { font-size: 12.5px; color: var(--ink-3); }
.end { text-align: center; color: var(--ink-3); font-size: 13px; padding: 28px 0 12px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; color: var(--ink-3); }
.empty h3 { font-size: 22px; color: var(--on); margin-bottom: 6px; }

/* ---------- Film page ---------- */
.film__hero { position: relative; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); isolation: isolate; overflow: hidden; }
.film__bg { position: absolute; inset: 0; z-index: -2; background: #000 center 25% / cover no-repeat; }
.film__hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 4%, rgba(var(--scrim),.88) 40%, rgba(var(--scrim),.35) 100%); }
.film__info { padding: 200px 0 8px; max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.film__title { font-size: clamp(30px, 5.5vw, 52px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; text-wrap: balance; }
.film__orig { color: var(--ink-3); font-size: 16px; margin-top: -6px; }
.film__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.film__meta .dot { color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px; border: 1.5px solid var(--ink-2); color: var(--on); font-size: 12.5px; font-weight: 700; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--glass); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.tag--ok { color: var(--ok); background: rgba(76,195,138,.12); }
.film__stats { color: var(--ink-3); font-size: 13.5px; }
.film__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 4px; }
.film__acts { display: flex; gap: 6px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 72px; padding: 6px 4px; border: 0; background: none; color: var(--ink-2); font-size: 12px; font-weight: 600; text-decoration: none; text-align: center; }
.act__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); }
.act svg { width: 20px; height: 20px; }
.act:hover { color: var(--on); } .act:hover .act__icon { background: var(--glass-hi); }
.act[aria-pressed="true"] .act__icon { background: var(--inv-bg); color: var(--inv-ink); }
.film__desc { color: var(--ink-2); font-size: 15px; line-height: 1.6; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.film__desc.is-open { display: block; }
.film__credit { color: var(--ink-3); font-size: 14px; }
.film__credit b { color: var(--ink-2); font-weight: 600; }
.film__section { margin-top: 30px; }
.film__section h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.film__alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.film__alt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 0; background: var(--bg-elev); text-align: left; color: var(--ink); }
.film__alt:hover { background: var(--bg-hover); }
.film__alt small { color: var(--ink-3); }
@media (min-width: 900px) {
  .film__bg { left: 30%; background-position: center 20%; }
  .film__hero::after { background: linear-gradient(to top, var(--bg) 2%, transparent 40%), linear-gradient(to right, var(--bg) 30%, rgba(var(--scrim),.7) 55%, rgba(var(--scrim),.1) 85%); }
  .film__info { padding: 90px 0 30px; min-height: min(72vh, 640px); justify-content: flex-end; }
}

/* ---------- Player overlay ---------- */
.player { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.86); color: var(--ink); display: grid; place-items: center; animation: fade .18s; }
.player__panel { width: min(100%, 1280px, calc((100dvh - 120px) * 16 / 9)); background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.player__bar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 18px; background: #0b0b0d; }
.player__brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; flex: none; padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--line-strong); }
.player__brand img { border-radius: 7px; }
.player__brand .brand__name { font-size: 17px; }
.player__cast { display: inline-grid; place-items: center; width: 44px; height: 44px; }
.player__cast google-cast-launcher { display: block; width: 26px; height: 26px; cursor: pointer; --disconnected-color: #fff; --connected-color: var(--red-hi); }
.player__cast.is-idle .player__castbtn { opacity: .75; }
.player__cast.is-on .player__castbtn { color: var(--red-hi); }
.player__castbtn svg { width: 24px; height: 24px; }
.casting { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: #000 center / cover no-repeat; }
.casting::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.78); }
.casting__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.casting__inner svg { width: 56px; height: 56px; color: var(--red-hi); }
.casting__inner p { color: var(--ink-2); }
.player__title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__bar .iconbtn { color: #fff; }
.player__frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.blocked { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: #000 center / cover no-repeat; }
.blocked::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.78); }
.blocked__inner { position: relative; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.blocked h3 { font-size: 22px; }
.blocked p { color: var(--ink-2); }
@media (max-width: 699px) {
  .player { background: #000; place-items: stretch; }
  .player__panel { width: 100%; border-radius: 0; display: flex; flex-direction: column; justify-content: center; box-shadow: none; }
  .player__bar { position: absolute; top: var(--sat); left: 0; right: 0; background: linear-gradient(rgba(0,0,0,.7), transparent); }
  .player__brand .brand__name { font-size: 15px; }
  .player__brand { padding-right: 10px; }
  .player__title { font-size: 14px; }
}

/* ---------- Footer ---------- */
.foot { display: flex; flex-direction: column; gap: 6px; margin-top: 48px; padding: 24px 0 calc(16px + var(--sab)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; max-width: 760px; }
.foot b { color: var(--ink-2); }

/* ---------- Sheets (bottom sheet on phones, centred dialog on larger screens) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: end stretch; backdrop-filter: blur(2px); animation: fade .15s; }
.sheet__panel { max-height: calc(100dvh - 24px - var(--sat)); display: flex; flex-direction: column; background: var(--bg-2); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); animation: rise .22s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--sab); }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; }
.sheet__head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 20px; }
.sheet__head h2 { flex: 1; font-size: 18px; }
.sheet__body { padding: 4px 20px 16px; overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot { padding: 10px 20px 12px; border-top: 1px solid var(--line); }
.sheet__foot--inline { border: 0; padding-inline: 0; }
.sheet__body fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.sheet__body legend, .fgroup__title, .fsub { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.fsub { margin: 12px 0 6px; letter-spacing: .06em; }
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.field__hint { display: block; color: var(--ink-3); font-size: 12.5px; }
.field select { font-size: 16px; color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; min-height: 40px; max-width: 200px; }
.field--switch { cursor: pointer; }
.field--switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--track); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
input:checked + .switch { background: var(--red); }
input:checked + .switch::after { transform: translateX(18px); }
input:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 2px; }
.help { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.help a { color: var(--ink-2); }
.prose p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.55; }
.prose__credits ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 12.5px; columns: 2; }
.menu__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 16px; }
.menu__item small { display: block; color: var(--ink-3); font-size: 13px; }
.menu__item[aria-selected="true"] { color: var(--on); font-weight: 700; }
.menu__item svg { width: 20px; height: 20px; flex: none; color: var(--red-hi); }
.fgroup { padding: 10px 0 6px; border-top: 1px solid var(--line); }
.fgroup:first-child { border-top: 0; }
.fgroup__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { min-height: 38px; font-size: 13.5px; padding: 0 12px; }
.chips .chip[disabled] { opacity: .35; }
.fsearch { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--bg-elev); }
.fsearch input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; outline: none; }
.fsearch svg { width: 16px; height: 16px; color: var(--ink-3); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; padding: 4px; border-radius: 12px; background: var(--bg-elev); }
.seg__btn { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 0 10px; }
.seg__btn[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-ink); }
@media (min-width: 640px) {
  .sheet { place-items: center; }
  .sheet__panel { width: min(600px, 100% - 32px); max-height: min(86vh, 820px); border-radius: 20px; padding-bottom: 0; animation: pop .18s cubic-bezier(.2,.8,.2,1); }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 16px; }
}
@keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); z-index: 90; background: var(--inv-bg); color: var(--inv-ink); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast .link { color: var(--red); padding: 0; min-height: 0; }

/* ---------- Search suggestions ---------- */
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); z-index: 40; max-height: 70vh; overflow: auto; }
.suggest__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.suggest__item svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.suggest__item.is-active, .suggest__item:hover { background: var(--bg-hover); }
.suggest__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.suggest__text b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest__text small { color: var(--ink-3); font-size: 12px; }
.suggest__type { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Rails with arrows (mouse users) ---------- */
.railwrap { position: relative; }
.railwrap__btn { position: absolute; top: 40%; transform: translateY(-50%); z-index: 3; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(20,20,24,.92); color: #fff; box-shadow: var(--shadow); display: none; place-items: center; }
.railwrap__btn svg { width: 20px; height: 20px; }
.railwrap__btn--prev { left: -8px; } .railwrap__btn--next { right: -8px; }
@media (hover: hover) and (pointer: fine) {
  .railwrap.can-prev .railwrap__btn--prev, .railwrap.can-next .railwrap__btn--next { display: grid; }
}

/* ---------- TV mode: bigger type, wider margins, strong focus ring ---------- */
html.tv { font-size: 19px; }
html.tv main, html.tv .top__row { padding-left: max(var(--pad), 4vw); padding-right: max(var(--pad), 4vw); }
html.tv .chip { min-height: 48px; font-size: 17px; padding: 0 20px; }
html.tv .hscroll .card { width: 420px; }
html.tv .player__cast { display: none; } /* already on the TV */
html.tv .card__title { font-size: 19px; } html.tv .card__meta { font-size: 15px; }
html.tv .row__title { font-size: 28px; }
html.tv :focus-visible, html.tv .card:focus-within .card__media { outline: 4px solid var(--focus); outline-offset: 3px; }
html.tv .card:focus-within { transform: scale(1.04); transition: transform .15s; }

/* Swipe animation: as a row moves, a card sliding in grows and fades up to full size, and one sliding out shrinks and
   dims. Cards fully in view are untouched. Driven by the scroll position itself (no JavaScript), so it follows the
   finger exactly; browsers without scroll-driven animations simply show plain cards. */
@supports (animation-timeline: view()) {
  @keyframes card-swipe {
    entry 0%   { opacity: .35; transform: scale(.86) translateY(6px); }
    entry 100% { opacity: 1;   transform: none; }
    exit 0%    { opacity: 1;   transform: none; }
    exit 100%  { opacity: .35; transform: scale(.86) translateY(6px); }
  }
  .hscroll > .card, .hscroll > .star { animation: card-swipe linear both; animation-timeline: view(inline); animation-range: entry 0% exit 100%; will-change: transform, opacity; }
  .hscroll > .card { transform-origin: 50% 40%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Apple-style liquid glass (both themes; light tunes it brighter) for pills, search and secondary buttons. A translucent white fill with a
   frosted backdrop, a bright top rim and a faint lower edge, and a soft drop shadow. Pressed and active states keep
   their solid colours so the current choice still stands out. */
:root {
  --lg-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.045) 100%);
  --lg-fill-hi: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
  --lg-edge: inset 0 1px 0.5px rgba(255, 255, 255, 0.24), inset 0 -1px 1px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.35), 0 10px 24px -10px rgba(0, 0, 0, 0.7);
  --lg-blur: blur(18px) saturate(180%);
}
:root[data-theme="light"] {
  --lg-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(246, 247, 250, 0.52) 100%);
  --lg-fill-hi: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 253, 0.72) 100%);
  --lg-edge: inset 0 1px 0.5px rgba(255, 255, 255, 1), inset 0 -1px 1px rgba(0, 0, 0, 0.045), 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.08), 0 8px 22px -10px rgba(0, 0, 0, 0.22);
  --lg-blur: blur(18px) saturate(180%);
}
:root :is(.search, .fsearch, .seg, .field select, .film__alt, .act__icon, .tag, .btn--light, .btn--ghost, .chip:not([aria-pressed="true"]):not(.chip--active)) {
  background: var(--lg-fill); border-color: transparent; box-shadow: var(--lg-edge);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  transition: background .2s, box-shadow .2s, transform .12s;
}
:root :is(.search:focus-within, .film__alt:hover, .act:hover .act__icon, .btn--light:hover, .btn--ghost:hover, .chip:not([aria-pressed="true"]):not(.chip--active):hover) {
  background: var(--lg-fill-hi); box-shadow: var(--lg-edge), 0 10px 26px -12px rgba(0, 0, 0, 0.3);
}
:root :is(.chip, .btn, .act__icon, .film__alt):active { transform: scale(0.97); }
/* Over a picture the glass lets more of it through, so it reads as glass rather than a white tile. */
:root[data-theme="light"] .hero .btn--light { background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34)); }
:root[data-theme="light"] .seg__btn[aria-pressed="true"] { box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.35); }
:root .railwrap__btn { background: var(--lg-fill-hi); color: var(--ink); box-shadow: var(--lg-edge); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
@media (prefers-reduced-transparency: reduce) {
  :root :is(.search, .fsearch, .seg, .field select, .film__alt, .act__icon, .tag, .btn--light, .btn--ghost, .chip, .railwrap__btn) { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
