/* Tap! — plató de concurso retro-neón. Un solo CSS para portada, pantalla y mando. */
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0f0826;
  --bg-2: #2a1260;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-line: rgba(255, 255, 255, 0.14);
  --ink: #fff7ff;
  --muted: #b9a8e6;
  --dark: #14092e;
  --pink: #ff3d9a;
  --cyan: #2ee6ff;
  --yellow: #ffd23f;
  --good: #35e07f;
  --bad: #ff4d5e;
  --a: #1d6fe8;
  --b: #ff7a1a;
  --c: #17b85a;
  --d: #f2c200;
  --radius: 1.2rem;
  --shadow: 0 1.2rem 2.6rem -1rem rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

html { font-size: 16px; }
/* La pantalla escala entera con la ventana, sea más ancha o más alta que 16:9 */
html.host { font-size: clamp(10px, min(1.25vw, 2.2vh), 40px); }

body {
  min-height: 100dvh;
  font-family: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(60vw 50vh at 10% -10%, rgba(255, 61, 154, 0.34), transparent 70%),
    radial-gradient(55vw 55vh at 95% 0%, rgba(46, 230, 255, 0.24), transparent 70%),
    radial-gradient(80vw 60vh at 50% 118%, rgba(255, 210, 63, 0.14), transparent 70%),
    linear-gradient(160deg, var(--bg-2), var(--bg) 62%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Bombillas de plató: una trama de puntos muy tenue */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1.5px, transparent 1.6px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 45%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, p { text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- piezas comunes ---------- */
.logo {
  display: inline-block;
  font-weight: 700;
  font-size: 3em;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  transform: rotate(-4deg);
  text-shadow: 0 0 0.12em #fff, 0 0 0.45em var(--pink), 0 0 1em var(--pink), 0.06em 0.08em 0 #7a1050;
}
.logo b { color: var(--yellow); text-shadow: 0 0 0.3em var(--yellow), 0.06em 0.08em 0 #8a5a00; }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

.btn {
  --btn: #d81f7c; /* rosa algo más oscuro: texto blanco a 4.5:1 */
  --btn-dark: #8f0f4e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.7em 1.5em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.15em;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(rgba(255, 255, 255, 0.22), transparent 55%), var(--btn);
  box-shadow: 0 0.3em 0 var(--btn-dark), 0 0.6em 1.6em -0.2em color-mix(in srgb, var(--btn) 60%, transparent);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn:active { transform: translateY(0.22em); box-shadow: 0 0.08em 0 var(--btn-dark); }
.btn:disabled { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; transform: none; }
.btn.cyan { --btn: #10b6d6; --btn-dark: #08657a; color: #06222b; }
.btn.ghost { --btn: rgba(255, 255, 255, 0.12); --btn-dark: rgba(0, 0, 0, 0.35); font-size: 0.9em; box-shadow: 0 0.3em 0 var(--btn-dark); }

.panel {
  background: linear-gradient(rgba(255, 255, 255, 0.05), transparent 40%), var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.muted { color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.3em 0.95em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-line);
  font-size: 0.9em;
  white-space: nowrap;
}

/* Colores de jugador (0-9) y de respuesta (A-D) */
.p8 { --pc: #a3e635; } .p9 { --pc: #c9d1ff; }
.p0 { --pc: #ff3b5c; } .p1 { --pc: #3d8bff; } .p2 { --pc: #ffd60a; } .p3 { --pc: #2bd96b; }
.p4 { --pc: #ff8a1f; } .p5 { --pc: #b06bff; } .p6 { --pc: #18d8c8; } .p7 { --pc: #ff6fd0; }
.o0 { --oc: var(--a); --od: #1647a8; } .o1 { --oc: var(--b); --od: #a84300; }
.o2 { --oc: var(--c); --od: #0b6e33; } .o3 { --oc: var(--d); --od: #8f7000; }

/* Avatar: personaje del color del jugador sobre un círculo oscuro */
.av {
  --s: 2.4em;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pc, var(--cyan));
  background: radial-gradient(circle at 35% 25%, #3a2678, #170b38 70%);
  box-shadow: 0 0 0 0.12em var(--pc, var(--cyan)), 0 0 1em -0.15em var(--pc, var(--cyan));
}
.av svg { width: 80%; height: 80%; display: block; }
.av.big { --s: 7.5rem; }

@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(1.2em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes bob { 50% { transform: translateY(-0.35em) rotate(2deg); } }
@keyframes glow { 50% { box-shadow: 0 0 0 0.25em #fff, 0 0 2.5em 0.6em var(--oc); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes sway { from { transform: rotate(var(--from)); } to { transform: rotate(var(--to)); } }
@keyframes flash { 0% { opacity: 0; transform: scale(1.15); } 12%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(0.96); } }
@keyframes float { 0% { transform: translateY(0) scale(0.4); opacity: 0; } 12% { opacity: 1; transform: translateY(-8vh) scale(1.1); } 100% { transform: translateY(-78vh) scale(1); opacity: 0; } }
@keyframes chat { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@keyframes shake { 20% { transform: translateX(-0.5rem) rotate(-0.4deg); } 40% { transform: translateX(0.5rem) rotate(0.4deg); } 60% { transform: translateX(-0.3rem); } 80% { transform: translateX(0.3rem); } }
@keyframes hop { 30% { transform: translateY(-1rem) scale(1.05); } 60% { transform: translateY(0); } 80% { transform: translateY(-0.35rem); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes reorder { from { transform: translateY(calc(var(--from) * (100% + 0.55rem))); } }
@keyframes wobble { 25% { transform: rotate(-1.5deg) translateX(-0.4rem); } 75% { transform: rotate(1.5deg) translateX(0.4rem); } }
@keyframes flip { from { transform: perspective(60rem) rotateX(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 70%, transparent); } to { box-shadow: 0 0 0 3rem transparent; } }

/* ---------- mascota: Foco ---------- */
.foco { width: 9em; height: auto; flex: none; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 0 1.2em rgba(255, 210, 63, 0.55)); }
.foco .eye { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
.foco .mouth, .foco .brow { display: none; }
.foco.talking { animation-duration: 0.9s; }
.foco.talking .smile { display: none; }
.foco.talking .mouth { display: block; transform-box: fill-box; transform-origin: center; animation: chat 0.16s ease-in-out infinite alternate; }
.foco.roast .brow { display: block; }
.say:empty { visibility: hidden; }
.say.in { animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.host-line.quip .foco, .host-line.mini .foco { width: 3.4rem; filter: drop-shadow(0 0 0.6em rgba(255, 210, 63, 0.55)); }
.host-line.quip { gap: 0.9rem; }
.host-line.quip .say { font-size: 1.5rem; max-width: 34em; padding: 0.35em 0.9em; }
.host-line.mini .say { font-size: 1rem; max-width: 20em; text-align: left; }
.say {
  position: relative;
  padding: 0.7em 1.1em;
  border-radius: 1.1em;
  background: #fff;
  color: #2a1260;
  font-weight: 600;
  font-size: 1.15em;
  max-width: 22em;
  box-shadow: var(--shadow);
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.say::after {
  content: '';
  position: absolute;
  left: -0.55em;
  top: 50%;
  border: 0.6em solid transparent;
  border-right-color: #fff;
  border-left: 0;
  transform: translateY(-50%);
}
.host-line { display: flex; align-items: center; gap: 1.2em; min-width: 0; }

/* Pausa: velo sobre todo */
.paused { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(15, 8, 38, 0.82); backdrop-filter: blur(6px); text-align: center; }
.paused b { display: block; font-size: clamp(3rem, 10vw, 7rem); line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); text-shadow: 0 0 0.4em rgba(255, 210, 63, 0.7); animation: pulse 1.6s infinite; }
.paused span { color: var(--muted); font-size: 1.3rem; }

.offline {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  padding: 0.4em 1.2em; border-radius: 0 0 0.8em 0.8em;
  background: var(--bad); color: #fff; font-weight: 600; z-index: 40;
}

/* ---------- portada ---------- */
.home {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6rem;
  padding: 2rem 1.2rem;
  text-align: center;
  grid-template-columns: minmax(0, 52rem); /* sin esto la columna toma el ancho de los botones y desborda en el móvil */
}
.home .logo { font-size: clamp(5rem, 22vw, 10rem); margin-bottom: 0.5rem; }
.home .tagline { font-size: clamp(1.1rem, 3.5vw, 1.6rem); max-width: 26em; }
.home .actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.home .steps { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); max-width: 52rem; width: 100%; margin-top: 1rem; }
.home .steps li { list-style: none; padding: 1rem 1.2rem; text-align: left; }
.home .steps b { display: block; color: var(--yellow); font-size: 1.1em; margin-bottom: 0.2em; }
.home ol { padding: 0; display: contents; }

/* ============================================================
   PANTALLA (host)
   ============================================================ */
.host body { height: 100dvh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }

/* Focos de plató que se mecen despacio */
.beams { position: absolute; inset: 0; }
.beams i {
  position: absolute; top: -12vh; width: 34vw; height: 135vh; transform-origin: 50% 0;
  background: linear-gradient(to bottom, var(--beam), transparent 78%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(1.2vw); opacity: 0.5;
  animation: sway 11s ease-in-out infinite alternate;
}
.beams i:nth-child(1) { left: 2%; --beam: var(--beam1); --from: -14deg; --to: 10deg; }
.beams i:nth-child(2) { left: 33%; --beam: rgba(255, 255, 255, 0.1); --from: 8deg; --to: -9deg; animation-duration: 14s; }
.beams i:nth-child(3) { left: 64%; --beam: var(--beam2); --from: -8deg; --to: 15deg; animation-duration: 9s; }

.topbar { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 4.4rem 0; }
.topbar .logo { font-size: 3rem; margin-right: 1rem; }
.topbar .room { font-size: 1.05rem; color: var(--muted); margin-right: 0.6rem; }
.topbar .room b { color: #fff; font-size: 1.6rem; letter-spacing: 0.12em; margin-left: 0.35em; }
.icon-btn {
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--panel-line);
  font-size: 1.25rem; transition: background 0.15s, opacity 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.icon-btn[aria-pressed='false'] { opacity: 0.4; background: repeating-linear-gradient(135deg, transparent 0 46%, var(--bad) 46% 54%, transparent 54%); }

/* Recorrido de rondas */
.rail { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-width: 0; }
.stop {
  display: inline-flex; align-items: center; gap: 0.45em; height: 2.5rem; padding: 0 0.7rem; border-radius: 999px;
  color: var(--muted); border: 1px solid var(--panel-line); background: rgba(255, 255, 255, 0.05); font-size: 1.1rem; white-space: nowrap;
}
.stop.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.stop.now { color: var(--dark); background: var(--yellow); border-color: var(--yellow); font-weight: 700; padding: 0 1.1rem; box-shadow: 0 0 1.4em -0.2em var(--yellow); }
.stop + .stop { position: relative; margin-left: 1.1rem; }
.stop + .stop::before { content: ''; position: absolute; right: calc(100% + 0.35rem); width: 0.9rem; height: 2px; background: var(--panel-line); }

#screen { position: relative; min-height: 0; padding: 1rem 4.4rem; display: grid; view-transition-name: screen; }
#screen > * { min-height: 0; isolation: isolate; }

/* --- lobby --- */
.lobby { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.5fr); gap: 2rem; align-items: stretch; }
.lobby .joinbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem; padding: 1.5rem; text-align: center; }
.step-n, .lobby h2 { font-size: 1.5rem; font-weight: 600; }
.lobby .qr { width: min(18rem, 36vh); aspect-ratio: 1; padding: 0.7rem; background: #fff; border-radius: 1.2rem; box-shadow: 0 0 0 0.3rem rgba(46, 230, 255, 0.35), 0 0 3rem rgba(46, 230, 255, 0.45); }
.lobby .qr svg { width: 100%; height: 100%; display: block; }
.lobby .url { font-size: 1.25rem; color: var(--cyan); word-break: break-all; }
.lobby .code { font-size: 4.4rem; font-weight: 700; letter-spacing: 0.18em; line-height: 1; padding-left: 0.18em; color: var(--yellow); text-shadow: 0 0 0.4em rgba(255, 210, 63, 0.7); }
.lobby .side { display: grid; grid-template-rows: auto 1fr auto; gap: 1.1rem; min-height: 0; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.7rem; margin-top: 0.7rem; }
.slot {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0.6rem; height: 3.4rem; padding: 0 0.8rem; border-radius: 1rem;
  border: 2px dashed var(--panel-line); color: var(--muted); font-size: 1.15rem; min-width: 0;
}
.slot.on {
  justify-content: flex-start; border: 2px solid var(--pc); color: #fff; font-weight: 600; text-align: left;
  background: linear-gradient(100deg, color-mix(in srgb, var(--pc) 34%, transparent), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 1.6em -0.5em var(--pc); animation: pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.slot .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .cap { position: absolute; top: -0.7rem; right: -0.4rem; color: var(--yellow); font-size: 1.2rem; transform: rotate(18deg); filter: drop-shadow(0 0 0.3em rgba(255, 210, 63, 0.8)); }
.slot .cap .ic, .crown .ic { fill: currentColor; }
.slot.on.away { filter: grayscale(0.7) brightness(0.7); }
.slot.on:is(:hover, :focus-visible)::after { content: '✕ quitar'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 9, 46, 0.9); color: #fff; border-radius: inherit; font-size: 0.9em; }
.settings { padding: 0.9rem 1.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 2rem; align-content: start; overflow: auto; }
.settings > :last-child { grid-column: 2; grid-row: 2; }
.settings .mode { grid-row: 1; }
.settings .pair { grid-column: 1 / -1; }
.lobby .foco { width: 6.5em; }
.settings h3 { font-size: 0.9rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.settings .pair { display: flex; gap: 0.8rem 2rem; flex-wrap: wrap; }
.toggles { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.35rem; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.9em; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--panel-line); color: var(--muted); font-size: 1.02rem; transition: all 0.15s;
}
.toggle input:checked + span { background: var(--cyan); border-color: var(--cyan); color: #06222b; font-weight: 600; box-shadow: 0 0 1em -0.3em var(--cyan); }
.toggle input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }
.lobby .go { display: flex; align-items: center; gap: 1.5rem; }
.lobby .go .btn { font-size: 1.6rem; padding: 0.65em 1.6em; white-space: nowrap; }

/* --- presentación de ronda --- */
.intro { display: grid; place-content: center; justify-items: center; text-align: center; gap: 1.4rem; }
.intro .title { position: relative; display: flex; align-items: center; gap: 2rem; text-align: left; }
.intro .rays { position: absolute; left: 4rem; top: 50%; width: 46rem; height: 46rem; margin: -23rem 0 0 -23rem; border-radius: 50%; z-index: -1; opacity: 0.5;
  background: repeating-conic-gradient(rgba(255, 210, 63, 0.16) 0 8deg, transparent 8deg 20deg); mask-image: radial-gradient(closest-side, #000 20%, transparent 85%); animation: spin 28s linear infinite; }
.intro .host-line { margin-top: 0.6rem; }
.intro .foco { width: 7.5em; }
.intro .say { font-size: 1.45rem; max-width: 24em; text-align: left; }
.round-badge {
  width: 8rem; height: 8rem; border-radius: 50%; display: grid; place-items: center; font-size: 4.2rem; color: var(--dark);
  background: radial-gradient(circle at 35% 28%, #fff3b8, var(--yellow) 60%, #d99a00);
  box-shadow: 0 0 0 0.5rem rgba(255, 210, 63, 0.2), 0 0 4rem rgba(255, 210, 63, 0.6);
  animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
  flex: none;
}
.intro .n { font-size: 1.5rem; color: var(--cyan); letter-spacing: 0.3em; text-transform: uppercase; animation: rise 0.5s 0.3s backwards; }
.intro .rule { animation: rise 0.5s 0.5s backwards; }
.intro h1 { font-size: 7.5rem; line-height: 0.95; font-weight: 700; color: #fff; transform: rotate(-3deg) skewX(-6deg);
  text-shadow: 0 0.015em 0 #ffd9ee, 0 0.03em 0 #ff9dcf, 0 0.045em 0 #ff3d9a, 0 0.06em 0 #d81f7c, 0 0.075em 0 #a8135c, 0 0.09em 0 #7a1050, 0 0.16em 0.25em rgba(0, 0, 0, 0.6); }
.intro h1 span { display: inline-block; animation: drop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) calc(var(--i) * 0.045s + 0.25s) backwards; }
.intro .rule { font-size: 1.8rem; max-width: 26em; color: #f3e9ff; }

/* --- pregunta --- */
.question { display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; }
.qhead { display: flex; align-items: center; gap: 1.2rem; font-size: 1.25rem; height: 4.6rem; }
.qhead .spacer { flex: 1; }
.chip.cat { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); font-weight: 600; }
.dots { display: inline-flex; gap: 0.45rem; }
.dots i { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: rgba(255, 255, 255, 0.18); transition: all 0.3s; }
.dots i.done { background: var(--good); }
.dots i.now { background: var(--yellow); width: 2.2rem; border-radius: 999px; box-shadow: 0 0 0.9em var(--yellow); }
.timer {
  --p: 1;
  width: 4.6rem; height: 4.6rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: radial-gradient(closest-side, #1a0d3d 78%, transparent 80%), conic-gradient(var(--cyan) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.14) 0);
  box-shadow: 0 0 1.6em -0.4em var(--cyan);
}
.timer.low { color: var(--bad); background: radial-gradient(closest-side, #1a0d3d 78%, transparent 80%), conic-gradient(var(--bad) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.14) 0); box-shadow: 0 0 1.6em -0.2em var(--bad); animation: pulse 1s infinite; }
.qbody { display: grid; align-content: center; justify-items: center; gap: 0.9rem; text-align: center; min-height: 0; }
.qcard {
  width: 100%; padding: 1.6rem 2.5rem; border-radius: 1.6rem; display: grid; place-items: center; min-height: 9.5rem;
  background: linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); border: 1px solid var(--panel-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.qcard { animation: flip 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) backwards; transition: border-color 0.3s, box-shadow 0.3s; }
.question.hurry .qcard { border-color: var(--bad); box-shadow: var(--shadow), 0 0 2.5rem -0.5rem var(--bad); }
.qtext { font-size: 3.1rem; line-height: 1.12; font-weight: 600; max-width: 24em; text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.35); }
.qtext.long { font-size: 2.5rem; }
.banner { min-height: 3.6rem; display: flex; align-items: center; justify-content: center; }
.banner > span {
  display: inline-flex; align-items: center; gap: 0.6em; padding: 0.25em 1.2em 0.25em 0.3em; border-radius: 999px;
  font-size: 1.7rem; font-weight: 700; color: var(--dark); background: var(--pc, #fff);
  box-shadow: 0 0 2em var(--pc, rgba(255, 255, 255, 0.5)); animation: pop 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.banner .av { --s: 1.8em; box-shadow: 0 0 0 0.1em var(--dark); }
.banner > span.hint { padding: 0; background: transparent; color: var(--yellow); box-shadow: none; animation: pulse 1.2s infinite; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.opt {
  position: relative; display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.2rem; min-height: 5rem;
  border-radius: 1.2rem; color: #fff; font-size: 1.9rem; font-weight: 600; line-height: 1.1;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent 50%), var(--oc);
  box-shadow: 0 0.3em 0 var(--od), 0 0.9em 1.4em -0.6em var(--oc); transition: opacity 0.4s, filter 0.4s, transform 0.4s;
}
.options.enter .opt { animation: flipin 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; animation-delay: calc(var(--i) * 0.09s + 0.15s); }
.opt.o1, .opt.o2, .opt.o3 { color: #2a2100; } /* blanco sobre naranja/verde no llega a 3:1 */
.opt .letter { flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); color: #fff; font-weight: 700; }
.opt .who { margin-left: auto; display: flex; gap: 0.3em; flex-wrap: wrap; justify-content: flex-end; }
.opt .who .av { --s: 1.5em; box-shadow: 0 0 0 0.09em #fff; animation: pop 0.3s backwards; }
.options.revealed .opt:not(.right) { opacity: 0.4; filter: saturate(0.45); transform: scale(0.97); box-shadow: 0 0.3em 0 var(--od); }
.opt.right { animation: glow 0.9s ease-in-out 3; box-shadow: 0 0 0 0.2em #fff, 0 0 2em 0.3em var(--oc); }
.options.revealed .opt.right { transform: scale(1.03); }
.opt.right .letter { background: #fff; color: var(--od); }
.opt.right .letter .ic { stroke-width: 3.5; }
.opt.struck { opacity: 0.4; filter: saturate(0.3); }
.opt.struck .txt { text-decoration: line-through; }

/* --- tira de jugadores --- */
.strip { display: flex; gap: 0.7rem; padding: 0.4rem 2rem 1.2rem; justify-content: center; }
.pcard {
  position: relative; flex: 1 1 0; max-width: 14rem; min-width: 0; display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--panel-line); border-bottom: 0.3rem solid var(--pc);
  transition: transform 0.25s, opacity 0.3s, filter 0.3s, background 0.3s;
}
.pcard .av { --s: 2.8rem; }
.who-score { min-width: 0; flex: 1; }
.pcard .name { display: flex; align-items: center; gap: 0.4em; font-size: 1rem; white-space: nowrap; color: #e9ddff; }
.pcard .name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pcard .score { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; }
.pcard .mark { position: absolute; top: 0.3rem; right: 0.5rem; font-size: 1.1rem; }
.pcard .mark .ic { stroke-width: 3.5; }
.streak { display: inline-flex; align-items: center; gap: 0.1em; color: #ffb02e; font-weight: 700; }
.streak .ic { fill: currentColor; stroke: none; }
.pcard.answered { background: rgba(255, 255, 255, 0.18); transform: translateY(-0.35rem); }
.pcard.queued { background: color-mix(in srgb, var(--pc) 30%, transparent); transform: translateY(-0.35rem); }
.pcard .place { color: var(--yellow); }
.pcard.answered .mark { color: var(--good); }
.pcard.buzzed { background: var(--pc); color: var(--dark); transform: translateY(-0.8rem) scale(1.06); box-shadow: 0 0 2.5em var(--pc); }
.pcard.buzzed .name { color: var(--dark); }
.pcard.buzzed .av { box-shadow: 0 0 0 0.12em var(--dark); }
.pcard.locked, .pcard.dead { opacity: 0.45; filter: grayscale(0.8); }
.pcard.locked .mark { color: var(--bad); }
.pcard.away { opacity: 0.4; }
.delta { padding: 0.05em 0.6em; border-radius: 999px; font-weight: 700; }
.pcard .delta { position: absolute; top: -1.1rem; right: 0.4rem; font-size: 1.2rem; animation: pop 0.4s cubic-bezier(0.2, 1.7, 0.4, 1); z-index: 1; }
.pcard:has(.delta.up) { animation: hop 0.7s ease-out; }
.pcard:has(.delta.down) { animation: shake 0.5s; }
.pcard .av { transition: transform 0.25s; }
.pcard.answered .av, .pcard.buzzed .av { transform: scale(1.12) rotate(-6deg); }
.delta.up { background: var(--good); color: #05331a; }
.delta.down { background: var(--bad); color: #fff; }

/* --- efectos: quien pulsa y reacciones --- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.flash {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--pc) 92%, #fff), color-mix(in srgb, var(--pc) 80%, #000));
  color: var(--dark); animation: flash 1.2s ease-out forwards;
}
.flash .av { --s: 14rem; box-shadow: 0 0 0 0.6rem var(--dark); }
.flash b { font-size: 7rem; line-height: 1; }
body.shake #screen { animation: shake 0.45s; }
.reaction { position: absolute; bottom: 0; display: grid; justify-items: center; animation: float 3s ease-out forwards; }
.reaction > span { font-size: 4rem; line-height: 1; filter: drop-shadow(0 0.2rem 0.4rem rgba(0, 0, 0, 0.5)); }
.reaction .av { --s: 1.8rem; margin-top: -0.4rem; }

/* --- clasificación y final --- */
.scores { display: grid; grid-template-columns: auto minmax(0, 46rem); gap: 3rem; place-content: center; align-items: center; }
.scores h1 { font-size: 3rem; margin-bottom: 1rem; }
.rows { display: grid; gap: 0.55rem; }
.row { display: grid; grid-template-columns: 2rem auto 1fr auto; align-items: center; gap: 0.9rem; padding: 0.35rem 1.3rem 0.35rem 1rem; border-radius: 999px; font-size: 1.6rem; background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 80%, transparent) var(--w, 50%), rgba(255, 255, 255, 0.08) 0); border: 1px solid var(--panel-line); animation: reorder 0.9s 1.4s cubic-bezier(0.3, 1.3, 0.5, 1) backwards; }
.row.roasted { animation: wobble 0.5s 3; outline: 0.2rem dashed var(--yellow); outline-offset: 0.2rem; }
.row.roasted .av { filter: grayscale(0.6); }
.scores .foco { width: 10em; }
.scores .host-line { flex-direction: column; gap: 1.4rem; width: 24rem; }
.scores .say { font-size: 1.5rem; text-align: center; }
.scores .host-line .foco { order: 2; }
.scores .say::after { left: 50%; top: auto; bottom: -0.55em; border: 0.6em solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }
.row .av { --s: 2.6rem; box-shadow: 0 0 0 0.1em var(--dark); }
.row .pos { font-weight: 700; text-align: center; text-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.6); }
.row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.6); }
.row .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.move { font-size: 0.6em; margin-left: 0.5em; }
.move.up { color: #b6ffd0; } .move.down { color: #ffc0c6; }

.final { display: grid; grid-template-rows: auto 1fr auto auto auto; justify-items: center; gap: 0.8rem; text-align: center; }
.final > :not(.confetti) { position: relative; z-index: 1; }
.final h1 { font-size: 4rem; line-height: 1; text-shadow: 0 0 0.4em var(--yellow); }
.final h1 b { color: var(--pc); text-shadow: 0 0 0.5em var(--pc); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1.2rem; align-self: end; }
.step { position: relative; width: 14rem; display: grid; gap: 0.25rem; justify-items: center; animation: rise 0.7s backwards; }
.step .av { --s: 5rem; }
.step.s1 .av { --s: 6.5rem; }
.crown { color: var(--yellow); font-size: 3rem; line-height: 1; margin-bottom: -0.9rem; filter: drop-shadow(0 0 0.4em rgba(255, 210, 63, 0.8)); animation: bob 2.4s ease-in-out infinite; z-index: 1; }
.step .nm { font-size: 1.8rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .sc { font-size: 1.25rem; color: var(--muted); }
.step .block { width: 100%; border-radius: 1.2rem 1.2rem 0 0; background: linear-gradient(rgba(255, 255, 255, 0.25), transparent 30%), linear-gradient(var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); display: grid; place-items: start center; padding-top: 0.4rem; font-size: 3rem; font-weight: 700; color: var(--dark); box-shadow: 0 0 2.5em -0.4em var(--pc); }
.step.s1 .block { height: 9.5rem; } .step.s2 .block { height: 6.5rem; } .step.s3 .block { height: 4.5rem; }
/* El podio se descubre por partes: Foco va nombrando y host.js añade r3, r2, r1 */
.final .step, .final h1, .final .rest, .final .awards, .final .confetti { visibility: hidden; animation: none; }
.final.r3 .s3, .final.r2 .s2, .final.r1 .s1 { visibility: visible; animation: rise 0.8s cubic-bezier(0.2, 1.4, 0.4, 1); }
.final.r1 h1 { visibility: visible; animation: pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }
.final.r1 .rest, .final.r1 .awards, .final.r1 .confetti { visibility: visible; }
.final.r1 .awards .award { animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }
.final.r1 .s1 .av { animation: hop 1s 0.8s 2; }
.final.drum:not(.r1) .podium { animation: shake 0.3s infinite; }
.rest { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; font-size: 1.15rem; }
.rest .chip { padding-left: 0.3em; display: inline-block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.rest .chip .av { display: inline-grid; vertical-align: middle; margin-right: 0.4em; }
.final .podium { min-height: 0; }
.rest .av { --s: 1.7em; }
.awards { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.award { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1.2rem 0.5rem 0.6rem; border-radius: 999px; text-align: left; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--panel-line); animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }
.award .av { --s: 2.8rem; }
.award b { display: flex; align-items: center; gap: 0.35em; color: var(--yellow); font-size: 1.15rem; }
.award span { font-size: 0.95rem; color: #e9ddff; }
.final .go { display: flex; gap: 1rem; align-items: center; padding-bottom: 0.8rem; }
.lobby .go .btn.ready { animation: pulse 1.4s ease-in-out infinite; }
.lobby .qr { animation: bob 5s ease-in-out infinite; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti i { position: absolute; top: -3vh; width: 0.7rem; height: 1.1rem; border-radius: 0.15rem; animation: fall linear infinite; }

/* ============================================================
   MANDO (móvil)
   ============================================================ */
.play body { display: grid; grid-template-rows: auto auto 1fr auto; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.phead { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; background: rgba(0, 0, 0, 0.3); border-bottom: 0.2rem solid var(--pc, transparent); font-size: 1.2rem; }
.phead .av { --s: 2.2rem; }
.phead #face { display: flex; }
.phead .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phead .pts { margin-left: auto; font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; color: var(--yellow); }
.phead .leave { font-size: 0.8rem; color: var(--muted); min-height: 44px; padding: 0 0.6rem; text-decoration: underline; }
.pbar { height: 0.45rem; background: rgba(255, 255, 255, 0.1); }
.pbar i { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 0.8rem var(--cyan); transition: background 0.3s; }
.pbar i.low { background: var(--bad); box-shadow: 0 0 0.8rem var(--bad); }

#pad { grid-row: 3; min-height: 0; padding: 1rem; display: grid; overflow-y: auto; }
#pad > * { animation: pop 0.25s ease-out; min-height: 0; }

.msg { display: grid; place-content: center; justify-items: center; gap: 0.9rem; text-align: center; padding: 0.5rem; }
.msg .big { font-size: clamp(2rem, 9vw, 3.2rem); font-weight: 700; line-height: 1.05; }
.msg .mid { font-size: 1.25rem; color: #eadfff; max-width: 20em; }
.msg .mid.small { font-size: 1rem; color: var(--yellow); }
.msg .mid.small .ic { fill: currentColor; margin-right: 0.35em; }
.msg.good .big { color: var(--good); } .msg.bad .big { color: var(--bad); }
.msg .delta { font-size: 2.6rem; }
.msg .streak { font-size: 1.2rem; }
.msg .round-badge { width: 6.5rem; height: 6.5rem; font-size: 3.4rem; }
.msg .crown { font-size: 3.5rem; margin-bottom: -1.6rem; }
.msg .btn { font-size: 1.35rem; margin-top: 0.3rem; }
.msg.good .big { animation: hop 0.8s 0.1s; }
.msg.good .delta { animation: ring 0.9s ease-out 2; }
.msg.bad { animation: shake 0.45s; }
.msg .round-badge { animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1), bob 3s 0.6s ease-in-out infinite; }
.ans { animation: rise 0.35s backwards; }
.ans.o1 { animation-delay: 0.05s; } .ans.o2 { animation-delay: 0.1s; } .ans.o3 { animation-delay: 0.15s; }
.victim { animation: rise 0.35s backwards; }

/* Elegir personaje */
.faces { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.5rem; width: 100%; max-width: 24rem; }
.face { display: grid; place-items: center; padding: 0.15rem; border-radius: 50%; opacity: 0.55; transition: transform 0.12s, opacity 0.12s; }
.face .av { --s: 100%; aspect-ratio: 1; height: auto; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.face.on { opacity: 1; transform: scale(1.12); }
.face.on .av { box-shadow: 0 0 0 3px #fff, 0 0 1rem var(--pc, var(--cyan)); }

.join { display: grid; align-content: center; justify-items: stretch; gap: 0.85rem; max-width: 24rem; width: 100%; margin: 0 auto; text-align: center; }
.join .logo { font-size: 4.2rem; justify-self: center; margin-bottom: 0.3rem; }
.join label, .join .label { display: grid; gap: 0.3rem; text-align: left; color: var(--muted); font-size: 0.95rem; }
.join input {
  padding: 0.7rem 1rem; border-radius: 0.9rem; font-size: 1.4rem; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.35); border: 2px solid var(--panel-line); width: 100%;
}
.join input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(46, 230, 255, 0.25); }
.join input#room { text-transform: uppercase; letter-spacing: 0.35em; text-align: center; font-size: 1.9rem; }
.join .btn { font-size: 1.4rem; margin-top: 0.3rem; }
.join .err { color: #fff; background: var(--bad); padding: 0.5rem 0.8rem; border-radius: 0.7rem; font-weight: 600; }

.answers { display: grid; grid-template-rows: auto repeat(4, 1fr); gap: 0.7rem; }
.answers .lead { text-align: center; font-size: 1.15rem; font-weight: 600; color: var(--yellow); min-height: 1.4em; }
.ans {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.5rem 1rem; min-height: 64px; border-radius: 1.2rem;
  color: #fff; font-size: clamp(1.1rem, 5vw, 1.6rem); font-weight: 600; text-align: left; line-height: 1.1;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent 50%), var(--oc);
  box-shadow: 0 0.4rem 0 var(--od); transition: transform 0.06s, box-shadow 0.06s, opacity 0.2s;
}
.ans.o1, .ans.o2, .ans.o3 { color: #2a2100; }
.ans .letter { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); color: #fff; font-size: 1.5rem; font-weight: 700; }
.ans:active { transform: translateY(0.3rem); box-shadow: 0 0.1rem 0 var(--od); }
.answers.sent .ans { opacity: 0.25; pointer-events: none; }
.answers.sent .ans.mine { opacity: 1; box-shadow: 0 0 0 0.25rem #fff, 0 0.4rem 0 var(--od); }

.buzzwrap { display: grid; place-content: center; justify-items: center; gap: 1.5rem; }
.buzz {
  width: min(74vw, 50dvh); aspect-ratio: 1; border-radius: 50%;
  font-size: clamp(2rem, 11vw, 3.4rem); font-weight: 700; color: #fff; text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.3);
  background: radial-gradient(circle at 35% 28%, #ffb3bd, #ff2d4b 45%, #b3001f);
  box-shadow: 0 1.1rem 0 #7a0016, 0 0 0 0.9rem rgba(255, 255, 255, 0.12), 0 0 0 1.1rem rgba(255, 255, 255, 0.05), 0 0 4rem rgba(255, 45, 75, 0.7);
  transition: transform 0.05s, box-shadow 0.05s;
  animation: pulse 1.1s ease-in-out infinite;
}
.buzz:active { transform: translateY(0.8rem); box-shadow: 0 0.3rem 0 #7a0016, 0 0 0 0.9rem rgba(255, 255, 255, 0.12); animation: none; }
.buzz:disabled { filter: grayscale(0.9) brightness(0.55); animation: none; }
.buzz.late { filter: saturate(0.6) brightness(0.85); animation: none; }
.buzzwrap p { font-size: 1.3rem; text-align: center; font-weight: 600; }

.victims { display: grid; gap: 0.7rem; align-content: center; }
.victims h2 { text-align: center; font-size: 1.6rem; margin-bottom: 0.3rem; }
.victim { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1.1rem 0.6rem 0.6rem; min-height: 64px; border-radius: 999px; background: var(--pc); color: var(--dark); font-size: 1.4rem; font-weight: 700; box-shadow: 0 0.35rem 0 rgba(0, 0, 0, 0.35); }
.victim .av { --s: 2.8rem; box-shadow: 0 0 0 0.1em var(--dark); }
.victim span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.victim span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.victim:active { transform: translateY(0.25rem); }

.reacts { display: flex; justify-content: space-around; padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.3); border-top: 1px solid var(--panel-line); }
.reacts button { font-size: 1.9rem; width: 3.2rem; height: 3.2rem; border-radius: 50%; transition: transform 0.1s; }
.reacts button:active { transform: scale(1.35); }
.reacts button.sent { animation: pulse 0.3s; }

/* Sin animaciones: en portada y móvil manda el sistema; en la tele, el botón de la barra (que arranca según el sistema) */
@media (prefers-reduced-motion: reduce) {
  html:not(.host) *, html:not(.host) *::before, html:not(.host) *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media all {
  html.still *, html.still *::before, html.still *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   PROFUNDIDAD: plató por capas, cortes entre pantallas y brillos
   ============================================================ */
@property --beam1 { syntax: '<color>'; inherits: true; initial-value: rgba(255, 61, 154, 0.22); }
@property --beam2 { syntax: '<color>'; inherits: true; initial-value: rgba(46, 230, 255, 0.2); }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

@keyframes settle { from { transform: scale(1.1); filter: blur(12px); opacity: 0; } }
@keyframes zoomin { from { transform: scale(1.25); } }
@keyframes floor { to { background-position: 0 6vh, 0 6vh; } }
@keyframes drift { to { transform: translate(var(--dx), var(--dy)) scale(1.15); } }
@keyframes cut { from { transform: scale(14) rotate(-90deg); } to { transform: scale(0) rotate(40deg); } }
@keyframes flipin { from { transform: perspective(50rem) rotateX(-80deg) translateY(1rem); opacity: 0; } }
@keyframes gloss { 0%, 60% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
@keyframes turn { to { --spin: 360deg; } }
@keyframes ghost { from { transform: translateX(5%) scale(1.25); } to { transform: translateX(-5%); } }
@keyframes sticker { from { transform: translate(-50%, 0) scale(0.2); opacity: 0; } 15% { opacity: 1; } to { transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)) scale(1.2); opacity: 0; } }

/* La luz del plató cambia con la ronda */
body { transition: --beam1 1.2s, --beam2 1.2s; }
body[data-round='warmup'] { --beam1: rgba(255, 150, 40, 0.26); --beam2: rgba(255, 210, 63, 0.2); }
body[data-round='speed'] { --beam1: rgba(46, 230, 255, 0.26); --beam2: rgba(61, 139, 255, 0.26); }
body[data-round='buzzer'] { --beam1: rgba(255, 45, 75, 0.3); --beam2: rgba(255, 61, 154, 0.24); }
body[data-round='thief'] { --beam1: rgba(176, 107, 255, 0.3); --beam2: rgba(53, 224, 127, 0.2); }
body[data-round='countdown'] { --beam1: rgba(255, 45, 75, 0.34); --beam2: rgba(255, 138, 31, 0.26); }

/* Viñeta: oscurece los bordes y centra la mirada */
body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5, 2, 16, 0.6)); }

/* Fondo por capas: focos, luces flotando y un suelo en perspectiva que avanza */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
body.zoom .backdrop { animation: zoomin 1.6s cubic-bezier(0.5, 1, 0.89, 1); }
.backdrop::before {
  content: ''; position: absolute; left: 5vw; right: 5vw; bottom: 24vh; height: 34vh;
  background: radial-gradient(closest-side, var(--beam1), transparent); filter: blur(3vw);
}
.backdrop::after {
  content: ''; position: absolute; left: -60%; right: -60%; bottom: -2vh; height: 40vh; opacity: 0.55;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cyan) 60%, transparent) 2px, transparent 2px) 0 0 / 6vh 6vh,
    linear-gradient(0deg, color-mix(in srgb, var(--pink) 60%, transparent) 2px, transparent 2px) 0 0 / 6vh 6vh;
  transform: perspective(38vh) rotateX(62deg); transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 5%, transparent 80%);
  animation: floor 2.4s linear infinite;
}
.orbs i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; opacity: 0.45;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6), var(--c) 40%, transparent 70%); filter: blur(var(--b));
  font-style: normal; animation: drift var(--d) ease-in-out infinite alternate;
}
.orbs i:nth-child(1) { --x: 6%; --y: 22%; --s: 9vw; --c: #ff3d9a; --b: 0.9vw; --d: 13s; --dx: 5vw; --dy: -6vh; --e: '⭐'; }
.orbs i:nth-child(2) { --x: 84%; --y: 14%; --s: 6vw; --c: #2ee6ff; --b: 0.5vw; --d: 9s; --dx: -4vw; --dy: 7vh; --e: '🎈'; }
.orbs i:nth-child(3) { --x: 70%; --y: 58%; --s: 12vw; --c: #b06bff; --b: 1.4vw; --d: 17s; --dx: -7vw; --dy: -5vh; --e: '🚀'; }
.orbs i:nth-child(4) { --x: 22%; --y: 66%; --s: 5vw; --c: #ffd23f; --b: 0.4vw; --d: 11s; --dx: 6vw; --dy: -8vh; --e: '🌈'; }
.orbs i:nth-child(5) { --x: 45%; --y: 8%; --s: 3.5vw; --c: #2ee6ff; --b: 0.2vw; --d: 8s; --dx: 3vw; --dy: 5vh; --e: '🦄'; }
.orbs i:nth-child(6) { --x: 92%; --y: 72%; --s: 4vw; --c: #ff3d9a; --b: 0.3vw; --d: 10s; --dx: -5vw; --dy: -4vh; --e: '🍭'; }
.orbs i:nth-child(7) { --x: -3%; --y: 80%; --s: 14vw; --c: #2f7bff; --b: 1.8vw; --d: 19s; --dx: 6vw; --dy: -3vh; --e: '☁️'; }
.orbs i:nth-child(8) { --x: 58%; --y: 30%; --s: 2.5vw; --c: #ffd23f; --b: 0.1vw; --d: 7s; --dx: -3vw; --dy: 6vh; --e: '🪁'; }

/* Corte entre pantallas: una estrella tapa todo y se encoge */
.cut {
  position: absolute; left: 50%; top: 50%; width: 24vmax; height: 24vmax; margin: -12vmax;
  background: conic-gradient(var(--pink), var(--yellow), var(--cyan), var(--pink));
  clip-path: polygon(100.0% 50.0%, 85.7% 59.6%, 93.3% 75.0%, 76.2% 76.2%, 75.0% 93.3%, 59.6% 85.7%, 50.0% 100.0%, 40.4% 85.7%, 25.0% 93.3%, 23.8% 76.2%, 6.7% 75.0%, 14.3% 59.6%, 0.0% 50.0%, 14.3% 40.4%, 6.7% 25.0%, 23.8% 23.8%, 25.0% 6.7%, 40.4% 14.3%, 50.0% 0.0%, 59.6% 14.3%, 75.0% 6.7%, 76.2% 23.8%, 93.3% 25.0%, 85.7% 40.4%);
  animation: cut 0.95s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}

/* Cristal con filo de luz */
.panel { position: relative; backdrop-filter: blur(14px) saturate(1.3); }
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.55), transparent 30%, transparent 70%, color-mix(in srgb, var(--cyan) 70%, transparent));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.lobby .joinbox { transform: perspective(90rem) rotateY(5deg); transform-origin: 0 50%; }

/* Brillo que cruza botones, respuestas e insignias */
.btn:not(.ghost), .ans, .round-badge { position: relative; overflow: hidden; }
.btn:not(.ghost)::after, .opt::before, .ans::before, .round-badge::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  animation: gloss 4s calc(var(--i, 0) * 0.3s) infinite;
}

/* Títulos y números fantasma detrás, a otra escala: dan fondo a la escena */
.intro, .qbody { position: relative; }
.echo, .echo-n { position: absolute; z-index: -1; font-weight: 700; line-height: 1; white-space: nowrap; color: transparent; pointer-events: none; }
.echo { left: 50%; top: 50%; translate: -50% -50%; font-size: 19rem; -webkit-text-stroke: 0.12rem rgba(255, 255, 255, 0.1); animation: ghost 14s cubic-bezier(0.5, 1, 0.89, 1) both; }
.echo-n { right: 3rem; top: 50%; translate: 0 -50%; font-size: 26rem; -webkit-text-stroke: 0.12rem rgba(255, 255, 255, 0.1); }

/* Tarjeta de la pregunta: cristal con un borde de luz que gira */
.qcard { position: relative; backdrop-filter: blur(10px); box-shadow: 0 2.5rem 4rem -1.5rem rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* Con 9 o 10 jugadores la clasificación se aprieta */
.rows.many { gap: 0.3rem; }
.rows.many .row { font-size: 1.25rem; padding-block: 0.15rem; }
.rows.many .row .av { --s: 2rem; }

/* Final: rayos del color de quien gana */
.step .rays {
  position: absolute; top: -7rem; left: 50%; width: 32rem; height: 32rem; margin-left: -16rem; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(color-mix(in srgb, var(--pc) 35%, transparent) 0 8deg, transparent 8deg 20deg);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 85%); animation: spin 28s linear infinite;
}

/* Portada */
.home .logo { animation: settle 1.2s 0.35s cubic-bezier(0.5, 1, 0.89, 1) backwards; }
.home .tagline, .home .actions, .home .steps li { animation: rise 0.6s 0.9s backwards; }
.home .steps li:nth-child(2) { animation-delay: 1.05s; } .home .steps li:nth-child(3) { animation-delay: 1.2s; }

/* ============================================================
   MODO NIÑOS: más color, gorro de fiesta y pegatinas
   ============================================================ */
.foco { overflow: visible; }
.foco .hat { display: none; }
body.kids .foco .hat { display: block; }
body.kids {
  --bg: #2647c9; --bg-2: #7a3ff2; --muted: #dcd3ff;
  background:
    radial-gradient(60vw 50vh at 10% -10%, rgba(255, 95, 176, 0.5), transparent 70%),
    radial-gradient(55vw 55vh at 95% 0%, rgba(255, 210, 63, 0.4), transparent 70%),
    linear-gradient(160deg, #7a3ff2, #2647c9 60%, #13a3c9);
  background-attachment: fixed;
}
body.kids .orbs i { background: none; filter: none; opacity: 0.6; border-radius: 0; font-size: calc(var(--s) * 0.3 + 1.5vw); line-height: 1; }
body.kids .scores .host-line { gap: 3.4rem; } /* sitio para el gorro bajo el bocadillo */
body.kids .orbs i::before { content: var(--e); }
body.kids .logo b { animation: hop 1.6s infinite; display: inline-block; }
.sticker { position: absolute; left: 50%; top: 62%; font-size: 4.5rem; line-height: 1; animation: sticker 1.9s cubic-bezier(0.2, 0.9, 0.3, 1) both; }

/* ============================================================
   PLATÓ: telón, marquesina, atriles y cortes de cámara
   ============================================================ */
@keyframes drop { from { transform: translateY(-130%) rotate(-25deg); opacity: 0; } }
@keyframes band { from { transform: skewY(-2.5deg) scaleX(0); } }
@keyframes bulbs { 50% { --b1: #6b4d12; --b2: #fff3b0; } }
@keyframes vt-out-left { to { transform: translateX(-70%) rotate(-5deg) scale(0.8); opacity: 0; } }
@keyframes vt-in-right { from { transform: translateX(70%) rotate(5deg) scale(0.8); opacity: 0; } }
@keyframes vt-fly { to { transform: scale(2); opacity: 0; filter: blur(16px); } }
@keyframes vt-land { from { transform: scale(0.55); opacity: 0; } }

/* Entre preguntas la cámara se desliza; de la presentación a la pregunta, atraviesa el rótulo */
::view-transition-group(screen) { animation-duration: 0.6s; }
html[data-vt='slide']::view-transition-old(screen) { animation: vt-out-left 0.55s cubic-bezier(0.6, 0, 0.3, 1) both; }
html[data-vt='slide']::view-transition-new(screen) { animation: vt-in-right 0.55s cubic-bezier(0.2, 1, 0.3, 1) both; }
html[data-vt='zoom']::view-transition-old(screen) { animation: vt-fly 0.6s cubic-bezier(0.6, 0, 0.3, 1) both; }
html[data-vt='zoom']::view-transition-new(screen) { animation: vt-land 0.6s cubic-bezier(0.2, 1.2, 0.3, 1) both; }

/* Telón: asoma por los lados y se cierra en cada cambio de escena */
.curtains i {
  position: fixed; top: 0; bottom: 0; width: 51vw; z-index: 15; pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.6)),
    repeating-linear-gradient(90deg, #5c0c3a 0, #c9226f 1.5vw, #8a1556 2.3vw, #43082b 3.3vw);
  box-shadow: 0 0 3vw rgba(0, 0, 0, 0.85); transition: transform 0.5s cubic-bezier(0.6, 0, 0.3, 1);
}
.curtains i:first-child { left: 0; transform: translateX(-94.5%); }
.curtains i:last-child { right: 0; transform: translateX(94.5%); }
.curtains::after {
  content: 'Tap!'; position: fixed; inset: 0; z-index: 16; display: grid; place-items: center; pointer-events: none;
  font-size: 13rem; font-weight: 700; color: #fff; rotate: -4deg; opacity: 0; scale: 0.6; transition: opacity 0.15s, scale 0.3s;
  text-shadow: 0 0 0.12em #fff, 0 0 0.45em var(--yellow), 0.05em 0.07em 0 #43082b;
}
body.closed .curtains i { transform: none; }
body.closed .curtains::after { opacity: 1; scale: 1; transition-delay: 0.3s; }
/* Cada modo temático tiene su telón */
body[data-mode='friki'] .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.5), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.6)), repeating-linear-gradient(90deg, #06210f 0, #19c257 1.5vw, #0c6b30 2.3vw, #03130a 3.3vw); }
body[data-mode='80'] .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.4), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.5)), repeating-linear-gradient(90deg, #ff2d95 0 2vw, #2ee6ff 2vw 4vw, #1a0b3d 4vw 6vw); }
body[data-mode='90'] .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.4), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.5)), repeating-linear-gradient(90deg, #0fa3a3 0, #7b3fd1 1.7vw, #ffd23f 2.3vw, #0b6b6b 3.3vw); }
body[data-mode='00'] .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.4), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.5)), repeating-linear-gradient(90deg, #12357a 0, #b9c7e6 1.5vw, #3d6fd6 2.3vw, #0b2152 3.3vw); }
body[data-mode='hoy'] .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.4), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.5)), repeating-linear-gradient(90deg, #5b1fd1 0, #ff7a1a 1.7vw, #c2206e 2.4vw, #2a0f6b 3.3vw); }
body.kids .curtains i { background: linear-gradient(rgba(0, 0, 0, 0.35), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.45)), repeating-linear-gradient(90deg, #ff5fb0 0 3vw, #ffd23f 3vw 6vw, #35e07f 6vw 9vw, #2ee6ff 9vw 12vw, #b06bff 12vw 15vw); }

/* Presentación de ronda: banda de color que cruza la pantalla y letras que caen */
body { --rc: var(--pink); }
body[data-round='warmup'] { --rc: #ff8a1f; } body[data-round='speed'] { --rc: #10b6d6; } body[data-round='buzzer'] { --rc: #ff2d4b; }
body[data-round='thief'] { --rc: #8a4dff; } body[data-round='countdown'] { --rc: #e0245e; }
.intro .title::before, .intro .title::after {
  content: ''; position: absolute; left: -100vw; right: -100vw; z-index: -2; transform: skewY(-2.5deg);
  animation: band 0.6s cubic-bezier(0.2, 1, 0.3, 1) 0.05s backwards;
}
.intro .title::before { top: -1.6rem; bottom: -1.6rem; background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 55%, #000), var(--rc) 45%, color-mix(in srgb, var(--rc) 70%, #fff)); box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.7); }
.intro .title::after { bottom: -2.6rem; height: 0.6rem; background: var(--yellow); animation-delay: 0.2s; box-shadow: 0 0 1.2rem var(--yellow); }
.intro .n { color: #fff; text-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.5); }
.intro .rule { margin-top: 2.6rem; }
.echo { top: 22%; }

/* La pregunta, en una marquesina con bombillas que se alternan */
.qcard { border: 0; padding: 2.6rem 3.4rem; background: linear-gradient(#2c1670, #170b3a); box-shadow: 0 2.5rem 4rem -1.5rem rgba(0, 0, 0, 0.85), inset 0 0 0 1.2rem #3d1d8a, inset 0 0 3rem 1rem rgba(0, 0, 0, 0.5); }
.qcard::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.2rem; pointer-events: none; --b1: #fff3b0; --b2: #6b4d12;
  background:
    radial-gradient(circle at 25% 25%, var(--b1) 0 0.26rem, transparent 0.32rem),
    radial-gradient(circle at 75% 75%, var(--b1) 0 0.26rem, transparent 0.32rem),
    radial-gradient(circle at 75% 25%, var(--b2) 0 0.26rem, transparent 0.32rem),
    radial-gradient(circle at 25% 75%, var(--b2) 0 0.26rem, transparent 0.32rem);
  background-size: 2.4rem 2.4rem; background-repeat: round;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  filter: drop-shadow(0 0 0.3rem #ffd23f); animation: bulbs 0.9s steps(1) infinite;
}
.question.hurry .qcard::before { --b1: #ff8f9a; filter: drop-shadow(0 0 0.4rem var(--bad)); animation-duration: 0.35s; }
.qtext { font-size: 2.8rem; } .qtext.long { font-size: 2.3rem; }

/* Las respuestas, como paneles girados hacia el público */
.options { perspective: 70rem; }
.opt:nth-child(odd) { rotate: y -5deg; transform-origin: 100% 50%; }
.opt:nth-child(even) { rotate: y 5deg; transform-origin: 0 50%; }

/* Concursantes: cada uno en su atril, con el marcador encendido */
.strip { align-items: flex-end; gap: 0.6rem; padding: 0.2rem 4.6rem 0.8rem; }
.pcard { max-width: 10.5rem; flex-direction: column; gap: 0; padding: 0; background: none; border: 0; }
.pcard .av { --s: 3.7rem; margin-bottom: -1rem; z-index: 1; }
.who-score {
  width: 100%; padding: 1.15rem 0.5rem 0.45rem; text-align: center; clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  background: linear-gradient(rgba(255, 255, 255, 0.4), transparent 35%), linear-gradient(var(--pc), color-mix(in srgb, var(--pc) 50%, #000));
}
.pcard .name { justify-content: center; color: var(--dark); font-weight: 700; font-size: 0.95rem; }
.pcard .streak { color: var(--dark); }
.pcard .score { display: inline-block; min-width: 70%; margin-top: 0.15rem; padding: 0.05em 0.5em; border-radius: 0.45rem; font-size: 1.35rem; background: #14092e; color: var(--yellow); text-shadow: 0 0 0.4em rgba(255, 210, 63, 0.7); }
.pcard .mark { top: 0; right: 8%; z-index: 2; }
.pcard.answered, .pcard.queued, .pcard.buzzed { background: none; box-shadow: none; }
.pcard.answered .av { box-shadow: 0 0 0 0.14em var(--good), 0 0 1em var(--good); }
.pcard.buzzed { filter: drop-shadow(0 0 1.2rem var(--pc)); }
.pcard.buzzed .av { box-shadow: 0 0 0 0.14em #fff; }

/* Sala: los jugadores esperan en fila, dando botes */
.slots { grid-template-columns: repeat(10, 1fr); gap: 0.3rem; }
.slot, .slot.on { flex-direction: column; justify-content: flex-start; height: auto; padding: 0.3rem 0.1rem; gap: 0.25rem; border: 0; background: none; box-shadow: none; font-size: 0.95rem; text-align: center; }
.slot:not(.on)::before { content: ''; width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 2px dashed var(--panel-line); }
.slot .av { --s: 3.5rem; animation: bob 2.4s ease-in-out infinite; }
.slot:nth-child(even) .av { animation-delay: -1.2s; }
.slot .nm { max-width: 100%; }
.slot .cap { top: -0.5rem; right: 0.2rem; }

/* Regalo del podio: aparece con su escalón */
.step .gift { display: flex; align-items: flex-start; gap: 0.35em; max-width: 100%; margin: 0.15rem 0 0.35rem; font-size: 0.95rem; line-height: 1.2; color: #f3e9ff; text-wrap: balance; }
.step .gift .ic { color: var(--yellow); flex: none; vertical-align: 0; }
