:root {
  --bg: #05090f;
  --bg-soft: #0c1724;
  --card: rgba(18, 33, 50, .72);
  --card-solid: #122132;
  --line: rgba(86, 140, 170, .22);
  --line-strong: rgba(0, 229, 240, .45);
  --text: #eefcff;
  --muted: #9fbccb;
  --accent: #00e5f0;
  --accent-2: #7b61ff;
  --accent-3: #ff4d9d;
  --error: #ff8a8a;
  --glow: 0 0 0 1px rgba(0, 229, 240, .15), 0 18px 48px -18px rgba(0, 229, 240, .35);
  --radius: 16px;
}
* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(1200px 680px at 12% -8%, rgba(0, 229, 240, .14), transparent 60%),
    radial-gradient(1000px 620px at 100% 0%, rgba(123, 97, 255, .16), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, rgba(255, 77, 157, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Aurora ambiente: sólo transform/opacity (GPU), se congela con movimiento reducido. */
body::before {
  content: "";
  position: fixed;
  inset: -30vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vmax 42vmax at 28% 32%, rgba(0, 229, 240, .20), transparent 62%),
    radial-gradient(38vmax 38vmax at 74% 60%, rgba(123, 97, 255, .20), transparent 60%),
    radial-gradient(30vmax 30vmax at 55% 18%, rgba(255, 77, 157, .14), transparent 60%);
  opacity: .9;
  will-change: transform;
  animation: tv-aurora 34s ease-in-out infinite alternate;
}
@keyframes tv-aurora {
  0%   { transform: translate3d(-4%, -3%, 0) rotate(0deg) scale(1.05); }
  50%  { transform: translate3d(3%, 2%, 0) rotate(6deg) scale(1.12); }
  100% { transform: translate3d(5%, -2%, 0) rotate(-4deg) scale(1.08); }
}

.brand-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.error { color: var(--error); min-height: 1.2em; font-size: 14px; }

/* ── Barra superior ───────────────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 28px);
  background: linear-gradient(180deg, rgba(10, 22, 34, .9), rgba(10, 22, 34, .62));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
#topbar .brand {
  font-size: 23px; font-weight: 800; letter-spacing: .3px;
  text-shadow: 0 0 22px rgba(0, 229, 240, .35);
}
#topbar .search { flex: 1; display: flex; }
#search {
  width: 100%; max-width: 540px; padding: 11px 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(7, 16, 24, .72); color: var(--text); font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#search::placeholder { color: #6f90a0; }
#search:focus {
  outline: none; border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(0, 229, 240, .16);
  background: rgba(7, 16, 24, .95);
}

/* ── Botones ──────────────────────────────────────────────────────── */
button {
  font: inherit; cursor: pointer; border: none; border-radius: 12px;
  padding: 11px 18px; font-weight: 700; letter-spacing: .2px;
  color: #04171b;
  background: linear-gradient(135deg, var(--accent), #35f0ff);
  box-shadow: 0 10px 26px -12px rgba(0, 229, 240, .7);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease;
}
button:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 34px -12px rgba(0, 229, 240, .8); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.ghost {
  background: rgba(255, 255, 255, .03); color: var(--text);
  border: 1px solid var(--line); box-shadow: none; font-weight: 600;
}
button.ghost:hover { border-color: var(--line-strong); background: rgba(0, 229, 240, .08); }

main { padding: 0; }

/* ── Acceso ───────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.login-card {
  width: 100%; max-width: 380px; position: relative;
  background: linear-gradient(165deg, rgba(18, 33, 50, .9), rgba(10, 20, 31, .82));
  border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--glow), 0 40px 90px -40px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(0, 229, 240, .55), rgba(123, 97, 255, .45), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.login-card h1 { margin: 0 0 6px; font-size: 38px; font-weight: 800; letter-spacing: .5px; }
.login-card > .muted { font-size: 14px; }
.login-card form { display: grid; gap: 16px; margin-top: 22px; }
.login-card label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.login-card input {
  padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(5, 10, 16, .7); color: var(--text); font: 16px/1.4 inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-card input:focus {
  outline: none; border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(0, 229, 240, .16);
}
.login-card button[type="submit"] { margin-top: 4px; padding: 13px; font-size: 16px; }

/* ── Contenedor principal ─────────────────────────────────────────── */
.app { padding: clamp(16px, 3.5vw, 28px); max-width: 1240px; margin: 0 auto; }

#category-nav { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 18px; scrollbar-width: thin; }
#category-nav::-webkit-scrollbar { height: 6px; }
#category-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
#category-nav button {
  white-space: nowrap; background: rgba(255, 255, 255, .04); color: var(--text);
  border: 1px solid var(--line); box-shadow: none; font-weight: 600; padding: 9px 16px;
}
#category-nav button:hover { border-color: var(--line-strong); background: rgba(0, 229, 240, .1); transform: translateY(-1px); }

#content-panel > button { margin: 6px 6px 6px 0; }

.notice {
  background: linear-gradient(135deg, rgba(42, 32, 53, .85), rgba(30, 24, 44, .85));
  border: 1px solid #5b4a6e; color: #eadcff;
  padding: 13px 16px; border-radius: 12px; margin: 8px 0 18px;
  box-shadow: 0 14px 34px -22px rgba(123, 97, 255, .8);
}

/* ── Estantes y rejillas ──────────────────────────────────────────── */
.shelf { margin-bottom: 34px; }
.shelf h2 {
  font-size: 20px; margin: 10px 0 14px; font-weight: 800; letter-spacing: .2px;
  display: flex; align-items: center; gap: 12px;
}
.shelf h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(0, 229, 240, .6);
}
.shelf h3 { font-size: 15px; margin: 18px 0 10px; color: var(--muted); font-weight: 700; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

/* ── Filas estilo Netflix (sólo en la portada del catálogo) ─────────
   Búsqueda y páginas de categorías conservan la rejilla que envuelve. */
#catalog .grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: clamp(136px, 40vw, 180px);
  gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 24px 6px 28px; margin: -16px -6px 0;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  scroll-padding-left: 6px;
}
#catalog .grid::-webkit-scrollbar { height: 8px; }
#catalog .grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
#catalog .grid::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }
#catalog .grid > .card { scroll-snap-align: start; }

/* Primera fila = cartelera destacada, formato apaisado más grande. */
#catalog .shelf:first-of-type:not(#continue-shelf):not(#top-shelf):not(.genre-shelf):not(.live-shelf) .grid { grid-auto-columns: clamp(240px, 78vw, 360px); }
#catalog .shelf:first-of-type:not(#continue-shelf):not(#top-shelf):not(.genre-shelf):not(.live-shelf) .poster { aspect-ratio: 16 / 9; font-size: 40px; }
#catalog .shelf:first-of-type:not(#continue-shelf):not(#top-shelf):not(.genre-shelf):not(.live-shelf) .card:hover { transform: translateY(-6px) scale(1.03); }

/* ── Fila "Continuar viendo" ──────────────────────────────────────── */
#continue-shelf .card { position: relative; }
.cw-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255, 255, 255, .18); z-index: 1;
}
.cw-progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.cw-remove {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  padding: 1px 8px; font-size: 13px; line-height: 1.4; border-radius: 999px;
  background: rgba(4, 12, 18, .72); color: var(--text); border: 1px solid var(--line);
  box-shadow: none; font-weight: 700; opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.cw-remove:hover { background: rgba(255, 77, 157, .7); }
#continue-shelf .card:hover .cw-remove,
#continue-shelf .card:focus-within .cw-remove { opacity: 1; }
@media (hover: none) { .cw-remove { opacity: 1; } }

/* ── Encabezado de fila con «Ver todo ›» ─────────────────────────── */
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shelf-head h2 { margin-right: auto; }
.shelf-more {
  background: transparent; border: none; box-shadow: none; color: var(--accent);
  font-size: 14px; font-weight: 700; padding: 6px 10px; white-space: nowrap; border-radius: 999px;
}
.shelf-more:hover { background: rgba(0, 229, 240, .1); transform: none; filter: none; box-shadow: none; }

/* ── Vista «Ver todo» (cuadrícula + carga continua) ──────────────── */
#content-panel > .section-count { margin: 2px 0 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.section-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.load-sentinel {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 0 8px; color: var(--muted); font-size: 14px;
}
.mini-ring {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: pl-spin .9s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .mini-ring { animation: none; } }
.related-shelf { margin-top: 30px; margin-bottom: 0; }
.row-scroll {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: clamp(136px, 40vw, 170px);
  overflow-x: auto; overflow-y: hidden; padding: 10px 4px 18px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.row-scroll > .card { scroll-snap-align: start; }
@media (max-width: 640px) { .section-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; } }

/* ── Cabecera destacada (billboard estilo Netflix) ─────────────────── */
.hero-slot:empty, .genre-slot:empty { display: none; }
.hero {
  position: relative; display: flex; align-items: flex-end; overflow: hidden;
  min-height: clamp(320px, 50vw, 540px); margin: 4px 0 30px; border-radius: 22px;
  background: var(--card-solid); border: 1px solid var(--line);
  box-shadow: 0 50px 100px -60px rgba(0, 0, 0, .95), var(--glow);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 9, 15, .94) 0%, rgba(5, 9, 15, .7) 36%, rgba(5, 9, 15, .05) 72%),
    linear-gradient(0deg, rgba(5, 9, 15, .92) 0%, rgba(5, 9, 15, 0) 48%);
}
.hero-body { position: relative; z-index: 1; max-width: 640px; padding: clamp(22px, 4vw, 48px); }
.hero-tag { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--accent); }
.hero-title {
  margin: 8px 0 10px; font-size: clamp(30px, 5.2vw, 56px); line-height: 1.04; font-weight: 900;
  letter-spacing: -.01em; text-shadow: 0 6px 34px rgba(0, 0, 0, .65);
}
.hero-meta { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--accent); white-space: pre-wrap; }
.hero-overview {
  margin: 0 0 22px; font-size: 15px; line-height: 1.55; color: #d7e7ef;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-play { font-size: 16px; padding: 13px 26px; display: inline-flex; align-items: center; gap: 10px; }
.hero-play::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #04171b;
}
.hero-info {
  font-size: 16px; padding: 13px 22px; background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (max-width: 640px) {
  .hero { min-height: 440px; }
  .hero-img { object-position: center top; }
  .hero-shade { background: linear-gradient(0deg, rgba(5, 9, 15, .97) 18%, rgba(5, 9, 15, .45) 62%, rgba(5, 9, 15, .1)); }
  .hero-overview { -webkit-line-clamp: 4; font-size: 14px; }
  .hero-play, .hero-info { flex: 1 1 140px; justify-content: center; }
}

/* ── Carrusel de recomendaciones (cambia solo) ─────────────────────── */
/* Sólo transform/opacity animados; nada de blur sobre la imagen en movimiento. */
.hero-layer {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .9s ease;
}
.hero-layer.is-in { opacity: 1; }
.hero-layer.is-out { opacity: 0; pointer-events: none; }
.hero-layer .hero-img { transform-origin: 60% 30%; will-change: transform; }
.hero-layer.is-in .hero-img { animation: heroZoom 24s ease-out both; }
.hero-layer.is-in .hero-body > * { animation: heroRise .75s cubic-bezier(.2, .7, .2, 1) both; }
.hero-layer.is-in .hero-body > :nth-child(2) { animation-delay: .08s; }
.hero-layer.is-in .hero-body > :nth-child(3) { animation-delay: .16s; }
.hero-layer.is-in .hero-body > :nth-child(4) { animation-delay: .24s; }
.hero-layer.is-in .hero-body > :nth-child(5) { animation-delay: .32s; }
.hero-layer .hero-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero.is-paused .hero-layer .hero-img,
.hero.is-paused .hero-seg.on > i { animation-play-state: paused; }
.hero-tagline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-reason {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
}
@keyframes heroZoom { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes heroRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heroFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes heroPulse { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }

.hero-hud {
  position: absolute; z-index: 2; top: clamp(14px, 2.4vw, 24px); right: clamp(14px, 2.4vw, 24px);
  display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 14px; border-radius: 999px;
  background: rgba(5, 9, 15, .62); border: 1px solid rgba(255, 255, 255, .12);
}
.hero-live {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.hero-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); }
.hero-live i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-3);
  animation: heroPulse 1.6s ease-out infinite;
}
.hero.is-paused .hero-live i::after { animation-play-state: paused; }
.hero-segs { display: flex; align-items: center; gap: 5px; }
.hero-seg, .hero-seg:hover, .hero-seg:active {
  position: relative; width: 26px; height: 18px; padding: 0; border-radius: 0;
  background: none; box-shadow: none; transform: none; filter: none;
}
.hero-seg::before, .hero-seg > i {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 3px;
}
.hero-seg::before { background: rgba(255, 255, 255, .26); }
.hero-seg > i {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transform: scaleX(0); transform-origin: left center;
}
.hero-seg.done > i { transform: scaleX(1); }
.hero-seg.on > i { animation: heroFill var(--hero-dur, 12s) linear forwards; }
.hero-pause, .hero-pause:hover, .hero-pause:active {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 11px; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, .12); box-shadow: none; transform: none; filter: none;
}
.hero-next {
  position: absolute; z-index: 2; right: clamp(14px, 2.4vw, 24px); bottom: clamp(14px, 2.4vw, 24px);
  display: none; align-items: center; gap: 12px; max-width: 270px; padding: 8px 16px 8px 8px;
  border-radius: 14px; text-align: left; color: var(--text);
  background: rgba(5, 9, 15, .66); border: 1px solid rgba(255, 255, 255, .12); box-shadow: none; filter: none;
}
.hero-next:hover { transform: translateY(-2px); border-color: rgba(0, 229, 240, .5); box-shadow: none; filter: none; }
.hero-next img { width: 46px; height: 68px; flex: none; object-fit: cover; border-radius: 8px; background: var(--card-solid); }
.hero-next span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.hero-next b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 3px; font-size: 14px; line-height: 1.3;
}
.hero-next.tick { animation: heroRise .6s cubic-bezier(.2, .7, .2, 1) both; }
@media (min-width: 1100px) { .hero-next { display: flex; } }
@media (max-width: 640px) {
  .hero-rotor { min-height: 470px; }
  .hero-hud { left: 14px; right: 14px; gap: 10px; }
  .hero-live { font-size: 10px; letter-spacing: .12em; }
  .hero-segs { flex: 1; }
  .hero-seg, .hero-seg:hover, .hero-seg:active { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-layer { transition-duration: .01s; }
  .hero-layer.is-in .hero-img, .hero-layer.is-in .hero-body > *,
  .hero-live i::after, .hero-next.tick { animation: none; }
}

/* ── Ficha con fondo (TMDB) ───────────────────────────────────────── */
#content-panel > .detail-hero {
  position: relative; overflow: hidden;
  margin: calc(-1 * clamp(18px, 3vw, 30px)) calc(-1 * clamp(18px, 3vw, 30px)) 18px;
  height: clamp(170px, 30vw, 340px);
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
.detail-shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(12, 22, 34, 1) 0%, rgba(12, 22, 34, .35) 55%, rgba(12, 22, 34, .08));
}

/* ── Vista por géneros (TMDB) ─────────────────────────────────────── */
.genre-switch { display: flex; gap: 10px; margin: 4px 0 18px; }
.genre-switch button { padding: 9px 18px; }
.genre-switch button.active { box-shadow: 0 10px 26px -12px rgba(0, 229, 240, .7); }
.genre-wait { margin: 0 0 16px; }
.tmdb-credit { font-size: 11px; color: var(--muted); opacity: .75; margin: 10px 0 24px; }
.tmdb-meta { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: .2px; }
#content-panel > p.tmdb-meta { color: var(--accent); margin: 4px 0 0; }

/* ── Fila "Top 10 películas del mes" (estilo Netflix) ─────────────── */
#top-shelf .grid { grid-auto-columns: clamp(190px, 52vw, 240px); align-items: center; }
.card.top-card {
  background: transparent; border: none; overflow: visible; box-shadow: none;
  flex-direction: row; align-items: stretch; gap: 2px; backdrop-filter: none;
}
.card.top-card::after { content: none; }
.card.top-card .top-rank {
  font-size: clamp(74px, 15vw, 128px); font-weight: 900; line-height: .86;
  letter-spacing: -.06em; flex: 0 0 auto; display: flex; align-items: flex-end;
  color: transparent; -webkit-text-stroke: 2px var(--accent);
  text-shadow: 0 0 26px rgba(0, 229, 240, .35);
}
.card.top-card .poster {
  flex: 1 1 auto; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
}
.card.top-card:hover .poster, .card.top-card:focus-visible .poster {
  border-color: var(--line-strong); box-shadow: 0 18px 40px -22px rgba(0, 229, 240, .55);
}
.card.top-card:hover, .card.top-card:focus-visible { transform: translateY(-4px); outline: none; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s ease, box-shadow .22s ease;
  display: flex; flex-direction: column;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 -60px 50px -40px rgba(0, 0, 0, .55);
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px) scale(1.015);
  border-color: var(--line-strong);
  box-shadow: 0 24px 48px -24px rgba(0, 229, 240, .55);
  outline: none;
}
.card .poster {
  aspect-ratio: 2 / 3; position: relative;
  background: linear-gradient(145deg, #123744, #0a1c27 60%, #0f1230);
  display: grid; place-items: center; color: var(--accent);
  font-size: 30px; font-weight: 800;
  text-shadow: 0 0 18px rgba(0, 229, 240, .5);
}
.card .poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .4s ease;
}
.card .poster img[src] { animation: tv-img-in .5s ease forwards; }
@keyframes tv-img-in { to { opacity: 1; } }
/* Esqueleto mientras carga la carátula: sólo en posters con imagen real.
   La imagen, al cargar, es opaca y tapa el brillo (no se anima bajo ella). */
.card .poster:has(img)::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(0, 229, 240, .14) 45%, rgba(123, 97, 255, .14) 55%, transparent 80%);
  background-size: 220% 100%;
  animation: tv-shimmer 1.3s linear infinite;
  will-change: background-position;
}
@keyframes tv-shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.card .body { padding: 11px 13px 13px; }
.card .title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card.locked { opacity: .5; filter: grayscale(.3); }
.card.locked:hover { transform: none; }
.card .badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: #ffd9ea; border: 1px solid rgba(255, 77, 157, .5); border-radius: 999px;
  padding: 2px 9px; display: inline-block; margin-top: 8px;
  background: rgba(255, 77, 157, .12);
}

.episodes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.episode {
  background: rgba(7, 16, 24, .6); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.episode:hover, .episode:focus-visible { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(0, 229, 240, .07); outline: none; }
.episode.locked { opacity: .45; }
.episode.locked:hover { transform: none; }

.load-more { margin-top: 18px; }

/* ── Panel de detalle (al abrir una película/serie) ───────────────── */
#content-panel {
  background: linear-gradient(165deg, rgba(16, 29, 44, .9), rgba(9, 18, 28, .86));
  border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 0 40px 90px -46px rgba(0, 0, 0, .9), var(--glow);
  position: relative; overflow: hidden;
}
#content-panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 160px;
  background: radial-gradient(600px 180px at 20% 0%, rgba(0, 229, 240, .16), transparent 70%),
              radial-gradient(500px 160px at 90% 0%, rgba(123, 97, 255, .16), transparent 70%);
  pointer-events: none;
}
#content-panel > * { position: relative; }
#content-panel > h2 { font-size: clamp(22px, 4vw, 32px); margin: 0 0 4px; }
#content-panel > button.ghost:first-of-type {
  position: absolute; top: clamp(16px, 3vw, 26px); right: clamp(16px, 3vw, 26px);
  margin: 0; z-index: 2;
}
#content-panel > p { color: var(--muted); max-width: 70ch; font-size: 15px; margin: 10px 0 18px; }
#content-panel > button:not(.ghost) {
  font-size: 16px; padding: 13px 26px; display: inline-flex; align-items: center; gap: 10px;
}
#content-panel > button:not(.ghost)::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #04171b;
}
#content-panel .episodes { margin-top: 20px; }

/* ── Reproductor ──────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: radial-gradient(1000px 700px at 50% 30%, rgba(8, 20, 30, .82), rgba(2, 6, 9, .96));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: clamp(12px, 3vw, 24px); z-index: 50;
}
.player-box {
  width: 100%; max-width: 980px;
  background: linear-gradient(165deg, rgba(14, 26, 38, .9), rgba(8, 16, 24, .9));
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .95), var(--glow);
}
.player-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
#player-title { font-size: 18px; font-weight: 700; }

/* ── Escenario del reproductor (vídeo + capas) ────────────────────── */
.player-stage { position: relative; border-radius: 14px; overflow: hidden; background: #000; }
#video { width: 100%; max-height: 72vh; background: #000; display: block; }
.player-stage:fullscreen { background: #000; border-radius: 0; display: grid; place-items: center; }
.player-stage:fullscreen #video { max-height: 100vh; height: 100vh; width: 100%; object-fit: contain; }

/* ── Cargando creativo ────────────────────────────────────────────── */
.player-loading {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: radial-gradient(600px 400px at 50% 45%, rgba(4, 12, 18, .55), rgba(2, 6, 9, .82));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.pl-ring { position: relative; width: 74px; height: 74px; }
.pl-ring span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent);
  animation: pl-spin 1s linear infinite;
}
.pl-ring span:nth-child(2) { inset: 10px; border-top-color: var(--accent-2); animation-duration: 1.4s; animation-direction: reverse; }
.pl-ring span:nth-child(3) { inset: 20px; border-top-color: var(--accent-3); animation-duration: 1.8s; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
.pl-text {
  margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .3px; color: var(--text);
  text-shadow: 0 0 16px rgba(0, 229, 240, .4); text-align: center; max-width: 80%;
}
.player-loading.tv-nospin .pl-ring { display: none; }  /* mensajes de error: sin ruedecita */
@media (prefers-reduced-motion: reduce) { .pl-ring span { animation: none; } }

/* Botón grande central (cuando está en pausa) */
.pb-big {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 76px; height: 76px; border-radius: 50%; padding: 0;
  background: rgba(0, 229, 240, .16); border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
}
.pb-big::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent var(--text); margin-left: 5px; }
.pb-big:hover { background: rgba(0, 229, 240, .28); transform: translate(-50%, -50%) scale(1.06); }

/* ── Barra de control propia ──────────────────────────────────────── */
.player-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(3, 9, 14, .92), rgba(3, 9, 14, .55) 70%, transparent);
}
.pb-btn {
  background: transparent; border: none; box-shadow: none; color: var(--text);
  font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 10px; cursor: pointer;
}
.pb-btn:hover { background: rgba(255, 255, 255, .1); transform: none; }
.pb-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }
.pb-seek { flex: 1 1 140px; min-width: 120px; height: 6px; cursor: pointer; accent-color: var(--accent); }
.pb-seek:disabled { opacity: .5; cursor: default; }
.pb-vol { width: 84px; accent-color: var(--accent); }
.pb-sel { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pb-sel select {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font: inherit; max-width: 130px;
}
.pb-sel select:focus-visible, .pb-btn:focus-visible, .pb-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#player-status { font-size: 13px; }
@media (max-width: 560px) {
  .pb-vol { display: none; }
  .pb-sel select { max-width: 92px; }
  .pb-seek { flex-basis: 100%; order: 5; }
}

/* ── Capa de animación (failsafe: sólo activa con tv-anime.js vivo) ── */
.tv-anime-on .tv-pend { opacity: 0; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #topbar { flex-wrap: wrap; gap: 10px; }
  #topbar .search { order: 3; flex-basis: 100%; }
  .login-card { padding: 28px 22px; }
  .login-card h1 { font-size: 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
}

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

[hidden] { display: none !important; }

/* ═══════════════ TV en vivo ═══════════════ */
.live-shell { display: block; }
.live-tuning { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.live-hero {
  position: relative; overflow: hidden; margin: 4px 0 28px; padding: clamp(22px, 4vw, 40px);
  border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(520px 260px at 0% 0%, rgba(255, 59, 92, .30), transparent 70%),
    radial-gradient(620px 300px at 100% 100%, rgba(0, 229, 240, .20), transparent 70%),
    linear-gradient(135deg, rgba(20, 12, 28, .95), rgba(8, 18, 30, .95));
  box-shadow: 0 40px 90px -50px rgba(255, 59, 92, .55), var(--glow);
}
.live-hero-top h1 { margin: 10px 0 4px; font-size: clamp(32px, 6vw, 60px); font-weight: 900; letter-spacing: -.02em; }
.live-stats { margin: 0; color: #cfdde6; font-weight: 600; }
.live-dot {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: .18em; color: #fff; background: rgba(255, 59, 92, .9);
  box-shadow: 0 8px 26px -8px rgba(255, 59, 92, .9);
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.live-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.live-search {
  flex: 1 1 260px; padding: 13px 18px; font: inherit; color: var(--text); border-radius: 14px;
  border: 1px solid var(--line); background: rgba(4, 10, 16, .75);
}
.live-search:focus { outline: none; border-color: rgba(255, 59, 92, .7); box-shadow: 0 0 0 3px rgba(255, 59, 92, .18); }
.live-country {
  flex: 0 1 230px; padding: 12px 14px; font: inherit; font-weight: 700; color: var(--text); border-radius: 14px;
  border: 1px solid var(--line); background: rgba(4, 10, 16, .75); cursor: pointer;
}
.live-country:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.live-results[hidden], .live-rows[hidden] { display: none !important; }
.live-results-title { font-size: 18px; margin: 0 0 14px; }
.live-pick {
  margin: 0 0 26px; padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--line-strong);
  color: #cfdde6; background: rgba(0, 229, 240, .05);
}

/* filas y tarjetas de canal */
#catalog .grid.live-row { grid-auto-columns: clamp(168px, 46vw, 230px); }
.live-mine .shelf-head h2 { color: #ffd45e; }
.ch-tile { background: transparent; border: none; box-shadow: none; overflow: visible; backdrop-filter: none; }
.ch-tile::after { content: none; }
.ch-art {
  position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center; font-size: 26px; font-weight: 900; color: var(--accent);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(0, 229, 240, .16), transparent 60%),
    linear-gradient(160deg, #142233, #0a131e 70%);
  transition: border-color .18s ease, box-shadow .2s ease;
}
.ch-art .ch-logo { width: 72%; height: 70%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.ch-tile:hover .ch-art, .ch-tile:focus-visible .ch-art {
  border-color: rgba(255, 59, 92, .7); box-shadow: 0 18px 40px -20px rgba(255, 59, 92, .8);
}
.ch-tile:hover, .ch-tile:focus-visible { transform: translateY(-4px); outline: none; }
.ch-live {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 10px;
  font-weight: 900; letter-spacing: .12em; color: #fff; background: rgba(255, 59, 92, .92);
}
.ch-q {
  position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 800;
  color: #04171b; background: var(--accent);
}
.ch-star {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  font-size: 17px; line-height: 1; color: #fff; background: rgba(4, 10, 16, .65); border: 1px solid var(--line);
  box-shadow: none; opacity: 0; transition: opacity .15s ease, transform .15s ease;
}
.ch-star.on { color: #ffd45e; opacity: 1; }
.ch-tile:hover .ch-star, .ch-tile:focus-within .ch-star { opacity: 1; }
.ch-star:hover { transform: scale(1.12); filter: none; }
@media (hover: none) { .ch-star { opacity: 1; } }
.ch-name { margin-top: 8px; font-size: 14px; font-weight: 700; line-height: 1.25; }
.ch-tile.down .ch-art { filter: grayscale(1); opacity: .5; }
.ch-tile.down .ch-live { background: #5c6670; }
.ch-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* países */
.country-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.country-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: var(--text); border: 1px solid var(--line); box-shadow: none;
  font-weight: 700;
}
.country-chip:hover { background: rgba(0, 229, 240, .1); border-color: var(--line-strong); filter: none; }
.chip-flag { font-size: 22px; line-height: 1; }
.chip-count { font-size: 12px; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); }

/* reproductor: favorito, aviso de canal y lista */
.player-head { gap: 10px; }
.pb-fav {
  margin-left: auto; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 20px;
  background: rgba(255, 255, 255, .06); color: #fff; border: 1px solid var(--line); box-shadow: none;
}
.pb-fav.on { color: #ffd45e; }
.ch-osd {
  position: absolute; top: 18px; left: 18px; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 14px; background: rgba(4, 10, 16, .78); border: 1px solid var(--line-strong);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
}
.ch-osd.show { animation: osd 2.6s ease forwards; }
@keyframes osd { 0% { opacity: 0; transform: translateY(-8px); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }
.osd-num { font-size: 26px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.osd-name { font-size: 18px; font-weight: 800; }
.ch-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 3; width: min(300px, 80%); overflow-y: auto;
  padding: 14px 10px 84px;   /* la barra de controles (z 4) queda por encima y siempre usable */
  background: linear-gradient(270deg, rgba(4, 10, 16, .96), rgba(4, 10, 16, .88));
  border-left: 1px solid var(--line);
}
.ch-drawer[hidden] { display: none !important; }
.drawer-title { margin: 0 6px 10px; font-weight: 800; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.drawer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.drawer-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px;
  background: transparent; color: var(--text); border: 1px solid transparent; box-shadow: none; font-weight: 600;
  border-radius: 10px;
}
.drawer-item:hover { background: rgba(255, 255, 255, .06); transform: none; filter: none; }
.drawer-item.current { background: rgba(255, 59, 92, .18); border-color: rgba(255, 59, 92, .55); }
.drawer-item.down { opacity: .45; }
.drawer-num { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .live-dot::before { animation: none; }
  .ch-osd.show { animation: none; opacity: 1; transform: none; }
}

/* ── Vista rápida de una carátula (sin salir del catálogo) ─────────── */
/* Panel bajo la fila de la carátula pulsada; en el móvil, hoja inferior.
   Sólo transform/opacity animados (más el trazo del anillo, un SVG pequeño). */
.card.qv-on .poster { box-shadow: 0 0 0 2px var(--accent), 0 20px 44px -20px rgba(0, 229, 240, .75); }
.card.qv-on .title { color: var(--accent); }
.qv-panel {
  --qv-arrow: 50%;
  position: relative; isolation: isolate; grid-column: 1 / -1; flex-basis: 100%;
  min-height: 250px; margin: 2px 0 28px; border-radius: 20px; outline: none;
  background: var(--card-solid); border: 1px solid rgba(0, 229, 240, .28);
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .95), var(--glow);
  animation: qvIn .38s cubic-bezier(.2, .7, .2, 1) both;
}
.qv-panel::before {
  content: ""; position: absolute; z-index: 3; top: -9px; left: var(--qv-arrow);
  width: 16px; height: 16px; margin-left: -8px; transform: rotate(45deg);
  background: var(--card-solid); border-left: 1px solid rgba(0, 229, 240, .28); border-top: 1px solid rgba(0, 229, 240, .28);
}
.qv-bg, .qv-shade { position: absolute; inset: 0; border-radius: inherit; }
.qv-bg { z-index: -2; overflow: hidden; }
.qv-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
  opacity: 0; transition: opacity .5s ease;
}
.qv-bg img.on { opacity: 1; animation: qvDrift 18s ease-out both; }
.qv-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 9, 15, .97) 0%, rgba(5, 9, 15, .84) 44%, rgba(5, 9, 15, .3) 100%),
    linear-gradient(0deg, rgba(5, 9, 15, .9) 0%, rgba(5, 9, 15, 0) 55%);
}
.qv-panel:not(.has-bg) .qv-shade {
  background: radial-gradient(120% 140% at 100% 0%, rgba(123, 97, 255, .2), transparent 55%),
              radial-gradient(90% 120% at 0% 100%, rgba(0, 229, 240, .12), transparent 60%);
}
.qv-grab { display: none; }
.qv-close, .qv-close:hover, .qv-close:active {
  position: absolute; z-index: 2; top: 14px; right: 14px; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; font-size: 14px; line-height: 1; color: #fff;
  background: rgba(5, 9, 15, .62); border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; filter: none;
}
.qv-close { transition: transform .25s ease; }
.qv-close:hover { transform: rotate(90deg); }
.qv-content {
  display: flex; align-items: flex-start; gap: clamp(18px, 3vw, 30px);
  max-width: 1000px; padding: clamp(20px, 3vw, 34px); padding-right: clamp(56px, 6vw, 72px);
}
.qv-poster {
  flex: none; width: clamp(110px, 12vw, 160px); aspect-ratio: 2 / 3; overflow: hidden;
  display: grid; place-items: center; border-radius: 14px; background: var(--bg-soft);
  font-size: 42px; font-weight: 900; color: var(--muted);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 26px 50px -24px #000;
  animation: qvPop .5s .05s cubic-bezier(.2, .7, .2, 1) both;
}
.qv-poster img { width: 100%; height: 100%; object-fit: cover; }
.qv-text { flex: 1; min-width: 0; }
.qv-text > * { animation: qvFade .45s cubic-bezier(.2, .7, .2, 1) both; }
.qv-text > :nth-child(2) { animation-delay: .05s; }
.qv-text > :nth-child(3) { animation-delay: .1s; }
.qv-text > :nth-child(4) { animation-delay: .15s; }
.qv-text > :nth-child(5) { animation-delay: .2s; }
.qv-tag { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--accent); }
.qv-panel .qv-title {               /* gana a `.shelf h3`: el panel vive dentro de una fila */
  margin: 6px 0 12px; font-size: clamp(22px, 3vw, 34px); line-height: 1.1; font-weight: 900; color: var(--text);
}
.qv-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.qv-ring-slot:empty { display: none; }
.qv-ring { position: relative; width: 52px; height: 52px; flex: none; }
.qv-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.qv-ring circle { fill: none; stroke-width: 5; }
.qv-ring .track { stroke: rgba(255, 255, 255, .12); }
.qv-ring .value { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1); }
.qv-ring.hi .value { stroke: var(--accent); }
.qv-ring.mid .value { stroke: #ffc24b; }
.qv-ring.lo .value { stroke: var(--accent-3); }
.qv-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.qv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qv-chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #e6f3f8;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
}
.qv-chip.genre { color: var(--accent); background: rgba(0, 229, 240, .08); border-color: rgba(0, 229, 240, .35); }
.qv-chip.soft { color: var(--muted); }
.qv-chip.warn { color: #ffd27a; background: rgba(255, 194, 75, .1); border-color: rgba(255, 194, 75, .45); }
.qv-overview {
  max-width: 70ch; max-height: 9.6em; overflow-y: auto; margin: 0 0 20px;
  font-size: 15px; line-height: 1.6; color: #d7e7ef; scrollbar-width: thin;
}
.qv-overview.loading {
  position: relative; overflow: hidden; min-height: 4.8em; border-radius: 10px;
  background: rgba(255, 255, 255, .06);
}
.qv-overview.loading::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent);
  animation: qvShimmer 1.2s ease-in-out infinite;
}
.qv-overview.swap { animation: qvFade .45s ease both; }
.qv-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.qv-play { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; font-size: 15px; }
.qv-play::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #04171b;
}
.qv-out { animation: qvOut .26s ease both; }
@keyframes qvIn { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes qvOut { to { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes qvPop { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes qvFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes qvDrift { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes qvShimmer { to { transform: translateX(100%); } }
@keyframes qvUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes qvDown { to { transform: translateY(100%); } }
@keyframes qvScrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes qvScrimOut { to { opacity: 0; } }

/* Móvil: hoja que sube desde abajo; se cierra tocando fuera, con ✕ o deslizando. */
html.qv-lock, html.qv-lock body { overflow: hidden; }
.qv-sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.qv-scrim { position: absolute; inset: 0; background: rgba(2, 5, 9, .64); animation: qvScrimIn .3s ease both; }
.qv-panel.qv-sheet {
  width: 100%; max-height: 86vh; margin: 0; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 22px 22px 0 0; border-bottom: none; padding-bottom: env(safe-area-inset-bottom);
  animation: qvUp .38s cubic-bezier(.2, .7, .2, 1) both; transition: transform .25s ease;
}
.qv-sheet::before { content: none; }
.qv-sheet .qv-bg { bottom: auto; height: 240px; border-radius: 22px 22px 0 0; }
.qv-sheet .qv-shade {
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(18, 33, 50, .1) 0, rgba(18, 33, 50, .7) 150px, var(--card-solid) 240px);
}
.qv-sheet .qv-grab {
  display: block; position: relative; z-index: 2; width: 44px; height: 5px; margin: 10px auto 0;
  border-radius: 5px; background: rgba(255, 255, 255, .35);
}
/* Carátula + título/valoración arriba; sinopsis y botones debajo a todo el ancho. */
.qv-sheet .qv-content {
  display: grid; grid-template-columns: 92px 1fr; column-gap: 16px; align-items: start;
  padding: 18px 18px 26px;
}
.qv-sheet.has-bg .qv-content { padding-top: 110px; }
.qv-sheet .qv-text { display: contents; }
.qv-sheet .qv-poster { grid-column: 1; grid-row: 1 / span 3; width: 92px; border-radius: 12px; }
.qv-sheet .qv-tag, .qv-sheet .qv-title, .qv-sheet .qv-meta { grid-column: 2; }
.qv-sheet .qv-tag { align-self: end; padding-top: 4px; }
.qv-panel.qv-sheet .qv-title { font-size: 22px; margin: 4px 0 10px; }
.qv-sheet .qv-meta { margin-bottom: 0; gap: 10px; }
.qv-sheet .qv-ring { width: 44px; height: 44px; }
.qv-sheet .qv-overview, .qv-sheet .qv-actions { grid-column: 1 / -1; }
.qv-sheet .qv-overview { max-height: none; overflow: visible; margin: 18px 0 20px; font-size: 14.5px; }
.qv-sheet .qv-actions > button { flex: 1 1 140px; justify-content: center; white-space: nowrap; padding: 13px 12px; font-size: 15px; }
.qv-sheet .qv-chip.soft { display: none; }       /* en el teléfono, sin el chip de votos */
.qv-sheet-wrap.qv-out { animation: none; }
.qv-sheet-wrap.qv-out .qv-scrim { animation: qvScrimOut .26s ease both; }
.qv-sheet-wrap.qv-out .qv-sheet { animation: qvDown .26s ease both; }
@media (prefers-reduced-motion: reduce) {
  .qv-panel, .qv-poster, .qv-text > *, .qv-bg img.on, .qv-overview.swap, .qv-out,
  .qv-scrim, .qv-panel.qv-sheet, .qv-sheet-wrap.qv-out .qv-scrim, .qv-sheet-wrap.qv-out .qv-sheet,
  .qv-overview.loading::after { animation: none; }
  .qv-ring .value, .qv-bg img, .qv-close { transition: none; }
}

/* ── Pantallas a la vez: aviso dentro del reproductor ───────────────── */
.sl-panel {
  position: absolute; inset: 0; z-index: 4; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: clamp(18px, 4vw, 40px); gap: 6px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 77, 157, .14), transparent 60%), rgba(5, 9, 15, .94);
  animation: qvFade .4s ease both;
}
.player-stage.sl-on { min-height: min(580px, 84vh); }
.sl-screens { display: flex; gap: 10px; margin-bottom: 10px; }
.sl-screens i {
  position: relative; width: 44px; height: 30px; border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .04);
}
.sl-screens i::after {                       /* el pie de la pantalla */
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 3px; margin-left: -8px;
  border-radius: 2px; background: rgba(255, 255, 255, .25);
}
.sl-screens i.on { border-color: var(--accent-3); background: rgba(255, 77, 157, .18); animation: slOn 1.8s var(--d, 0s) ease-in-out infinite; }
.sl-screens i.me { border-style: dashed; border-color: rgba(0, 229, 240, .7); animation: slWait 1.4s ease-in-out infinite; }
.sl-panel h3 { margin: 6px 0 0; font-size: clamp(20px, 3vw, 28px); font-weight: 900; }
.sl-panel > p { margin: 4px 0 8px; color: var(--muted); max-width: 46ch; }
.sl-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; width: min(100%, 460px); }
.sl-list li {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left;
  padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
}
.sl-list .sl-ico { grid-row: 1 / span 2; font-size: 22px; }
.sl-list b { font-size: 14.5px; }
.sl-list span:last-child { font-size: 13px; color: var(--muted); }
.sl-wait { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 14px; font-weight: 700; margin: 4px 0 12px; }
.sl-ring {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 3px solid rgba(0, 229, 240, .25); border-top-color: var(--accent); animation: pl-spin .9s linear infinite;
}
.sl-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sl-tip { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
@keyframes slOn { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes slWait { 0%, 100% { opacity: .45; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ── Mi cuenta: plan, pantallas y dispositivos conectados ──────────────── */
.account-panel .acc-body { max-width: 860px; }
.acc-plan {
  position: relative; overflow: hidden; margin: 6px 0 26px; padding: clamp(18px, 3vw, 28px); border-radius: 18px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(123, 97, 255, .22), transparent 55%),
              radial-gradient(90% 120% at 0% 100%, rgba(0, 229, 240, .14), transparent 60%), var(--card-solid);
  border: 1px solid rgba(0, 229, 240, .22);
}
.acc-hello { margin: 0 0 14px; font-size: clamp(20px, 3vw, 26px); font-weight: 900; }
.acc-meter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.acc-meter:empty { display: none; }
.acc-meter i { width: 38px; height: 26px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .22); }
.acc-meter i.on { border-color: var(--accent); background: rgba(0, 229, 240, .2); box-shadow: 0 0 18px -4px rgba(0, 229, 240, .8); }
.acc-usage { margin: 0 0 4px; font-weight: 800; color: var(--accent); }
.acc-expiry { margin: 0; color: var(--muted); font-size: 14px; }
.acc-expiry.warn { color: #ffd27a; }
.acc-head { margin: 0 0 6px; font-size: 18px; }
.account-panel .acc-head { color: var(--text); }
.acc-note { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.acc-devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.acc-device {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ico info" "btn btn"; gap: 10px 14px;
  align-items: center; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  transition: opacity .3s ease, transform .3s ease;
}
.acc-device.current { border-color: rgba(0, 229, 240, .45); background: rgba(0, 229, 240, .06); }
.acc-device.watching { border-color: rgba(255, 77, 157, .45); }
.acc-device.leaving { opacity: 0; transform: translateX(16px) scale(.97); }
.acc-ico { grid-area: ico; font-size: 28px; }
.acc-info { grid-area: info; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acc-info b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-tags:empty { display: none; }
.acc-tags em {
  font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; color: var(--accent); background: rgba(0, 229, 240, .1);
}
.acc-tags em.tv { color: #c9b8ff; background: rgba(123, 97, 255, .16); }
.acc-status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.acc-device.watching .acc-status { color: #ffc4dd; }
.acc-live { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent-3); }
.acc-live::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-3);
  animation: heroPulse 1.6s ease-out infinite;
}
.acc-out { grid-area: btn; justify-self: stretch; padding: 9px 14px; font-size: 14px; }
.acc-out.armed, .acc-all.armed { color: #fff; background: rgba(255, 77, 157, .22); border-color: rgba(255, 77, 157, .6); }
.acc-all { margin-top: 18px; }
#account { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .sl-panel, .sl-screens i.on, .sl-screens i.me, .sl-ring, .acc-live::after { animation: none; }
  .acc-device { transition: none; }
}
@media (max-width: 640px) { .account-panel .acc-body { margin-top: 22px; } }

/* ── Perfiles: «¿Quién está viendo?» ───────────────────────────────── */
.pf-c-cian    { --pf1: #00e5f0; --pf2: #0067d6; }
.pf-c-violeta { --pf1: #9d84ff; --pf2: #4a1fb8; }
.pf-c-rosa    { --pf1: #ff6aae; --pf2: #a3135a; }
.pf-c-ambar   { --pf1: #ffd166; --pf2: #d17a00; }
.pf-c-verde   { --pf1: #3ee089; --pf2: #0b7a43; }
.pf-c-rojo    { --pf1: #ff6b6b; --pf2: #a31b1b; }
.pf-c-azul    { --pf1: #5b9bff; --pf2: #1e3a8a; }
.pf-c-naranja { --pf1: #ff9a52; --pf2: #b84a00; }
.pf-avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; line-height: 1;
  width: 40px; height: 40px; border-radius: 12px; font-size: 22px;
  background: linear-gradient(145deg, var(--pf1, #00e5f0), var(--pf2, #0067d6));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.pf-avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 16px; }
.pf-avatar.md { width: 64px; height: 64px; border-radius: 18px; font-size: 34px; }
.pf-avatar.lg { width: clamp(96px, 14vw, 140px); height: clamp(96px, 14vw, 140px); border-radius: 26px; font-size: clamp(50px, 7vw, 72px); }
.pf-avatar.xl { width: 96px; height: 96px; border-radius: 26px; font-size: 52px; }

.pf-gate {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px 16px 40px; text-align: center;
  background: radial-gradient(80% 60% at 50% 0%, rgba(123, 97, 255, .2), transparent 60%),
              radial-gradient(70% 60% at 50% 100%, rgba(0, 229, 240, .12), transparent 60%), var(--bg);
}
.pf-gate[hidden] { display: none; }
.pf-brand { position: absolute; top: 18px; left: 22px; font-size: 22px; font-weight: 900; }
.pf-gate h1 { margin: 0 0 18px; font-size: clamp(26px, 4.4vw, 46px); font-weight: 900; letter-spacing: -.01em; }
.pf-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 3vw, 34px); max-width: 980px; }
.pf-tile, .pf-tile:hover, .pf-tile:active {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px; width: clamp(110px, 16vw, 156px);
  background: none; box-shadow: none; filter: none; border-radius: 22px; color: var(--muted);
}
.pf-tile { animation: pfRise .5s calc(var(--i, 0) * 70ms) cubic-bezier(.2, .7, .2, 1) both; transition: transform .2s ease; }
.pf-tile .pf-avatar { transition: transform .2s ease, box-shadow .2s ease; }
.pf-tile:hover .pf-avatar, .pf-tile:focus-visible .pf-avatar {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 0 0 3px var(--text), 0 18px 40px -14px var(--pf1, #00e5f0);
}
.pf-tile:focus-visible { outline: none; }
.pf-tile:hover .pf-name, .pf-tile:focus-visible .pf-name { color: var(--text); }
.pf-tile.last .pf-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.pf-tile.chosen .pf-avatar { transform: scale(1.18); transition-duration: .35s; }
.pf-gate:has(.pf-tile.chosen) .pf-tile:not(.chosen) { opacity: 0; transition: opacity .3s ease; }
.pf-name { font-size: 16px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 18px; }
.pf-tags em, .pf-kids-tag {
  font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--text);
}
.pf-tags em.kids, .pf-kids-tag { background: linear-gradient(90deg, #ffd166, #ff6aae); color: #2b0b1a; }
.pf-add { background: rgba(255, 255, 255, .06); color: var(--muted); font-weight: 300; border: 2px dashed rgba(255, 255, 255, .25); }
.pf-tile.add:hover .pf-add { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 0 transparent; }
.pf-pen {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit;
  background: rgba(5, 9, 15, .55); font-size: .55em; color: #fff;
}
.pf-info { margin: 14px 0 4px; color: var(--muted); font-size: 14px; }
.pf-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.pf-actions .ghost { letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
@keyframes pfRise { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }

/* Perfil en la barra superior */
#profile-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; white-space: nowrap; }
#profile-chip[hidden] { display: none; }
.pf-chip-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .pf-chip-name { display: none; } #profile-chip { padding: 5px; } }

/* Ventanas: editor y PIN */
.pf-modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.pf-scrim { position: absolute; inset: 0; background: rgba(2, 5, 9, .7); animation: qvScrimIn .25s ease both; }
.pf-modal {
  position: relative; width: min(100%, 560px); max-height: calc(100vh - 32px); overflow-y: auto; outline: none;
  padding: clamp(18px, 3vw, 28px); border-radius: 22px; background: var(--card-solid);
  border: 1px solid rgba(0, 229, 240, .25); box-shadow: 0 40px 90px -40px #000, var(--glow);
  animation: pfRise .32s cubic-bezier(.2, .7, .2, 1) both;
}
.pf-modal h3 { margin: 0; font-size: 22px; font-weight: 900; }
.pf-ed-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.pf-ed-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pf-ed-preview b { font-size: 13px; color: var(--muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-field { display: grid; gap: 7px; margin-bottom: 14px; }
.pf-field > span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-field input, .pf-field select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(5, 10, 16, .7); color: var(--text); font: 16px/1.4 inherit; color-scheme: dark;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.pf-field input:focus, .pf-field select:focus { outline: none; border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(0, 229, 240, .16); }
.pf-field select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.pf-pick-avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.pf-pick-avatars button, .pf-pick-avatars button:hover {
  aspect-ratio: 1; padding: 0; font-size: 22px; border-radius: 12px; box-shadow: none; filter: none;
  background: rgba(255, 255, 255, .05); border: 2px solid transparent;
}
.pf-pick-avatars button[aria-checked="true"] { border-color: var(--accent); background: rgba(0, 229, 240, .14); }
.pf-pick-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-pick-colors button, .pf-pick-colors button:hover {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; box-shadow: none; filter: none; transform: none;
  background: linear-gradient(145deg, var(--pf1), var(--pf2)); border: 3px solid transparent;
}
.pf-pick-colors button[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--pf1); }
.pf-prefs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.pf-switches { display: grid; gap: 10px; margin: 2px 0 14px; }
.pf-toggle {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.pf-toggle.off { opacity: .55; cursor: not-allowed; }
.pf-toggle-text { display: grid; gap: 2px; }
.pf-toggle-text small { color: var(--muted); font-size: 12.5px; }
.pf-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-toggle i {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .18);
  transition: background .2s ease;
}
.pf-toggle i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .2s ease;
}
.pf-toggle input:checked + i { background: var(--accent); }
.pf-toggle input:checked + i::after { transform: translateX(18px); }
.pf-toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.pf-pinbox { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); margin-bottom: 12px; }
.pf-pin-state { margin: 0 0 10px; font-size: 14px; }
.pf-pin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-error { color: #ff9cc5; min-height: 1.2em; margin: 4px 0; font-size: 14px; }
.pf-ed-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-delete { margin-top: 14px; width: 100%; color: #ff9cc5; }
.pf-delete.armed { color: #fff; background: rgba(255, 77, 157, .22); border-color: rgba(255, 77, 157, .6); }
.pf-pin { width: min(100%, 340px); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pf-dots { display: flex; gap: 14px; margin: 6px 0; }
.pf-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); transition: transform .15s ease, background .15s ease; }
.pf-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.12); }
.pf-pin-msg { margin: 0; min-height: 1.3em; color: #ff9cc5; font-size: 14px; }
.pf-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.pf-pad button, .pf-pad button:hover {
  height: 56px; padding: 0; font-size: 22px; font-weight: 800; border-radius: 16px; color: var(--text);
  background: rgba(255, 255, 255, .07); box-shadow: none; filter: none;
}
.pf-pad button:hover { background: rgba(0, 229, 240, .16); }
.pf-pad button.blank { visibility: hidden; }
.pf-pin-cancel { margin-top: 6px; }
.pf-modal.shake { animation: pfShake .42s ease both; }
@keyframes pfShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pf-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 14px; background: var(--card-solid); border: 1px solid rgba(0, 229, 240, .35);
  box-shadow: 0 20px 50px -20px #000; font-weight: 700; animation: qvFade .3s ease both;
}

/* «Mi cuenta»: fila de perfiles */
.acc-profiles { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.acc-faces { display: flex; }
.acc-faces .pf-avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--card-solid); }
.acc-profiles span { font-weight: 700; margin-left: 6px; }

/* Siguiente episodio */
.ap-next {
  position: absolute; right: 16px; bottom: 76px; z-index: 5; display: grid; gap: 6px; width: min(320px, calc(100% - 32px));
  padding: 14px 16px; border-radius: 16px; background: rgba(5, 9, 15, .9); border: 1px solid rgba(0, 229, 240, .35);
  animation: qvFade .35s ease both;
}
.ap-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.ap-next b { font-size: 15px; }
.ap-bar { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .15); overflow: hidden; position: relative; }
.ap-bar::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transform-origin: left center; animation: heroFill var(--ap, 10s) linear both;
}
.ap-row { display: flex; gap: 8px; }

/* Perfil infantil: tono más cálido */
body.pf-kids { --accent: #ffd166; }
body.pf-kids .hero-reason { background: linear-gradient(90deg, #ffd166, #ff6aae); color: #2b0b1a; }

@media (max-width: 640px) {
  .pf-prefs { grid-template-columns: 1fr; }
  .pf-pick-avatars { grid-template-columns: repeat(6, 1fr); }
  .pf-brand { position: static; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-tile, .pf-modal, .pf-scrim, .pf-modal.shake, .pf-toast, .ap-next, .ap-bar::after { animation: none; }
  .pf-tile .pf-avatar, .pf-dots i, .pf-toggle i, .pf-toggle i::after { transition: none; }
}
