/* DRAMAA — Netflix-style UI. Mobile-first (< 820px: phone layout with bottom tabs), desktop ≥ 820px (top nav, full-bleed hero). */
:root {
  color-scheme: dark;
  --bg: #141414;
  --bg-2: #181818;
  --surface: #262626;
  --surface-2: #333;
  --ink: #fff;
  --muted: #b3b3b3;
  --dim: #808080;
  --red: #e50914;
  --star: #f5c518;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 64px;
  --tab-h: 62px;
  --gutter: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 40; padding: env(safe-area-inset-top) 0 0; transition: background .35s var(--ease); background: linear-gradient(180deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 100%); }
.top.solid { background: rgba(20,20,20,.96); backdrop-filter: blur(14px); }
.top-row { height: var(--nav-h); display: flex; align-items: center; gap: 18px; padding: 0 var(--gutter); }
.logo { font-weight: 900; font-size: 24px; letter-spacing: .1em; color: var(--red); line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.nav { display: none; gap: 20px; font-size: 14px; color: var(--muted); }
.nav button { padding: 6px 0; font-weight: 600; transition: color .2s; }
.nav button.on, .nav button:hover { color: #fff; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 32px; height: 32px; border-radius: 6px; background: linear-gradient(135deg, #1f8cff, #0d5bd8); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.chips { display: flex; gap: 8px; padding: 4px var(--gutter) 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); font-size: 14px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.2); transition: background .2s, border-color .2s; }
.chip.on { background: rgba(255,255,255,.22); border-color: transparent; }
.chip svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ambient backdrop (phone hero) ---------- */
.ambient { position: absolute; top: 0; left: 0; right: 0; height: 78vh; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient img { width: 100%; height: 100%; object-fit: cover; filter: blur(50px) saturate(1.4) brightness(.6); transform: scale(1.4); }
.ambient::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,20,.1) 0%, rgba(20,20,20,.55) 55%, var(--bg) 100%); }

main { position: relative; z-index: 1; padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + 48px); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }

/* ---------- Phone hero ---------- */
.hero-m { margin: 8px var(--gutter) 4px; }
.hero-card { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface); box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(10,10,10,.55) 72%, rgba(10,10,10,.92) 100%); }
.hero-card .n { position: absolute; top: 12px; left: 12px; z-index: 2; color: var(--red); font-weight: 900; font-size: 22px; letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.hero-card .star { position: absolute; top: 12px; right: 12px; z-index: 2; }
.hero-content { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 16px 18px; text-align: center; }
.hero-title { font-size: clamp(30px, 10vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -.03em; text-shadow: 0 4px 24px rgba(0,0,0,.7); margin: 0 0 10px; }
.hero-tags { font-size: 14px; font-weight: 600; color: #e8e8e8; margin-bottom: 14px; }
.hero-tags i { font-style: normal; margin: 0 7px; color: var(--muted); }
.hero-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 6px; font-weight: 700; font-size: 16px; transition: transform .15s var(--ease), background .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.w { background: #fff; color: #000; }
.btn.w:hover { background: #e6e6e6; }
.btn.g { background: rgba(109,109,110,.72); color: #fff; }
.btn.g:hover { background: rgba(109,109,110,.5); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 22px; height: 22px; fill: currentColor; }
.btn svg.ln { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Desktop hero ---------- */
.hero-d { display: none; position: relative; min-height: 78vh; margin-top: calc(-1 * (var(--nav-h) + 48px)); overflow: hidden; }
.hero-d .bg { position: absolute; inset: 0; }
.hero-d .bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(34px) saturate(1.3) brightness(.55); transform: scale(1.25); }
.hero-d .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,20,.92) 0%, rgba(20,20,20,.6) 45%, rgba(20,20,20,.2) 100%), linear-gradient(180deg, rgba(20,20,20,0) 55%, var(--bg) 100%); }
.hero-d .wrap { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 48px; padding: calc(var(--nav-h) + 40px) 60px 72px; max-width: 1480px; margin: 0 auto; width: 100%; }
.hero-d .copy { max-width: 560px; }
.hero-d .kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .22em; margin-bottom: 14px; }
.hero-d .kicker b { color: var(--red); font-size: 18px; letter-spacing: .1em; }
.hero-d h1 { font-size: clamp(44px, 5.2vw, 76px); line-height: .98; letter-spacing: -.035em; font-weight: 900; margin: 0 0 18px; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.hero-d .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; color: #ddd; margin-bottom: 16px; }
.hero-d .hook { font-size: 18px; line-height: 1.5; color: #eee; margin: 0 0 26px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hero-d .btns { display: flex; gap: 12px; }
.hero-d .btns .btn { height: 50px; padding: 0 28px; font-size: 18px; }
.hero-d .poster { flex: 0 0 auto; width: clamp(240px, 24vw, 340px); border-radius: 10px; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.1); position: relative; }
.hero-d .poster .star { position: absolute; top: 12px; right: 12px; }

/* ---------- Rows & cards ---------- */
.row { margin: 22px 0 6px; }
.row h2 { font-size: 18px; font-weight: 700; margin: 0 var(--gutter) 10px; letter-spacing: -.01em; }
.rail { display: flex; gap: 8px; overflow-x: auto; padding: 6px var(--gutter) 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.card { flex: 0 0 auto; width: 31vw; max-width: 170px; scroll-snap-align: start; cursor: pointer; transition: transform .25s var(--ease); }
.card .ps { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card .t { margin: 7px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); color: #fff; font-weight: 800; font-size: 11.5px; padding: 3px 7px 3px 6px; border-radius: 5px; line-height: 1; }
.star svg { width: 12px; height: 12px; fill: var(--star); }
.card .star { position: absolute; top: 6px; right: 6px; }
.pill { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; line-height: 1; }
.has-strip .pill { bottom: 28px; }
.strip { position: absolute; left: 0; right: 0; bottom: 0; background: var(--red); color: #fff; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 4px 0; }
.strip.soon { background: rgba(60,60,60,.92); color: #ddd; }
.top10 { position: absolute; top: 0; left: 6px; background: var(--red); color: #fff; font-size: 9px; font-weight: 900; line-height: 1; padding: 4px 5px 3px; border-radius: 0 0 4px 4px; text-align: center; letter-spacing: .04em; }
.top10 span { display: block; font-size: 13px; }
.rank { display: flex; align-items: flex-end; flex: 0 0 auto; scroll-snap-align: start; }
.rank .num { font-size: 108px; line-height: .78; font-weight: 900; letter-spacing: -.12em; color: var(--bg); -webkit-text-stroke: 3px #9a9a9a; margin-right: -22px; position: relative; z-index: 0; font-family: "Arial Black", "Manrope", sans-serif; }
.rank .card { position: relative; z-index: 1; width: 34vw; max-width: 180px; }
.rank .card .t { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; padding: 0 var(--gutter); }
.grid .card { width: auto; max-width: none; }
.empty { padding: 48px var(--gutter); text-align: center; color: var(--dim); }
.empty b { display: block; color: #fff; font-size: 18px; margin-bottom: 6px; }

/* ---------- Bottom tabs (phone) ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(18,18,18,.94); backdrop-filter: blur(16px); border-top: 1px solid rgba(255,255,255,.08); display: flex; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--dim); }
.tabs button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: #fff; }
.tabs .me { width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #1f8cff, #0d5bd8); display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; }

/* ---------- Detail sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; inset: 0; z-index: 51; background: var(--bg-2); overflow-y: auto; overscroll-behavior: contain; transform: translateY(100%); transition: transform .38s var(--ease); -webkit-overflow-scrolling: touch; }
.sheet.on { transform: translateY(0); }
.sheet .hero { position: relative; height: min(62vw, 440px); overflow: hidden; background: #000; }
.sheet .hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.sheet .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24,24,24,0) 55%, var(--bg-2) 100%); }
.sheet .x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; background: rgba(30,30,30,.85); display: grid; place-items: center; }
.sheet .x svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; }
.sheet .play-float { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.85); display: grid; place-items: center; }
.sheet .play-float svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }
.sheet .body { padding: 0 var(--gutter) 40px; margin-top: -8px; position: relative; z-index: 2; }
.brand { color: var(--red); font-weight: 900; letter-spacing: .22em; font-size: 12px; }
.brand small { color: var(--muted); letter-spacing: .18em; font-weight: 700; margin-left: 6px; }
.sheet h1 { font-size: 30px; line-height: 1.05; letter-spacing: -.02em; margin: 6px 0 4px; font-weight: 900; }
.sheet .orig { color: var(--dim); font-size: 14px; margin-bottom: 12px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; color: var(--muted); font-size: 14.5px; }
.box { border: 1px solid #777; border-radius: 3px; padding: 1px 5px; font-size: 11px; font-weight: 800; color: #ddd; letter-spacing: .02em; line-height: 1.3; }
.box.red { background: var(--red); border-color: var(--red); color: #fff; }
.box.gold { border-color: var(--star); color: var(--star); }
.sheet .stack { display: grid; gap: 10px; margin: 18px 0 16px; }
.sheet .stack .btn { height: 48px; }
.resume { margin: 0 0 18px; }
.resume .nm { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.prog { position: relative; height: 3px; background: #555; border-radius: 2px; overflow: hidden; }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); border-radius: 2px; }
.resume .rem { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.sheet .desc { font-size: 15.5px; line-height: 1.5; margin: 0 0 10px; color: #eee; }
.sheet .cast { color: var(--dim); font-size: 13.5px; margin: 0 0 4px; line-height: 1.5; }
.sheet .cast b { color: var(--muted); font-weight: 600; }
.acts { display: flex; gap: 8px; padding: 18px 0 6px; }
.acts button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #ddd; min-width: 78px; padding: 6px 4px; border-radius: 8px; }
.acts button svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acts button.on svg { fill: #fff; }
.rate-box { display: none; align-items: center; gap: 6px; padding: 6px 0 12px; }
.rate-box.on { display: flex; }
.rate-box button svg { width: 30px; height: 30px; fill: #555; transition: fill .15s, transform .15s; }
.rate-box button.lit svg { fill: var(--star); }
.rate-box button:hover svg { transform: scale(1.12); }
.rate-box span { margin-left: 8px; font-size: 13px; color: var(--muted); }
.dtabs { display: flex; gap: 26px; border-top: 1px solid #3a3a3a; margin-top: 8px; }
.dtabs button { padding: 16px 0 12px; font-weight: 700; font-size: 16px; color: var(--dim); position: relative; transition: color .2s; }
.dtabs button.on { color: #fff; }
.dtabs button.on::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 3px; background: var(--red); }
.season-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 6px; }
.season { height: 40px; padding: 0 14px; border-radius: 6px; background: var(--surface); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.season svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.season-row .info { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #000; font-weight: 900; display: grid; place-items: center; font-family: Georgia, serif; }
.eps { display: grid; }
.ep { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-radius: 8px; text-align: left; width: 100%; }
.ep .th { position: relative; width: 132px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #2b2b2b; flex: 0 0 auto; }
.ep .th img { width: 100%; height: 100%; object-fit: cover; }
.ep .th .pl { position: absolute; inset: 0; display: grid; place-items: center; }
.ep .th .pl i { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.9); background: rgba(0,0,0,.4); display: grid; place-items: center; }
.ep .th .pl svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.ep .th .pb { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.3); }
.ep .th .pb i { display: block; height: 100%; background: var(--red); }
.ep .tx { flex: 1; min-width: 0; }
.ep .nm { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .du { color: var(--dim); font-size: 13px; margin-top: 3px; }
.ep .dl svg { width: 22px; height: 22px; fill: none; stroke: #ccc; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ep.lock { opacity: .42; cursor: default; }
.ep.lock .th .pl i { border-color: rgba(255,255,255,.5); }
.ep.now .nm { color: #fff; }
.ep.now .th { outline: 2px solid var(--red); outline-offset: -2px; }
.similar { padding-top: 14px; }
.pane[hidden] { display: none; }
.trailer-empty { padding: 34px 0; color: var(--dim); text-align: center; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 100; background: #000; display: none; }
.player.on { display: block; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .stage { position: absolute; inset: 0; }
.ctl { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 65%, rgba(0,0,0,.75) 100%); transition: opacity .3s; pointer-events: none; }
.ctl > * { pointer-events: auto; }
.ctl.hide { opacity: 0; }
.ctl.hide > * { pointer-events: none; }
.ctl .trow { display: flex; justify-content: space-between; align-items: center; }
.ctl .trow .ttl { font-weight: 700; font-size: 14px; color: #ddd; }
.cbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: transform .15s var(--ease), background .2s; }
.cbtn:hover { transform: scale(1.12); }
.cbtn:disabled { opacity: .35; transform: none; cursor: default; }
.cbtn svg { width: 30px; height: 30px; fill: #fff; }
.cbtn svg.ln { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cbtn .n { position: absolute; font-size: 9px; font-weight: 900; margin-top: 3px; }
.cbtn { position: relative; }
.center-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.9); display: grid; place-items: center; }
.center-play svg { width: 40px; height: 40px; fill: #fff; margin-left: 4px; }
.center-play[hidden] { display: none; }
.spinner { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--red); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brow { display: grid; gap: 12px; }
.pwrap { display: flex; align-items: center; gap: 14px; }
.pbar { position: relative; flex: 1; height: 18px; cursor: pointer; display: flex; align-items: center; }
.pbar .track { position: relative; width: 100%; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; transition: height .15s; }
.pbar:hover .track { height: 5px; }
.pbar .buf, .pbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.pbar .buf { background: rgba(255,255,255,.4); }
.pbar .fill { background: var(--red); }
.pbar .thumb { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--red); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(229,9,20,.3); }
.ptime { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: #eee; min-width: 48px; text-align: right; }
.cbar { display: flex; align-items: center; gap: 6px; }
.cbar .mid { flex: 1; text-align: center; font-weight: 700; font-size: 15px; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.cbar .mid span { color: var(--muted); font-weight: 600; }
.player .ambient-note { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 6px; font-size: 13px; color: #eee; pointer-events: none; }
.eplist { position: absolute; right: 16px; bottom: 96px; width: min(380px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; background: rgba(24,24,24,.96); border-radius: 10px; padding: 10px 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.eplist h3 { margin: 4px 4px 8px; font-size: 14px; color: var(--muted); font-weight: 700; }

/* ---------- Search & sheets ---------- */
.search { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: none; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 24px; overflow-y: auto; }
.search.on { display: flex; }
.search .bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 8px; padding: 0 12px; height: 46px; margin-bottom: 18px; }
.search .bar svg { width: 22px; height: 22px; fill: none; stroke: #bbb; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.search input { flex: 1; background: none; border: 0; color: #fff; font: inherit; font-size: 16px; outline: none; min-width: 0; }
.search input::placeholder { color: #8a8a8a; }
.search .cancel { color: #ddd; font-weight: 600; }
.search h2 { font-size: 16px; margin: 0 0 12px; }
.gsheet { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.75); }
.gsheet.on { display: flex; }
.gsheet .list { width: 100%; max-width: 520px; max-height: 70vh; overflow-y: auto; background: #1f1f1f; border-radius: 16px 16px 0 0; padding: 14px 8px calc(16px + env(safe-area-inset-bottom)); }
.gsheet .list h3 { margin: 4px 12px 10px; font-size: 14px; color: var(--muted); }
.gsheet .list button { display: block; width: 100%; text-align: left; padding: 14px 12px; font-size: 17px; font-weight: 600; border-radius: 8px; color: #ddd; }
.gsheet .list button.on { color: #fff; background: rgba(255,255,255,.08); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #fff; color: #000; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 120; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 24px var(--gutter) 8px; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
footer b { color: var(--red); letter-spacing: .1em; }

/* ---------- Desktop ---------- */
@media (min-width: 820px) {
  :root { --gutter: 48px; }
  .nav { display: flex; }
  .chips { display: none; }
  .ambient { display: none; }
  .tabs { display: none; }
  main { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 60px; }
  .hero-m { display: none; }
  .hero-d { display: block; }
  .row { margin: 10px 0 14px; }
  .row h2 { font-size: 22px; margin-bottom: 12px; }
  .rail { gap: 10px; padding-bottom: 16px; }
  .card { width: 190px; max-width: 190px; }
  .card:hover { transform: scale(1.06); z-index: 2; }
  .card .t { font-size: 13.5px; }
  .rank .num { font-size: 150px; margin-right: -26px; }
  .rank .card { width: 200px; max-width: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
  .sheet { inset: 4vh auto auto 50%; width: min(920px, 94vw); max-height: 92vh; transform: translate(-50%, 40px); opacity: 0; border-radius: 12px; box-shadow: 0 40px 120px rgba(0,0,0,.8); transition: transform .32s var(--ease), opacity .32s; }
  .sheet.on { transform: translate(-50%, 0); opacity: 1; }
  .sheet .hero { height: 500px; }
  .sheet .hero img { object-position: 50% 22%; }
  .sheet .body { padding: 0 44px 48px; }
  .sheet h1 { font-size: 40px; }
  .sheet .stack { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 40px; }
  .search { padding: 90px 48px 40px; }
  .ctl { padding: 28px 44px; }
  .cbar { gap: 16px; }
  .cbtn svg { width: 34px; height: 34px; }
  .gsheet { align-items: center; }
  .gsheet .list { border-radius: 16px; }
}
@media (max-width: 819px) {
  .ctl { padding-left: 10px; padding-right: 10px; }
  .cbar { justify-content: space-between; gap: 0; }
  .cbar .mid { display: none; }
  .cbtn { width: 40px; height: 40px; }
  .cbtn svg { width: 26px; height: 26px; }
  #btnCC { display: none; }
  .ctl .trow .ttl { font-size: 13px; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
