/* Velvet TV web: estilo de la web de Netflix, responsive de 1920 (TV/PC) a celular.
   Fluidez: solo se anima transform y opacity; las filas se deslizan con el scroll nativo (compositor). */
@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url(../fonts/dmsans_400.ttf) format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url(../fonts/dmsans_500.ttf) format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url(../fonts/dmsans_700.ttf) format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 800; font-display: swap; src: url(../fonts/dmsans_800.ttf) format('truetype'); }

:root {
  --bg: #141414; --bg2: #181818; --bg3: #232323; --line: rgba(255,255,255,.14);
  --text: #fff; --soft: #e5e5e5; --muted: #a3a3a3; --dim: #777;
  --accent: #E50914; --brand: #E0233F; --green: #46d369;
  --pad: 4vw; --gap: .4vw; --n: 6; --head: 68px; --radius: 4px;
  --cw: calc((100vw - 2 * var(--pad) - (var(--n) - 1) * var(--gap)) / (var(--n) + .25));
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: dark;
}
@media (max-width: 1400px) { :root { --n: 5; } }
@media (max-width: 1100px) { :root { --n: 4; --gap: .6vw; } }
@media (max-width: 800px) { :root { --n: 3; } }
@media (max-width: 900px) { :root { --head: 56px; } }
@media (min-width: 2200px) { :root { --n: 7; } }

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.4 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; min-height: 100vh; }
body.layer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; }
.ic { width: 24px; height: 24px; flex: none; display: block; }
.ic.rot90 { transform: rotate(90deg); }
code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; font-size: .9em; word-break: break-all; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus { outline: none; }
[hidden] { display: none !important; }
body.kbd :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- arranque ---------- */
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .3s; }
#boot img { width: 180px; opacity: .95; }
body:not(.booting) #boot { opacity: 0; pointer-events: none; }

/* ---------- encabezado ---------- */
#header { position: fixed; z-index: 30; left: 0; right: 0; top: 0; height: var(--head); display: flex; align-items: center; padding: 0 var(--pad);
  background: linear-gradient(180deg, rgba(0,0,0,.75) 10%, transparent); transition: background-color .4s; }
body.scrolled #header { background-color: var(--bg); }
.brand img { height: 26px; width: auto; }
.nav { display: flex; gap: 20px; margin-left: 46px; }
.nav a { font-size: 14px; color: var(--soft); transition: color .3s; white-space: nowrap; }
.nav a:hover { color: #b3b3b3; }
.nav a.active { color: #fff; font-weight: 700; }
.hright { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.hicon { display: flex; padding: 4px; }
.hicon.active, .hicon:hover { color: #fff; }
.hsearch { display: flex; align-items: center; border: 1px solid transparent; height: 36px; padding: 0 6px; transition: background-color .2s, border-color .2s; }
#header .hsearch input { width: 0; border-radius: 0; padding: 0; border: 0; background: transparent; outline: none; font-size: 14px; transition: width .25s var(--ease), padding .25s; }
.hsearch.open { background: rgba(0,0,0,.75); border-color: #fff; }
#header .hsearch.open input { width: 230px; padding: 0 6px; }
.hsearch input::-webkit-search-cancel-button { filter: invert(1); }
.hs-btn { display: flex; }
#chips { display: none; }
#tabbar { display: none; }
@media (max-width: 1000px) { .nav { gap: 14px; margin-left: 28px; } }
@media (max-width: 900px) {
  .nav { display: none; }
  .hsearch { display: none; }
  .brand img { height: 22px; }
  #chips { display: flex; position: fixed; z-index: 29; top: var(--head); left: 0; right: 0; gap: 8px; padding: 2px var(--pad) 10px; transition: transform .3s var(--ease), opacity .3s;
    background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); }
  body.scrolled #chips { transform: translate3d(0,-110%,0); opacity: 0; pointer-events: none; }
  body.page-other #chips { display: none; }
  .chip { border: 1px solid rgba(255,255,255,.55); border-radius: 18px; padding: 5px 14px; font-size: 14px; font-weight: 500; background: rgba(0,0,0,.25); }
  .chip.active { background: #fff; color: #000; border-color: #fff; }
  #tabbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: rgba(18,18,18,.97); border-top: 1px solid rgba(255,255,255,.08);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: #9a9a9a; }
  #tabbar a.active { color: #fff; }
  #tabbar .ic { width: 24px; height: 24px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.player-open #tabbar { display: none; }
}

/* ---------- páginas ---------- */
#pages { min-height: 100vh; }
.page { padding-bottom: 60px; }
.page-head { padding: calc(var(--head) + 28px) var(--pad) 8px; }
.page-title { font-size: clamp(26px, 3.2vw, 44px); font-weight: 800; margin: 0; letter-spacing: -.01em; }
.page-logo { height: clamp(40px, 6vw, 90px); width: auto; }
.page-head .note { color: var(--muted); margin: 6px 0 0; }
@media (max-width: 900px) { .page-head { padding-top: calc(var(--head) + 46px); } }
.empty { padding: 40px var(--pad); color: var(--muted); font-size: 18px; text-align: center; line-height: 1.6; }
.empty:empty { display: none; }
.empty b { color: #fff; }
.empty a { color: #fff; text-decoration: underline; }
.empty span { font-size: 15px; }
.empty .ic { display: inline-block; vertical-align: -6px; width: 22px; height: 22px; }

/* ---------- billboard ---------- */
/* Cuánto suben las filas sobre el billboard: menos en ventanas anchas y bajas (Safari sin pantalla completa). */
:root { --bb-over: min(8.5vw, 15vh); }
.billboard { position: relative; height: 56.25vw; max-height: 85vh; min-height: 420px; overflow: hidden; background: var(--bg); container-type: size; }
.bb-media { position: absolute; inset: 0; cursor: pointer; overflow: hidden; container-type: size; }
.bb-img { position: absolute; inset: 0; background: #111 50% 22%/cover no-repeat; opacity: 0; transition: opacity .6s; }
.bb-img.loaded { opacity: 1; }
/* Tráiler: cubre el recuadro como una imagen (cover) y se agranda 1,3× para recortar el título y el logo de
   YouTube. Invisible y sin clics hasta que YouTube avisa que ya reproduce; nunca se ve su interfaz. */
.yt-host { position: absolute; left: 50%; top: 50%; width: max(100cqw, 177.78cqh); height: max(100cqh, 56.25cqw);
  transform: translate(-50%,-50%) scale(1.3); opacity: 0; transition: opacity .5s; pointer-events: none; }
.yt-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.yt-host.on { opacity: 1; }
.bb-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(77deg, rgba(0,0,0,.62) 0, rgba(0,0,0,.2) 46%, transparent 70%), linear-gradient(180deg, transparent 48%, rgba(20,20,20,.45) 66%, rgba(20,20,20,.85) 78%, var(--bg) 86%); }
/* El texto se apoya sobre las filas que suben (8,5vw) y nunca toca el encabezado. */
.bb-info { position: absolute; left: var(--pad); bottom: calc(var(--bb-over) + min(2.6vw, 4vh)); width: 40%; min-width: 320px; }
.bb-logo { transform-origin: 0 100%; transition: transform 1.2s var(--ease); }
.bb-logo img { max-width: 100%; max-height: min(11vw, 18cqh); width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.bb-title { font-size: clamp(32px, 4.4vw, 72px); font-weight: 800; line-height: 1; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.bb-rank { display: flex; align-items: center; gap: 10px; margin-top: 1.2vw; font-size: clamp(14px, 1.45vw, 24px); font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.bb-rank.note { color: #fff; }
.bb-meta { margin-top: .8vw; color: var(--soft); font-size: clamp(13px, 1vw, 17px); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.bb-meta i, .pv-genres i, .s-sugg i { font-style: normal; margin: 0 8px; color: #777; }
.bb-desc { font-size: clamp(14px, 1.25vw, 21px); line-height: 1.35; margin: .8vw 0 0; text-shadow: 0 1px 4px rgba(0,0,0,.7);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: opacity .8s, transform .8s var(--ease); }
.bb-actions { display: flex; gap: 12px; margin-top: 1.6vw; align-items: center; }
/* El texto cabe siempre entre el encabezado y las filas: con poco alto, menos líneas y sin lo secundario. */
@container (max-height: 760px) { .bb-desc { -webkit-line-clamp: 2; } .bb-rank { margin-top: 8px; } .bb-meta { margin-top: 6px; } .bb-actions { margin-top: 14px; } }
@container (max-height: 600px) { .bb-desc { display: none; } }
@container (max-height: 500px) { .bb-rank, .bb-meta { display: none; } }
.billboard.trailer-on .bb-desc, .billboard.trailer-on .bb-meta { opacity: 0; transform: translate3d(0,12px,0); }
.billboard.trailer-on .bb-logo { transform: scale(.72); }
.billboard.trailer-on .bb-rank { opacity: 0; transition: opacity .8s; }
.bb-side { position: absolute; right: 0; bottom: calc(var(--bb-over) + min(3.4vw, 5vh)); display: flex; align-items: center; gap: 14px; }
.age-flag { background: rgba(51,51,51,.6); border-left: 3px solid #dcdcdc; padding: 6px 60px 6px 12px; font-size: clamp(14px, 1.1vw, 18px); }
.billboard .mylist-m { display: none; }
.billboard.loading .bb-info { opacity: 0; }

/* Tablet: más alto, para que el texto no choque con el encabezado. */
@media (max-width: 900px) and (min-width: 600px) {
  .billboard { height: 78vw; max-height: 82vh; }
  .bb-info { width: 62%; }
  .bb-logo img { max-height: 18vw; }
}

/* Celular: póster vertical como la app de Netflix. */
.billboard.portrait { container-type: normal; height: auto; max-height: none; min-height: 0; overflow: visible; background: none; padding: calc(var(--head) + 44px) var(--pad) 8px; }
.billboard.portrait .bb-media { position: relative; aspect-ratio: 2/3; max-height: 72vh; margin: 0 auto; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.billboard.portrait .bb-shade { position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--head) + 44px); bottom: 8px; margin: 0 auto; max-height: 72vh; aspect-ratio: 2/3;
  border-radius: 10px; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.85)); }
.billboard.portrait .bb-info { left: 0; right: 0; bottom: 26px; width: auto; min-width: 0; padding: 0 calc(var(--pad) + 16px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.billboard.portrait .bb-logo img { max-height: 90px; max-width: 70%; margin: 0 auto; }
.billboard.portrait .bb-desc, .billboard.portrait .bb-rank, .billboard.portrait .bb-side { display: none; }
.billboard.portrait .bb-meta { margin-top: 10px; }
.billboard.portrait .bb-actions { width: 100%; max-width: 360px; }
.billboard.portrait .bb-actions .btn { flex: 1; justify-content: center; }
.billboard.portrait .btn.info { display: none; }
.billboard.portrait .mylist-m { display: inline-flex; flex: 1; justify-content: center; }
.billboard.portrait .bb-logo { display: none; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; border-radius: var(--radius); padding: .55em 1.5em .55em 1.2em; font-size: clamp(14px, 1.15vw, 19px); font-weight: 700;
  background: rgba(109,109,110,.7); color: #fff; transition: background-color .2s, transform .15s; white-space: nowrap; }
.btn:hover { background: rgba(109,109,110,.45); }
.btn:active { transform: scale(.97); }
.btn .ic { width: 1.5em; height: 1.5em; }
.btn.play, .btn.primary { background: #fff; color: #000; }
.btn.play:hover, .btn.primary:hover { background: rgba(255,255,255,.75); }
.btn.primary.red { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.4); }
.btn.danger { background: transparent; border: 1px solid #b0303a; color: #ff8a8a; }
.btn.disabled { opacity: .6; cursor: default; }
.btn small { font-weight: 500; opacity: .75; margin-left: 4px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.file { cursor: pointer; }
.round { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: rgba(42,42,42,.6); border: 2px solid rgba(255,255,255,.55); color: #fff; transition: border-color .2s, background-color .2s, transform .15s; }
.round:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.round.sm { width: 34px; height: 34px; }
.round.sm .ic { width: 20px; height: 20px; }
.round.white { background: #fff; color: #000; border-color: #fff; }
.round.white:hover { background: #e6e6e6; }
.round.outline { background: rgba(42,42,42,.6); }
.round.on { background: rgba(255,255,255,.18); border-color: #fff; }
.round[disabled] { opacity: .3; cursor: default; }

/* ---------- filas ---------- */
.rows { position: relative; z-index: 2; margin-top: calc(-1 * var(--bb-over)); }
.mode-platform .rows, .mode-genre .rows, .mode-mylist .rows { margin-top: 0; }
@media (max-width: 600px) { .rows { margin-top: 4px; } }
.row { position: relative; margin: 0 0 3vw; contain: layout style; }
.row-title { font-size: clamp(16px, 1.4vw, 24px); font-weight: 700; margin: 0 var(--pad) .55em; color: var(--soft); }
.slider { position: relative; }
.track { display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; padding: 0 var(--pad); scroll-padding: 0 var(--pad); scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.track::-webkit-scrollbar { display: none; }
.track > * { scroll-snap-align: start; flex: none; }
.row.kind-cards .track { min-height: calc(var(--cw) * .5625); }
.row.top10 .track { min-height: calc(var(--cw) * .82); }
.row.skeleton .track { background: linear-gradient(90deg, transparent var(--pad), rgba(255,255,255,.04) var(--pad), rgba(255,255,255,.04) calc(100% - var(--pad)), transparent 0); }
.arrow { position: absolute; z-index: 3; top: 0; bottom: 0; width: calc(var(--pad) - var(--gap)); display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,20,.5); color: #fff; opacity: 0; transition: opacity .2s, background-color .2s; }
.arrow .ic { width: 38px; height: 38px; transition: transform .2s; }
.arrow:hover { background: rgba(20,20,20,.75); }
.arrow:hover .ic { transform: scale(1.25); }
.arrow.prev { left: 0; border-radius: 0 4px 4px 0; }
.arrow.next { right: 0; border-radius: 4px 0 0 4px; }
@media (hover: hover) and (pointer: fine) { .row:hover .arrow { opacity: 1; } }
.row.at-start .arrow.prev, .row.at-end .arrow.next { opacity: 0 !important; pointer-events: none; }
@media (hover: none), (pointer: coarse) { .arrow { display: none; } .track { scroll-snap-type: x proximity; } }
.row.season { padding: 2vw 0 1vw; margin-bottom: 2vw; }
.row.season:before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,20,.95) 20%, rgba(20,20,20,.55)), var(--season-img) center 30%/cover;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 75%, transparent); mask-image: linear-gradient(180deg, transparent, #000 35%, #000 75%, transparent); }
.row.season .row-title { position: relative; color: #ff5a4f; font-size: clamp(18px, 1.7vw, 28px); }

/* ---------- tarjetas ---------- */
.card { position: relative; display: block; width: var(--cw); border-radius: var(--radius); transition: transform .25s var(--ease), opacity .2s; }
.card.meta { aspect-ratio: 16/9; overflow: hidden; background: #2a2a2a; }
.card .art { position: absolute; inset: 0; display: block; }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card.noart .art img { object-position: center 20%; }
.clogo { position: absolute; left: 7%; bottom: 9%; width: 58%; height: 40%; display: flex; align-items: flex-end; pointer-events: none; }
.clogo img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 1px 4px rgba(0,0,0,.65)); }
.ctext { font-weight: 800; font-size: clamp(13px, calc(var(--cw) / 13), 22px); line-height: 1.1; text-shadow: 0 1px 6px rgba(0,0,0,.9);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.meta:after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55)); pointer-events: none; }
.card.meta > span:not(.art) { z-index: 1; }
.ctop { position: absolute; right: 0; top: 0; }
.ctop .top10-chip { width: 26px; height: 30px; font-size: 8px; border-radius: 0 0 0 3px; }
.cnote { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 3px 3px 0 0; white-space: nowrap; }
.cep { position: absolute; left: 7%; top: 8%; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 3px; }
.cprog { position: absolute; left: 7%; right: 7%; bottom: 6%; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; display: block; }
.cprog i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; }
.card.meta:has(.cprog) .clogo { bottom: 16%; }
.card.meta:has(.cnote) .clogo { bottom: 20%; height: 34%; }
@media (hover: hover) and (pointer: fine) { .card.meta:hover, .card.t10:hover { transform: scale(1.03); } }
.card.previewing { opacity: .4; }
body.kbd .card:focus-visible { transform: scale(1.06); outline: 3px solid #fff; outline-offset: 1px; z-index: 2; }
.top10-chip { display: inline-flex; align-items: center; justify-content: center; text-align: center; width: 30px; height: 34px; border-radius: 3px; background: var(--accent);
  color: #fff; font-size: 9px; font-weight: 800; line-height: 1.05; letter-spacing: .02em; flex: none; }

/* Celular: pósters verticales (tres por pantalla, como la app de Netflix). */
@media (max-width: 599px) {
  :root { --n: 3.1; --pad: 12px; --gap: 7px; }
  .card.pcard { aspect-ratio: 2/3; }
  .card.pcard:after { display: none; }
  .row.kind-cards .track { min-height: calc(var(--cw) * 1.5); }
  .row.top10 .track { min-height: calc(var(--cw) * 1.5); }
  .card.t10 { width: calc(var(--cw) * 1.5); aspect-ratio: auto; height: calc(var(--cw) * 1.5); }
  .card.t10 .num { font-size: calc(var(--cw) * 1.3); }
  .card.t10 .num.n10 { font-size: calc(var(--cw) * .95); }
  .card.t10 .art { flex: none; width: var(--cw); }
  .card.t10 .num { width: auto; flex: 1; }
  .cnote { font-size: 9px; padding: 1px 5px; }
  .ctop .top10-chip { width: 20px; height: 24px; font-size: 7px; }
  .cep { font-size: 10px; left: 6px; top: 6px; }
  .row-title { font-size: 17px; }
  .row { margin-bottom: 20px; }
  .card.genre, .card.platform { width: calc(var(--cw) * 1.3); }
}

/* Top 10: número grande con borde y póster, como Netflix. */
.card.t10 { display: flex; align-items: flex-end; aspect-ratio: 1/.82; }
.card.t10 .num { flex: none; width: 48%; font-weight: 800; font-size: calc(var(--cw) * .82); line-height: .78; letter-spacing: -.08em; color: var(--bg);
  -webkit-text-stroke: max(2px, calc(var(--cw) * .012)) #595959; text-align: right; margin-right: -2%; font-feature-settings: "tnum" 0; position: relative; z-index: 0; }
.card.t10 .num.n10 { font-size: calc(var(--cw) * .62); letter-spacing: -.12em; width: 52%; }
.card.t10 .art { position: relative; flex: 1; height: 100%; border-radius: var(--radius); overflow: hidden; background: #2a2a2a; z-index: 1; }
.card.t10 .art img { width: 100%; height: 100%; object-fit: cover; }

/* Categorías y plataformas. */
.row.kind-genres .track { min-height: calc(var(--cw) * .42); }
.card.genre, .card.platform { aspect-ratio: 2.2/1; display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #2c2c33, #1d1d22); border: 1px solid rgba(255,255,255,.06); transition: transform .25s var(--ease), background-color .2s; }
.card.platform { background: linear-gradient(135deg, #24242b, #18181c); }
.card.platform img { max-width: 58%; max-height: 52%; object-fit: contain; }
.card.genre span { font-size: clamp(15px, calc(var(--cw) / 10), 26px); text-align: center; padding: 0 10px; }
@media (hover: hover) and (pointer: fine) { .card.genre:hover, .card.platform:hover { transform: scale(1.04); background: #33333c; } }
.gs0 { font-weight: 700; display: inline-block; transform: scaleX(.86); }
.gs1 { font-family: Georgia, serif; font-weight: 700; letter-spacing: .03em; }
.gs2 { font-weight: 800; }
.gs3 { font-weight: 400; letter-spacing: .2em; }
.gs4 { font-style: italic; font-weight: 500; letter-spacing: .06em; display: inline-block; transform: scaleX(.86); }
.gs5 { font-weight: 500; letter-spacing: .12em; }

/* Grillas (Mi lista, búsqueda). */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(150px, calc(var(--cw) * .92)), 1fr)); gap: calc(var(--gap) * 2.4) var(--gap); padding: 0 var(--pad); }
.grid .card { width: auto; }
.grid-title { font-size: clamp(16px, 1.4vw, 24px); margin: 2.4em var(--pad) .6em; color: var(--soft); }

/* ---------- vista previa ---------- */
.preview { position: absolute; z-index: 25; border-radius: 6px; overflow: hidden; background: var(--bg2); box-shadow: 0 6px 24px rgba(0,0,0,.75); will-change: transform; }
.pv-media { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #111; container-type: size; }
.pv-img { position: absolute; inset: 0; background: center/cover no-repeat; }
.pv-logo { position: absolute; left: 6%; bottom: 8%; width: 52%; height: 36%; display: flex; align-items: flex-end; transition: opacity .5s; }
.pv-logo img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.pv-media.playing .pv-logo { opacity: .85; }
.pv-mute { position: absolute; right: 10px; z-index: 2; }
.pv-body { padding: 14px 16px 18px; }
.pv-btns { display: flex; gap: 8px; align-items: center; }
.pv-btns .more { margin-left: auto; }
.pv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--soft); }
.score { color: var(--green); font-weight: 700; }
/* Notas reales (como RatingSpans de Android): insignia amarilla de IMDb y el tomate de Rotten Tomatoes. */
.rt { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; white-space: nowrap; }
.rt-line { display: inline-flex; flex-wrap: wrap; }
.rt-imdb { background: #F5C518; color: #000; font-weight: 800; font-size: .72em; line-height: 1.5; padding: 0 5px; border-radius: 3px; }
.rt-ic { width: 1.25em; height: 1.25em; }
.rt-tmdb { color: var(--muted); }
.age { border: 1px solid rgba(255,255,255,.4); padding: 0 6px; font-size: .9em; line-height: 1.35; }
.hd { border: 1px solid rgba(255,255,255,.4); border-radius: 3px; font-size: 10px; font-weight: 700; padding: 0 4px; line-height: 1.6; }
.pv-note { margin-top: 8px; font-size: 13px; font-weight: 700; }
.pv-genres { margin-top: 8px; font-size: 14px; }
.rate-group { position: relative; display: inline-flex; }
.rate-opts { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.6); display: flex; gap: 2px; padding: 4px; border-radius: 30px; background: #2a2a2a;
  box-shadow: 0 3px 12px rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: transform .18s var(--ease), opacity .15s; z-index: 2; }
.rate-group:hover .rate-opts, .rate-group:focus-within .rate-opts { transform: translate(-50%,-50%) scale(1); opacity: 1; pointer-events: auto; }
.rate-opts .round { border: 0; background: transparent; }
.rate-opts .round:hover, .rate-opts .round.on { background: rgba(255,255,255,.18); }

/* ---------- capas ---------- */
#layers > .layer { position: fixed; inset: 0; z-index: 40; }
.scroll-y { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- detalle ---------- */
.detail-layer { background: rgba(0,0,0,.7); padding: 30px 0 60px; }
.modal { position: relative; width: min(900px, 94vw); margin: 0 auto; background: var(--bg2); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  animation: modalIn .28s var(--ease); }
@keyframes modalIn { from { transform: translate3d(0,24px,0) scale(.97); opacity: 0; } }
.modal > .close { position: absolute; right: 16px; top: 16px; z-index: 5; background: var(--bg2); border: 0; width: 38px; height: 38px; }
.hero { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.hero-media { position: absolute; inset: 0; overflow: hidden; container-type: size; }
.hero-img { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity .5s; }
.hero-img.loaded { opacity: 1; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg2) 0, transparent 50%); pointer-events: none; transition: opacity .5s; }
.hero-info { position: absolute; left: 48px; right: 48px; bottom: 6%; transition: opacity .5s; }
.hero-logo { max-width: 46%; margin-bottom: 22px; transform-origin: 0 100%; transition: transform 1s var(--ease); }
.hero-logo img { max-width: 100%; max-height: 140px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.d-title { font-size: clamp(28px, 4vw, 48px); font-weight: 800; margin: 0; line-height: 1.05; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hero.trailer-on .hero-logo { transform: scale(.75); }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn.play { font-size: 18px; padding: 9px 26px 9px 20px; }
.hero-progress { flex-basis: 100%; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.hero-progress .cprog { position: static; width: 200px; }
.hero-mute { position: absolute; right: 48px; bottom: 8%; }
.d-body { padding: 4px 48px 40px; }
.d-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #bcbcbc; font-size: 16px; }
.d-age { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; }
.d-age:empty, .d-rank:empty { display: none; }
.d-rank { margin-top: 12px; font-weight: 700; font-size: 18px; }
.d-rank .soon { color: #fff; }
.d-desc { font-size: 17px; line-height: 1.5; margin: 14px 0 0; }
.d-right { font-size: 14px; line-height: 1.5; color: #ddd; }
.d-right > div { margin: 0 0 10px; }
.lbl { color: var(--dim); }
.d-body h3 { font-size: 24px; margin: 44px 0 16px; }
.d-eph { display: flex; align-items: center; justify-content: space-between; }
.d-eph h3 { margin-top: 44px; }
.season-pick select { background: #242424; border: 1px solid #4d4d4d; border-radius: 4px; padding: 10px 14px; font-size: 16px; font-weight: 700; margin-top: 28px; }
.ep { position: relative; display: flex; align-items: center; border-bottom: 1px solid #404040; border-radius: 4px; }
.ep:first-child { border-top: 1px solid #404040; }
.ep-main { flex: 1; display: flex; align-items: center; gap: 18px; padding: 22px 14px; min-width: 0; border-radius: 4px; }
.ep:hover, .ep:focus-within { background: #333; }
.ep.future { opacity: .55; }
.ep-num { width: 30px; flex: none; text-align: center; font-size: 24px; color: #d2d2d2; }
.ep-thumb { position: relative; width: 140px; flex: none; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: #2a2a2a; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-play { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 1px solid #fff; background: rgba(30,30,30,.5);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.ep-main:hover .ep-play, .ep-main:focus-visible .ep-play, .sc-media:hover .ep-play, .tcard:hover .ep-play { opacity: 1; }
.ep-thumb .cprog { left: 0; right: 0; bottom: 0; border-radius: 0; height: 4px; }
.ep-text { flex: 1; min-width: 0; }
.ep-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.ep-len { font-weight: 400; color: #d2d2d2; white-space: nowrap; font-size: 14px; }
.ep-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 14px; color: #d2d2d2; line-height: 1.4; }
.ep-src { margin-right: 12px; opacity: 0; transition: opacity .2s; }
.ep:hover .ep-src, .ep:focus-within .ep-src, body.kbd .ep-src:focus { opacity: 1; }
@media (hover: none) { .ep-src { opacity: 1; } }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.scard { background: #2f2f2f; border-radius: 4px; overflow: hidden; }
.sc-media { position: relative; display: block; aspect-ratio: 16/9; background: #222; }
.sc-media img { width: 100%; height: 100%; object-fit: cover; }
.sc-name { position: absolute; left: 10px; right: 10px; bottom: 8px; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,.9); }
.sc-body { padding: 12px 14px 16px; }
.sc-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sc-add { margin-left: auto; }
.scard p { font-size: 14px; color: #d2d2d2; margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tcard { text-align: left; }
.tc-media { position: relative; display: block; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: #222; }
.tc-media img { width: 100%; height: 100%; object-fit: cover; }
.tc-title { display: block; margin-top: 8px; font-size: 14px; font-weight: 700; }
.d-about { margin-top: 10px; font-size: 14px; color: #ddd; }
.d-about h3 { font-weight: 400; }
.d-about > div { margin: 0 0 8px; }
.d-about .age { margin-right: 6px; }
@media (max-width: 760px) {
  .detail-layer { padding: 0; background: var(--bg2); }
  .modal { width: 100%; border-radius: 0; min-height: 100%; box-shadow: none; animation: sheetIn .3s var(--ease); }
  @keyframes sheetIn { from { transform: translate3d(0,40px,0); opacity: 0; } }
  .modal > .close { right: 12px; top: calc(12px + env(safe-area-inset-top)); width: 34px; height: 34px; background: rgba(0,0,0,.6); }
  .hero { aspect-ratio: auto; overflow: visible; background: none; }
  .hero-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
  .hero-shade { bottom: auto; aspect-ratio: 16/9; }
  .hero-info { position: relative; left: auto; right: auto; bottom: auto; padding: 0 16px; margin-top: -34px; }
  .hero-logo { max-width: 60%; margin-bottom: 14px; }
  .hero-logo img { max-height: 70px; }
  .hero-actions .btn.play { flex-basis: 100%; justify-content: center; }
  .hero-mute { right: 16px; bottom: auto; top: 16px; display: none; }
  .d-body { padding: 0 16px 90px; }
  .d-cols { grid-template-columns: 1fr; gap: 10px; }
  .d-desc { font-size: 15px; }
  .ep-main { gap: 12px; padding: 14px 4px; flex-wrap: wrap; }
  .ep-num { display: none; }
  .ep-thumb { width: 130px; }
  .ep-desc { -webkit-line-clamp: 2; }
  .d-body h3 { font-size: 20px; margin-top: 30px; }
  .sim-grid, .tr-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .scard p { -webkit-line-clamp: 3; font-size: 13px; }
}

/* ---------- panel de fuentes ---------- */
.drawer { position: absolute; inset: 0; z-index: 20; }
.player .drawer { position: fixed; }
.dr-dim { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
.dr-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(620px, 100vw); background: #161616; box-shadow: -8px 0 30px rgba(0,0,0,.6); padding: 0 0 40px;
  transform: translate3d(40px,0,0); opacity: 0; transition: transform .22s var(--ease), opacity .2s; }
.drawer.on .dr-dim { opacity: 1; }
.drawer.on .dr-panel { transform: none; opacity: 1; }
.dr-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 16px; padding: 22px 22px 12px; background: #161616; }
.dr-head > div { flex: 1; min-width: 0; }
.dr-title { margin: 0; font-size: 22px; line-height: 1.2; }
.dr-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dr-sub .age { margin-left: 6px; }
.dr-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.spin, .dr-status .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.dr-head .close { border: 0; background: #2a2a2a; }
.dr-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 22px 14px; position: sticky; top: 86px; background: #161616; z-index: 1; }
.pchip { border: 1px solid rgba(255,255,255,.3); border-radius: 18px; padding: 5px 13px; font-size: 14px; font-weight: 500; }
.pchip.sel { background: #fff; color: #000; border-color: #fff; }
/* En vivo: pastillas por lista, número de canal tecleado y mensajes de reconexión */
.lprov { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lprov:empty { display: none; }
.lp-digits { position: absolute; right: 48px; top: 40px; z-index: 6; font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0,0,0,.8); opacity: 0; transition: opacity .15s; pointer-events: none; }
.lp-digits.on { opacity: 1; }
.liveplayer .lr-text { white-space: pre-line; }
.dr-list { padding: 0 12px; }
.srow { display: block; padding: 12px 14px; border-radius: 8px; cursor: pointer; transition: background-color .15s; }
.srow:hover, body.kbd .srow:focus-visible { background: rgba(255,255,255,.1); }
.srow-main { display: flex; align-items: center; }
.srow-body { flex: 1; min-width: 0; }
.srow-top { display: flex; align-items: center; gap: 8px; }
.srow .ic { width: 18px; height: 18px; }
.srow .ic.scur { width: 22px; height: 22px; margin-right: 10px; color: var(--green); }
.qtag { border: 1px solid rgba(255,255,255,.5); border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 1.5; flex: none; }
.slang { flex: 1; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssize { font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.srow .ic-bolt { color: #ffd34d; }
.sdetail { margin-top: 3px; font-size: 13px; color: #9a9aa2; }
.srec { color: var(--green); font-weight: 700; }
.scompat { margin-top: 3px; font-size: 13px; }
.scompat.maybe { color: #d9b44a; }
.scompat.no { color: #ff7a7a; }
.scompat.server { color: #7fb8ff; }
.srow.incompatible .srow-top { opacity: .55; }

/* ---------- reproductor ---------- */
.player { background: #000; overflow: hidden; cursor: default; color: #fff; user-select: none; -webkit-user-select: none; }
.player:not(.ui-on):not(.loading):not(.paused) { cursor: none; }
.p-stage { position: absolute; inset: 0; }
#html5video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.p-subs { position: absolute; text-align: center; line-height: 1.3; font-weight: 700; color: #fff; pointer-events: none; transition: transform .35s var(--ease); z-index: 2; }
.player.ui-on .p-subs { transform: translate3d(0,-90px,0); transition-duration: .2s; }
.p-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; z-index: 4; }
.player.loading .p-loading, .player.fading .p-loading { display: flex; }
.p-bg { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity .4s; }
.p-bg.loaded { opacity: .28; }
.p-lbox { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 24px; text-align: center; }
.lring { position: relative; width: 96px; height: 96px; }
.lring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.lr-track { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 6; }
.lr-arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 414.7; stroke-dashoffset: 414.7; transition: stroke-dashoffset .12s linear; }
.lr-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.lring.spin svg { animation: spin 1s linear infinite; }
.lr-text { margin-top: 20px; font-size: 18px; max-width: 760px; color: var(--soft); }
.lr-text:empty { display: none; }
.lr-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.lr-actions:empty { display: none; }
.player.failed .lring { display: none; }
.player.failed .lr-text { color: #fff; font-size: 20px; }
.player.buffering:not(.loading) .p-stage:after { content: ''; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border: 4px solid rgba(255,255,255,.25);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.p-controls { position: absolute; inset: 0; z-index: 3; opacity: 0; transition: opacity .35s; pointer-events: none; }
.player.ui-on .p-controls { opacity: 1; transition-duration: .2s; }
.player.ui-on .p-controls > * { pointer-events: auto; }
.player.loading:not(.failed) .p-controls { opacity: 1; }
.player.loading .p-controls > :not(.p-top) { display: none; }
.p-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 18px; padding: calc(18px + env(safe-area-inset-top)) 24px 50px;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); }
.p-toptitle { font-size: 18px; font-weight: 700; opacity: 0; }
.p-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 24px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0,0,0,.8), transparent); }
.pbtn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; transition: transform .15s, background-color .15s; }
.pbtn .ic { width: 34px; height: 34px; }
.pbtn:hover { transform: scale(1.18); }
body.kbd .pbtn:focus-visible { background: rgba(255,255,255,.18); outline: 2px solid #fff; }
.p-barrow { display: flex; align-items: center; gap: 16px; }
.p-bar { position: relative; flex: 1; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.p-track { position: relative; width: 100%; height: 4px; background: rgba(255,255,255,.3); transition: height .15s; overflow: hidden; }
.p-bar:hover .p-track, .player.scrub .p-track { height: 7px; }
.p-buf, .p-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); }
.p-buf { background: rgba(255,255,255,.35); }
.p-fill { background: var(--accent); }
.p-knob { position: absolute; left: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--accent); transition: width .15s, height .15s; }
.p-bar:hover .p-knob, .player.scrub .p-knob { width: 20px; height: 20px; margin: -10px 0 0 -2px; }
.p-tip { position: absolute; bottom: 26px; left: 0; background: rgba(20,20,20,.9); padding: 3px 8px; border-radius: 3px; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; transition: opacity .15s; }
.p-bar:hover .p-tip, .player.scrub .p-tip { opacity: 1; }
.p-remain { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.p-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.p-left, .p-right { display: flex; align-items: center; gap: 14px; flex: none; }
.p-title { flex: 1; min-width: 0; text-align: center; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title span { color: #cfcfcf; font-weight: 400; margin-left: 6px; }
.p-vol { display: flex; align-items: center; }
.p-volrange { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--accent); }
.p-vol:hover .p-volrange, .p-vol:focus-within .p-volrange { width: 90px; opacity: 1; margin-left: 4px; }
.p-center { display: none; }
.p-rating { position: absolute; left: 48px; top: 90px; display: flex; gap: 14px; opacity: 0; pointer-events: none; z-index: 2; }
.p-rating i { width: 4px; background: var(--accent); }
.pr-title { font-size: 22px; font-weight: 700; }
.pr-desc { font-size: 16px; color: #ddd; }
.p-next { position: absolute; right: 40px; bottom: 130px; z-index: 4; opacity: 0; transform: translate3d(0,16px,0); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.p-next.on { opacity: 1; transform: none; pointer-events: auto; }
.p-next small { margin-left: 8px; opacity: .7; font-variant-numeric: tabular-nums; }
.p-next.on { display: flex; align-items: center; gap: 10px; }
.p-nextx { background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.5); }
/* «Saltar intro» abajo a la derecha, como Netflix (intro.js) */
.p-skip { position: absolute; right: 40px; bottom: 130px; z-index: 4; padding: 12px 26px; border-radius: 4px; border: 1px solid rgba(255,255,255,.7); background: rgba(20,20,20,.72);
  color: #fff; font-size: clamp(15px, 1.2vw, 19px); font-weight: 700; opacity: 0; transform: translate3d(0,16px,0); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.p-skip.on { opacity: 1; transform: none; pointer-events: auto; }
.p-skip:hover, body.kbd .p-skip:focus-visible { background: #fff; color: #000; }
.p-panel { position: absolute; z-index: 5; right: 24px; bottom: 120px; width: min(420px, calc(100vw - 48px)); max-height: calc(100% - 170px); background: rgba(24,24,24,.96);
  border-radius: 8px; padding: 6px 0 12px; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.pp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px 20px; }
.pp-head h3 { margin: 0; font-size: 20px; }
.pp-head .round { border: 0; }
.pp-header { padding: 14px 20px 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pp-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 20px; font-size: 16px; }
.pp-opt:hover:not([disabled]), body.kbd .pp-opt:focus-visible { background: rgba(255,255,255,.1); }
.pp-opt[disabled] { cursor: default; color: var(--muted); }
.pp-opt .ic { width: 20px; height: 20px; color: #fff; }
.pp-opt small { display: block; color: var(--muted); font-size: 13px; }
.p-tap { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.p-ripple { position: absolute; top: 30%; width: 30%; height: 40%; border-radius: 50%; background: rgba(255,255,255,.16); opacity: 0; }
.p-ripple.l { left: 4%; } .p-ripple.r { right: 4%; }
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .p-center { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; justify-content: center; align-items: center; gap: 12vw; }
  .p-center .pbtn .ic { width: 40px; height: 40px; }
  .p-center .pbtn.big { width: 74px; height: 74px; }
  .p-center .pbtn.big .ic { width: 58px; height: 58px; }
  .p-left .p-rw, .p-left .p-ff, .p-left .p-pp2, .p-vol { display: none; }
  .p-toptitle { opacity: 1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
  .p-title { display: none; }
  .p-row { justify-content: flex-end; }
  .p-right { gap: 6px; }
  .pbtn { width: 42px; height: 42px; }
  .pbtn .ic { width: 28px; height: 28px; }
  .p-bottom { padding: 60px 16px calc(10px + env(safe-area-inset-bottom)); }
  .p-panel { right: 12px; bottom: 90px; width: calc(100vw - 24px); }
  .p-rating { left: 20px; top: 70px; }
  .p-next, .p-skip { right: 16px; bottom: 110px; }
  .player.ui-on .p-subs { transform: translate3d(0,-60px,0); }
}
.player.ui-on.panel-on .p-subs { opacity: 0; }

/* En vivo */
.live-body { padding-top: 10px; }
.lfeat { position: relative; display: flex; align-items: center; margin: 0 var(--pad) 3vw; min-height: clamp(220px, 26vw, 420px); border-radius: 12px; overflow: hidden; }
.lc-bg { position: absolute; inset: 0; background: linear-gradient(180deg, #26262D, #18181D); transition: background .4s; }
.lf-logo { position: absolute; right: 7%; top: 50%; transform: translateY(-50%); max-width: 30%; max-height: 50%; object-fit: contain; filter: drop-shadow(0 4px 20px rgba(0,0,0,.4)); }
.lf-text { position: relative; padding: 4%; max-width: 60%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lf-top { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.85); }
.lf-name { font-size: clamp(26px, 3.6vw, 56px); font-weight: 800; line-height: 1.05; }
.lf-now { font-size: clamp(15px, 1.4vw, 22px); font-weight: 700; }
.lf-now small { font-weight: 400; opacity: .8; margin-left: 6px; }
.lf-next { font-size: 14px; color: rgba(255,255,255,.8); }
.lfeat .lbar { width: min(380px, 80%); }
.lfeat .btn { margin-top: 10px; }
.live-badge { display: inline-block; background: var(--accent); border-radius: 3px; padding: 1px 7px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.lcard .live-badge { position: absolute; left: 8px; top: 8px; }
.live-row .track { min-height: calc(var(--cw) * .5625); }
.lcard { position: relative; width: var(--cw); aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; transition: transform .25s var(--ease); }
.lcard img { position: relative; max-width: 52%; max-height: 46%; object-fit: contain; transition: opacity .2s; }
.lc-initials { position: relative; display: none; padding: 0 16px; text-align: center; font-size: clamp(16px, calc(var(--cw) / 11), 24px); font-weight: 700; }
.lcard.nologo .lc-initials { display: block; }
.lc-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 10px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); display: flex; flex-direction: column;
  font-size: 13px; opacity: 0; transition: opacity .2s; }
.lc-info small { color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard .lbar { position: absolute; left: 0; right: 0; bottom: 0; }
@media (hover: hover) and (pointer: fine) { .lcard:hover { transform: scale(1.04); } .lcard:hover .lc-info { opacity: 1; } }
body.kbd .lcard:focus-visible { transform: scale(1.05); }
body.kbd .lcard:focus-visible .lc-info { opacity: 1; }
.lbar { display: block; height: 3px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; }
.lbar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; }
.liveplayer .lp-banner { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 32px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.lp-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lp-num { font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-name { font-size: 30px; font-weight: 800; }
.lp-group { color: var(--muted); }
.lp-epg { margin-top: 8px; max-width: 900px; }
.lp-now span:not(.lbar), .lp-next { color: #ccc; }
.lp-now .lbar { width: 320px; margin: 8px 0; }
.lp-now p { margin: 6px 0 0; color: #ddd; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-btns { position: absolute; right: 24px; bottom: calc(22px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }

/* ---------- búsqueda ---------- */
.page.search { padding-top: calc(var(--head) + 24px); }
.s-bar { display: none; align-items: center; margin: 0 var(--pad) 14px; background: #2a2a2a; border-radius: 6px; padding: 0 12px; }
.page .s-bar input { flex: 1; width: auto; background: transparent; border: 0; outline: none; padding: 12px 8px; font-size: 16px; }
.s-ic { color: var(--muted); display: flex; }
@media (max-width: 900px) { .s-bar { display: flex; } }
.s-sugg { margin: 0 var(--pad) 10px; color: var(--muted); font-size: 15px; line-height: 2; }
.s-lbl { margin-right: 10px; }
.s-chip { color: #fff; }
.s-chip:hover { text-decoration: underline; }
.s-head { font-size: clamp(16px, 1.3vw, 22px); font-weight: 500; color: var(--soft); margin: 18px var(--pad) 14px; }
.search.busy .s-grid { opacity: .5; transition: opacity .2s; }

/* ---------- ajustes ---------- */
.page.settings { max-width: 860px; margin: 0 auto; padding: calc(var(--head) + 28px) var(--pad) 80px; }
.page.settings .page-title { margin-bottom: 18px; }
.set { background: #1c1c1c; border-radius: 8px; padding: 22px 24px 24px; margin-top: 18px; }
.set h2 { margin: 0 0 6px; font-size: 20px; }
.note { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 14px; }
.note a { color: #fff; text-decoration: underline; }
.addons { list-style: none; padding: 0; margin: 0 0 14px; }
.addon { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.a-text { flex: 1; min-width: 0; }
.a-text small { color: var(--muted); }
.a-text span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-btns { display: flex; gap: 6px; }
.a-btns .round { border-width: 1px; }
.row-form { display: flex; gap: 10px; align-items: center; }
.row-form > input, .row-form > .field { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label:not(.check):not(.btn) { margin-top: 10px; font-weight: 700; font-size: 15px; }
.stack label small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; background: #101013; border: 1px solid #3a3a3f; border-radius: 6px; padding: 11px 12px; font-size: 16px; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: #fff; }
textarea { resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.field { position: relative; }
.field.secret input { padding-right: 48px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.eye:hover { color: #fff; }
.eye .ic { width: 20px; height: 20px; }
.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--muted); font-size: 13px; }
.form-end { display: flex; justify-content: flex-end; margin-top: 12px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--soft); font-weight: 700; padding: 6px 0; }
details .stack { margin-top: 8px; }
.copyable { cursor: copy; }
.set .btn { font-size: 15px; padding: 9px 18px; }
@media (max-width: 600px) { .set { padding: 18px 16px; } .row-form { flex-wrap: wrap; } .row-form .btn { flex: 1; justify-content: center; } }

/* ---------- diálogos y avisos ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .16s; }
.dialog-wrap.on { opacity: 1; }
.dialog { width: min(460px, 100%); max-height: 90vh; overflow-y: auto; background: #1f1f1f; border-radius: 10px; padding: 22px 22px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.7);
  transform: scale(.96); transition: transform .16s var(--ease); }
.dialog.wide { width: min(600px, 100%); }
.dialog-wrap.on .dialog { transform: none; }
.dlg-title { margin: 0 0 8px; font-size: 20px; }
.dlg-text { color: var(--soft); font-size: 15px; line-height: 1.5; margin-bottom: 14px; }
.dlg-text a { color: #fff; text-decoration: underline; }
.dlg-opts { display: flex; flex-direction: column; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 10px; border-radius: 6px; font-size: 16px; }
.opt:hover, body.kbd .opt:focus-visible { background: rgba(255,255,255,.1); }
.opt .ic { width: 20px; height: 20px; color: var(--green); }
.opt-sub { display: block; color: var(--muted); font-size: 13px; }
.opt.danger { color: #ff8a8a; }
.dlg-form .field { margin: 6px 0 4px; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlg-buttons .btn { font-size: 15px; padding: 9px 18px; }
.big-code { margin: 16px 0 4px; font-size: 34px; font-weight: 800; letter-spacing: .12em; text-align: center; background: #111; border-radius: 8px; padding: 12px; }
#toast { position: fixed; z-index: 70; left: 50%; bottom: 40px; max-width: min(640px, calc(100vw - 32px)); transform: translate3d(-50%, 20px, 0); background: #fff; color: #000; font-weight: 700;
  padding: 12px 20px; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.5); opacity: 0; transition: opacity .2s, transform .25s var(--ease); pointer-events: none; text-align: center; font-size: 15px; }
#toast.on { opacity: 1; transform: translate3d(-50%, 0, 0); }
@media (max-width: 900px) { #toast { bottom: calc(80px + env(safe-area-inset-bottom)); } body.player-open #toast { bottom: 30px; } }

/* ---------- «Inicia sesión en Velvet TV» (como activity_hub.xml: texto y botón a la izquierda, QR y código a la derecha) ---------- */
.login { position: fixed; inset: 0; z-index: 85; background: radial-gradient(ellipse at 30% 0%, #2a0e14 0, var(--bg) 60%); display: flex; align-items: center; justify-content: center; padding: 72px 24px 24px; overflow-y: auto; }
.lg-brand { position: absolute; left: var(--pad); top: 22px; height: 28px; }
.lg-box { width: min(1040px, 100%); }
.lg-box h1 { font-size: clamp(28px, 3.6vw, 52px); margin: 0 0 3vh; font-weight: 700; line-height: 1.1; }
.lg-cols { display: flex; gap: 6vw; align-items: center; }
.lg-side { flex: 1; min-width: 0; }
.lg-text { font-size: clamp(17px, 1.6vw, 24px); line-height: 1.4; color: var(--soft); margin: 0; max-width: 520px; }
.lg-actions { display: flex; gap: 12px; margin-top: 4vh; flex-wrap: wrap; }
.btn.big { font-size: clamp(16px, 1.4vw, 21px); padding: .8em 1.8em; border-radius: 6px; }
.lg-help { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 18px 0 0; max-width: 460px; }
.lg-help b { color: var(--soft); }
.lg-qr { flex: none; width: clamp(220px, 24vw, 300px); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.lg-qrimg { width: clamp(170px, 18vw, 230px); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.lg-qrimg svg { width: 100%; height: 100%; }
.lg-qrimg .spin { border-color: rgba(0,0,0,.2); border-top-color: #000; width: 28px; height: 28px; }
.lg-or { color: var(--muted); font-size: 14px; line-height: 1.45; }
.lg-or b { color: var(--soft); font-weight: 500; }
.lg-code { font-size: clamp(30px, 3.2vw, 44px); font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.lg-status { color: var(--muted); font-size: 14px; min-height: 1.4em; }
@media (max-width: 760px) {
  .lg-cols { flex-direction: column; gap: 32px; align-items: stretch; }
  .lg-box h1, .lg-side { text-align: center; } .lg-text, .lg-help { margin-left: auto; margin-right: auto; }
  .lg-actions { justify-content: center; } .lg-actions .btn { flex: 1; justify-content: center; max-width: 360px; }
  .lg-qr { width: auto; }
}

/* ---------- menú del avatar (izquierda) y monograma (derecha) ---------- */
.with-profile .nav { margin-left: 28px; }
.monogram { display: flex; margin-left: 4px; }
.monogram img { width: 30px; height: 30px; }
.hp-wrap { position: relative; }
.hprofile { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.hprofile .ic { width: 18px; height: 18px; transition: transform .15s; }
.hp-wrap.open .hprofile .ic { transform: rotate(180deg); }
body.kbd .hprofile:focus-visible { outline: none; }
body.kbd .hprofile:focus-visible .avatar { outline: 2px solid #fff; outline-offset: 2px; }
.pmenu { position: absolute; left: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px; border-radius: 10px; background: rgba(18,18,20,.94);
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 10px 30px rgba(0,0,0,.55); opacity: 0; transform: translate3d(0,-6px,0);
  transition: opacity .14s ease-out, transform .14s ease-out; pointer-events: none; z-index: 40; }
.hp-wrap.open .pmenu { opacity: 1; transform: none; pointer-events: auto; }
.pmenu:before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.pm-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 15px; color: #e5e5e5; }
.pm-item .ic { width: 22px; height: 22px; margin: 0 5px; }
.pm-item span { display: flex; flex-direction: column; min-width: 0; }
.pm-item small { color: inherit; opacity: .7; font-size: 12px; }
.pm-item:hover, .pm-item:focus-visible, body.kbd .pm-item:focus { background: #e9e9e9; color: #111; outline: none; }
.pm-sep { height: 1px; background: rgba(255,255,255,.12); margin: 6px 4px; }

/* ---------- perfiles («¿Quién está viendo?») ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; position: relative; background: var(--av, #E0233F); color: #fff; font-weight: 800; border-radius: 6px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 16px; border-radius: 4px; }
.avatar.big { width: clamp(84px, 10vw, 150px); height: clamp(84px, 10vw, 150px); font-size: clamp(38px, 4.6vw, 70px); }
.avatar i { position: absolute; left: 0; right: 0; bottom: 6%; font-style: normal; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
.avatar.sm i { display: none; }
.avatar.mid { width: 56px; height: 56px; font-size: 26px; }
.avatar.mid i { font-size: 8px; }
/* Perfil niño: círculo con degradado del color del perfil, como el dashboard del Hub y Android. */
.avatar.kids { border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%), var(--av); }
.pf .avatar.kids + .pf-edit { border-radius: 50%; }
.profiles { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; animation: modalIn .3s var(--ease); }
.pf-brand { position: absolute; left: var(--pad); top: 22px; height: 26px; }
.profiles h1 { font-size: clamp(28px, 3.5vw, 56px); font-weight: 500; margin: 0 0 2vw; text-align: center; }
.pf-list { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 2vw, 32px); max-width: 1100px; }
.pf { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); position: relative; }
.pf .avatar { outline: 3px solid transparent; outline-offset: 0; transition: outline-color .15s; }
.pf:hover .avatar, body.kbd .pf:focus-visible .avatar { outline-color: #fff; }
.pf:hover, .pf:focus-visible { color: #fff; }
body.kbd .pf:focus-visible { outline: none; }
.pf-name { font-size: clamp(14px, 1.3vw, 20px); }
.addav { background: transparent !important; border: 2px solid #555; color: #888; }
.addav .ic { width: 50%; height: 50%; }
.pf-edit { position: absolute; top: 0; left: 0; right: 0; height: clamp(84px, 10vw, 150px); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); border-radius: 6px; color: #fff; }
.pf-edit .ic { width: 36%; height: 36%; }
.pf-manage { margin-top: 3vw; text-transform: uppercase; letter-spacing: .12em; font-size: 15px; }
.pf-colors { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.pf-color { width: 34px; height: 34px; border-radius: 6px; background: var(--av); outline: 3px solid transparent; outline-offset: 2px; }
.pf-color.sel { outline-color: #fff; }
body.picking { overflow: hidden; }

/* Menos movimiento si el sistema lo pide. */
/* ---------- Ajustes (como HubSettings) ---------- */
.set-profile { display: flex; align-items: center; gap: 14px; margin: 10px 0 16px; }
.set-profile b { font-size: 18px; }
.set-profile small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.sub-preview { margin-top: 10px; height: 92px; border-radius: 6px; background: linear-gradient(135deg, #3b4a5a, #1d2630); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; }
.sub-preview span { color: #fff; font-weight: 500; text-shadow: 0 0 4px #000, 0 0 2px #000; transition: font-size .15s; }
.set p { margin: 6px 0; }
button.link { color: var(--muted); text-decoration: underline; font-size: 14px; margin-left: 8px; }
button.link:hover { color: #fff; }

/* ---------- featured con foco (teclado o control): borde suave, como billboard_focus.xml ---------- */
.billboard:after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); opacity: 0; transition: opacity .22s; pointer-events: none; z-index: 4; }
body.kbd .billboard:focus-within:after { opacity: 1; }
.billboard.portrait:after { display: none; }

/* ---------- modo liviano (lite.js, el de Samsung y LG): equipos antiguos o lentos ---------- */
/* Sin tráileres (V.cfg.previews), sin la tarjeta que se agranda (cards.js) y sin animaciones grandes. */
.lite .billboard .bb-desc, .lite .billboard .bb-meta, .lite .billboard .bb-logo, .lite .bb-img, .lite .hero-img { transition: none !important; }
.lite .row.season { background-image: none !important; }
.lite .row.season:before, .lite .row.season:after { display: none; }
.lite body.kbd .card:focus-visible, .lite .card:hover { transform: none; }
.lite .page, .lite .layer, .lite .dialog, .lite .profiles { animation: none !important; }

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