/* BBX design system — public site.
   Palette from the logo: navy #061A3B/#142E5A, orange #FF5900, sky #55B7E8, white. */

:root {
  --bg: #050F24;
  --surface: #0A1A3A;
  --surface-2: #142E5A;
  --surface-3: #1B3A6E;
  --border: #1F3D70;
  --border-soft: rgba(255, 255, 255, .08);

  --brand: #FF5900;
  --brand-hover: #FF7A16;
  --brand-press: #E94700;
  --brand-glow: #FF9A50;
  --sky: #55B7E8;
  --sky-light: #9BDCF5;
  --navy-ink: #061A3B;

  --text: #FFFFFF;
  --text-muted: #A9BCD9;
  --text-dim: #6E85AB;

  --ok: #3FBF7F;
  --warn: #F2B53A;
  --danger: #F2545B;

  --grad-brand: radial-gradient(circle at 38% 25%, #FF7A16, #FF5900 58%, #E94700);
  --grad-sky: linear-gradient(135deg, #9BDCF5, #55B7E8);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 68px;

  --font-display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--sky-light); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
.display { font-family: var(--font-display); letter-spacing: -.01em; font-weight: 400; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.wrap { padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:active { background: var(--brand-press); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn-outline { border-color: var(--border); background: transparent; }
.btn-outline:hover { border-color: var(--sky); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--sky); color: var(--navy-ink); }

/* ---------- badges / chips */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255, 255, 255, .14); color: #fff;
}
.badge-brand { background: var(--brand); }
.badge-sky { background: var(--sky); color: var(--navy-ink); }
.badge-outline { background: transparent; border: 1px solid rgba(255, 255, 255, .4); }
.chip {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip:hover, .chip.active { border-color: var(--sky); color: #fff; background: var(--surface-2); }
.chip.active { background: var(--sky); color: var(--navy-ink); border-color: var(--sky); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--text-muted); font-size: 14px; }
.meta .sep::before { content: "•"; color: var(--text-dim); }
.rating { color: var(--warn); font-weight: 700; }

/* ---------- announcement + header */
.announce { background: var(--grad-brand); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 8px 40px; position: relative; }
.announce button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 18px; }

.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 28px; padding-inline: var(--gutter);
  background: linear-gradient(180deg, rgba(5, 15, 36, .9), rgba(5, 15, 36, 0));
  transition: background .25s;
}
.site-header.scrolled { background: rgba(5, 15, 36, .96); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border-soft); }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { width: 42px; height: 42px; }
.logo span { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.main-nav { display: flex; gap: 22px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.main-nav a.active, .main-nav a:hover { color: #fff; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input {
  width: 260px; height: 40px; padding: 0 14px 0 40px; border-radius: 999px;
  background: rgba(10, 26, 58, .8); border: 1px solid var(--border);
}
.search-box input:focus { border-color: var(--sky); outline: none; }
.search-box svg { position: absolute; left: 13px; top: 11px; width: 18px; height: 18px; color: var(--text-dim); pointer-events: none; }
.search-results {
  position: absolute; right: 0; top: 48px; width: 380px; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.search-results a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results img { width: 44px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff; background: var(--grad-brand); flex-shrink: 0;
}
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: none; border: 0; font-size: 14px; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: #fff; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 6px 0; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }

/* mega menu for genres */
.mega { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 2px; min-width: 460px; }
.mega h4 { grid-column: 1 / -1; margin: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }

/* ---------- hero */
.hero { position: relative; height: min(82vh, 760px); min-height: 480px; margin-top: calc(-1 * var(--header-h)); overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide > img, .hero-slide > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 15, 36, .95) 0%, rgba(5, 15, 36, .55) 45%, rgba(5, 15, 36, 0) 75%),
              linear-gradient(0deg, var(--bg) 0%, rgba(5, 15, 36, 0) 40%);
}
.hero-content { position: absolute; z-index: 2; left: var(--gutter); bottom: 18%; max-width: 560px; }
.hero-content h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5vw, 64px); letter-spacing: -.02em; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.hero-content p { color: #dbe6f6; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: 18%; display: flex; gap: 8px; }
.hero-dots button { width: 28px; height: 4px; border-radius: 2px; border: 0; background: rgba(255,255,255,.3); cursor: pointer; padding: 0; }
.hero-dots button.active { background: var(--brand); }

/* ---------- rows / carousels */
.rows { position: relative; z-index: 2; margin-top: -9vh; display: flex; flex-direction: column; gap: 34px; padding-bottom: 60px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-inline: var(--gutter); margin-bottom: 12px; }
.row-head h2 { font-size: 20px; font-weight: 800; }
.row-head a { font-size: 13px; font-weight: 700; color: var(--sky); white-space: nowrap; }
.row-head a:hover { color: var(--sky-light); }
.carousel { position: relative; }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(130px, 14vw, 200px); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 6px var(--gutter) 14px; scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track.wide { grid-auto-columns: clamp(220px, 24vw, 340px); }
.track > * { scroll-snap-align: start; }
.car-btn {
  position: absolute; top: 6px; bottom: 14px; width: var(--gutter); min-width: 40px; z-index: 3;
  border: 0; cursor: pointer; color: #fff; opacity: 0; transition: opacity .2s;
  background: linear-gradient(90deg, rgba(5, 15, 36, .9), rgba(5, 15, 36, 0));
}
.car-btn.next { right: 0; transform: scaleX(-1); }
.car-btn.prev { left: 0; }
.carousel:hover .car-btn { opacity: 1; }
.car-btn svg { width: 28px; height: 28px; margin: auto; }

/* ---------- cards */
.card { position: relative; display: block; border-radius: var(--radius); }
.card-poster { position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-poster img { transform: scale(1.06); }
.card:hover .card-poster { box-shadow: 0 0 0 2px var(--sky), var(--shadow); }
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.card-title { margin-top: 8px; font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { font-size: 12px; color: var(--text-dim); }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.2); }
.card-progress > span { display: block; height: 100%; background: var(--brand); }
.card-wide .card-poster { aspect-ratio: 16/9; }

/* top 10: big outlined number left of the poster */
.track.top10 { grid-auto-columns: clamp(190px, 20vw, 270px); }
.card-rank { display: grid; grid-template-columns: 44% 56%; align-items: end; }
.card-rank .rank {
  font-family: var(--font-display); font-size: clamp(90px, 10vw, 150px); line-height: .8; text-align: right;
  color: var(--bg); -webkit-text-stroke: 3px var(--sky); margin-right: -14px; position: relative; z-index: 0;
}
.card-rank .card-poster { z-index: 1; }

/* ---------- grids (archive / search / list) */
.page { padding: calc(var(--header-h) + 24px) var(--gutter) 60px; margin-top: calc(-1 * var(--header-h)); }
.page-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 4vw, 42px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; align-items: center; }
.filters select { height: 34px; border-radius: 999px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); }
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty svg { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--text-dim); }

/* ---------- tabs */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border-soft); margin-bottom: 22px; overflow-x: auto; }
.tabs button, .tabs a {
  background: none; border: 0; padding: 12px 0; font-weight: 700; color: var(--text-muted); cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs .active { color: #fff; border-bottom-color: var(--sky); }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--sky); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-error { background: rgba(242, 84, 91, .12); border-color: rgba(242, 84, 91, .4); }
.alert-ok { background: rgba(63, 191, 127, .12); border-color: rgba(63, 191, 127, .4); }
.panel { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px; }

/* ---------- ad slot (filled by ads.js) */
.ad-slot:empty { display: none; }
.ad-slot { padding-inline: var(--gutter); }

/* ---------- footer */
.site-footer { border-top: 1px solid var(--border-soft); padding: 40px var(--gutter); color: var(--text-dim); font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 30px; }
.footer-grid h4 { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.footer-grid a { display: block; padding: 3px 0; }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 100;
  background: var(--surface-2); border: 1px solid var(--border); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: all .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- mobile tab bar (mobile-first: visible by default, hidden on desktop) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(5, 15, 36, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--border-soft);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-dim); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: #fff; }
.tabbar a.active svg { color: var(--brand); }
body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
body.no-tabbar { padding-bottom: 0; }
body.no-tabbar .tabbar { display: none; }
@media (min-width: 769px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}
.toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 769px) { .toast { bottom: 28px; } }

/* ---------- responsive */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); padding: 16px var(--gutter); gap: 14px; border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
  .search-box input { width: 180px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .logo span { display: none; }
  .search-box input { width: 40px; padding: 0; cursor: pointer; background: transparent; border-color: transparent; }
  .search-box input:focus { width: calc(100vw - 150px); padding: 0 14px 0 40px; background: var(--surface); border-color: var(--sky); cursor: text; }
  .search-results { position: fixed; left: 16px; right: 16px; width: auto; top: calc(var(--header-h) + 4px); }
  .hero { height: 72vh; min-height: 440px; }
  .hero-content { bottom: 12%; right: var(--gutter); }
  .hero-dots { bottom: 4%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 18px 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-rank .rank { -webkit-text-stroke-width: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* =====================================================================
   PUBLIC PAGES — written mobile-first (base = phone, min-width = enhance)
   ===================================================================== */

.ico { width: 20px; height: 20px; flex-shrink: 0; }
.ico-sm { width: 16px; height: 16px; vertical-align: -3px; display: inline-block; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff6b71; color: #fff; }
.btn[aria-pressed="true"].btn-ghost { background: rgba(85, 183, 232, .22); color: #fff; }
[aria-pressed="true"] .when-off, [aria-pressed="false"] .when-on, .btn:not([aria-pressed]) .when-on { display: none; }
.btn-icon-m { width: 44px; padding: 0; }
.btn-icon-m .lbl { display: none; }
@media (min-width: 641px) { .btn-icon-m { width: auto; padding: 0 22px; } .btn-icon-m .lbl { display: inline; } }
.remind[aria-pressed="true"] { border-color: var(--sky); color: var(--sky-light); }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.center { text-align: center; }
.section-title { font-size: 18px; font-weight: 800; margin: 30px 0 14px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.link-more { background: none; border: 0; padding: 0; color: var(--sky); font-weight: 700; cursor: pointer; font-size: 14px; min-height: 32px; }

/* mobile nav menus: no fixed widths */
.main-nav.open .dropdown-menu { position: static; box-shadow: none; border: 0; padding: 4px 0 0 8px; min-width: 0; background: transparent; }
.main-nav.open .mega { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
@media (max-width: 480px) { .mega { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.search-results .search-all { justify-content: center; color: var(--sky); font-weight: 700; font-size: 13px; border-top: 1px solid var(--border-soft); border-radius: 0; margin-top: 4px; }
.header-right .btn-sm { height: 38px; }

/* ---------- hero (phone first) */
.hero { height: 78vh; height: 78svh; min-height: 460px; max-height: 760px; }
.hero-slide > img { object-position: 70% center; }
.hero-slide::after {
  background: linear-gradient(0deg, var(--bg) 0%, rgba(5, 15, 36, .85) 30%, rgba(5, 15, 36, .1) 70%, rgba(5, 15, 36, .5) 100%);
}
.hero-content { left: var(--gutter); right: var(--gutter); bottom: 48px; max-width: 600px; }
@media (max-width: 640px) {
  .search-box input:not(:focus)::placeholder { color: transparent; }
}
.hero-content h1 { font-size: clamp(30px, 8.5vw, 64px); margin-bottom: 8px; }
.hero-content p { font-size: 14px; -webkit-line-clamp: 2; margin: 10px 0 0; }
.hero-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hero-actions { margin-top: 16px; }
.hero-actions .btn-primary { flex: 1; max-width: 220px; }
.hero-dots { left: var(--gutter); right: auto; bottom: 20px; }
.hero-dots button { height: 6px; width: 22px; }
@media (min-width: 769px) {
  .hero { height: min(82vh, 760px); }
  .hero-slide > img { object-position: center; }
  .hero-slide::after {
    background: linear-gradient(90deg, rgba(5, 15, 36, .95) 0%, rgba(5, 15, 36, .55) 45%, rgba(5, 15, 36, 0) 75%),
                linear-gradient(0deg, var(--bg) 0%, rgba(5, 15, 36, 0) 40%);
  }
  .hero-content { right: auto; bottom: 130px; max-width: 560px; }
  .hero-content p { font-size: 16px; -webkit-line-clamp: 3; }
  .hero-actions .btn-primary { flex: none; }
  .hero-dots { left: auto; right: var(--gutter); bottom: 150px; }
}

/* ---------- rows & cards (phone first) */
.rows { margin-top: 4px; gap: 26px; }
.rows-flat { margin-top: 0; }
.row-head h2 { font-size: 17px; }
.row-head a { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.track { grid-auto-columns: 34vw; gap: 10px; }
.track.wide { grid-auto-columns: 72vw; }
.track.top10 { grid-auto-columns: 52vw; }
.track.vertical { grid-auto-columns: 38vw; }
@media (min-width: 641px) {
  .track { grid-auto-columns: clamp(140px, 17vw, 200px); gap: 12px; }
  .track.wide { grid-auto-columns: clamp(240px, 30vw, 340px); }
  .track.top10 { grid-auto-columns: clamp(190px, 22vw, 270px); }
  .track.vertical { grid-auto-columns: clamp(150px, 16vw, 200px); }
}
@media (min-width: 769px) { .rows { margin-top: -70px; gap: 34px; } .row-head h2 { font-size: 20px; } }
@media (hover: none) { .car-btn { display: none; } }

.card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-play {
  position: absolute; left: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(5, 15, 36, .7); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.3);
}
.card-play svg { width: 14px; height: 14px; margin-left: 2px; }
.card:hover .card-play { background: var(--brand); border-color: var(--brand); }
.card-duration { position: absolute; right: 8px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(5, 15, 36, .75); }
.card-wide .card-progress ~ .card-duration { bottom: 12px; }
.card-v .card-poster { aspect-ratio: 9/16; }
.card-v-play { position: absolute; inset: 0; display: grid; place-items: center; }
.card-v-play svg { width: 44px; height: 44px; opacity: .85; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.card-upcoming .card-poster { display: block; }
.card-upcoming .btn { margin-top: 8px; }
.card-rank .rank { font-size: clamp(84px, 24vw, 150px); }

/* ---------- page heads, grids, filters */
.page { min-height: 60vh; }
.page.narrow { max-width: 760px; margin-inline: auto; }
.page-head { margin-bottom: 8px; }
.page-head p { margin: 4px 0 0; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
@media (min-width: 641px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 14px; } }
.filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.filters::-webkit-scrollbar { display: none; }
.filters select { height: 40px; flex-shrink: 0; color: var(--text); max-width: 60vw; }
.filters-count { white-space: nowrap; font-size: 13px; }
@media (min-width: 769px) { .filters { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding: 0; } .filters select { height: 36px; } }
.load-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 20px 0; }
.ad-slot { margin: 6px 0; }
.page .ad-slot { padding-inline: 0; }

/* genre / country tiles */
.tiles { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.tile {
  position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; min-height: 120px; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--border-soft);
  background: linear-gradient(120deg, hsl(var(--hue) 55% 22%), var(--surface) 70%);
}
.tile:hover { border-color: var(--sky); color: #fff; }
.tile-art { display: flex; flex-shrink: 0; }
.tile-art img { width: 58px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 14px rgba(0,0,0,.4); }
.tile-art img + img { margin-left: -30px; transform: rotate(6deg); }
.tile-art img:nth-child(3) { transform: rotate(12deg); }
.tile-body h2 { font-size: 18px; margin: 0 0 4px; }
.tile-body p { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.tile-body .dim { font-size: 12px; }

/* upcoming */
.upcoming-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.up-item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.up-art img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.up-body { display: flex; gap: 14px; padding: 14px; }
.up-date { flex-shrink: 0; width: 54px; text-align: center; border-right: 1px solid var(--border-soft); padding-right: 12px; }
.up-day { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--sky); }
.up-month { text-transform: uppercase; font-size: 12px; font-weight: 800; color: var(--text-muted); }
.up-text { min-width: 0; flex: 1; }
.up-text h2 { font-size: 19px; margin: 6px 0; }
.countdown { display: flex; gap: 6px; margin: 10px 0 12px; font-size: 12px; color: var(--text-muted); }
.countdown span { background: var(--surface-2); border-radius: 6px; padding: 4px 8px; }
.countdown b { font-size: 16px; color: #fff; margin-right: 2px; font-variant-numeric: tabular-nums; }
@media (min-width: 769px) {
  .up-item { display: grid; grid-template-columns: 340px 1fr; }
  .up-art img { height: 100%; aspect-ratio: auto; }
}
.ep-schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ep-schedule a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface); }
.ep-schedule img { width: 44px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; }
.ep-schedule a > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ep-schedule a > div span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* search page */
.search-page-form { position: relative; margin: 6px 0 18px; }
.search-page-form svg { position: absolute; left: 16px; top: 15px; color: var(--text-dim); }
.search-page-form input { width: 100%; height: 52px; border-radius: 999px; padding: 0 18px 0 48px; font-size: 16px; background: var(--surface); border: 1px solid var(--border); }
.search-page-form input:focus { outline: none; border-color: var(--sky); }

/* ---------- series detail (phone first) */
.detail-hero { position: relative; margin-top: calc(-1 * var(--header-h)); padding-top: var(--header-h); overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0 0 auto 0; width: 100%; height: 62vw; max-height: 620px; object-fit: cover; }
.detail-hero::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 62vw; max-height: 620px;
  background: linear-gradient(0deg, var(--bg) 2%, rgba(5, 15, 36, .55) 50%, rgba(5, 15, 36, .6) 100%);
}
.detail-inner { position: relative; z-index: 1; padding: 22vw var(--gutter) 10px; display: flex; flex-direction: column; gap: 16px; }
.detail-poster { width: 32vw; max-width: 180px; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 8vw, 56px); letter-spacing: -.02em; margin: 0; }
.detail-orig { font-size: 14px; margin-bottom: 8px; }
.detail-tagline { font-style: italic; color: var(--sky-light); margin: 10px 0 4px; }
.detail-synopsis { color: #dbe6f6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 0 0; max-width: 720px; }
.detail-synopsis.open { -webkit-line-clamp: unset; display: block; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.detail-actions > .btn-primary { flex: 1 1 100%; }
.detail-body { padding-top: 10px; padding-bottom: 40px; }
@media (min-width: 769px) {
  .detail-backdrop, .detail-hero::after { height: 100%; max-height: none; }
  .detail-hero::after { background: linear-gradient(90deg, rgba(5, 15, 36, .97) 0%, rgba(5, 15, 36, .75) 45%, rgba(5, 15, 36, .25) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(5, 15, 36, 0) 35%); }
  .detail-inner { flex-direction: row; align-items: flex-end; gap: 36px; padding: 120px var(--gutter) 40px; }
  .detail-poster { width: 240px; max-width: none; flex-shrink: 0; }
  .detail-actions > .btn-primary { flex: none; }
}
.rate-menu { min-width: 0; right: auto; left: 0; }
.stars { display: flex; gap: 2px; padding: 0 6px 6px; }
.stars button { width: 44px; height: 44px; font-size: 28px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--surface-3); padding: 0; }
.stars button.on, .stars button.hover { color: var(--warn); }
.season-pick select { height: 44px; border-radius: 999px; padding: 0 16px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; max-width: 100%; }

.ep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ep-item { display: grid; grid-template-columns: 40% 1fr; gap: 12px; padding: 8px; border-radius: var(--radius); align-items: start; }
a.ep-item:hover { background: var(--surface); color: inherit; }
.ep-item.current { background: var(--surface-2); }
.ep-thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-thumb .card-play { width: 32px; height: 32px; left: 8px; bottom: 8px; }
.ep-head { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ep-head .dim { font-size: 12px; }
.ep-text p { margin: 4px 0 0; font-size: 13px; }
.ep-done { display: inline-flex; gap: 4px; align-items: center; color: var(--ok); font-size: 12px; font-weight: 700; margin-top: 4px; }
.ep-item.locked { opacity: .6; }
.ep-lock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 15, 36, .55); }
.ep-now { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--brand); padding: 2px 6px; border-radius: 4px; }
@media (min-width: 1100px) {
  .ep-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
  .ep-list.hidden { display: none; }
}
@media (min-width: 769px) {
  .ep-item { grid-template-columns: 220px 1fr; gap: 16px; padding: 10px; }
  .ep-head { flex-direction: row; justify-content: space-between; gap: 12px; font-size: 15px; }
  .ep-text p { font-size: 14px; }
  .ep-list.compact .ep-item { grid-template-columns: 180px 1fr; }
}
.details { display: grid; grid-template-columns: 1fr; gap: 2px 20px; margin: 0; max-width: 760px; }
.details dt { color: var(--text-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 12px; }
.details dd { margin: 2px 0 0; }
.details a { color: var(--sky); }
@media (min-width: 641px) { .details { grid-template-columns: 200px 1fr; } .details dt { margin-top: 0; padding: 10px 0; } .details dd { padding: 10px 0; border-bottom: 1px solid var(--border-soft); } }
.trailer-box video { width: 100%; max-width: 900px; aspect-ratio: 16/9; border-radius: var(--radius); background: #000; }

/* ---------- watch page */
.page-watch .site-header { position: relative; background: var(--bg); }
.page-watch .announce, .page-auth .announce { display: none; }
.page-auth .header-right .btn-primary { display: none; }
.page-watch main { padding-bottom: 40px; }
@media (max-width: 768px) { .page-watch .site-header { display: none; } }
.watch-layout { display: flex; flex-direction: column; }
.watch-stage { background: #000; }
.watch-info { padding-top: 16px; }
.watch-head { display: flex; flex-direction: column; gap: 12px; }
.watch-head h1 { font-size: 20px; margin: 2px 0 6px; }
.watch-series { font-weight: 700; color: var(--sky); }
.watch-nav { display: flex; gap: 8px; }
@media (min-width: 769px) {
  .watch-stage { padding: 0 var(--gutter); background: linear-gradient(180deg, #000 70%, var(--bg)); }
  .watch-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .watch-head h1 { font-size: 26px; }
}

/* ---------- player */
.player {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; color: #fff;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none;
  max-height: 100vh; margin: 0 auto;
}
@media (min-width: 769px) { .player { max-height: calc(100vh - var(--header-h) - 20px); width: min(100%, calc((100vh - var(--header-h) - 20px) * 16 / 9)); } }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player video::cue { background: rgba(0, 0, 0, .65); font-family: var(--font); font-size: 1em; }
.player.fs { max-height: none; width: 100%; height: 100%; aspect-ratio: auto; }
.player-v { aspect-ratio: 9/16; max-width: 100%; height: auto; }
.page-watch.watch-v .player-v { width: 100%; height: 100vh; height: 100svh; aspect-ratio: auto; max-height: none; }
.page-watch.watch-v .player-v video { object-fit: cover; }
@media (min-width: 769px) {
  .page-watch.watch-v .player-v { width: auto; height: calc(100vh - var(--header-h) - 20px); aspect-ratio: 9/16; }
}

.pl-gesture { position: absolute; inset: 0; z-index: 2; display: flex; }
.pl-zone { flex: 1; display: grid; place-items: center; }
.pl-ripple { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; font-size: 12px; background: rgba(0,0,0,.45); border-radius: 50%; width: 84px; height: 84px; justify-content: center; }
.pl-zone.flash .pl-ripple { animation: plflash .6s ease; }
@keyframes plflash { 0% { opacity: 0; transform: scale(.8); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

.pl-top, .pl-controls { position: absolute; left: 0; right: 0; z-index: 4; transition: opacity .25s, transform .25s; }
.pl-top { top: 0; display: flex; align-items: center; gap: 6px; padding: 8px 10px calc(30px); background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); }
.pl-titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pl-titles strong { font-size: 14px; }
.pl-titles span { font-size: 12px; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-controls { bottom: 0; padding: 30px 8px 6px; background: linear-gradient(0deg, rgba(0,0,0,.8), transparent); }
.player:not(.controls-on) .pl-top, .player:not(.controls-on) .pl-controls { opacity: 0; pointer-events: none; }
.player:not(.controls-on) .pl-controls { transform: translateY(8px); }
.player:not(.controls-on) { cursor: none; }
.player.in-ad .pl-top, .player.in-ad .pl-controls, .player.in-ad .pl-big-play, .player.in-ad .pl-skip, .player.in-ad .pl-gesture { display: none !important; }

.pl-bar { display: flex; align-items: center; gap: 2px; }
.pl-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: none; border: 0; color: #fff; cursor: pointer; flex-shrink: 0; }
.pl-icon:hover { background: rgba(255,255,255,.12); color: #fff; }
.pl-icon svg { width: 22px; height: 22px; }
.pl-spacer { flex: 1; }
.pl-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 6px; color: rgba(255,255,255,.9); }
.player .i-pause, .player.playing .i-play { display: none; }
.player.playing .i-pause { display: block; }
.player .i-mute, .player.muted .i-vol { display: none; }
.player.muted .i-mute { display: block; }
/* volume (behaviour in player.js): desktop = icon + always-visible slider; touch = icon opens .pl-vol-pop;
   iPhone/iPad (.vol-locked) = icon only, toggles mute */
.pl-volume { position: relative; display: flex; align-items: center; }
.pl-vol-pop { display: flex; align-items: center; }
.pl-vol-mute { display: none; }
.pl-volume input[type=range] {
  -webkit-appearance: none; appearance: none; width: 84px; height: 28px; margin: 0 6px 0 2px; cursor: pointer;
  background: linear-gradient(90deg, var(--brand) var(--fill, 100%), rgba(255, 255, 255, .28) var(--fill, 100%)) center / 100% 4px no-repeat;
  border-radius: 2px;
}
.pl-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.pl-volume input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.pl-volume input[type=range]::-moz-range-track { background: transparent; }
.pl-volume input[type=range]:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.player.vol-locked .pl-vol-pop { display: none; }
/* touch: popover above the icon with a large slider and its own mute toggle */
.player.vol-touch .pl-vol-pop {
  display: none; position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 6; gap: 4px; padding: 6px 10px 6px 4px;
  background: rgba(5, 15, 36, .94); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; box-shadow: var(--shadow);
}
.player.vol-touch .pl-volume.open .pl-vol-pop { display: flex; }
.player.vol-touch .pl-vol-mute { display: grid; }
.player.vol-touch .pl-volume input[type=range] { width: 150px; height: 40px; background-size: 100% 6px; }
.player.vol-touch .pl-volume input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
.player.vol-touch .pl-volume input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
@media (max-width: 479px) { .player:not(.vol-touch) .pl-volume input[type=range] { width: 64px; } }
.hide-xs { display: none; }
@media (min-width: 480px) { .hide-xs { display: grid; } }

.pl-seek { position: relative; height: 24px; margin: 0 8px 2px; display: flex; align-items: center; }
.pl-rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); transition: height .15s; }
.pl-seek:hover .pl-rail, .player.scrubbing .pl-rail { height: 6px; }
.pl-buffer, .pl-played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.pl-buffer { background: rgba(255,255,255,.35); }
.pl-played { background: var(--brand); }
.pl-played::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(255, 89, 0, .3); }
.pl-marks i { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--warn); border-radius: 1px; }
.pl-seek input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pl-seek-tip { position: absolute; bottom: 26px; transform: translateX(-50%); background: rgba(5,15,36,.95); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.pl-seek:hover .pl-seek-tip, .player.scrubbing .pl-seek-tip { opacity: 1; }

.pl-big-play {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center; background: var(--grad-brand); color: #fff;
  box-shadow: 0 10px 30px rgba(255, 89, 0, .45);
}
.pl-big-play svg { width: 30px; height: 30px; margin-left: 4px; }
.player.playing .pl-big-play, .player.loading .pl-big-play, .player.started:not(.paused) .pl-big-play { display: none; }
.pl-spinner { position: absolute; z-index: 3; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--brand); animation: spin .8s linear infinite; display: none; }
.player.loading .pl-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.pl-error { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.8); text-align: center; padding: 20px; }

.pl-skip { position: absolute; z-index: 5; right: 14px; bottom: 86px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5); background: rgba(5,15,36,.75); color: #fff; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.pl-skip[hidden] { display: none; }
.pl-skip:hover { background: #fff; color: var(--navy-ink); }

.pl-menu-wrap { position: relative; }
.pl-menu { position: absolute; right: 0; bottom: 52px; width: 240px; padding: 10px; background: rgba(5,15,36,.97); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pl-menu-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin: 4px 2px 6px; }
.pl-menu-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pl-menu-opts button { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; }
.pl-menu-opts button.on { background: var(--sky); border-color: var(--sky); color: var(--navy-ink); }

.pl-next { position: absolute; z-index: 7; right: 12px; bottom: 12px; left: 12px; display: flex; gap: 12px; align-items: center; padding: 12px; background: rgba(5,15,36,.95); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pl-next img { width: 40%; max-width: 200px; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-sm); }
.pl-next-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.pl-next-body strong { font-size: 15px; }
.pl-next-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
@media (min-width: 769px) { .pl-next { left: auto; width: 460px; bottom: 90px; right: 20px; } }
.player.show-next .pl-controls { opacity: 1; }

.pl-toast { position: absolute; z-index: 5; left: 50%; top: 18%; transform: translateX(-50%); background: rgba(5,15,36,.88); padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.pl-toast.show { opacity: 1; }

.pl-drawer { position: absolute; z-index: 8; top: 0; right: 0; bottom: 0; width: min(360px, 88%); background: rgba(5,15,36,.97); border-left: 1px solid var(--border); transform: translateX(105%); transition: transform .25s; display: flex; flex-direction: column; }
.pl-drawer.open { transform: none; }
.pl-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--border-soft); }
.pl-drawer ol { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.pl-drawer a { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 44px; border-radius: var(--radius-sm); font-size: 14px; }
.pl-drawer a:hover { background: var(--surface-2); }
.pl-drawer a.current { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.pl-drawer a.locked { opacity: .5; cursor: default; }
.pl-drawer .n { width: 26px; text-align: center; font-weight: 800; color: var(--text-dim); }
.pl-drawer .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* vertical micro-drama player: controls overlay TikTok-style */
.player-v .pl-top { padding-top: max(10px, env(safe-area-inset-top)); }
.player-v .pl-controls { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* ---------- prose / legal */
.prose { max-width: 760px; margin-inline: auto; line-height: 1.7; }
.prose h2 { font-size: 18px; margin: 28px 0 8px; }
.prose a { color: var(--sky); }
.prose code { background: var(--surface); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.prose ul { padding-left: 20px; }
.ok-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(63,191,127,.15); color: var(--ok); }
.ok-icon svg { width: 32px; height: 32px; }

/* ---------- auth */
.page-auth .site-header { background: transparent; }
.auth { min-height: calc(100vh - var(--header-h)); display: flex; justify-content: center; align-items: flex-start; padding: 12px var(--gutter) 40px;
  background: radial-gradient(ellipse at top, rgba(85, 183, 232, .14), transparent 60%), radial-gradient(ellipse at bottom right, rgba(255, 89, 0, .10), transparent 55%); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin: 8px 0 6px; }
.auth-card > p { margin: 0 0 20px; }
.auth-logo img { width: 64px; height: 64px; }
.auth-switch { text-align: center; color: var(--text-muted); margin-top: 20px; }
.auth-switch a { color: var(--sky); font-weight: 700; }
.auth form .field input { font-size: 16px; }
@media (min-width: 641px) { .auth { align-items: center; } .auth-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); } }
.pwd { position: relative; }
.pwd input { padding-right: 84px !important; }
.pwd-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--sky); font-weight: 700; cursor: pointer; font-size: 13px; }
.perks { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); font-size: 14px; }
.perks svg { color: var(--ok); }
.check a { color: var(--sky); }
.demo-accounts { margin-top: 22px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border-soft); padding-top: 14px; }
.demo-accounts summary { cursor: pointer; color: var(--text-dim); font-weight: 700; }
.demo-accounts ul { padding-left: 18px; line-height: 1.9; }
.demo-accounts code { color: var(--sky-light); }

/* ---------- account */
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.account-head .page-title { font-size: 26px; margin: 0; }
.account-head p { margin: 2px 0 0; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.stat-row > * { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 12px; text-align: center; display: flex; flex-direction: column; }
.stat-row b { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.stat-row span { font-size: 12px; color: var(--text-muted); }
.panel-stack { display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 17px; margin-bottom: 14px; }
.panel { padding: 18px; }
@media (min-width: 641px) { .panel { padding: 24px; } }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.danger-zone summary { cursor: pointer; list-style: none; }
.danger-zone summary h2 { color: var(--danger); margin: 0; }
.danger-zone[open] summary { margin-bottom: 12px; }
.switch { min-height: 44px; }

/* ---------- list & history */
.list-item { position: relative; }
.list-remove { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(5,15,36,.8); color: #fff; cursor: pointer; z-index: 2; }
.list-remove svg { width: 16px; height: 16px; }
.list-remove:hover { background: var(--danger); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: var(--radius); padding: 8px; }
.history-link { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; }
.history-link .ep-thumb { width: 120px; flex-shrink: 0; }
.history-text { min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.history-text strong { font-size: 14px; }
.history-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-icon-btn { width: 44px; height: 44px; border: 0; background: none; color: var(--text-dim); cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.pl-icon-btn:hover { color: #fff; background: var(--surface-2); }

/* ---------- cookie consent */
/* consent banner (static/js/bbx.js). Garante 2021: "Rifiuta" as prominent as "Accetta", X = reject, no cookie wall */
.consent { position: fixed; z-index: 95; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: 10px; }
.consent-box { position: relative; max-width: 720px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); font-size: 13px; }
.consent-box strong { display: block; padding-right: 36px; font-size: 15px; }
.consent-box p { margin: 6px 0 12px; color: var(--text-muted); line-height: 1.5; }
.consent-box a { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.consent-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.consent-x:hover, .consent-x:focus-visible { background: var(--surface-3); color: #fff; }
.consent-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; padding: 12px; border-radius: var(--radius-sm); background: rgba(5, 15, 36, .45); }
.consent-opts .check { align-items: flex-start; line-height: 1.4; }
.consent-opts .check input { margin-top: 1px; flex: none; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
/* both choices share one style: neither is visually favoured */
.btn-consent { height: 44px; border-radius: 999px; background: #fff; color: var(--navy-ink); border: 1px solid #fff; font-weight: 800; font-size: 14px; }
.btn-consent:hover { background: var(--sky-light); border-color: var(--sky-light); color: var(--navy-ink); }
.btn-linklike, .linklike { grid-column: 1 / -1; justify-self: center; background: none; border: 0; padding: 6px 8px; color: var(--sky); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 769px) {
  .consent { bottom: 16px; }
  .consent-actions { grid-template-columns: auto auto 1fr; }
  .consent-actions .btn-consent { padding: 0 26px; }
  .btn-linklike { grid-column: auto; justify-self: end; }
}
body.no-tabbar .consent { bottom: 0; }

/* sign-up / terms consent boxes */
.consent-checks { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 10px; }
.consent-checks .check { align-items: flex-start; line-height: 1.4; }
.consent-checks .check input { margin-top: 1px; flex: none; }
.consent-checks a, .consent-note a { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.consent-note { font-size: 12px; color: var(--text-muted); margin: 4px 0 18px; line-height: 1.5; }
.req { color: var(--brand-glow); font-weight: 800; }

/* ---------- languages (i18n) */
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 999px;
  background: rgba(10, 26, 58, .8); border: 1px solid var(--border); cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.lang-btn svg { width: 16px; height: 16px; }
.lang-btn:hover, .lang-dd.open .lang-btn { border-color: var(--sky); }
.lang-menu { min-width: 180px; }
.lang-menu a { justify-content: space-between; }
.lang-menu a.active { color: #fff; font-weight: 700; }
.lang-menu a svg { width: 16px; height: 16px; color: var(--sky); }
/* phones: the switcher lives in the hamburger menu and the footer, the header keeps room for search + login */
.lang-header { display: none; }
@media (min-width: 641px) { .lang-header { display: block; } }
.nav-langs { display: none; }
.main-nav.open .nav-langs { display: block; border-top: 1px solid var(--border-soft); padding-top: 12px; margin-top: 4px; }
.nav-langs > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.nav-langs-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nav-langs-list a, .footer-langs a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.nav-langs-list a.active, .footer-langs a.active { border-color: var(--sky); color: #fff; background: var(--surface-2); }
.footer-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.footer-langs > svg { width: 16px; height: 16px; color: var(--text-dim); }
.legal-draft { display: inline-block; font-size: 12px; font-weight: 700; color: var(--warn); border: 1px solid rgba(242, 181, 58, .4); border-radius: 6px; padding: 4px 10px; }
.field .hint { font-size: 12px; }

/* long words (DE/NL/PL) must not break fixed-size UI */
.tabbar a span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { max-width: 100%; }
.btn > span:not(.when-on):not(.when-off) { overflow: hidden; text-overflow: ellipsis; }
.badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-head h2, .card-title, .page-title, .detail-title { overflow-wrap: anywhere; hyphens: auto; }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- card polish: every element has its own box, nothing moves against a clipping edge */

/* Carousels clip vertically (overflow-x forces it): give hover rings/shadows real room inside the track
   and compensate with negative margins so the page rhythm doesn't change. */
.track { padding-top: 10px; padding-bottom: 18px; margin-top: -4px; margin-bottom: -10px; }
.car-btn { top: 10px; bottom: 18px; }

/* Poster: fixed box; only the image zooms inside it */
.card-poster { isolation: isolate; transform: translateZ(0); }
.card-poster::after {   /* top scrim so tags stay readable on any artwork */
  content: ""; position: absolute; inset: 0 0 auto; height: 42%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 15, 36, .55), rgba(5, 15, 36, 0));
  opacity: 0; transition: opacity .25s;
}
.card-poster:has(.card-badges)::after { opacity: 1; }
.card:hover .card-poster { box-shadow: 0 0 0 2px var(--sky), 0 14px 30px -12px rgba(0, 0, 0, .7); }

/* Tags: one row, same height, glassy, never stacked over the title art */
.card-badges {
  position: absolute; z-index: 2; top: 8px; left: 8px; right: 8px;
  flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; pointer-events: none;
}
.card-badges .badge {
  height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  line-height: 1; max-width: calc(100% - 4px);
  background: rgba(5, 15, 36, .72); border: 1px solid rgba(255, 255, 255, .16); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.card-badges .badge-brand { background: var(--grad-brand); border-color: rgba(255, 154, 80, .55); }
.card-badges .badge-sky { background: var(--sky); border-color: transparent; color: var(--navy-ink); }
.card-badges .badge-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3FBF7F; flex: none;
  box-shadow: 0 0 0 3px rgba(63, 191, 127, .25);
}
@media (max-width: 640px) {
  .card-badges { top: 6px; left: 6px; right: 6px; gap: 3px; }
  .card-badges .badge { height: 18px; padding: 0 6px; font-size: 9px; }
  /* narrow cards: one tag only (the first = most important), never a second line */
  .card-badges .badge + .badge { display: none; }
}

/* Top 10: number and poster in two fixed columns, number fully visible (line-height 1, no negative overlap) */
.card-rank {
  display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); align-items: end; column-gap: 0;
}
.card-rank .rank {
  display: block; font-family: var(--font-display); line-height: 1; text-align: right;
  font-size: clamp(76px, 21vw, 132px); letter-spacing: -.06em; padding-right: .06em; margin: 0 -4px -.07em 0;
  color: transparent; -webkit-text-stroke: 2px var(--sky);
  text-shadow: none; transition: -webkit-text-stroke-color .2s, color .2s;
}
.card-rank .rank-2d { font-size: clamp(64px, 17vw, 112px); letter-spacing: -.1em; }
.card-rank:hover .rank { color: rgba(85, 183, 232, .14); -webkit-text-stroke-color: var(--sky-light); }
.card-rank .card-poster { position: relative; z-index: 1; }
@media (min-width: 641px) {
  .card-rank .rank { font-size: clamp(96px, 9vw, 140px); -webkit-text-stroke-width: 3px; }
  .card-rank .rank-2d { font-size: clamp(80px, 7.5vw, 118px); }
}

/* ---------- installable app (PWA) — see static/js/pwa.js */
/* opened from the home screen: no browser bars, so respect the notch / status bar */
html.is-standalone .site-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
html.is-standalone .announce { padding-top: calc(8px + env(safe-area-inset-top)); }
html.is-standalone .announce + .site-header { padding-top: 0; height: var(--header-h); }
html.is-standalone body { overscroll-behavior-y: none; }

.pwa-card {
  position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: rgba(10, 26, 58, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.pwa-card.show { transform: none; opacity: 1; }
.pwa-card img { border-radius: 10px; flex: none; }
.pwa-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pwa-card-text strong { font-size: 14px; }
.pwa-card-text span { font-size: 12px; color: var(--text-muted); }
.pwa-x {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-muted); font-size: 22px; line-height: 1;
}
.pwa-x:hover { background: var(--surface-2); color: #fff; }

.pwa-sheet { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; }
.pwa-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.pwa-sheet-panel {
  position: relative; width: 100%; max-width: 460px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  animation: pwa-up .25s ease;
}
@media (min-width: 641px) { .pwa-sheet { align-items: center; } .pwa-sheet-panel { border-radius: 20px; } }
@keyframes pwa-up { from { transform: translateY(30px); opacity: 0; } }
.pwa-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pwa-sheet-head img { border-radius: 10px; }
.pwa-sheet-head div { flex: 1; display: flex; flex-direction: column; }
.pwa-sheet-head span { font-size: 13px; color: var(--text-muted); }
.pwa-sheet ol { margin: 10px 0 18px; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; }
.pwa-sheet ol svg { display: inline; vertical-align: -3px; color: var(--sky); }

.pwa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pwa-hint { margin-top: 10px; font-size: 13px; }
[data-push-toggle][aria-pressed="true"] { border-color: var(--ok); color: #fff; }
[data-push-toggle][aria-pressed="true"]::before { content: "●"; color: var(--ok); margin-right: 2px; }

.offline-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.offline-page img { margin: 0 auto 16px; }
