/* Self-hosted fonts (no dependency on Google at runtime) */
@font-face { font-family: 'Bebas Neue'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/bebas-neue-latin.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(/fonts/dm-sans-latin.woff2) format('woff2'); }

/* ───────────────────────── StreamVault ───────────────────────── */
:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --bg-3: #1e1e24;
  --line: #2a2a31;
  --text: #f5f5f7;
  --muted: #a3a3ad;
  --dim: #6e6e78;
  --accent: #e50914;
  --accent-2: #f6121d;
  --ok: #46d369;
  --pad: clamp(16px, 4vw, 56px);
  --nav-h: 64px;
  --radius: 6px;
  --cards: 2.3;          /* cards visible per row */
  --gap: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (min-width: 560px)  { :root { --cards: 3.3; } }
@media (min-width: 900px)  { :root { --cards: 4.3; --gap: 10px; } }
@media (min-width: 1200px) { :root { --cards: 5.3; } }
@media (min-width: 1600px) { :root { --cards: 6.3; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; }
.ico { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.brand { font-family: 'Bebas Neue', Impact, sans-serif; color: var(--accent); font-size: 30px; letter-spacing: 2px; line-height: 1; white-space: nowrap; }
.brand-lg { font-size: clamp(44px, 12vw, 64px); letter-spacing: 4px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px;
  border-radius: var(--radius); font-weight: 700; font-size: 16px; transition: background .15s, transform .1s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn .ico { width: 24px; height: 24px; }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: rgba(255,255,255,.8); }
.btn-red { background: var(--accent); color: #fff; }
.btn-red:hover { background: var(--accent-2); }
.btn-ghost { background: rgba(109,109,110,.7); color: #fff; }
.btn-ghost:hover { background: rgba(109,109,110,.45); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text); transition: background .15s; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn.spin .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ───────────────────────────────────────────── */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(229,9,20,.25), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(229,9,20,.12), transparent 60%),
    var(--bg); }
.login-box { width: min(400px, 100%); background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 12px;
  padding: clamp(28px, 6vw, 48px); text-align: center; animation: rise .5s ease both; backdrop-filter: blur(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.login-sub { color: var(--muted); font-size: 14px; letter-spacing: .5px; margin: 8px 0 32px; }
.login-box input { width: 100%; height: 50px; padding: 0 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: #333; border: 1px solid transparent; color: #fff; font-size: 16px; outline: none; transition: border .2s; }
.login-box input:focus { border-color: #fff; }
.login-box .btn { height: 50px; background: var(--accent); color: #fff; }
.login-box .btn:hover { background: var(--accent-2); }
.login-err { color: #e87c03; font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ── Nav ─────────────────────────────────────────────── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  height: calc(var(--nav-h) + var(--safe-t)); padding: var(--safe-t) var(--pad) 0;
  background: linear-gradient(180deg, rgba(0,0,0,.8) 10%, transparent); transition: background .3s; }
.nav.solid { background: rgba(11,11,13,.96); box-shadow: 0 1px 0 rgba(255,255,255,.04); }
.nav-links { display: flex; gap: 20px; font-size: 14px; }
.nav-links a { color: #e5e5e5; transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: #b3b3b3; }
.nav-links a.active { color: #fff; font-weight: 700; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 4px;
  cursor: text; transition: background .2s, border-color .2s; }
.search input { width: 0; background: transparent; border: 0; outline: none; color: #fff; font-size: 14px; transition: width .25s; }
.search input::-webkit-search-cancel-button { filter: invert(1); }
.search.open, .search:focus-within { background: rgba(0,0,0,.75); border-color: rgba(255,255,255,.85); }
.search.open input, .search:focus-within input { width: min(220px, 40vw); }

@media (max-width: 899px) {
  :root { --nav-h: 96px; }
  .nav { flex-wrap: wrap; align-content: center; gap: 4px 12px; }
  .nav-links { order: 3; width: 100%; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
  .nav-links a.active { background: #fff; color: #000; border-color: #fff; }
  .brand { font-size: 26px; }
  .search.open input, .search:focus-within input { width: min(180px, 42vw); }
}

/* ── Views ───────────────────────────────────────────── */
.view { min-height: 100vh; outline: none; padding-bottom: calc(48px + var(--safe-b)); }
.page { padding: calc(var(--nav-h) + var(--safe-t) + 24px) var(--pad) 0; }
.page-title { font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 20px; }
.empty { color: var(--muted); padding: 60px 0; text-align: center; line-height: 1.7; }
.loading-page { min-height: 70vh; display: grid; place-items: center; }
.loader { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* ── Hero ────────────────────────────────────────────── */
.hero { position: relative; height: min(80vh, 56.25vw + 120px); min-height: 440px; display: flex; align-items: flex-end;
  padding: 0 var(--pad) clamp(40px, 9vh, 120px); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: var(--bg-2) center/cover no-repeat; transform: scale(1.02); }
.hero-bg::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(77deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.25) 55%, transparent 85%),
              linear-gradient(0deg, var(--bg) 0%, rgba(11,11,13,.55) 22%, transparent 45%); }
.hero-body { position: relative; max-width: min(640px, 100%); animation: rise .6s ease both; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: #ddd; margin-bottom: 10px; font-weight: 700; }
.hero-kicker b { color: var(--accent); font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 1px; }
.hero-title { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; font-size: clamp(44px, 9vw, 110px); line-height: .92; letter-spacing: 1px;
  text-shadow: 0 2px 20px rgba(0,0,0,.5); margin-bottom: 14px; word-break: break-word; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: #ddd; font-size: 15px; margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-progress { width: min(320px, 100%); margin-bottom: 18px; }
.hero-progress .bar { height: 4px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.hero-progress .bar i { display: block; height: 100%; background: var(--accent); }
.hero-progress small { display: block; color: #ccc; font-size: 13px; margin-top: 6px; }
.chip { display: inline-block; border: 1px solid rgba(255,255,255,.45); border-radius: 3px; padding: 0 6px; font-size: 12px; line-height: 20px; color: #ddd; }
.chip-hd { font-weight: 700; }
.match { color: var(--ok); font-weight: 700; }

/* ── Rows ────────────────────────────────────────────── */
.rows { position: relative; z-index: 2; margin-top: -60px; }
.rows.flat { margin-top: 0; padding-top: calc(var(--nav-h) + var(--safe-t) + 16px); }
.row { margin-bottom: clamp(24px, 4vw, 44px); }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--pad); margin-bottom: 10px; }
.row-title { font-size: clamp(17px, 2vw, 22px); font-weight: 700; color: #e5e5e5; }
.row-link { font-size: 13px; color: #54b9c5; font-weight: 700; opacity: .9; }
.row-link:hover { text-decoration: underline; }
.row-wrap { position: relative; }
.row-track { display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  padding: 6px var(--pad) 10px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { flex: 0 0 calc((100vw - 2 * var(--pad) - (var(--cards) - 1) * var(--gap)) / var(--cards)); scroll-snap-align: start; }
.row-arrow { position: absolute; top: 6px; bottom: 10px; width: var(--pad); min-width: 36px; z-index: 3; display: none; place-items: center;
  background: rgba(11,11,13,.6); color: #fff; opacity: 0; transition: opacity .2s, background .2s; }
.row-arrow svg { width: 32px; height: 32px; fill: currentColor; transition: transform .15s; }
.row-arrow:hover svg { transform: scale(1.25); }
.row-arrow.left { left: 0; border-radius: 0 4px 4px 0; }
.row-arrow.right { right: 0; border-radius: 4px 0 0 4px; }
@media (hover: hover) and (pointer: fine) {
  .row-arrow { display: grid; }
  .row-wrap:hover .row-arrow:not([disabled]) { opacity: 1; }
  .row-arrow:hover { background: rgba(11,11,13,.85); }
}

/* ── Cards ───────────────────────────────────────────── */
.card { position: relative; display: block; border-radius: var(--radius); background: var(--bg-3); cursor: pointer; transition: transform .25s ease, box-shadow .25s; }
.card-img { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #24242c, #15151a); }
.card-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.card-img img.loaded { opacity: 1; }
.card-img .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center;
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: 1px; color: rgba(255,255,255,.25); }
.card-label { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px;
  background: linear-gradient(0deg, rgba(0,0,0,.9), rgba(0,0,0,.55) 55%, transparent); }
.card-name { font-weight: 700; font-size: clamp(13px, 1.25vw, 16px); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.card-sub { font-size: 12px; color: #c9c9cf; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badge { position: absolute; z-index: 2; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 6px; border-radius: 3px; }
.card-progress { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 6px; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.card-progress i { display: block; height: 100%; background: var(--accent); }
.card.has-progress .card-label { padding-bottom: 14px; }
.card-play { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.card-play span { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.5); display: grid; place-items: center; }
.card-play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.card-remove { position: absolute; z-index: 3; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.5);
  display: grid; place-items: center; font-size: 14px; opacity: 0; transition: opacity .2s; z-index: 2; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: scale(1.06); z-index: 4; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
  .card:hover .card-play, .card:hover .card-remove { opacity: 1; }
}
@media (hover: none) { .card-remove { opacity: .9; } .card:active { transform: scale(.97); } }

/* ── Grid (browse/search) ────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 260px), 1fr)); gap: clamp(10px, 1.4vw, 16px); }
@media (max-width: 559px) { .grid { grid-template-columns: 1fr 1fr; } }
.grid-sec { margin-bottom: 36px; }
.grid-sec h2 { font-size: 18px; margin-bottom: 12px; color: #e5e5e5; }

/* ── Title details ───────────────────────────────────── */
.detail-hero { position: relative; min-height: min(72vh, 680px); display: flex; align-items: flex-end; padding: calc(var(--nav-h) + var(--safe-t) + 40px) var(--pad) 36px; }
.detail-hero .hero-bg::after { background: linear-gradient(90deg, rgba(11,11,13,.95) 0%, rgba(11,11,13,.6) 50%, rgba(11,11,13,.2) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 50%); }
.detail-hero .hero-title { font-size: clamp(40px, 7vw, 88px); }
.detail-desc { color: #ccc; font-size: 15px; line-height: 1.6; margin-bottom: 20px; max-width: 560px; }
.detail-file { color: var(--dim); font-size: 13px; word-break: break-all; margin-top: 18px; }
.episodes { padding: 0 var(--pad); max-width: 1100px; }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ep-head h2 { font-size: clamp(20px, 2.5vw, 26px); }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; background: #242424; color: #fff; border: 1px solid #4d4d4d; border-radius: 4px;
  font: inherit; font-size: 15px; font-weight: 700; padding: 10px 40px 10px 14px; max-width: min(78vw, 420px); cursor: pointer; text-overflow: ellipsis; }
.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 0; height: 0; border: 6px solid transparent; border-top-color: #fff; margin-top: -2px; pointer-events: none; }
.ep { display: grid; grid-template-columns: 28px clamp(120px, 22vw, 200px) 1fr; gap: clamp(10px, 2vw, 20px); align-items: center;
  padding: clamp(12px, 2vw, 22px) clamp(8px, 2vw, 24px); border-bottom: 1px solid var(--line); border-radius: 6px; cursor: pointer; transition: background .15s; }
.ep:hover { background: var(--bg-3); }
.ep.current { background: #232329; }
.ep-num { font-size: clamp(16px, 2vw, 22px); color: #d2d2d2; text-align: center; }
.ep-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--bg-3); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.ep-thumb img.loaded { opacity: 1; }
.ep-thumb .card-progress { left: 0; right: 0; bottom: 0; border-radius: 0; height: 4px; }
.ep-thumb .card-play { opacity: 0; }
.ep:hover .ep-thumb .card-play { opacity: 1; }
.ep-info { min-width: 0; }
.ep-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: clamp(14px, 1.5vw, 16px); }
.ep-title span:first-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ep-dur { color: var(--muted); font-weight: 400; white-space: nowrap; font-size: 14px; }
.ep-meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ep-done { color: var(--ok); font-weight: 700; }
.ep-dl { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.ep-dl:hover { color: #fff; }
@media (max-width: 559px) {
  .ep { grid-template-columns: 112px 1fr; padding: 12px 4px; }
  .ep-num { display: none; }
  .ep-title { flex-direction: column; gap: 2px; }
}

/* ── Toast ───────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 200; max-width: min(92vw, 520px);
  background: rgba(30,30,36,.97); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; line-height: 1.45; border-left: 3px solid var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────────────────────── Player ───────────────────────── */
.player { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.idle { cursor: none; }
.p-tap { position: absolute; inset: 0; z-index: 1; }

.p-ui { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none;
  opacity: 1; transition: opacity .3s; }
.player.idle .p-ui { opacity: 0; }
.p-ui > * { pointer-events: auto; }
.player.idle .p-ui > * { pointer-events: none; }
.p-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) max(var(--pad), env(safe-area-inset-right)) 40px max(var(--pad), env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(0,0,0,.75), transparent); }
.p-title { min-width: 0; flex: 1; }
.p-title-main { font-weight: 700; font-size: clamp(15px, 2vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title-sub { color: #ccc; font-size: clamp(12px, 1.5vw, 15px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.p-badges { display: flex; gap: 6px; flex-shrink: 0; }
.p-badges .chip { background: rgba(0,0,0,.4); }

.p-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: clamp(28px, 8vw, 90px); }
.p-big svg { width: clamp(40px, 7vw, 64px); height: clamp(40px, 7vw, 64px); }
.p-play.p-big { width: clamp(64px, 10vw, 92px); height: clamp(64px, 10vw, 92px); border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.p-skip svg { width: clamp(34px, 5vw, 48px); height: clamp(34px, 5vw, 48px); }
.p-skip text { fill: #fff; font-family: var(--font); }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .p-mid { display: none; }  /* desktop: click video to play/pause, like Netflix */
}

.p-bottom { padding: 40px max(var(--pad), env(safe-area-inset-right)) calc(10px + var(--safe-b)) max(var(--pad), env(safe-area-inset-left));
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.p-row { display: flex; align-items: center; gap: clamp(2px, 1vw, 12px); }
.p-spacer { flex: 1; }
.p-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; transition: transform .15s, background .15s; color: #fff; }
.p-btn svg { width: 28px; height: 28px; fill: #fff; }
.p-btn:hover { transform: scale(1.12); }
.p-btn:active { transform: scale(.95); }
.p-text-btn { width: auto; min-width: 44px; padding: 0 8px; border-radius: 4px; font-weight: 700; font-size: 15px; }
.p-hd { border: 2px solid #fff; height: 28px; padding: 0 6px; font-size: 13px; }
.i-pause, .i-muted, .i-fs-exit { display: none; }
.player.playing .i-play { display: none; }
.player.playing .i-pause { display: block; }
.player.muted .i-vol { display: none; }
.player.muted .i-muted { display: block; }
.player.fullscreen .i-fs { display: none; }
.player.fullscreen .i-fs-exit { display: block; }
.p-time { font-variant-numeric: tabular-nums; font-size: 14px; color: #ddd; white-space: nowrap; padding-left: 4px; }
.p-vol { display: flex; align-items: center; }
.p-vol input { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--accent); height: 4px; cursor: pointer; }
.p-vol:hover input, .p-vol:focus-within input { width: 90px; opacity: 1; margin-right: 6px; }
@media (hover: none) { .p-vol input { display: none; } }
@media (hover: none) and (pointer: coarse) { .p-vol { display: none; } }  /* phones/tablets: hardware volume keys */
@media (max-width: 559px) {
  .p-row { gap: 0; }
  .p-btn { width: 38px; height: 40px; }
  .p-text-btn { min-width: 38px; padding: 0 4px; font-size: 14px; }
  .p-hd { height: 24px; font-size: 12px; margin: 0 4px; }
  .p-btn svg { width: 24px; height: 24px; }
  .p-time .sep, .p-time #p-dur { display: none; }
  #p-pip { display: none !important; }
  .p-badges { display: none; }
}

/* seek bar */
.p-seek { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin-bottom: 4px; }
.p-seek-track { position: relative; width: 100%; height: 4px; background: rgba(255,255,255,.22); border-radius: 2px; transition: height .15s; }
.p-seek:hover .p-seek-track, .p-seek.dragging .p-seek-track { height: 7px; }
.p-seek-track > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.p-seek-prepared { background: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, rgba(255,255,255,.08) 6px 12px); }
.p-seek-buffered { background: rgba(255,255,255,.42); }
.p-seek-played { background: var(--accent); }
.p-seek-thumb { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent);
  transform: scale(0); transition: transform .15s; pointer-events: none; }
.p-seek:hover .p-seek-thumb, .p-seek.dragging .p-seek-thumb { transform: scale(1); }
@media (hover: none) { .p-seek-thumb { transform: scale(.8); } }
.p-seek-tip { position: absolute; bottom: 30px; transform: translateX(-50%); background: rgba(20,20,24,.95); padding: 4px 8px; border-radius: 4px;
  font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap; }
.p-seek:hover .p-seek-tip, .p-seek.dragging .p-seek-tip { opacity: 1; }

/* spinner */
.p-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.p-spinner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.p-spinner .ring { width: 64px; height: 64px; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.p-spinner-text { background: rgba(0,0,0,.6); padding: 6px 12px; border-radius: 6px; font-size: 14px; color: #eee; text-align: center; max-width: 80vw; }
.p-spinner-text:empty { display: none; }
.player.loading .p-play.p-big { visibility: hidden; }  /* spinner takes the play button's spot */

/* double-tap ripples */
.p-ripple { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; }
.p-ripple.left { left: 0; border-radius: 0 50% 50% 0 / 0 50% 50% 0; }
.p-ripple.right { right: 0; border-radius: 50% 0 0 50% / 50% 0 0 50%; }
.p-ripple.show { opacity: 1; background: rgba(255,255,255,.08); }
.p-ripple span { font-weight: 700; font-size: 18px; background: rgba(0,0,0,.5); padding: 8px 14px; border-radius: 20px; }

/* subtitles */
.p-subs { position: absolute; left: 5%; right: 5%; bottom: 7%; z-index: 2; text-align: center; pointer-events: none; transition: bottom .3s; }
.player:not(.idle) .p-subs { bottom: calc(120px + var(--safe-b)); }
.p-subs span { display: inline; background: rgba(0,0,0,.72); color: #fff; padding: .1em .35em; line-height: 1.5; border-radius: 3px;
  font-size: clamp(16px, 2.6vw, 34px); font-weight: 500; box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: pre-line; }
video::cue { background: rgba(0,0,0,.72); color: #fff; font-family: var(--font); }

/* menus */
.p-menu { position: absolute; z-index: 6; right: max(var(--pad), env(safe-area-inset-right)); bottom: calc(96px + var(--safe-b)); width: min(380px, 92vw); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; background: rgba(24,24,28,.97); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); overflow: hidden; animation: rise .18s ease both; }
.p-menu.wide { width: min(560px, 94vw); }
.p-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 18px; font-weight: 700; font-size: 17px; }
.p-menu-close { width: 36px; height: 36px; font-size: 16px; }
.p-menu-body { overflow-y: auto; padding: 4px 0 12px; overscroll-behavior: contain; }
.p-menu-cols { display: grid; grid-template-columns: 1fr 1fr; }
.p-menu-cols > div + div { border-left: 1px solid rgba(255,255,255,.08); }
.p-menu-sec { padding: 10px 18px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.p-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; text-align: left; font-size: 15px; color: #ccc; transition: background .12s, color .12s; }
.p-opt:hover { background: rgba(255,255,255,.08); color: #fff; }
.p-opt.on { color: #fff; font-weight: 700; }
.p-opt .tick { width: 18px; flex-shrink: 0; color: var(--accent); visibility: hidden; }
.p-opt.on .tick { visibility: visible; }
.p-opt .opt-main { flex: 1; min-width: 0; }
.p-opt .opt-note { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.p-opt .opt-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.p-opt .opt-state.ok { color: var(--ok); }
.p-opt .opt-state.busy { color: #f5c518; }
.p-menu-foot { padding: 8px 18px 4px; font-size: 12px; color: var(--dim); line-height: 1.5; }
.p-eps .ep { grid-template-columns: 110px 1fr; padding: 10px 14px; border-radius: 0; border-color: rgba(255,255,255,.06); }
.p-eps .ep-num { display: none; }
.p-eps .ep-title { flex-direction: column; gap: 2px; font-size: 14px; }
.p-eps .select { padding: 4px 14px 8px; }
.p-eps .select::after { right: 28px; }
.p-eps .select select { width: 100%; max-width: none; font-size: 14px; }
@media (max-width: 559px), (max-height: 500px) {
  .p-menu, .p-menu.wide { left: 0; right: 0; bottom: 0; width: 100%; max-height: 75vh; border-radius: 14px 14px 0 0; padding-bottom: var(--safe-b); }
  .p-menu-cols { grid-template-columns: 1fr; }
  .p-menu-cols > div + div { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
}

/* up next */
.p-upnext { position: absolute; z-index: 5; right: max(var(--pad), env(safe-area-inset-right)); bottom: calc(110px + var(--safe-b)); display: flex; gap: 14px; align-items: center;
  background: rgba(20,20,24,.95); border-radius: 10px; padding: 12px; width: min(460px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: rise .25s ease both; }
.p-upnext img { width: 40%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--bg-3); }
.upnext-info { flex: 1; min-width: 0; }
.upnext-label { color: var(--muted); font-size: 13px; }
.upnext-title { font-weight: 700; margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upnext-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* error */
.p-error { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(0,0,0,.75); padding: 24px; }
.p-error-box { max-width: 460px; text-align: center; }
.p-error-box h3 { font-size: 22px; margin-bottom: 10px; }
.p-error-box p { color: #ccc; line-height: 1.6; margin-bottom: 20px; }
.p-error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

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