:root {
  --bg: #0b0c10;
  --surface: #14161c;
  --surface-2: #1c1f27;
  --surface-3: #262a34;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f2f3f5;
  --text-2: #b7bcc6;
  --muted: #8a909c;
  --accent: #ff6a4d;
  --accent-2: #ff8a6e;
  --accent-ink: #1a0b07;
  --good: #3ccf8e;
  --star: #f5c518;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 10px;
  --poster-w: clamp(108px, 29vw, 184px);
  --wide-w: clamp(220px, 64vw, 340px);
  --tabbar-h: 0px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
main { outline: none; padding-bottom: calc(var(--tabbar-h) + 48px + env(safe-area-inset-bottom)); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; gap: 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.topbar.solid { background: rgba(11, 12, 16, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 800; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: url(icon.svg) center/cover; }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 6px 0; position: relative; transition: color .2s; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); }
.topnav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: transparent; border: 0; color: var(--text); }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: linear-gradient(135deg, var(--accent), #c2410c); color: #fff; }

/* ---------- bottom tab bar (phones) ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: none;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(11, 12, 16, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { color: var(--accent); }

@media (max-width: 760px) {
  :root { --tabbar-h: 58px; --topbar-h: 54px; }
  .tabbar:not([hidden]) { display: flex; }
  .topnav { display: none; }
  .topbar-right .icon-btn { display: grid; }
  .brand { font-size: 19px; }
}

/* ---------- hero ---------- */
.hero { position: relative; height: min(82vh, 760px); min-height: 460px; overflow: hidden; background: #000; touch-action: pan-y; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility 0s .9s; }
.hero-slide.on { opacity: 1; visibility: visible; z-index: 1; transition: opacity .9s var(--ease); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transform: scale(1.04); transition: transform 9s linear; }
.hero-slide.on .hero-bg { transform: scale(1); }
.hero-slide::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(11,12,16,.85) 18%, rgba(11,12,16,0) 55%),
    linear-gradient(to right, rgba(11,12,16,.92) 0%, rgba(11,12,16,.5) 38%, rgba(11,12,16,0) 70%); }
.hero-content { position: absolute; z-index: 3; left: var(--gutter); bottom: clamp(56px, 11vh, 120px); width: min(560px, 88vw); }
.hero-logo { max-width: min(440px, 80%); max-height: 150px; object-fit: contain; object-position: left bottom; margin-bottom: 18px; filter: drop-shadow(0 4px 18px rgba(0,0,0,.6)); }
.hero-title { font-size: clamp(30px, 5vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.hero-content .actions { margin-top: 20px; }
.hero-overview { color: var(--text-2); margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: clamp(60px, 11vh, 124px); display: flex; gap: 7px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border-radius: 4px; border: 0; background: rgba(255,255,255,.35); transition: width .35s var(--ease), background .35s; }
.hero-dots button.on { width: 26px; background: var(--accent); }
@media (max-width: 760px) {
  .hero { height: 72vh; min-height: 440px; }
  .hero-slide::after { background: linear-gradient(to top, var(--bg) 0%, rgba(11,12,16,.8) 30%, rgba(11,12,16,.1) 65%, rgba(11,12,16,.35) 100%); }
  .hero-content { left: 50%; transform: translateX(-50%); bottom: 44px; text-align: center; width: calc(100% - 32px); }
  .hero-logo { margin: 0 auto 14px; object-position: center bottom; max-height: 110px; }
  .hero-overview { display: none; }
  .hero .meta { justify-content: center; }
  .hero .actions { justify-content: center; }
  .hero-dots { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; }
}

/* ---------- meta & badges ---------- */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.meta .dot::before { content: "•"; margin-right: 12px; color: var(--muted); }
.meta .rating { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.meta .rating svg { width: 15px; height: 15px; color: var(--star); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,.28); font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--text-2); }
.badge.hq { border-color: rgba(255,106,77,.6); color: var(--accent-2); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 10px; border: 0; font-weight: 700; font-size: 15px; transition: transform .15s var(--ease), background .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; }
.btn-primary { background: #fff; color: #0b0c10; }
.btn-primary:hover { background: #e9e9ec; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-round { width: 46px; padding: 0; border-radius: 50%; }
.btn-round.on { color: var(--accent); }
.btn .sub { font-weight: 500; opacity: .7; font-size: 13px; }
@media (max-width: 760px) { .btn { height: 44px; padding: 0 18px; } .btn-round { width: 44px; padding: 0; } }

/* ---------- services strip ---------- */
.services { display: flex; gap: 10px; overflow-x: auto; padding: 4px var(--gutter) 6px; scrollbar-width: none; }
.services::-webkit-scrollbar { display: none; }
.service-tile { flex: none; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px 0 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); transition: background .2s, transform .2s var(--ease), border-color .2s; }
.service-tile:hover { background: var(--surface-2); transform: translateY(-2px); border-color: rgba(255,255,255,.16); }
.service-tile .logo { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.service-tile .logo.text { display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.service-tile b { font-size: 14px; font-weight: 650; }
.service-tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- rows / rails ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--gutter); margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: clamp(17px, 2vw, 21px); font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.section-head h2 .logo { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.section-head h2 .logo.text { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.on-services .logo.text { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.section-head .more { margin-left: auto; color: var(--muted); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.section-head .more:hover { color: var(--accent-2); }
.section-head .more svg { width: 18px; height: 18px; }
.rail-wrap { position: relative; }
.rail { display: flex; gap: clamp(8px, 1.2vw, 14px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); padding: 4px var(--gutter) 10px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-btn { position: absolute; top: 4px; bottom: 10px; width: calc(var(--gutter) - 4px); min-width: 36px; z-index: 5; border: 0; display: grid; place-items: center; color: #fff; background: rgba(11,12,16,.7); opacity: 0; transition: opacity .2s; }
.rail-btn.prev { left: 0; border-radius: 0 10px 10px 0; }
.rail-btn.next { right: 0; border-radius: 10px 0 0 10px; }
.rail-btn svg { width: 30px; height: 30px; }
@media (hover: hover) { .rail-wrap:hover .rail-btn:not([disabled]) { opacity: 1; } }
.rail-btn[disabled] { pointer-events: none; }

/* ---------- cards ---------- */
.card { position: relative; flex: none; width: var(--poster-w); border-radius: var(--radius); transition: transform .25s var(--ease); }
.card .art { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.card .art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.card .art > :is(.progress, .watched, .chip-q, .play-ico), .ep .art > :is(.progress, .watched) { z-index: 2; }
.card .art img.ok { opacity: 1; }
.card .fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-weight: 700; color: var(--text-2); font-size: 13px; }
.card .cap { padding: 7px 2px 0; }
.card .cap .t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cap .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .watched, .ep .watched { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--good); display: grid; place-items: center; color: #06140d; }
.card .watched svg { width: 15px; height: 15px; }
.card .chip-q { position: absolute; top: 7px; left: 7px; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.65); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; }
.progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); }
  .card:hover .art { box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.18); }
}
.card.wide { width: var(--wide-w); }
.card.wide .art { aspect-ratio: 16 / 9; }
.card.wide .play-ico { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.25); }
.card.wide .play-ico span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #000; }
@media (hover: hover) { .card.wide:hover .play-ico { opacity: 1; } }

.skeleton { background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- pages ---------- */
.page { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 18px); }
.page-head { padding: 0 var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.page-head h1 img { width: 40px; height: 40px; border-radius: 10px; }
.page-head .count { color: var(--muted); font-weight: 600; font-size: 14px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gutter) 14px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.chip.on { background: var(--text); color: #0b0c10; border-color: var(--text); }
.select { flex: none; height: 34px; padding: 0 30px 0 12px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a909c'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 18px; color: var(--text); font: 600 13.5px/1 inherit; -webkit-appearance: none; appearance: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; padding: 0 var(--gutter); }
.grid > * { min-width: 0; }
.grid .card { width: auto; }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 9px; } .grid .card .cap .t { font-size: 12.5px; } }
@media (max-width: 360px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sentinel { height: 1px; }
.empty { padding: 60px var(--gutter); text-align: center; color: var(--muted); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 10px; opacity: .5; }

/* ---------- search ---------- */
.searchbox { position: relative; margin: 0 var(--gutter) 22px; }
.searchbox input { width: 100%; height: 52px; padding: 0 48px 0 50px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; outline: none; transition: border-color .2s, background .2s; }
.searchbox input:focus { border-color: rgba(255,106,77,.6); background: var(--surface-2); }
.searchbox > svg { position: absolute; left: 16px; top: 15px; color: var(--muted); }
.searchbox button { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }

/* ---------- detail ---------- */
.detail { position: relative; }
.detail-bg { position: relative; height: min(76vh, 720px); min-height: 420px; overflow: hidden; }
.detail-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.detail-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(11,12,16,.75) 30%, rgba(11,12,16,.15) 70%, rgba(11,12,16,.45) 100%),
              linear-gradient(to right, rgba(11,12,16,.85) 0%, rgba(11,12,16,0) 60%); }
.detail-body { position: relative; z-index: 2; margin-top: max(-46vh, -420px); padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 1180px; }
.detail-body .logo { max-width: min(460px, 80%); max-height: 160px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 4px 18px rgba(0,0,0,.6)); }
.detail-body h1 { margin: 0; font-size: clamp(28px, 4.6vw, 52px); line-height: 1.04; font-weight: 800; letter-spacing: -.02em; }
.detail-body .tagline { color: var(--text-2); font-style: italic; margin: -6px 0 0; }
.detail-body .overview { color: var(--text-2); max-width: 720px; margin: 0; font-size: 15.5px; }
.genres { display: flex; flex-wrap: wrap; gap: 6px; }
.genres a { padding: 4px 11px; border-radius: 14px; background: rgba(255,255,255,.08); font-size: 13px; font-weight: 600; color: var(--text-2); }
.genres a:hover { background: rgba(255,255,255,.14); color: var(--text); }
.on-services { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.on-services a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 4px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.on-services a img, .on-services a .logo { width: 24px; height: 24px; border-radius: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 13.5px; }
.facts b { color: var(--text-2); font-weight: 600; }
@media (max-width: 760px) {
  .detail-bg { height: 62vh; min-height: 360px; }
  .detail-body { margin-top: -34vh; text-align: left; }
  .detail-body .logo { max-height: 110px; }
  .detail .actions .btn-play { flex: 1 1 100%; }
}
.cast .card { width: clamp(92px, 24vw, 128px); }
.cast .card .art { aspect-ratio: 1; border-radius: 50%; }
.cast .card .cap { text-align: center; }

/* seasons & episodes */
.season-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--gutter) 14px; scrollbar-width: none; }
.season-tabs::-webkit-scrollbar { display: none; }
.episodes { display: grid; gap: 12px; padding: 0 var(--gutter); max-width: 1180px; }
.ep { display: grid; grid-template-columns: clamp(140px, 30vw, 260px) 1fr; gap: 16px; align-items: start; padding: 10px; margin: 0 -10px; border-radius: 12px; transition: background .2s; }
.ep:hover { background: var(--surface); }
.ep .art { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.ep .art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.ep .art .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.ep h3 { margin: 2px 0 4px; font-size: 15.5px; font-weight: 650; }
.ep .s { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.ep p { margin: 0; color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep.unaired { opacity: .5; pointer-events: none; }
@media (max-width: 560px) { .ep { grid-template-columns: 132px 1fr; gap: 12px; } .ep p { -webkit-line-clamp: 2; font-size: 13px; } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, rgba(255,106,77,.22), transparent 60%), radial-gradient(900px 600px at 110% 110%, rgba(88,34,180,.22), transparent 60%), var(--bg); }
.login form { width: min(380px, 100%); display: grid; gap: 14px; padding: 30px 26px; border-radius: 18px; background: rgba(20,22,28,.85); border: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login .brand { justify-content: center; font-size: 28px; margin-bottom: 6px; }
.login .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.login label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.login input { height: 48px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 16px; outline: none; }
.login input:focus { border-color: rgba(255,106,77,.6); }
.login .err { color: #ff8a80; font-size: 13.5px; min-height: 18px; margin: 0; }
.login .btn { width: 100%; margin-top: 4px; }

/* ---------- profile ---------- */
.profile-card { margin: 0 var(--gutter) 10px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 760px; }
.profile-card .avatar { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.profile-card .who b { display: block; font-size: 18px; }
.profile-card .who span { color: var(--muted); font-size: 13.5px; }
.profile-card .btn { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px var(--gutter) 0; max-width: 760px; }
.stat { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-size: 24px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.idle { cursor: none; }
.player .layer { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; opacity: 1; transition: opacity .3s var(--ease); pointer-events: none; }
.player.idle .layer { opacity: 0; }
.player .layer > * { pointer-events: auto; }
.player .p-top { display: flex; align-items: center; gap: 14px; padding: calc(14px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 40px calc(16px + env(safe-area-inset-left)); background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent); }
.player .p-title { min-width: 0; }
.player .p-title b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .p-title span { color: var(--text-2); font-size: 13px; }
.player .p-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: clamp(28px, 9vw, 80px); pointer-events: none; }
.player .p-center button { pointer-events: auto; border: 0; background: rgba(0,0,0,.35); color: #fff; border-radius: 50%; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.player .p-center .big { width: 76px; height: 76px; }
.player .p-center .big svg { width: 40px; height: 40px; }
.player .p-center .skip { width: 54px; height: 54px; }
.player .p-center .skip svg { width: 30px; height: 30px; }
.player .p-bottom { padding: 40px calc(18px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left)); background: linear-gradient(to top, rgba(0,0,0,.85), transparent); }
.player .scrub { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.player .scrub .track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); transition: height .15s; }
.player .scrub:hover .track, .player .scrub.drag .track { height: 6px; }
.player .scrub .buf { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.35); border-radius: 2px; }
.player .scrub .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 2px; }
.player .scrub .knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,106,77,.35); transform: scale(0); transition: transform .15s; }
.player .scrub:hover .knob, .player .scrub.drag .knob { transform: scale(1); }
.player .scrub .tip { position: absolute; bottom: 24px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: rgba(20,22,28,.95); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; }
.player .scrub:hover .tip, .player .scrub.drag .tip { opacity: 1; }
.player .p-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.player .p-row .time { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); margin: 0 8px; white-space: nowrap; }
.player .p-row .grow { flex: 1; }
.player .pbtn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: grid; place-items: center; }
.player .pbtn:hover { background: rgba(255,255,255,.12); }
.player .pbtn svg { width: 26px; height: 26px; }
.player .vol { width: 90px; accent-color: var(--accent); }
.player .spinner { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 4px solid rgba(255,255,255,.18); border-top-color: var(--accent); animation: spin .8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.player .method { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 5px; background: rgba(255,255,255,.14); color: var(--text-2); white-space: nowrap; }
.player .menu { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(96px + env(safe-area-inset-bottom)); width: min(320px, calc(100vw - 32px)); max-height: min(60vh, 460px); overflow-y: auto; border-radius: 14px; background: rgba(20,22,28,.97); border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.6); padding: 8px; z-index: 5; }
.player .menu h4 { margin: 8px 10px 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.player .menu button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; }
.player .menu button:hover { background: rgba(255,255,255,.07); }
.player .menu button.on { color: var(--accent-2); font-weight: 700; }
.player .menu button.on::after { content: "✓"; margin-left: auto; }
.player .menu button small { color: var(--muted); font-weight: 500; }
.player .seek-flash { position: absolute; top: 50%; transform: translateY(-50%); width: 30%; height: 60%; display: grid; place-items: center; font-weight: 800; font-size: 15px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.player .seek-flash.l { left: 0; border-radius: 0 50% 50% 0; background: radial-gradient(circle at left, rgba(255,255,255,.18), transparent 70%); }
.player .seek-flash.r { right: 0; border-radius: 50% 0 0 50%; background: radial-gradient(circle at right, rgba(255,255,255,.18), transparent 70%); }
.player .seek-flash.show { opacity: 1; }
.player .upnext { position: absolute; right: calc(20px + env(safe-area-inset-right)); bottom: calc(110px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(20,22,28,.95); border: 1px solid var(--border); max-width: min(420px, calc(100vw - 40px)); }
.player .upnext img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.player .upnext small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.player .upnext b { display: block; font-size: 14px; margin: 2px 0 8px; }
.player .upnext .actions .btn { height: 36px; padding: 0 14px; font-size: 13.5px; }
.player .p-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(0,0,0,.7); }
@media (max-width: 760px) { .player .vol, .player .volbtn { display: none; } .player .p-row .time { font-size: 12.5px; margin: 0 4px; } }

/* ---------- requests ---------- */
:root { --st-ready: #3ccf8e; --st-dl: var(--accent); --st-warn: #f5a524; --st-search: #6aa8ff; --st-bad: #ff6b6b; }
button.card { padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.req-badge { position: absolute; top: 7px; right: 7px; z-index: 2; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #0b0c10; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.req-badge svg { width: 16px; height: 16px; }
.badge-add { background: rgba(255,255,255,.92); }
.badge-available { background: var(--st-ready); }
.badge-downloading, .badge-importing { background: var(--st-dl); color: #fff; }
.badge-stalled { background: var(--st-warn); }
.badge-searching, .badge-pending { background: var(--st-search); }
.badge-queued { background: #d4d8df; }
.badge-declined, .badge-failed { background: var(--st-bad); color: #fff; }
@media (hover: hover) { .req-card:hover .badge-add { background: var(--accent); color: #fff; } }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-available { color: var(--st-ready); background: rgba(60,207,142,.12); }
.pill-downloading, .pill-importing { color: var(--accent-2); background: rgba(255,106,77,.13); }
.pill-downloading::before { animation: pulse 1.4s ease-in-out infinite; }
.pill-stalled { color: var(--st-warn); background: rgba(245,165,36,.13); }
.pill-searching, .pill-pending { color: var(--st-search); background: rgba(106,168,255,.13); }
.pill-searching::before { animation: pulse 1.4s ease-in-out infinite; }
.pill-declined, .pill-failed { color: var(--st-bad); background: rgba(255,107,107,.13); }
.pill-queued { color: #d4d8df; background: rgba(255,255,255,.08); }
@keyframes pulse { 50% { opacity: .25; } }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.req-list { display: grid; gap: 10px; padding: 0 var(--gutter); max-width: calc(900px + 2 * var(--gutter)); }
#rq-mine .section-head { max-width: calc(900px + 2 * var(--gutter)); }
.req-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: background .2s, border-color .2s; }
.req-row:hover { background: var(--surface-2); border-color: rgba(255,255,255,.14); }
.req-poster { flex: none; width: 56px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.req-poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.req-poster img.ok { opacity: 1; }
.req-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.req-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.req-title span:not(.badge) { color: var(--muted); font-weight: 500; }
.req-title .badge { margin-left: 4px; vertical-align: 1px; }
.req-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; max-width: 420px; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s var(--ease); }
.bar-stalled i { background: var(--st-warn); }
.bar-importing i { background: var(--st-ready); }
.bar-queued i { background: #8a909c; }
.req-play { flex: none; height: 40px; padding: 0 16px; }
@media (max-width: 560px) { .req-play span { display: none; } .req-play { width: 44px; padding: 0; border-radius: 50%; } }

/* bottom sheet (phone) / dialog (desktop) */
.sheet-wrap { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0); transition: background .25s; }
.sheet-wrap.show { background: rgba(0,0,0,.6); }
.sheet { position: relative; width: 100%; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.5); transform: translateY(100%); transition: transform .28s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.show .sheet { transform: none; }
@media (min-width: 761px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { width: min(620px, 100%); border-radius: 18px; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .25s; }
  .sheet-wrap.show .sheet { opacity: 1; }
}
.sheet-bg { position: relative; aspect-ratio: 16/7; background: var(--surface-2); overflow: hidden; }
.sheet-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.sheet-bg img.ok { opacity: 1; }
.sheet-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--surface), transparent 70%); }
.sheet-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-body { position: relative; padding: 0 20px 22px; margin-top: -54px; z-index: 1; }
.sheet-head { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 14px; }
.sheet-poster { width: 92px; aspect-ratio: 2/3; border-radius: 10px; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,.5); flex: none; }
.sheet-head h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.15; }
.sheet-body .overview { color: var(--text-2); font-size: 14.5px; margin: 0 0 16px; }
.sheet-body .genres a { cursor: default; }
.sheet-status { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.sheet-body .actions .btn { flex: 1 1 auto; }
@media (min-width: 761px) { .sheet-body .actions .btn { flex: 0 0 auto; } }

/* request tracker */
.track { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.track-h { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.wait-box { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.wait-box b { font-size: 15px; }
.wait-box span { color: var(--text-2); font-size: 13.5px; }
.wait-stuck { border-left-color: var(--st-warn); }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.step { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 14px; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--surface-3); }
.step-done:not(:last-child)::before { background: rgba(60,207,142,.45); }
.dotm { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: var(--surface-3); color: var(--muted); position: relative; z-index: 1; }
.dotm svg { width: 14px; height: 14px; }
.step-done .dotm { background: var(--st-ready); color: #06140d; }
.step-active .dotm { background: var(--accent); box-shadow: 0 0 0 0 rgba(255,106,77,.6); animation: ring 1.6s infinite; }
.step-stuck .dotm { background: var(--st-warn); color: #1d1300; }
@keyframes ring { 70% { box-shadow: 0 0 0 9px rgba(255,106,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,106,77,0); } }
.step-l { font-weight: 650; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; line-height: 22px; }
.step-todo .step-l { color: var(--muted); font-weight: 500; }
.step-t { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-d { color: var(--text-2); font-size: 12.5px; margin-top: 1px; overflow-wrap: anywhere; }
.step-active .step-d { color: var(--text); }
.track-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.track-actions .btn { height: 38px; padding: 0 14px; font-size: 13.5px; flex: 0 0 auto !important; }
.track-actions .btn svg { width: 18px; height: 18px; }
.rel-box { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 12px; display: grid; gap: 10px; font-size: 13.5px; }
.rel-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); font-size: 13px; }
.rel-reasons span { display: inline-block; min-width: 34px; font-weight: 800; color: var(--text); }
.rel-list { display: grid; gap: 8px; }
.rel { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 12.5px; }
.rel-mark { font-weight: 900; }
.rel.ok .rel-mark { color: var(--st-ready); }
.rel.no .rel-mark { color: var(--st-bad); }
.rel-t { overflow-wrap: anywhere; font-weight: 600; }
.rel-why { color: var(--st-warn); }
.log summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 700; padding: 6px 0; }
.log ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 7px; }
.log li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.log li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.log li.bad { color: #ffb4a8; }

@media (max-width: 380px) { .tabbar a { font-size: 9.5px; } .tabbar a svg { width: 21px; height: 21px; } }

/* ---------- Live TV ---------- */
:root { --live: #ff3b30; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255,59,48,.6); animation: livepulse 1.8s infinite; vertical-align: 1px; }
.live-dot.big { width: 12px; height: 12px; margin-right: 4px; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,48,.55); } 70% { box-shadow: 0 0 0 9px rgba(255,59,48,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); } }
.live-head h1 { display: flex; align-items: center; gap: 10px; }
.chip small { opacity: .6; font-weight: 700; }

.live-badge { position: absolute; top: 8px; left: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--live); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
.live-badge.static { position: static; }
.live-badge.big { height: 24px; padding: 0 9px; font-size: 11.5px; }
.q-badge { position: absolute; top: 8px; right: 8px; z-index: 3; height: 20px; padding: 0 6px; border-radius: 5px; background: rgba(0,0,0,.6); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.fav-badge { position: absolute; bottom: 8px; right: 8px; z-index: 3; color: var(--live); }
.fav-badge svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

.ltile { flex: none; width: clamp(168px, 44vw, 260px); display: block; transition: transform .25s var(--ease); }
.ltile-art { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, hsl(var(--hue) 45% 26%), hsl(calc(var(--hue) + 40) 40% 11%) 70%);
  box-shadow: 0 6px 20px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06); }
.ltile-logo { position: relative; z-index: 2; max-width: 62%; max-height: 58%; object-fit: contain; opacity: 0; transition: opacity .3s, transform .3s var(--ease); filter: drop-shadow(0 4px 14px rgba(0,0,0,.45)); }
.ltile-logo.ok { opacity: 1; }
.ltile-initials { position: absolute; z-index: 1; font-size: clamp(22px, 5vw, 32px); font-weight: 900; letter-spacing: .02em; color: rgba(255,255,255,.18); }
.ltile-art.nologo .ltile-initials { color: rgba(255,255,255,.85); }
.ltile-art:not(.nologo) .ltile-initials { opacity: 0; }
.ltile-cap { padding: 8px 2px 0; }
.ltile-cap b { display: block; font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltile-now { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); margin-top: 6px; overflow: hidden; }
.lbar i { display: block; height: 100%; background: var(--live); border-radius: 2px; }
@media (hover: hover) {
  .ltile:hover { transform: translateY(-4px); }
  .ltile:hover .ltile-art { box-shadow: 0 14px 34px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.18); }
  .ltile:hover .ltile-logo { transform: scale(1.06); }
}
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 14px; padding: 0 var(--gutter); }
.lgrid > * { min-width: 0; }
.lgrid .ltile { width: auto; }
@media (max-width: 560px) { .lgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; } }

.live-hero { position: relative; display: block; margin: 0 var(--gutter) 6px; border-radius: 18px; overflow: hidden; min-height: 210px;
  background: radial-gradient(140% 140% at 0% 0%, hsl(var(--hue) 55% 28%), hsl(calc(var(--hue) + 50) 45% 10%) 70%); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.live-hero-bg { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(40px) saturate(1.4); opacity: .35; }
.live-hero-in { position: relative; display: flex; align-items: center; gap: clamp(16px, 4vw, 34px); padding: clamp(20px, 4vw, 34px); }
.live-hero-logo { flex: none; width: clamp(96px, 22vw, 180px); aspect-ratio: 16/10; border-radius: 14px; display: grid; place-items: center; background: rgba(0,0,0,.28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.live-hero-logo img { max-width: 78%; max-height: 74%; object-fit: contain; }
.live-hero-logo span { font-size: 34px; font-weight: 900; }
.live-hero h2 { margin: 10px 0 4px; font-size: clamp(22px, 3.2vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.live-hero p { margin: 0 0 16px; color: var(--text-2); }
@media (max-width: 560px) { .live-hero-in { flex-direction: column; align-items: flex-start; } }

/* live player */
.live-player .p-top { align-items: center; }
.live-player .p-bottom { background: linear-gradient(to top, rgba(0,0,0,.94), rgba(0,0,0,.7) 55%, transparent); padding-top: 60px; }
.live-player .p-top .grow { flex: 1; }
.lp-logo { flex: none; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 15px; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, hsl(var(--hue, 10) 45% 30%), hsl(calc(var(--hue, 10) + 40) 40% 12%)); }
.lp-logo img { max-width: 84%; max-height: 84%; object-fit: contain; }
.lp-epg { margin-bottom: 10px; max-width: 640px; display: grid; gap: 6px; font-size: 13.5px; }
.lp-epg .lbar { margin: 0; max-width: 420px; }
.lp-now, .lp-next { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--text-2); }
.lp-now b { color: var(--text); font-size: 15px; }
.lp-now span, .lp-next span { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.12); color: var(--text); }
.lp-now span { background: var(--live); }
.lp-now em, .lp-next em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.lp-golive { height: 34px; padding: 0 12px; font-size: 13px; }
.live-player .method { background: rgba(60,207,142,.15); color: var(--good); }
.live-player .method.starlink { background: rgba(106,168,255,.16); color: var(--st-search); }
.lp-flash { position: absolute; top: calc(78px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -10px); z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 16px; background: rgba(20,22,28,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 16px 40px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
.lp-flash.show { opacity: 1; transform: translate(-50%, 0); }
.lp-flash-logo { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, hsl(var(--hue) 45% 30%), hsl(calc(var(--hue) + 40) 40% 12%)); }
.lp-flash-logo img { max-width: 84%; max-height: 84%; object-fit: contain; }
.lp-flash small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.lp-flash b { font-size: 17px; }
.radio-art { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(circle at 50% 40%, #2a1d3a, #0b0c10 70%); }
.radio-art img { width: min(42vw, 260px); max-height: 40vh; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); animation: radiofloat 6s ease-in-out infinite; }
.radio-art span { font-size: 64px; font-weight: 900; }
.is-radio .radio-art { display: grid; }
@keyframes radiofloat { 50% { transform: translateY(-8px) scale(1.02); } }
.ch-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 8; width: min(380px, 92vw); display: flex; flex-direction: column; background: rgba(14,15,20,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-left: 1px solid var(--border); box-shadow: -20px 0 60px rgba(0,0,0,.5); padding-top: env(safe-area-inset-top); animation: drawerin .25s var(--ease); }
@keyframes drawerin { from { transform: translateX(40px); opacity: 0; } }
.ch-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px 18px; }
.ch-head h3 { margin: 0; font-size: 14px; color: var(--text-2); }
.ch-list { overflow-y: auto; padding: 0 8px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 2px; }
.ch-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; width: 100%; }
.ch-item:hover { background: rgba(255,255,255,.06); }
.ch-item.on { background: rgba(255,59,48,.14); }
.ch-logo { position: relative; flex: none; width: 54px; height: 34px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, hsl(var(--hue) 45% 28%), hsl(calc(var(--hue) + 40) 40% 12%)); }
.ch-logo img { position: relative; z-index: 1; max-width: 80%; max-height: 80%; object-fit: contain; }
.ch-logo em { position: absolute; font-style: normal; font-size: 12px; font-weight: 900; color: rgba(255,255,255,.75); }
.ch-logo img + em { display: none; }
.ch-txt { flex: 1; min-width: 0; }
.ch-txt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-txt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .live-player .p-top .live-badge { display: none; }
  .ch-drawer { width: 100%; top: auto; height: 62vh; border-left: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; animation: sheetin .25s var(--ease); }
  @keyframes sheetin { from { transform: translateY(40px); opacity: 0; } }
}

/* ---------- Stream ---------- */
.lane-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.lane-pick span { margin-right: 2px; }
.src-list { display: grid; gap: 8px; padding: 0 var(--gutter); max-width: 960px; }
.src-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: background .2s, border-color .2s; }
.src-row:hover { background: var(--surface-2); border-color: rgba(255,255,255,.16); }
.src-row.on { border-color: var(--accent); }
.src-res { flex: none; width: 54px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-3); }
.src-main { flex: 1; min-width: 0; }
.src-main b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.src-mode { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; }
.src-mode.direct { background: rgba(60,207,142,.15); color: var(--good); }
.src-mode.gpu { background: rgba(255,106,77,.14); color: var(--accent-2); }

.stream-player .sp-prep { position: absolute; inset: 0; z-index: 7; display: none; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 30%, #1d1420, #07080b 70%); }
.stream-player.preparing .sp-prep { display: grid; }
.stream-player.preparing .layer, .stream-player.preparing .spinner { display: none; }
.sp-prep-in { width: min(460px, 100%); display: grid; gap: 14px; }
.sp-prep-in .sp-title { font-size: 22px; font-weight: 800; }
.sp-prep-in .sp-release { margin-top: -10px; overflow-wrap: anywhere; }
.sp-prep-msg { display: grid; gap: 4px; }
.sp-prep-msg b { color: #ffb4a8; }
.sp-prep-msg span { color: var(--text-2); font-size: 13.5px; }
.stream-player:not(.prep-failed) .sp-prep .actions [data-sp="sources"] { opacity: .8; }
.stream-player.seeking .spinner { display: block !important; }
.stream-player .spinner { display: none; }
.stream-player .sp-stats { background: rgba(255,255,255,.1); color: var(--text-2); }
.stream-player .sp-mode { background: rgba(255,106,77,.15); color: var(--accent-2); }
.stream-player .sp-lane { background: rgba(60,207,142,.15); color: var(--good); }
.sp-sources { position: absolute; top: 0; right: 0; bottom: 0; z-index: 9; width: min(440px, 94vw); display: flex; flex-direction: column; background: rgba(14,15,20,.97); border-left: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.sp-src-list { overflow-y: auto; display: grid; gap: 8px; padding: 4px 12px calc(16px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) { .sp-sources { width: 100%; top: auto; height: 70vh; border-left: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 200; padding: 11px 18px; border-radius: 12px; background: #f2f3f5; color: #0b0c10; font-weight: 650; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* stream: subtitle sync row inside the CC menu */
.sub-sync { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px 8px; }
.sub-sync button { width: auto !important; flex: 1; justify-content: center; background: rgba(255,255,255,.08) !important; }
.sub-sync span { flex: 1.4; text-align: center; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stream-player .menu { z-index: 8; }
.p-cc.on { color: var(--accent-2); }
::cue { background: rgba(0,0,0,.72); color: #fff; font-family: system-ui, sans-serif; line-height: 1.35; }
.lib-note { display: inline-flex; flex-direction: column; gap: 4px; justify-content: center; margin-right: 4px; }
.lib-note small { color: var(--muted); font-size: 12px; max-width: 320px; }
