@font-face { font-family: Manrope; src: url(/fonts/Manrope-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-ExtraBold.ttf) format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --accent: #5dc21e;
  --on-accent: #07090d;
  --bg: #07090d;
  --panel: #10141c;
  --panel-2: #171d28;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f6fa;
  --soft: rgba(244, 246, 250, 0.64);
  --faint: rgba(244, 246, 250, 0.36);
  --radius: 14px;
  --pad: 16px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 600 15px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.15; }
h2 { font-size: 17px; }
p { margin: 0; }
b { font-weight: 800; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.soft { color: var(--soft); }
.small { font-size: 13px; }
svg { width: 24px; height: 24px; flex: none; }

/* --- Botones ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 16px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:active { filter: brightness(1.1); }
.btn.wide { width: 100%; }
.btn svg { width: 22px; height: 22px; }
.btn:disabled { opacity: 0.5; }
.icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--text);
}
.icon:active { background: rgba(255, 255, 255, 0.12); }
.link { border: 0; background: none; color: var(--accent); font-weight: 800; padding: 10px 0; }

/* --- Pantallas ------------------------------------------------------------------ */
.screen { min-height: 100vh; padding: calc(var(--top) + 8px) 0 calc(var(--bottom) + 32px); }
.screen.center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding-left: 28px; padding-right: 28px; text-align: center;
}
.screen.center p { max-width: 340px; }
.emblem { width: 96px; height: auto; margin-bottom: 6px; filter: drop-shadow(0 8px 30px color-mix(in srgb, var(--accent) 35%, transparent)); }
.error { color: #ff8a80; max-width: 340px; }

#pairForm, #inviteForm { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 300px; margin-top: 10px; }
#pairForm[hidden], #inviteForm[hidden] { display: none; }
#inviteName {
  width: 100%; height: 56px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--panel); text-align: center; font-size: 20px; font-weight: 700; outline: none;
}
#inviteName:focus { border-color: var(--accent); }
#pairCode {
  width: 100%; height: 64px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--panel); text-align: center; font-size: 32px; font-weight: 800; letter-spacing: 0.18em;
  outline: none;
}
#pairCode:focus { border-color: var(--accent); }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner.big { width: 54px; height: 54px; border-width: 4.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Biblioteca ------------------------------------------------------------------ */
.top { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--pad) 4px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: auto; }
.brand h1 { font-size: 26px; }
#pcVersion { display: block; color: var(--faint); font-size: 11px; margin-top: 1px; }
#pcVersion[hidden] { display: none; }
.searchbar { display: flex; gap: 12px; align-items: center; padding: 6px var(--pad) 2px; }
.searchbar input {
  flex: 1; height: 44px; border-radius: 999px; border: 0; padding: 0 18px;
  background: var(--panel-2); outline: none; font-size: 16px;
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px var(--pad) 6px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 15px; border-radius: 999px; border: 0;
  background: var(--panel-2); color: var(--soft); font-weight: 800; font-size: 14px; white-space: nowrap;
}
.chip.on { background: var(--text); color: var(--bg); }
.chip.sort { margin-left: auto; background: transparent; border: 1.5px solid var(--line); color: var(--soft); }

section h2 { padding: 14px var(--pad) 10px; }
.row { display: flex; gap: 12px; overflow-x: auto; padding: 0 var(--pad) 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.ccard { flex: none; width: 240px; padding: 0; border: 0; background: none; text-align: left; scroll-snap-align: start; }
.cpic {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, var(--c, #1b2333), color-mix(in srgb, var(--c, #1b2333) 45%, #05070b));
}
.cpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpic .playmark {
  position: absolute; left: 10px; bottom: 14px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(5, 7, 11, 0.62); backdrop-filter: blur(6px);
}
.cpic .playmark svg { width: 18px; height: 18px; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 18px 12px; padding: 14px var(--pad) 0;
}
.card { padding: 0; border: 0; background: none; text-align: left; min-width: 0; }
.card:active .poster, .ccard:active .cpic { transform: scale(0.97); }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--c, #1b2333), color-mix(in srgb, var(--c, #1b2333) 40%, #05070b));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.12s ease;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ptitle-fallback {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px;
  font-weight: 800; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere;
}
.badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 7px; border-radius: 6px;
  background: rgba(5, 7, 11, 0.72); font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
}
.badge.ssd { display: flex; align-items: center; padding: 3px 4px; color: #ffd23f; }
.badge.ssd svg { width: 13px; height: 13px; }
.badge + .badge.ssd { left: 40px; }
.tag.ssd { border-color: #ffd23f; color: #ffd23f; }
.badge.dl { top: auto; bottom: 10px; left: 6px; background: var(--accent); color: var(--on-accent); }
.watched {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
}
.watched svg { width: 15px; height: 15px; }
.bar { height: 4px; background: rgba(255, 255, 255, 0.22); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 2px; }
.poster .bar, .cpic .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; }
.ctitle { margin-top: 7px; font-weight: 800; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.csub { color: var(--faint); font-size: 12.5px; }
.empty { padding: 60px 32px; text-align: center; display: flex; flex-direction: column; gap: 8px; }

/* --- Ficha ------------------------------------------------------------------------ */
.sheet {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); animation: rise 0.22s ease;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.hero {
  position: relative; height: min(56vw, 300px); overflow: hidden;
  background: linear-gradient(135deg, var(--c, #1b2333), #05070b);
}
.hero-img { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.hero-img.blur { filter: blur(22px) brightness(0.75); transform: scale(1.2); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.25) 0%, rgba(7, 9, 13, 0) 35%, var(--bg) 100%);
}
.hero .back {
  position: absolute; z-index: 1; top: calc(var(--top) + 10px); left: 10px;
  background: rgba(5, 7, 11, 0.55); backdrop-filter: blur(8px);
}
.detail-body { position: relative; margin-top: -64px; padding: 0 var(--pad) calc(var(--bottom) + 40px); display: flex; flex-direction: column; gap: 14px; z-index: 1; }
.head { display: flex; gap: 14px; align-items: flex-end; }
.dposter { width: 96px; flex: none; }
.dposter .poster { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
.dhead { min-width: 0; padding-bottom: 2px; }
.dhead h1 { font-size: 22px; overflow-wrap: anywhere; }
.meta { color: var(--soft); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { padding: 1px 6px; border-radius: 5px; border: 1.5px solid var(--faint); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: var(--text); }
.note { padding: 12px 14px; border-radius: var(--radius); background: var(--panel); color: var(--soft); font-size: 14px; }
.dprogress { display: flex; align-items: center; gap: 12px; }
.dprogress .bar { flex: 1; }
.options { display: grid; gap: 10px; margin-top: 4px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 0 14px; border-radius: var(--radius); background: var(--panel); min-height: 52px; }
.opt span { color: var(--soft); flex: none; }
.opt select {
  flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; text-align: right; text-align-last: right;
  padding: 0 34px 0 8px; font-weight: 800; font-size: 15px; outline: none; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  text-overflow: ellipsis;
}
.opt select:disabled { opacity: 0.55; }
.opt select option { background: var(--panel-2); color: var(--text); }
.synopsis { color: var(--soft); line-height: 1.6; margin-top: 6px; }
#dWatched { align-self: flex-start; }

/* --- Reproductor ------------------------------------------------------------------- */
.player { position: fixed; inset: 0; z-index: 20; background: #000; overflow: hidden; touch-action: manipulation; }
.player:not(.ui) { cursor: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player video, #tapLayer { touch-action: pan-x pan-y; }  /* (el pellizco cambia la imagen, no hace zoom a la pagina) */
.player .tap { position: absolute; inset: 0; }
.player > .spinner { position: absolute; left: 50%; top: 50%; margin: -27px 0 0 -27px; pointer-events: none; }
.subs {
  position: absolute; left: 5%; right: 5%; text-align: center; pointer-events: none;
  bottom: calc(var(--vid-bottom, 0px) + var(--vid-h, 56vw) * 0.06);
  font-weight: 700; font-size: clamp(14px, calc(var(--vid-h, 56vw) * 0.058), 44px); line-height: 1.25; color: #fff;
  text-shadow: 0 0 4px #000, 0 0 2px #000, 0 2px 3px rgba(0, 0, 0, 0.9);
  transition: bottom 0.2s ease;
}
.player.ui .subs { bottom: max(calc(var(--vid-bottom, 0px) + var(--vid-h, 56vw) * 0.06), calc(var(--bottom) + 92px)); }
.subs .sl { display: block; }
.subs .sl span { background: rgba(0, 0, 0, 0.32); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 0.2em; border-radius: 0.15em; }
.seekhint {
  position: absolute; top: 50%; transform: translateY(-50%); padding: 10px 18px; border-radius: 999px;
  background: rgba(5, 7, 11, 0.6); backdrop-filter: blur(8px); font-weight: 800; font-size: 18px; pointer-events: none;
}
.seekhint.left { left: 12%; }
.seekhint.right { right: 12%; }
.controls {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.78));
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.player.ui .controls { opacity: 1; }
.player.ui .controls button, .player.ui .controls input { pointer-events: auto; }
.ctop { display: flex; align-items: center; gap: 8px; padding: calc(var(--top) + 8px) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
.ptitle { flex: 1; min-width: 0; }
.ptitle > div:first-child { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmid { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 10vw, 72px); }
.icon.big { width: 60px; height: 60px; }
.icon.big svg { width: 38px; height: 38px; }
.icon.huge { width: 78px; height: 78px; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); }
.icon.huge svg { width: 42px; height: 42px; }
.cbot {
  display: flex; align-items: center; gap: 10px;
  padding: 0 max(14px, env(safe-area-inset-right)) calc(var(--bottom) + 14px) max(14px, env(safe-area-inset-left));
}
.time { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 44px; text-align: center; }
#pSeek { flex: 1; min-width: 0; height: 32px; background: transparent; -webkit-appearance: none; appearance: none; }
/* lo visto (acento), lo que ya bajo (verde, --buf) y el resto */
#pSeek::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), transparent var(--p, 0%)), var(--buf, linear-gradient(transparent, transparent)), rgba(255, 255, 255, 0.22); }
#pSeek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
#pSeek::-moz-range-track { height: 5px; border-radius: 3px; background: var(--buf, linear-gradient(transparent, transparent)), rgba(255, 255, 255, 0.22); }
#pSeek::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent); }
#pSeek::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }
#pSubs.off { opacity: 0.45; }
#pVol.off { opacity: 0.45; }
.opt[hidden] { display: none; }
.segs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--panel); margin-right: 6px; flex: none; }
.segs .chip { border: 0; }
.episodes { margin: 14px 0 6px; }
.episodes[hidden] { display: none; }
.eplist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ep { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.ep .epn { font-weight: 800; color: var(--accent); min-width: 34px; }
.ep .ept { flex: 1; min-width: 0; }
.ep .ept b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .ept span { font-size: 12.5px; color: var(--soft); }
.ep .bar { margin-top: 6px; }
.ep svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.ep.next { border-color: var(--accent); }
.pvol {
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: calc(var(--bottom) + 66px);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px;
  background: rgba(20, 22, 28, 0.92); backdrop-filter: blur(8px);
}
.pvol[hidden] { display: none; }
#pVolRange { width: min(200px, 46vw); height: 32px; background: transparent; -webkit-appearance: none; appearance: none; pointer-events: auto; }
#pVolRange::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 100%), rgba(255, 255, 255, 0.28) var(--p, 100%)); }
#pVolRange::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; }
#pVolText { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.pbuf {
  position: absolute; left: 50%; top: calc(50% + 44px); transform: translateX(-50%); pointer-events: none;
  font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); white-space: nowrap;
}
.pbuf[hidden] { display: none; }

.psheet, .perror {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
}
.psheet-box, .perror {
  text-align: left;
}
.psheet-box {
  width: min(420px, 100%); max-height: 100%; overflow-y: auto; padding: 20px; border-radius: 20px; background: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
}
.psheet-box .opt { background: var(--panel-2); }
.perror { align-content: center; justify-items: center; gap: 12px; text-align: center; }
.perror p { max-width: 420px; }
.psheet-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* --- Transmitir a la TV ------------------------------------------------------------ */
.tvbtn svg { width: 22px; height: 22px; }
.topbtns { display: flex; align-items: center; gap: 2px; }
.castbtn.on { color: var(--accent); }
.castbtn.on::after { content: ""; position: absolute; width: 7px; height: 7px; margin: -22px 0 0 26px; border-radius: 50%; background: var(--accent); }
.castbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom) + 12px); z-index: 5; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 16px; border: 0; border-radius: 18px; text-align: left;
  background: color-mix(in srgb, var(--accent) 24%, var(--panel)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.castbar svg { width: 26px; height: 26px; color: var(--accent); }
.castbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.castbar-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.castbar-text span { color: var(--soft); font-size: 13px; }
.castbar-go { font-weight: 800; color: var(--accent); }
#library.hasbar { padding-bottom: calc(var(--bottom) + 100px); }
.pick-tv.here svg { color: var(--soft); }
.pick-tv .check { margin-left: auto; color: var(--accent); width: 22px; height: 22px; }
.pick-tv div { min-width: 0; }
.rvol-level { flex: 1; display: grid; place-items: center; color: var(--soft); font-weight: 800; }
.pick {
  position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; justify-items: center;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); padding: 16px;
}
.pick-box {
  width: min(460px, 100%); padding: 20px 18px calc(var(--bottom) + 14px); border-radius: 22px; background: var(--panel);
  display: flex; flex-direction: column; gap: 10px; animation: rise 0.2s ease;
}
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-tv {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border: 0; border-radius: 16px;
  background: var(--panel-2); text-align: left;
}
.pick-tv svg { width: 26px; height: 26px; color: var(--accent); }
.pick-tv.off svg { color: var(--faint); }
.pick-tv b { display: block; font-size: 16px; }
.pick-tv span { display: block; color: var(--soft); font-size: 13px; }
.remote { display: flex; flex-direction: column; }
.rtop { display: flex; align-items: center; gap: 8px; padding: calc(var(--top) + 8px) 10px 0; position: relative; z-index: 1; }
.rwhere { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--soft); }
.rwhere svg { width: 20px; height: 20px; color: var(--accent); }
.rart {
  position: absolute; left: 0; right: 0; top: 0; height: min(64vw, 340px); background-size: cover; background-position: center 30%;
  opacity: 0.4;
}
.rart::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 9, 13, 0.3), var(--bg)); }
.rbody {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: min(36vw, 190px) var(--pad) calc(var(--bottom) + 28px);
  max-width: 560px; width: 100%; margin: 0 auto;
}
.rbody h1 { font-size: 24px; }
.rstate { color: var(--soft); min-height: 1.45em; }
.rstate.ask { color: var(--text); padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }
.rstate.bad { color: #ffb4ad; }
.rseek { display: flex; align-items: center; gap: 10px; }
#rSeek { flex: 1; min-width: 0; height: 32px; background: transparent; -webkit-appearance: none; appearance: none; }
#rSeek::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(255, 255, 255, 0.22) var(--p, 0%)); }
#rSeek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; }
#rSeek:disabled { opacity: 0.4; }
.rmid { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 10vw, 64px); }
.rmid .icon.huge { background: var(--accent); color: var(--on-accent); }
.rmid button:disabled { opacity: 0.35; }
.rrow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rrow .btn { flex: 1; min-width: 0; gap: 6px; padding: 0 14px; }
.rrow .btn svg { width: 20px; height: 20px; }
.rrow .btn:disabled { opacity: 0.4; }
.rbot { margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 24px); transform: translateX(-50%); z-index: 40;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px; background: var(--panel-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 14px; text-align: center;
}

/* NOVA cerrada: aviso de mantenimiento y "Mis descargas" */
.maint {
  margin: 6px var(--pad) 10px; padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, #ffb547 14%, var(--panel)); border: 1px solid color-mix(in srgb, #ffb547 40%, transparent);
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
}
.maint .mtext { flex: 1 1 240px; }
.maint strong { display: block; font-size: 15px; color: #ffcf85; }
.maint span { color: var(--soft); font-size: 13.5px; line-height: 1.4; }
.maint .mbtns { display: flex; gap: 8px; }
.dlbox {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 46;
  width: min(520px, calc(100% - 24px)); max-height: calc(100% - 48px); overflow: auto;
  padding: 18px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.dlbox .dlhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dlbox .dlhead strong { font-size: 18px; }
.dlbox p { margin: 0 0 12px; }
.dlrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dlrow div { flex: 1; min-width: 0; }
.dlrow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlrow small { color: var(--faint); }
.dlbox .empty { color: var(--soft); padding: 8px 0 14px; }
#dlOther { margin-top: 10px; }
.dlsec { margin: 14px 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.dlprog { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dlprog i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.dlbtn.on { color: var(--accent); }

/* Instalar la app (a las visitas) */
.installbox {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 16px); transform: translateX(-50%); z-index: 45;
  width: min(520px, calc(100% - 24px)); display: grid; grid-template-columns: 52px 1fr; gap: 12px 14px;
  padding: 16px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.installbox img { border-radius: 12px; }
.installbox strong { display: block; font-size: 16px; margin-bottom: 4px; }
.installbox p { margin: 0; color: var(--soft); font-size: 14px; line-height: 1.4; }
.installbox .ibbtns { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
  .detail-body { max-width: 720px; margin-left: auto; margin-right: auto; }
  .dposter { width: 140px; }
  .hero { height: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .controls, .poster, .btn { transition: none; }
}

/* ======================================================================================
   Diseño 2 (cine de noche, superficies de vidrio). Solo lo visual: mismos elementos y
   funciones; estas reglas van al final y reemplazan las de arriba.
   ====================================================================================== */
:root {
  --bg: #06070b;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.085);
  --solid: #12151d;                       /* (cajas sobre todo lo demas) */
  --glass: rgba(16, 19, 27, 0.78);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f5f6fa;
  --soft: rgba(245, 246, 250, 0.68);
  --faint: rgba(245, 246, 250, 0.38);
  --radius: 18px;
  --glow: color-mix(in srgb, var(--accent) 38%, transparent);
}
body {
  background:
    radial-gradient(90% 50% at 0% -8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(80% 40% at 110% 105%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1 { letter-spacing: -0.02em; }

/* Botones: vidrio; el principal, del color de NOVA con su brillo */
.btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; min-height: 50px; }
.btn.primary { border-color: transparent; box-shadow: 0 10px 28px var(--glow); }
.icon:active { background: rgba(255, 255, 255, 0.14); }
.topbtns { gap: 8px; }
.topbtns .icon { width: 42px; height: 42px; background: var(--panel); border: 1px solid var(--line); }
.topbtns .icon svg { width: 21px; height: 21px; }

/* Entrar (codigo, nombre de la visita) */
.screen.center h1 { font-size: 26px; }
.emblem { width: 108px; filter: drop-shadow(0 12px 40px var(--glow)); }
#pairCode, #inviteName {
  border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#pairCode:focus, #inviteName:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

/* Biblioteca: cabecera fija de vidrio */
#library .top {
  position: sticky; top: 0; z-index: 6;
  margin-top: calc(-1 * (var(--top) + 8px)); padding: calc(var(--top) + 12px) var(--pad) 12px;
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.92), rgba(6, 7, 11, 0.72));
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand img { width: 38px; filter: drop-shadow(0 4px 14px var(--glow)); }
.brand h1 { font-size: 27px; }
#pcName { font-size: 12.5px; }
.searchbar { padding-top: 12px; }
.searchbar input { height: 46px; background: var(--panel); border: 1px solid var(--line); }
.searchbar input:focus { border-color: var(--accent); }

/* Filtros */
.chips { gap: 8px; padding: 14px var(--pad) 8px; }
.chip { height: 38px; padding: 0 16px; background: var(--panel); border: 1px solid var(--line); color: var(--soft); font-size: 13.5px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px var(--glow); }
.chip.sort { border: 1px solid var(--line-2); }
.segs { background: var(--panel); border: 1px solid var(--line); }
.segs .chip { background: transparent; box-shadow: none; }
.segs .chip.on { background: var(--text); color: var(--bg); box-shadow: none; }

/* Seguir viendo */
section h2 { display: flex; align-items: center; gap: 10px; padding: 18px var(--pad) 12px; font-size: 18px; }
section h2::before { content: ""; width: 4px; height: 17px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--glow); }
.row { gap: 14px; }
.ccard { width: 268px; }
.cpic { border-radius: 16px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cpic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.6)); pointer-events: none; }
.cpic .playmark { z-index: 1; left: 12px; bottom: 18px; width: 38px; height: 38px; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px var(--glow); }
.cpic .bar { z-index: 1; left: 12px; right: 12px; bottom: 9px; }
.ccard .ctitle { margin-top: 9px; }

/* Cuadricula de carteles */
.grid { gap: 22px 12px; padding-top: 16px; }
.poster {
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.card:active .poster, .ccard:active .cpic { transform: scale(0.96); }
.ctitle { margin-top: 8px; font-size: 13px; font-weight: 700; }
.csub { font-size: 12px; margin-top: 1px; }
.badge {
  top: 7px; left: 7px; padding: 3px 7px; border-radius: 8px; font-size: 10.5px;
  background: rgba(6, 7, 11, 0.58); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.badge + .badge.ssd { left: 44px; }
.badge.dl { border-color: transparent; box-shadow: 0 4px 12px var(--glow); }
.watched { top: 7px; right: 7px; box-shadow: 0 4px 12px var(--glow); }
.bar { height: 4px; background: rgba(255, 255, 255, 0.2); }
.bar > div { box-shadow: 0 0 8px var(--glow); }

/* Ficha */
.hero { height: min(82vw, 440px); }
.hero::after {
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.35) 0%, rgba(6, 7, 11, 0) 30%, rgba(6, 7, 11, 0.55) 65%, var(--bg) 100%);
}
.hero .back {
  width: 42px; height: 42px; background: rgba(6, 7, 11, 0.5); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.detail-body { margin-top: -110px; gap: 16px; }
.head { gap: 16px; }
.dposter { width: 110px; }
.dposter .poster { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.dhead h1 { font-size: 25px; line-height: 1.12; }
.meta { gap: 7px; margin-top: 7px; font-size: 13.5px; }
.tag { padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel); }
.detail-body > .btn.primary, .detail-body .btn.primary { min-height: 56px; font-size: 17px; border-radius: 18px; }
.note { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; }
.opt { border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-height: 54px; }
.opt select { height: 54px; }
.opt select option { background: var(--solid); }
.synopsis { line-height: 1.65; font-size: 14.5px; }
.ep { border-radius: 16px; background: var(--panel); padding: 13px 14px; }
.ep.next { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

/* Reproductor: barra de abajo de vidrio, seek mas visible */
.ctop { padding-top: calc(var(--top) + 10px); }
.ptitle > div:first-child { font-size: 18px; letter-spacing: -0.01em; }
.player .controls .icon { border-radius: 999px; }
.icon.huge {
  width: 82px; height: 82px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}
.icon.big { background: rgba(255, 255, 255, 0.06); }
.cbot {
  gap: 6px; padding: 6px 10px;
  margin: 0 max(10px, env(safe-area-inset-right)) calc(var(--bottom) + 12px) max(10px, env(safe-area-inset-left));
  border-radius: 22px; background: rgba(12, 14, 20, 0.55); border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
}
.cbot .icon { width: 40px; height: 40px; }
.cbot .icon svg { width: 22px; height: 22px; }
#pSeek::-webkit-slider-runnable-track { height: 6px; }
#pSeek::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; box-shadow: 0 0 0 5px var(--glow), 0 1px 4px rgba(0, 0, 0, 0.5); }
#pSeek::-moz-range-track, #pSeek::-moz-range-progress { height: 6px; }
.pvol { bottom: calc(var(--bottom) + 80px); border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(12, 14, 20, 0.75); }
.seekhint { border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(6, 7, 11, 0.5); }
.psheet, .perror { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.psheet-box {
  border-radius: 24px; padding: 22px; background: var(--glass); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.psheet-box .opt { background: rgba(255, 255, 255, 0.06); }

/* Cajas y avisos: el mismo vidrio */
.toast {
  border-radius: 999px; padding: 12px 20px; background: var(--glass); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
#library.hasbar ~ .toast { bottom: calc(var(--bottom) + 88px); }
.castbar {
  border-radius: 22px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, rgba(14, 16, 23, 0.86));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.pick { background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pick-box { border-radius: 26px; background: var(--glass); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.pick-tv { border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.maint {
  border-radius: 18px; background: color-mix(in srgb, #ffb547 12%, rgba(16, 19, 27, 0.8));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.dlbox, .installbox {
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 24px;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.dlrow { border-top-color: var(--line); }
.dlprog i { box-shadow: 0 0 8px var(--glow); }
.dlbtn.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.castbtn.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.castbtn.on::after { display: none; }

/* En el telefono: "Descargas" sube desde abajo, como una hoja */
@media (max-width: 699px) {
  .dlbox {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; max-height: 84vh;
    border-radius: 26px 26px 0 0; border-bottom: 0; padding: 26px 18px calc(var(--bottom) + 18px);
    animation: rise 0.22s ease;
  }
  .dlbox::before {
    content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 2px; background: var(--line-2);
  }
}

/* Control de la TV */
.rmid .icon.huge { box-shadow: 0 12px 34px var(--glow); border-color: transparent; }
.rrow .btn { border-radius: 16px; }
#rSeek::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--glow); }

/* ======================================================================================
   Ficha (diseño 3): la imagen de la película detrás de todo. En el teléfono, arriba y el
   cartel montado encima; en tablet y PC (y el teléfono de lado), el cartel a la izquierda y
   todo lo demás a la derecha, como en la TV. Va al final: reemplaza lo de arriba.
   ====================================================================================== */
.dback {
  position: fixed; z-index: 12; top: calc(var(--top) + 12px); left: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(6, 7, 11, 0.5); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.dback svg { width: 22px; height: 22px; }
.hero {
  position: relative; height: min(64vw, 360px); overflow: hidden;
  background: radial-gradient(120% 90% at 70% 0%, color-mix(in srgb, var(--c, #1b2333) 70%, transparent), transparent 70%), var(--bg);
}
.hero-img { position: absolute; inset: 0; background-size: cover; background-position: center 22%; }
.hero-img.blur { filter: blur(30px) saturate(1.15) brightness(0.8); transform: scale(1.25); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.55) 0%, rgba(6, 7, 11, 0) 28%, rgba(6, 7, 11, 0) 46%,
                              rgba(6, 7, 11, 0.72) 76%, var(--bg) 100%);
}

.detail-body {
  position: relative; z-index: 1; display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 18px 16px;
  max-width: none; margin: -92px 0 0; padding: 0 var(--pad) calc(var(--bottom) + 44px);
}
.dposter { grid-column: 1; grid-row: 1; width: auto; align-self: end; }
.dposter .poster {
  border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.dmain { display: contents; }
.dmain > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
.dmain > .dhead { grid-column: 2; grid-row: 1; align-self: end; padding-bottom: 2px; }
.dhead h1 { font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.meta { margin-top: 8px; gap: 6px 8px; font-size: 13.5px; color: var(--soft); }
.tag {
  padding: 2px 8px; border-radius: 7px; font-size: 11px; letter-spacing: 0.05em; color: var(--text);
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-2);
}
.dgenre { margin-top: 6px; font-size: 13.5px; color: var(--faint); }
.dprogress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--soft); }
.dprogress .bar { flex: 1; height: 5px; border-radius: 3px; }
.dprogress span { white-space: nowrap; }

.dactions { display: flex; flex-wrap: wrap; gap: 10px; }
.dactions .btn { flex: 1 1 210px; min-height: 50px; padding: 0 16px; border-radius: 16px; font-size: 15.5px; }
.dactions .btn.primary { flex-basis: 100%; min-height: 56px; border-radius: 18px; font-size: 17px; }
.dactions .btn svg { width: 21px; height: 21px; }

.synopsis { color: rgba(245, 246, 250, 0.82); font-size: 15px; line-height: 1.65; }
.dmain > .ddirector { margin-top: -8px; font-size: 13.5px; color: var(--faint); }
.options { display: grid; gap: 10px; }
.episodes { margin: 0; }
.eplist { margin-top: 10px; }
.dlinks { display: flex; flex-wrap: wrap; gap: 10px; }
.dlink {
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--soft); font-weight: 700; font-size: 13.5px;
}
.dlink:active { background: var(--panel-2); color: var(--text); }

/* Tablet, PC o el teléfono de lado: dos columnas sobre la imagen de la película */
@media (min-width: 860px) {
  .hero { position: fixed; inset: 0; height: auto; z-index: 0; }
  .hero-img { opacity: 0.62; background-position: center 18%; }
  .hero-img.blur { opacity: 0.45; filter: blur(48px) saturate(1.2); transform: scale(1.3); }
  .hero::after {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(6, 7, 11, 0.9) 34%, rgba(6, 7, 11, 0.55) 64%, rgba(6, 7, 11, 0.32) 100%),
      linear-gradient(0deg, var(--bg) 0%, rgba(6, 7, 11, 0) 42%),
      linear-gradient(180deg, rgba(6, 7, 11, 0.6) 0%, rgba(6, 7, 11, 0) 22%);
  }
  .dback { top: calc(var(--top) + 20px); left: 20px; width: 48px; height: 48px; }
  .detail-body {
    grid-template-columns: clamp(200px, 23vw, 300px) minmax(0, 1fr); column-gap: clamp(32px, 4.5vw, 64px); row-gap: 0;
    align-items: start; max-width: 1200px; min-height: 100vh; margin: 0 auto;
    padding: calc(var(--top) + 96px) clamp(28px, 5vw, 72px) calc(var(--bottom) + 64px);
  }
  .dposter { position: sticky; top: calc(var(--top) + 96px); align-self: start; }
  .dposter .poster {
    border-radius: 18px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  .dmain { display: flex; flex-direction: column; gap: 20px; grid-column: 2; grid-row: 1; }
  .dmain > .dhead { padding: 0; align-self: stretch; }  /* (en columna, "end" lo mandaba a la derecha) */
  .dhead h1 { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.04; }
  .meta { margin-top: 12px; gap: 8px 10px; font-size: 15px; }
  .tag { padding: 3px 9px; font-size: 12px; }
  .dgenre { margin-top: 8px; font-size: 15px; }
  .dprogress { max-width: 560px; font-size: 14px; }
  .dactions { gap: 12px; }
  .dactions .btn { flex: 0 0 auto; min-height: 52px; padding: 0 24px; }
  .dactions .btn.primary { flex: 0 0 auto; min-width: 240px; min-height: 56px; padding: 0 30px; }
  .synopsis { max-width: 70ch; font-size: 16px; line-height: 1.7; }
  .dmain > .ddirector { font-size: 14.5px; }
  /* Calidad, Audio y Subtitulos: tres cuadros lado a lado, el nombre arriba y lo elegido abajo */
  .options { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; max-width: 820px; }
  .opt {
    flex-direction: column; align-items: stretch; justify-content: center; gap: 1px;
    min-height: 66px; padding: 9px 14px 5px; border-radius: 16px;
  }
  .opt span { font-size: 12px; letter-spacing: 0.02em; }
  .opt select {
    flex: none; width: 100%; height: 30px; padding: 0 24px 0 0; text-align: left; text-align-last: left; font-size: 15px;
    background-position: calc(100% - 10px) 50%, calc(100% - 5px) 50%;
  }
  .episodes { max-width: 820px; }
  .episodes .opt { max-width: 340px; }
  .eplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
}
/* Tablet parada: el cartel más grande y todo al centro */
@media (min-width: 600px) and (max-width: 859px) {
  .detail-body {
    grid-template-columns: 150px minmax(0, 1fr); gap: 20px 22px; max-width: 760px; margin: -130px auto 0;
    padding-left: 28px; padding-right: 28px;
  }
  .hero { height: 380px; }
  .dhead h1 { font-size: 32px; }
  .options { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* ======================================================================================
   Fluidez (tablets y teléfonos, para que el scroll vaya a 60 cuadros por segundo): nada que se
   tenga que volver a pintar en cada cuadro.
   - El fondo con brillo va en una capa fija aparte: como fondo "fixed" del body, el navegador
     repintaba toda la pantalla en cada cuadro del scroll.
   - Sin desenfocar lo de atrás (backdrop-filter) en lo que está en pantalla mientras se hace
     scroll (la barra de arriba, las etiquetas de los carteles, la barra de transmitir, el botón
     de volver): con un fondo casi sólido se ve igual y no se recalcula en cada cuadro.
   - Sombras de los carteles más livianas (se dibujan cada vez que aparece una fila nueva).
   ====================================================================================== */
html { background: var(--bg); }
body { background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 50% at 0% -8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(80% 40% at 110% 105%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
  will-change: transform;
}
#library .top {
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.97), rgba(6, 7, 11, 0.9));
  -webkit-backdrop-filter: none; backdrop-filter: none; will-change: transform;
}
.badge { background: rgba(6, 7, 11, 0.8); -webkit-backdrop-filter: none; backdrop-filter: none; }
.castbar { background: color-mix(in srgb, var(--accent) 16%, rgb(14, 16, 23)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.dback { background: rgba(6, 7, 11, 0.74); -webkit-backdrop-filter: none; backdrop-filter: none; }
.poster { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.07); }
.cpic { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.dposter .poster { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.sheet { will-change: scroll-position; }
@media (min-width: 860px) {
  .hero { will-change: transform; }  /* (la imagen de fondo, fija: en su capa, se pinta una vez) */
  .dposter .poster { box-shadow: 0 24px 54px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
}

/* --- Varios NOVA en la casa: "En <PC>" (arriba) abre la lista para cambiar de NOVA ---------------- */
.pcname {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; margin: 0; padding: 2px 0;
  border: 0; background: none; color: var(--soft); text-align: left;
}
.pcname:disabled { cursor: default; color: var(--soft); }
.pcname span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcname .chev { display: none; flex: none; width: 15px; height: 15px; color: var(--accent); }
.pcname.switch .chev { display: block; }
.others { width: min(420px, 100%); }
.pick-tv:disabled { cursor: default; }
.pick-tv.off b { color: var(--soft); }

/* --- Otros NOVA: buscar en la red o agregar con su direccion ------------------------------------ */
#serverPick .pick-box { max-height: calc(100dvh - 32px); overflow-y: auto; }
.srv-tools { display: flex; flex-direction: column; gap: 8px; }
.srv-tools[hidden] { display: none; }
.srv-tools .btn { min-height: 46px; }
.srv-add { display: flex; gap: 8px; }
.srv-add input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel-2); font-size: 16px; outline: none;
}
.srv-add input:focus { border-color: var(--accent); }
#serverAddErr { margin: 0; font-size: 13px; }
