/* Monkeflix — warm, roasted dark with an orange-to-peach glow. */
@font-face {
  font-family: 'Bricolage';
  src: url(/fonts/bricolage.woff2) format('woff2-variations'), url(/fonts/bricolage.woff2) format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --bg: #150e0a;
  --bg-raise: #1f1610;
  --card: #2a1d15;
  --card-2: #36261b;
  --line: rgba(255, 220, 195, 0.09);
  --text: #fbf0e8;
  --text-2: #cdb6a6;
  --text-3: #95796a;
  --orange: #ff7a1a;
  --orange-hi: #ff9544;
  --peach: #ffc49e;
  --on-orange: #1f0f04;
  --danger: #ff6a5f;
  --grad: linear-gradient(100deg, #ff6a00 0%, #ff8a32 45%, #ffc49e 100%);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --font-display: 'Bricolage', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.92em; }
.ico { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 0.6em; font-weight: 600; }
.fine { font-size: 12.5px; color: var(--text-3); margin: 8px 0 0; }
.center { text-align: center; }

/* ---------------------------------------------------------------- logo */
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 30px;
  letter-spacing: -0.01em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 2px;
}
.logo.big { font-size: clamp(64px, 13vw, 112px); }

/* ---------------------------------------------------------------- shell */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: calc(env(safe-area-inset-top) + 14px) var(--gutter) 14px;
  background: linear-gradient(180deg, rgba(21, 14, 10, 0.8), rgba(21, 14, 10, 0));
  transition: background-color 0.25s;
}
.topbar.solid { background: rgba(21, 14, 10, 0.94); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.topnav { display: flex; gap: 2px; }
.nav-a { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; color: var(--text-2); font-weight: 650; font-size: 14px; transition: color 0.15s, background-color 0.15s; }
.nav-a:hover { color: var(--text); }
.nav-a.on { color: var(--text); background: rgba(255, 240, 230, 0.08); }
.topnav .nav-a .ico { width: 18px; height: 18px; }
.tabbar { display: none; }

.view { min-height: 100dvh; }
body.watching { overflow: hidden; background: #000; }
body.watching .topbar, body.watching .tabbar, body.watching .up-pill,
body.locked-mode .topbar, body.locked-mode .tabbar { display: none !important; }

.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
body.booting .splash { opacity: 1; pointer-events: auto; }

@media (max-width: 720px) {
  .topnav { display: none; }
  .topbar { padding-top: calc(env(safe-area-inset-top) + 10px); padding-bottom: 10px; }
  .logo { font-size: 26px; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(21, 14, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar .nav-a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 0; border-radius: 12px; background: none; }
  .tabbar .nav-a .ico { width: 23px; height: 23px; }
  .tabbar .nav-a.on { color: var(--orange); }
  .view:not(.view-watch) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 0.12s, background-color 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn .ico { width: 19px; height: 19px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-lg .ico { width: 22px; height: 22px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--orange); color: var(--on-orange); }
.btn-primary:hover { background: var(--orange-hi); }
.btn-glass { background: rgba(255, 240, 230, 0.15); color: var(--text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgba(255, 240, 230, 0.24); }
.btn-ghost { background: rgba(255, 240, 230, 0.08); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 240, 230, 0.14); }
.btn-danger { background: var(--danger); color: #1c0604; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-icon-lg { width: 50px; height: 50px; padding: 0; }
.btn-icon-lg .ico { width: 22px; height: 22px; }
.is-static { pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-2); transition: background-color 0.15s, color 0.15s; flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.icon-btn .ico { width: 20px; height: 20px; }
.link { color: var(--orange-hi); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 240, 230, 0.08); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.seg button:hover { color: var(--text); }
.seg button.sel { background: var(--text); color: var(--bg); }

.switch { width: 50px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); position: relative; flex: none; transition: background-color 0.2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on { background: var(--orange); }
.switch.on i { transform: translateX(20px); }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field > span { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field-row { display: flex; gap: 12px; }
input:not([type='range']):not([type='checkbox']):not([type='file']), select, textarea {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cdb6a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px !important;
  cursor: pointer;
}
option { background: var(--bg-raise); color: var(--text); }

/* ---------------------------------------------------------------- artwork */
.ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(110% 90% at 15% 0%, hsl(var(--h) 95% 55% / 0.5), transparent 62%),
    radial-gradient(90% 80% at 100% 100%, hsl(calc(var(--h) + 16) 90% 50% / 0.42), transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 38% 17%), hsl(var(--h) 30% 9%));
}
.ph span { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: clamp(30px, 4vw, 56px); color: hsl(var(--h) 100% 86% / 0.82); letter-spacing: -0.02em; }
.ph.tall span { font-size: clamp(40px, 5vw, 72px); }
.ph.wide span { font-size: clamp(140px, 24vw, 360px); opacity: 0.22; }

.bar { height: 4px; background: rgba(255, 255, 255, 0.24); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); transform-origin: left; }

/* ---------------------------------------------------------------- hero */
.hero, .show-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; }
.hero { display: grid; align-items: stretch; grid-template: minmax(0, 1fr) / minmax(0, 1fr); min-height: min(80vh, 860px); }
/* Featured carousel: slides share one grid cell, so the area is as tall as the tallest one. */
.hero-slide { grid-area: 1 / 1; position: relative; isolation: isolate; display: flex; align-items: flex-end; padding: 120px var(--gutter) clamp(64px, 10vh, 112px); opacity: 0; visibility: hidden; transition: opacity 0.9s ease, visibility 0s linear 0.9s; }
.hero-slide.on { opacity: 1; visibility: visible; transition: opacity 0.9s ease; }
.hero-slide .hero-body { transform: translateY(14px); opacity: 0; transition: transform 0.7s ease, opacity 0.7s ease; }
.hero-slide.on .hero-body { transform: none; opacity: 1; transition-delay: 0.15s; }
.hero-slide.on .hero-art img.in { animation: mf-drift 9s ease-out both; }
@keyframes mf-drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: clamp(70px, 10.5vh, 118px); display: flex; gap: 7px; }
.hero-dot { width: 30px; height: 18px; display: grid; align-items: center; padding: 0; }
.hero-dot i { display: block; height: 4px; border-radius: 4px; background: rgba(255, 240, 230, 0.28); overflow: hidden; position: relative; }
.hero-dot i::after { content: ''; position: absolute; inset: 0; background: var(--text); transform: scaleX(0); transform-origin: left; }
.hero-dot.on i::after { animation: mf-fill 8s linear forwards; }
.hero.paused .hero-dot.on i::after, .hero-dot.on:hover i::after { animation-play-state: paused; }
.hero-dot:hover i { background: rgba(255, 240, 230, 0.5); }
@keyframes mf-fill { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero-slide.on .hero-art img.in { animation: none; }
  .hero-dot.on i::after { animation: none; transform: scaleX(1); }
}
.hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--bg-raise); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease; }
.hero-art img.in { opacity: 1; }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(21, 14, 10, 0.94) 0%, rgba(21, 14, 10, 0.6) 34%, rgba(21, 14, 10, 0) 68%),
    linear-gradient(0deg, var(--bg) 0%, rgba(21, 14, 10, 0.55) 22%, rgba(21, 14, 10, 0) 50%),
    linear-gradient(180deg, rgba(21, 14, 10, 0.55), rgba(21, 14, 10, 0) 22%);
}
.hero-body { max-width: min(680px, 100%); }
.hero-title, .show-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 0.86;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero-title { font-size: clamp(56px, 9vw, 140px); }
.show-title { font-size: clamp(44px, 6.6vw, 104px); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--text-2); font-size: 14px; font-weight: 650; }
.meta span:first-child { padding: 2px 10px; border: 1px solid rgba(255, 196, 158, 0.45); border-radius: 999px; color: var(--peach); font-size: 12.5px; }
.hero-desc { color: var(--text-2); max-width: 58ch; margin: 14px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-left { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.hero-left .bar { width: 160px; }

/* ---------------------------------------------------------------- rows */
.rows { position: relative; z-index: 1; margin-top: -36px; padding-bottom: 48px; }
.row { margin: 0 0 30px; }
.row-head { padding: 0 var(--gutter); margin-bottom: 10px; }
.row-head h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: clamp(20px, 2vw, 25px); margin: 0; letter-spacing: -0.005em; }
.row-scroller { position: relative; }
.row-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--cw);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  padding: 4px var(--gutter) 6px;
  scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }
.row[data-row='cw'], .row[data-row='recent'] { --cw: clamp(250px, 23vw, 350px); }
.row[data-row='series'], .row[data-row='movies'] { --cw: clamp(138px, 12.5vw, 196px); }
.row-nav {
  position: absolute;
  top: 4px;
  bottom: 52px;
  width: max(44px, calc(var(--gutter) - 2px));
  display: grid;
  place-items: center;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2;
}
.row-nav .ico { width: 30px; height: 30px; }
.row-nav.prev { left: 0; background: linear-gradient(90deg, rgba(21, 14, 10, 0.92), rgba(21, 14, 10, 0)); }
.row-nav.next { right: 0; background: linear-gradient(270deg, rgba(21, 14, 10, 0.92), rgba(21, 14, 10, 0)); }
.row-scroller:hover .row-nav.show { opacity: 1; pointer-events: auto; }
@media (hover: none) { .row-nav { display: none; } }

/* ---------------------------------------------------------------- cards */
.card { display: block; border-radius: var(--radius-m); outline-offset: 3px; min-width: 0; }
.card-art { position: relative; border-radius: var(--radius-m); overflow: hidden; background: var(--card); aspect-ratio: 16 / 9; }
.card-poster .card-art { aspect-ratio: 2 / 3; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s, transform 0.45s ease; }
.card-art img.in { opacity: 1; }
.card-cap { padding: 8px 2px 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card-cap b { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cap span { font-size: 12.5px; color: var(--text-3); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.card-poster.gen .card-cap b { display: none; }
.card-art .bar { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 1; }
.poster-name { position: absolute; inset: auto 0 0 0; padding: 50% 12px 12px; background: linear-gradient(0deg, rgba(15, 9, 6, 0.96) 10%, rgba(15, 9, 6, 0)); }
.poster-name b { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: clamp(20px, 1.8vw, 28px); line-height: 0.92; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(21, 14, 10, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transform: scale(0.9); transition: opacity 0.18s, transform 0.18s; z-index: 1; }
.card-play .ico { width: 20px; height: 20px; margin-left: 2px; }
@media (hover: hover) {
  .card:hover .card-play, .ep-row:hover .card-play { opacity: 1; transform: none; }
  .card:hover .card-art img { transform: scale(1.04); }
}
.card-badge { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 3px 9px; border-radius: 999px; background: rgba(21, 14, 10, 0.8); font-size: 11.5px; font-weight: 700; color: var(--peach); }
.card-wide-wrap { position: relative; min-width: 0; }
.card-x { position: absolute; top: 7px; right: 7px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(21, 14, 10, 0.75); opacity: 0; transition: opacity 0.15s; }
.card-x .ico { width: 15px; height: 15px; }
.card-wide-wrap:hover .card-x, .card-x:focus-visible { opacity: 1; }
@media (hover: none) { .card-x { opacity: 0.9; } }

/* ---------------------------------------------------------------- welcome / empty */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 120px var(--gutter) 80px; max-width: 820px; }
.welcome-mark { font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: clamp(170px, 30vw, 320px); line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: -0.18em 0 -0.06em -0.04em; }
.welcome h1 { font-family: var(--font-display); font-weight: 800; font-stretch: 78%; font-size: clamp(44px, 6.4vw, 80px); line-height: 0.92; margin: 0 0 16px; letter-spacing: -0.015em; }
.welcome p { color: var(--text-2); max-width: 52ch; font-size: 16.5px; margin: 0; }
.empty { min-height: 72vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 100px var(--gutter); gap: 10px; }
.empty h1 { font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: 44px; margin: 0; line-height: 1; }
.empty.small { min-height: 0; padding: 48px 0; }

/* ---------------------------------------------------------------- show page */
.show-hero { min-height: min(72vh, 720px); padding: 120px var(--gutter) 34px; }
.show-head { display: flex; gap: 34px; align-items: flex-end; width: 100%; }
.show-poster { position: relative; flex: none; width: clamp(160px, 15vw, 236px); aspect-ratio: 2 / 3; border-radius: var(--radius-m); overflow: hidden; background: var(--card); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.show-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; }
.show-poster img.in { opacity: 1; }
.show-text { min-width: 0; flex: 1; }
.show-desc { color: var(--text-2); max-width: 64ch; margin: 14px 0 0; white-space: pre-line; }
.add-desc { margin-top: 12px; display: inline-block; }
.episodes { padding: 10px var(--gutter) 64px; max-width: 1120px; }
.ep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ep-head h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 28px; margin: 0; }
.ep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-row { display: grid; grid-template-columns: clamp(150px, 20vw, 224px) minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: var(--radius-l); transition: background-color 0.15s; }
.ep-row:hover { background: var(--bg-raise); }
.ep-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-s); overflow: hidden; background: var(--card); }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; }
.ep-thumb img.in { opacity: 1; }
.ep-thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; z-index: 1; }
.ep-thumb-wait { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(110deg, var(--card) 30%, var(--bg-raise) 50%, var(--card) 70%); background-size: 300% 100%; animation: mf-shimmer 1.8s linear infinite; color: var(--text-3); }
.ep-thumb-wait .ico { width: 26px; height: 26px; opacity: 0.5; }
@keyframes mf-shimmer { to { background-position: -150% 0; } }
.ep-row.pending .ep-thumb { opacity: 0.55; }
.ep-row.watched .ep-thumb img.in { opacity: 0.72; }
.ep-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ep-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-weight: 650; font-size: 16px; line-height: 1.3; }
.ep-num { flex: none; font-family: var(--font-display); font-weight: 800; font-stretch: 75%; font-size: 24px; line-height: 1; color: var(--orange); min-width: 1.2ch; }
.ep-name { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.ep-title:hover .ep-name { text-decoration: underline; text-underline-offset: 3px; }
.ep-meta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.ep-meta > span + span:not(.ep-langs):not(.ep-cc)::before { content: '·'; margin-right: 8px; color: var(--text-3); }
.ep-meta > span + .ep-cc { margin-left: 4px; }
.ep-left { color: var(--peach); font-weight: 600; }
.ep-done { display: inline-flex; align-items: center; gap: 4px; }
.ep-done .ico { width: 14px; height: 14px; color: var(--orange); }
.ep-cc { padding: 1px 5px; border: 1px solid rgba(255, 240, 230, 0.28); border-radius: 4px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.04em; color: var(--text-2); }
.ep-langs { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ep-status { font-size: 12.5px; color: var(--peach); font-weight: 650; min-width: 0; }
.ep-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-status.err { color: var(--danger); font-weight: 600; }
.ep-status.note { color: var(--text-3); font-weight: 400; }
.ep-status.working { display: flex; align-items: center; gap: 7px; }
.ep-status.working .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: mf-pulse 1.2s ease-in-out infinite; }
@keyframes mf-pulse { 50% { opacity: 0.3; } }

/* ---------------------------------------------------------------- pages */
.page { padding: calc(env(safe-area-inset-top) + 100px) var(--gutter) 64px; max-width: 1100px; }
.page-head h1 { font-family: var(--font-display); font-weight: 800; font-stretch: 76%; font-size: clamp(48px, 6.4vw, 84px); line-height: 0.9; margin: 0 0 12px; letter-spacing: -0.015em; }
.page-head p { max-width: 62ch; margin: 0; }
.section-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin: 40px 0 14px; }
.section-head h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 28px; margin: 0; line-height: 1.1; }
.section-head .link { margin-left: auto; }

/* upload */
.drop {
  margin: 28px 0 0;
  border: 2px dashed rgba(255, 170, 110, 0.32);
  border-radius: 26px;
  padding: 44px 24px;
  text-align: center;
  background: radial-gradient(70% 120% at 50% 0%, rgba(255, 122, 26, 0.09), transparent 70%);
}
.drop-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 122, 26, 0.15); color: var(--orange); }
.drop-icon .ico { width: 30px; height: 30px; }
.drop-main { font-size: 19px; font-weight: 700; margin: 0; }
.drop-sub { color: var(--text-3); font-size: 13.5px; margin: 6px 0 20px; }
.drop-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.drop-hint { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(21, 14, 10, 0.84); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.drop-hint > div { border: 2px dashed var(--orange); border-radius: 30px; padding: 52px 72px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: 34px; color: var(--peach); }
.drop-hint .ico { width: 44px; height: 44px; color: var(--orange); }

.rv-group { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; margin-bottom: 14px; }
.rv-ghead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-ghead h3 { margin: 4px 0; font-size: 16px; }
.rv-title-wrap { flex: 1; min-width: 200px; }
.rv-title { font-weight: 700; font-size: 16px !important; }
.rv-year { width: 92px !important; }
.rv-badge { font-size: 12.5px; color: var(--peach); font-weight: 650; }
.rv-art { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rv-items { margin-top: 10px; }
.rv-item { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'se main x'; gap: 14px; align-items: start; padding: 12px 0 10px; border-top: 1px solid var(--line); }
.rv-item.movie { grid-template-columns: 1fr auto; grid-template-areas: 'main x'; }
.rv-se { grid-area: se; display: flex; gap: 8px; }
.rv-main { grid-area: main; min-width: 0; }
.rv-x { grid-area: x; }
.rv-se label { display: flex; align-items: center; gap: 5px; font-weight: 800; color: var(--text-3); font-size: 13px; }
.rv-se input { width: 54px !important; text-align: center; padding: 8px 4px !important; min-height: 40px !important; }
.rv-t { min-height: 40px !important; padding: 8px 12px !important; }
.rv-fname { font-size: 12.5px; color: var(--text-3); margin-top: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.rv-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-warn { margin-top: 8px; font-size: 12.5px; color: var(--peach); font-weight: 600; }
.rv-loose-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.rv-loose-row:first-of-type { border-top: 0; }
.rv-loose-row .rv-fname { margin: 0; }
.rv-loose-row select { max-width: 300px; flex: none; width: auto; }
.rv-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; padding: 18px 0 14px; position: sticky; bottom: 0; z-index: 5; background: linear-gradient(180deg, rgba(21, 14, 10, 0), var(--bg) 45%); }
.rv-actions .btn-primary { box-shadow: 0 10px 30px rgba(255, 122, 26, 0.28); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 10px; border-radius: 999px; background: rgba(255, 240, 230, 0.08); font-size: 12.5px; font-weight: 600; max-width: 100%; }
.chip .ico { width: 15px; height: 15px; color: var(--text-3); }
.chip button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; }
.chip button .ico { width: 13px; height: 13px; }
.chip button:hover { background: rgba(255, 255, 255, 0.1); }
.chip.add { padding: 0 12px 0 9px; color: var(--orange-hi); }
.chip.add .ico { color: var(--orange-hi); }
.chip select { background-color: transparent !important; border: 0 !important; padding: 0 18px 0 0 !important; min-height: 0 !important; height: 28px; font-size: 12.5px; font-weight: 650; width: auto !important; background-position: right 0 center; background-size: 13px; border-radius: 0; }

.q-total { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-bottom: 6px; }
.q-total i { display: block; height: 100%; background: var(--grad); transform-origin: left; transition: transform 0.3s; }
.q-list { list-style: none; padding: 0; margin: 10px 0 0; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.q-row.child { padding: 0 0 10px 34px; border-top: 0; }
.q-row.child .q-ico .ico { width: 16px; height: 16px; }
.q-ico { color: var(--text-3); display: grid; }
.q-body { flex: 1; min-width: 0; }
.q-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.q-line b, .q-line a { font-weight: 650; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.q-row.child .q-line b { font-weight: 500; color: var(--text-2); font-size: 13px; }
.q-line a { text-decoration: underline; text-underline-offset: 3px; }
.q-state { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.q-state .ico { width: 16px; height: 16px; color: var(--orange); }
.st-error .q-state { color: var(--danger); white-space: normal; text-align: right; }
.q-file { font-size: 12px; color: var(--text-3); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.q-bar { height: 3px; margin-top: 7px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--orange); transform-origin: left; transition: transform 0.25s linear; }

.import { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 44px; padding: 22px; border-radius: 22px; border: 1px solid var(--line); }
.import-text { flex: 1; min-width: 260px; }
.import h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 24px; margin: 0 0 6px; }
.import p { margin: 0 0 12px; max-width: 62ch; }
.path { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border-radius: 10px; background: var(--card); font-size: 13px; color: var(--text-2); text-align: left; transition: background-color 0.15s; }
.path:hover { background: var(--card-2); }
.path .ico { width: 17px; height: 17px; color: var(--orange); }
.path code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* search */
.search-box { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 60px; border-radius: 999px; background: var(--bg-raise); border: 1px solid var(--line); max-width: 760px; transition: border-color 0.15s; }
.search-box .ico { color: var(--text-3); width: 22px; height: 22px; }
.search-box:focus-within { border-color: var(--orange); }
.search-box input { border: 0 !important; background: none !important; padding: 0 !important; font-size: 18px; min-height: 0 !important; }
.search-box input::-webkit-search-cancel-button { filter: invert(0.7); }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; margin-top: 18px; }
.sr-h { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 22px; margin: 34px 0 10px; }
.sr-eps { list-style: none; padding: 0; margin: 0; }
.sr-ep { display: flex; gap: 14px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 14px; }
.sr-ep:hover { background: var(--bg-raise); }
.sr-ep-img { position: relative; width: 150px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--card); flex: none; }
.sr-ep-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.sr-ep-img img.in { opacity: 1; }
.sr-ep-img .ph span { font-size: 22px; }
.sr-ep b { display: block; font-weight: 650; }
.sr-ep span { font-size: 13px; color: var(--text-3); white-space: pre; }

/* settings */
.set-card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 24px; padding: 22px 24px; margin-top: 16px; }
.set-card h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 24px; margin: 0 0 8px; line-height: 1.15; }
.set-card > p { margin: 0 0 4px; max-width: 64ch; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-card h2 + .set-row { border-top: 0; }
.set-row > div:first-child { min-width: 0; flex: 1; }
.set-row b { display: block; font-weight: 650; }
.set-row span { font-size: 13px; color: var(--text-3); }
.set-row select { width: auto; min-width: 190px; }
.phone-card { display: flex; gap: 30px; align-items: center; justify-content: space-between; }
.phone-text { min-width: 0; }
.qr-wrap { flex: none; width: 188px; padding: 10px; background: #fff; border-radius: 20px; }
.qr { display: block; width: 100%; height: auto; }
.steps { padding-left: 20px; color: var(--text-2); margin: 6px 0 16px; }
.steps li { margin: 4px 0; }
.ok-dot, .warn-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.ok-dot { background: #7bdc8b; }
.warn-dot { background: var(--orange); }
.storage-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 8px 0 10px; }
.storage-bar i { display: block; height: 100%; background: var(--grad); transform-origin: left; }
.storage p { margin: 0 0 10px; }
.sub-preview {
  position: relative;
  height: 128px;
  border-radius: 16px;
  margin: 12px 0 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 25% 30%, rgba(255, 166, 92, 0.55), transparent 70%),
    radial-gradient(50% 70% at 80% 40%, rgba(120, 160, 255, 0.35), transparent 70%),
    linear-gradient(160deg, #4a3427, #120c09);
}
.sub-preview span { font-size: calc(var(--sub-scale, 1) * 21px); }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; }
.login .logo.big { margin-bottom: 18px; }
.pin-dots { display: flex; gap: 14px; height: 22px; align-items: center; margin: 12px 0 2px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--orange); }
.pin-dots.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.pin-err { color: var(--danger); min-height: 1.5em; margin: 0; font-size: 14px; font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; margin-top: 8px; }
.keypad button { height: 76px; border-radius: 50%; background: rgba(255, 240, 230, 0.08); font-size: 27px; font-weight: 600; display: grid; place-items: center; transition: background-color 0.12s, transform 0.1s; }
.keypad button:active { background: rgba(255, 240, 230, 0.2); transform: scale(0.95); }
.keypad .ok { background: var(--orange); color: var(--on-orange); }
.keypad .ico { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- overlays */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(8, 5, 3, 0.72); opacity: 0; transition: opacity 0.2s; }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 22px; padding: 22px; opacity: 0; transform: translateY(12px) scale(0.98); transition: opacity 0.2s, transform 0.2s; }
.modal.wide { width: min(640px, 100%); }
.modal-root.open .modal-scrim { opacity: 1; }
.modal-root.open .modal { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: 26px; margin: 0; line-height: 1.1; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.art-pickers { display: flex; gap: 14px; }
.art-pick { display: flex; flex-direction: column; gap: 8px; }
.art-pick.backdrop { flex: 0 1 280px; min-width: 0; }
.art-prev { position: relative; border-radius: 10px; overflow: hidden; background: var(--card); display: grid; place-items: center; color: var(--text-3); font-size: 13px; font-weight: 600; }
.art-pick.poster .art-prev { width: 96px; aspect-ratio: 2 / 3; }
.art-pick.backdrop .art-prev { aspect-ratio: 16 / 9; }
.art-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.sub-list li { display: flex; gap: 8px; align-items: center; }
.sub-list .sub-label { flex: 1; min-width: 0; }
.sub-list .sub-lang { width: 140px; flex: none; }

.menu-root { position: fixed; inset: 0; z-index: 90; }
.menu-scrim { position: absolute; inset: 0; }
.menu { position: absolute; min-width: 230px; max-width: 320px; background: #2b1e16; border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); opacity: 0; transform: translateY(-4px); transition: opacity 0.14s, transform 0.14s; }
.menu-root.open .menu { opacity: 1; transform: none; }
.menu-title { padding: 8px 12px 6px; font-size: 12.5px; color: var(--text-3); font-weight: 650; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; font-size: 14.5px; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.menu-item:disabled { opacity: 0.5; cursor: default; }
.menu-item .ico { width: 19px; height: 19px; color: var(--text-2); }
.menu-item.danger, .menu-item.danger .ico { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-root.sheet .menu-scrim { background: rgba(8, 5, 3, 0.62); opacity: 0; transition: opacity 0.2s; }
.menu-root.sheet.open .menu-scrim { opacity: 1; }
.menu-root.sheet .menu { left: 0; right: 0; bottom: 0; max-width: none; border-radius: 22px 22px 0 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); transform: translateY(30px); }
.menu-root.sheet.open .menu { transform: none; }
.menu-root.sheet .menu-item { padding: 14px; font-size: 15.5px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 120; background: #f7eadf; color: #1a0f08; padding: 12px 18px; border-radius: 14px; font-weight: 650; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); transition: opacity 0.22s, transform 0.22s; max-width: calc(100vw - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: #ffdcd8; color: #3b0c07; }
.toast-btn { font-weight: 800; color: #b3480a; }

.up-pill { position: fixed; right: 20px; bottom: 24px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: #2b1e16; border: 1px solid var(--line); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.up-pill b { font-weight: 700; }
.ring { width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--f, 0) * 360deg), rgba(255, 255, 255, 0.14) 0); display: grid; place-items: center; }
.ring i { width: 20px; height: 20px; border-radius: 50%; background: #2b1e16; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 720px) {
  .hero { min-height: 72vh; }
  .hero-slide { padding: 90px var(--gutter) 62px; }
  .hero-dots { left: var(--gutter); right: auto; bottom: 34px; }
  .hero-dot { width: 22px; }
  .hero-shade {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(21, 14, 10, 0.72) 32%, rgba(21, 14, 10, 0.1) 62%),
      linear-gradient(180deg, rgba(21, 14, 10, 0.6), rgba(21, 14, 10, 0) 25%);
  }
  .hero-title { font-size: clamp(54px, 15vw, 84px); }
  .hero-actions { margin-top: 18px; }
  .hero-actions .btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
  .hero-desc { -webkit-line-clamp: 2; font-size: 14px; }
  .rows { margin-top: -24px; }
  .row { margin-bottom: 24px; }
  .row-track { gap: 10px; }
  .row[data-row='cw'], .row[data-row='recent'] { --cw: 70vw; }
  .row[data-row='series'], .row[data-row='movies'] { --cw: 31vw; }
  .poster-name { padding: 50% 9px 9px; }
  .poster-name b { font-size: 17px; }
  .show-hero { min-height: 58vh; padding-top: 90px; }
  .show-desc { font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .show-desc.open { display: block; }
  .show-poster { display: none; }
  .show-title { font-size: clamp(46px, 13vw, 72px); }
  .hero-actions .btn-icon-lg { width: 46px; height: 46px; }
  .ep-row { grid-template-columns: 38% minmax(0, 1fr) 32px; gap: 12px; padding: 7px 0; margin: 0; border-radius: 0; }
  .ep-row:hover { background: none; }
  .ep-info { gap: 4px; }
  .ep-title { gap: 7px; font-size: 14.5px; line-height: 1.28; }
  .ep-num { font-size: 18px; }
  .ep-meta { font-size: 12px; gap: 6px; }
  .ep-meta > span + span:not(.ep-langs):not(.ep-cc)::before { margin-right: 6px; }
  .ep-head h2 { font-size: 24px; }
  .seg.seasons button { padding: 6px 12px; font-size: 13px; }
  .ep-langs { display: none; }
  .ep-more { width: 32px; height: 32px; margin-right: -6px; }
  .page { padding-top: calc(env(safe-area-inset-top) + 76px); }
  .drop { padding: 30px 18px; }
  .rv-group { padding: 14px; border-radius: 18px; }
  .rv-item { grid-template-columns: 1fr auto; grid-template-areas: 'se x' 'main main'; gap: 8px 12px; }
  .rv-item.movie { grid-template-areas: 'main x'; }
  .rv-actions { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .rv-loose-row { flex-direction: column; align-items: stretch; }
  .rv-loose-row select { max-width: none; width: 100%; }
  .poster-grid { grid-template-columns: repeat(3, 1fr); gap: 16px 10px; }
  .sr-ep-img { width: 116px; }
  .set-card { padding: 18px; border-radius: 20px; }
  .phone-card { flex-direction: column-reverse; align-items: flex-start; }
  .qr-wrap { width: 160px; }
  .set-row:has(select) { flex-wrap: wrap; }
  .set-row select { width: 100%; }
  .modal-root { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(40px); }
  .modal.wide { width: 100%; }
  .art-pickers { flex-direction: column; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .up-pill { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; }
  .field-row { flex-direction: row; }
}

/* ================================================================ player */
.view-watch { position: fixed; inset: 0; z-index: 60; background: #000; }
.player {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  container-type: size;
  outline: none;
  --sub-scale: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  color: #fff;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player:not(.ui-on) { cursor: none; }
.p-tap { position: absolute; inset: 0; z-index: 1; }

/* subtitles */
.p-subs { position: absolute; left: 4%; right: 4%; bottom: 7%; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.12em; pointer-events: none; font-size: calc(var(--sub-scale) * clamp(15px, min(4.7cqh, 5.4cqw), 54px)); transition: bottom 0.25s ease; }
.player.ui-on .p-subs { bottom: calc(7% + 72px); }
.p-subs span, .sub-preview span {
  display: inline-block;
  max-width: 100%;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1.24;
  text-align: center;
  padding: 0.06em 0.34em;
  border-radius: 0.22em;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, 0.7);
  overflow-wrap: break-word;
}
.player[data-sub-style='box'] .p-subs span, .sub-preview[data-sub-style='box'] span { background: rgba(0, 0, 0, 0.74); text-shadow: none; }

/* controls */
.p-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.player.ui-on .p-ui { opacity: 1; }
.player.ui-on .p-btn, .player.ui-on .p-seek, .player.ui-on .p-vol { pointer-events: auto; }
.p-top { position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) max(18px, env(safe-area-inset-right)) 48px max(14px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0)); }
.p-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.p-title strong { font-family: var(--font-display); font-weight: 750; font-stretch: 85%; font-size: clamp(18px, 2vw, 23px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title span { font-size: 13.5px; color: rgba(255, 255, 255, 0.78); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.p-bottom { position: absolute; inset: auto 0 0 0; padding: 56px max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 12px) max(20px, env(safe-area-inset-left)); background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0)); }
.p-btn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; transition: background-color 0.15s, transform 0.12s, color 0.15s; flex: none; }
.p-btn .ico { width: 26px; height: 26px; }
.p-btn:hover { background: rgba(255, 255, 255, 0.13); }
.p-btn:active { transform: scale(0.9); }
.p-btn.on { color: var(--orange); }
.p-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.p-spacer { flex: 1; }
.p-time { font-variant-numeric: tabular-nums; font-size: 14px; color: rgba(255, 255, 255, 0.92); margin-left: 10px; white-space: nowrap; }
.p-sep { opacity: 0.5; margin: 0 2px; }

.p-seek { position: relative; height: 30px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.p-track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.24); transition: height 0.12s; }
.p-seek:hover .p-track, .player.seeking .p-track { height: 6px; }
.p-buf, .p-played { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); border-radius: inherit; }
.p-buf { background: rgba(255, 255, 255, 0.34); }
.p-played { background: var(--orange); }
.p-knob { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255, 122, 26, 0.25); transform: scale(0); transition: transform 0.12s; }
.p-seek:hover .p-knob, .player.seeking .p-knob { transform: scale(1); }
.player.touch .p-knob { transform: scale(0.85); }
.player.touch.seeking .p-knob { transform: scale(1.2); }
.p-preview { position: absolute; bottom: 36px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.p-prev-img { border-radius: 9px; border: 2px solid rgba(255, 255, 255, 0.92); background-repeat: no-repeat; background-color: #111; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.p-preview span { font-variant-numeric: tabular-nums; font-weight: 750; font-size: 14px; background: rgba(0, 0, 0, 0.72); padding: 2px 9px; border-radius: 7px; }

.p-vol { display: flex; align-items: center; }
.p-volume { -webkit-appearance: none; appearance: none; width: 0; height: 4px; opacity: 0; border-radius: 2px; cursor: pointer; transition: width 0.2s, opacity 0.2s, margin 0.2s; background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255, 255, 255, 0.3) var(--v, 100%)); }
.p-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.p-volume::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.p-vol:hover .p-volume, .p-volume:focus-visible { width: 92px; opacity: 1; margin: 0 10px 0 2px; }

.p-mid { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: clamp(32px, 11vw, 96px); pointer-events: none; }
.player.touch .p-mid { display: flex; }
.p-big { width: 64px; height: 64px; background: rgba(0, 0, 0, 0.32); }
.p-big .ico { width: 34px; height: 34px; }
.p-ppm { width: 80px; height: 80px; }
.p-ppm .ico { width: 40px; height: 40px; }
.player.touch .hide-touch, .player.touch .p-pp { display: none; }
.player.touch .p-time { margin-left: 2px; font-size: 13px; }
.player.touch .p-row { gap: 0; }

.p-flash { position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 2; opacity: 0; pointer-events: none; }
.p-flash .ico { width: 40px; height: 40px; }
.p-flash.go { animation: p-flash 0.55s ease-out; }
@keyframes p-flash { 0% { opacity: 1; transform: scale(0.8); } 100% { opacity: 0; transform: scale(1.3); } }
.p-ripple { position: absolute; top: 0; bottom: 0; width: 40%; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.p-ripple.l { left: 0; background: radial-gradient(circle at 0% 50%, rgba(255, 255, 255, 0.16), transparent 70%); }
.p-ripple.r { right: 0; background: radial-gradient(circle at 100% 50%, rgba(255, 255, 255, 0.16), transparent 70%); }
.p-ripple span { font-weight: 800; font-size: 17px; background: rgba(0, 0, 0, 0.5); padding: 8px 14px; border-radius: 999px; }
.p-ripple.go { animation: p-ripple 0.7s ease-out; }
@keyframes p-ripple { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

.p-spinner { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; z-index: 2; pointer-events: none; }
.player.touch .p-spinner { width: 100px; height: 100px; z-index: 4; }
.p-spinner i, .p-spin-sm i { display: block; width: 100%; height: 100%; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.16); border-top-color: var(--orange); animation: spin 0.8s linear infinite; }
.p-spin-sm { width: 46px; height: 46px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* panels */
.p-panel { position: absolute; right: 18px; bottom: 100px; z-index: 6; width: min(380px, calc(100% - 36px)); max-height: calc(100% - 150px); overflow: auto; overscroll-behavior: contain; background: rgba(26, 17, 12, 0.97); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 20px; padding: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65); animation: rise 0.18s ease-out; }
.player.touch .p-panel { left: max(0px, env(safe-area-inset-left)); right: max(0px, env(safe-area-inset-right)); bottom: 0; width: auto; max-height: 78%; border-radius: 22px 22px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
@media (orientation: landscape) and (max-height: 500px) { .player.touch .p-panel { left: auto; width: min(420px, 60%); max-height: 100%; border-radius: 22px 0 0 0; } }
.pp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pp-head h3 { margin: 0 0 0 6px; font-family: var(--font-display); font-size: 21px; font-weight: 750; font-stretch: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-head .p-btn { width: 38px; height: 38px; }
.pp-head .ico { width: 20px; height: 20px; }
.pp-list { display: flex; flex-direction: column; }
.pp-opt { display: flex; align-items: center; gap: 10px; padding: 11px 8px; border-radius: 11px; text-align: left; font-size: 15px; }
.pp-opt .ico { width: 18px; height: 18px; opacity: 0; color: var(--orange); }
.pp-opt.sel { font-weight: 700; }
.pp-opt.sel .ico { opacity: 1; }
.pp-opt:hover { background: rgba(255, 255, 255, 0.07); }
.pp-add { display: flex; align-items: center; gap: 10px; padding: 10px 8px; color: var(--orange-hi); font-weight: 650; font-size: 14px; }
.pp-add .ico { width: 18px; height: 18px; }
.pp-group { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 12px 6px 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 8px; }
.pp-group.dim { opacity: 0.4; pointer-events: none; }
.pp-group.stack { flex-direction: column; align-items: stretch; }
.pp-group.stack .seg { display: flex; }
.pp-group.stack .seg button { flex: 1; padding-left: 6px; padding-right: 6px; }
.pp-label { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-weight: 650; }
.pp-sub { font-size: 13px; color: rgba(255, 255, 255, 0.6); font-weight: 650; margin: 8px 8px 2px; }
.player .seg button.sel { background: #fff; color: #140d09; }
.seg.tight button { padding: 6px 9px; font-size: 12.5px; }
.pp-seasons { margin: 4px 0 10px; }
.pp-eps { display: flex; flex-direction: column; gap: 2px; }
.pp-ep { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; text-align: left; }
.pp-ep:hover { background: rgba(255, 255, 255, 0.07); }
.pp-ep.sel { background: rgba(255, 122, 26, 0.17); }
.pp-ep:disabled { opacity: 0.5; }
.pp-ep-img { position: relative; width: 112px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #2a1d15; flex: none; }
.pp-ep-img img { width: 100%; height: 100%; object-fit: cover; }
.pp-ep-img i { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--f) * 100%); background: var(--orange); }
.pp-ep b { display: block; font-size: 14px; font-weight: 650; }
.pp-ep span { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }

.p-upnext { position: absolute; right: 22px; bottom: 112px; z-index: 5; display: flex; gap: 14px; align-items: center; width: min(460px, calc(100% - 44px)); padding: 12px; border-radius: 20px; background: rgba(26, 17, 12, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); animation: rise 0.3s ease-out; }
.un-img { width: 156px; aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden; background: #2a1d15; flex: none; }
.un-img img { width: 100%; height: 100%; object-fit: cover; }
.un-body { min-width: 0; }
.un-k { font-size: 12px; color: rgba(255, 255, 255, 0.66); font-weight: 650; }
.un-body b { display: block; font-size: 15px; margin: 2px 0 10px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.un-actions { display: flex; gap: 8px; }
.un-actions .btn { height: 38px; padding: 0 15px; }
.un-actions .ico { width: 17px; height: 17px; }
.un-n { font-style: normal; font-variant-numeric: tabular-nums; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.player.touch .p-upnext { left: 12px; right: 12px; width: auto; bottom: 96px; }
.player.touch .un-img { width: 108px; }

.p-msg { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: rgba(0, 0, 0, 0.74); }
.p-msg p { max-width: 46ch; font-size: 16px; line-height: 1.5; margin: 0; }
.p-msg strong { font-family: var(--font-display); font-size: 28px; font-weight: 750; font-stretch: 85%; line-height: 1.2; }
.p-msg .muted { color: rgba(255, 255, 255, 0.72); }
.p-msg-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.player.has-msg .p-mid, .player.has-msg .p-bottom, .player.has-msg .p-spinner, .player.has-msg .p-subs { visibility: hidden; }
.player.has-msg .p-ui { opacity: 1; }
.player.has-msg .p-back { pointer-events: auto; }
.player.has-msg .p-top { z-index: 7; position: absolute; }
.p-chip { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 78px); transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 16px; border-radius: 999px; background: rgba(26, 17, 12, 0.94); font-size: 14px; font-weight: 600; white-space: nowrap; animation: rise 0.22s ease-out; }
.p-chip:not(:has(button)) { padding-right: 16px; }
.p-chip button { padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 750; font-size: 13px; }

@media (max-width: 560px) {
  .p-btn { width: 42px; height: 42px; }
  .p-btn .ico { width: 24px; height: 24px; }
  .p-bottom { padding-top: 40px; }
}

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

/* ================================================================ cloud additions */
.install-banner { display: flex; align-items: center; gap: 12px; margin: 0 var(--gutter) 26px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--bg-raise); border: 1px solid var(--line); }
.welcome .install-banner { margin: 28px 0 0; max-width: 520px; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-banner b { font-size: 14.5px; }
.install-banner span { font-size: 12.5px; color: var(--text-3); }
.install-card { display: flex; align-items: center; gap: 18px; }
.install-card img { border-radius: 16px; flex: none; }
.install-card .phone-text { flex: 1; }
.install-card h2 { margin-bottom: 4px; }
.install-card p { margin: 0; }
@media (max-width: 720px) { .install-card { flex-wrap: wrap; } .install-card .btn { width: 100%; } }
.steps.big li { margin: 10px 0; font-size: 15.5px; }
.share-ico { display: inline-grid; place-items: center; vertical-align: -5px; color: #0a84ff; }
.share-ico .ico { width: 20px; height: 20px; }

.login-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; }
.login-form.shake { animation: shake 0.35s; }
.login-h { font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: 36px; margin: 0; }
.login .muted.center { max-width: 42ch; margin: 4px 0 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.rv-plan { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 1.4; }
.rv-plan .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.rv-plan.ok { color: var(--text-2); }
.rv-plan.ok .ico { color: #7bdc8b; }
.rv-plan.bad { color: var(--peach); }
.rv-plan.bad .ico { color: var(--orange); }
.rv-plan.checking { color: var(--text-3); align-items: center; }
.dot-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--orange); animation: spin 0.8s linear infinite; flex: none; }
.rv-force { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.rv-force input { accent-color: var(--orange); width: 16px; height: 16px; }
.rv-item.off .rv-t, .rv-item.off .rv-se, .rv-item.off .rv-subs { opacity: 0.45; }
.rv-audio { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.rv-audio .ico { width: 16px; height: 16px; color: var(--text-3); }
.rv-audio select { width: auto !important; min-height: 34px !important; padding: 4px 32px 4px 10px !important; font-size: 13px; border-radius: 999px; }
.chip.inner { padding-right: 12px; color: var(--text-2); }
.pp-note { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); margin: 4px 8px 6px; line-height: 1.45; }
.pp-opt[aria-disabled='true'] { opacity: 0.5; }
.pp-dim { font-style: normal; font-weight: 450; color: rgba(255, 255, 255, 0.55); font-size: 13px; margin-left: 4px; }
.empty .logo.big { font-size: 56px; margin-bottom: 18px; }
.ok-line { color: #8fd18f; }
.warn-line { color: var(--peach); font-weight: 600; }

/* ---------------------------------------------------------------- POVs */
.pov-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px 22px; padding: 2px; }
.pov-tabs::-webkit-scrollbar { display: none; }
.pov { flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 240, 230, 0.07); color: var(--text-2); font-weight: 650; font-size: 14px; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.pov:hover { background: rgba(255, 240, 230, 0.12); color: var(--text); }
.pov.sel { background: var(--text); color: var(--bg); }
.pov-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-stretch: 80%; font-size: 13px; color: #fff; background: linear-gradient(140deg, hsl(var(--h, 20) 85% 55%), hsl(calc(var(--h, 20) + 25) 80% 38%)); }
.pov-av.none { background: rgba(255, 240, 230, 0.16); color: var(--text-2); }
.pov.sel .pov-av.none { background: rgba(0, 0, 0, 0.15); color: var(--bg); }
.pov-n { font-size: 12px; font-weight: 700; opacity: 0.6; }
.pov-empty { margin: 4px 0 20px; }
.pov-edit { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pov-edit li { display: flex; align-items: center; gap: 10px; }
.pov-edit input { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .pov { font-size: 13.5px; padding: 5px 12px 5px 5px; }
  .pov-av { width: 26px; height: 26px; font-size: 11.5px; }
}
.rv-opt { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 13.5px; font-weight: 650; color: var(--text-2); }
.rv-opt .ico { width: 17px; height: 17px; color: var(--text-3); }
.rv-opt select { width: auto !important; min-height: 36px !important; padding: 4px 32px 4px 12px !important; font-size: 13.5px; border-radius: 999px; max-width: 70vw; }
.rv-note { margin: -4px 0 10px; }
.rv-item.movie.part { grid-template-columns: auto 1fr auto; grid-template-areas: 'se main x'; }
