/* TV. La base (1rem = 3vh, fuente, foco, componentes) está en css/sistema/tv-base.css.
   Aquí queda lo propio: sala, motor, Modo test y pruebas. El fondo oscuro es el de las
   escenas de los juegos y del Modo test; las pantallas del sistema llevan su fondo blanco. */
* { box-sizing: border-box; }
body {
  height: 100vh;
  overflow: hidden;
  background: #0b1020;
  color: #fff;
}
[hidden] { display: none !important; }

#escena { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Las bolas solo cambian de transform: la GPU las compone sin redibujar. */
.bola {
  position: absolute; left: 0; top: 0;
  width: 10vh; height: 10vh;
  border-radius: 50%;
  opacity: 0.35;
  will-change: transform;
}
.pantalla, .overlay { position: relative; z-index: 1; }

h2 { font-size: 1.4rem; margin: 0 0 0.6rem; }

.boton {
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b1020;
  background: #fff;
  border: 0.2rem solid transparent;
  border-radius: 0.6rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
}
.boton.grande { font-size: 1.8rem; padding: 0.8rem 2.2rem; }
/* Foco muy visible: se maneja con el mando */
.boton:focus { outline: none; border-color: #ffd60a; box-shadow: 0 0 0 0.35rem #ffd60a; }


#test, #prueba, #juego { height: 100vh; display: flex; flex-direction: column; padding: 2.4rem 1.4rem 0.8rem; }

.metricas {
  position: fixed;
  top: 0.5rem;
  left: 1.4rem;
  z-index: 5;
  display: flex;
  gap: 1.6rem;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.3rem 0.8rem;
  border-radius: 0.4rem;
}
.metricas b { color: #ffd60a; }

.sala-cuerpo { flex: 1; display: flex; gap: 1.6rem; margin-top: 0.4rem; min-height: 0; }

/* Lista de jugadores del Modo test (ficha larga con datos técnicos). La tarjeta de la
   sala es la del sistema (css/sistema/tv-base.css); aquí se deshace lo que no aplica. */
.jugadores-caja { flex: 1; min-width: 0; }
#jugadores-test { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.vacio { font-size: 1.1rem; opacity: 0.8; }

#jugadores-test .tarjeta {
  width: auto; flex-direction: row;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.1);
  border-left: 0.4rem solid #fff;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
}
#jugadores-test .tarjeta .avatar {
  width: 2.4rem; height: 2.4rem; background: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
#jugadores-test .tarjeta .avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#jugadores-test .tarjeta .nombre { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; max-width: none; white-space: normal; }
#jugadores-test .tarjeta .datos { font-size: 0.75rem; opacity: 0.9; }
#jugadores-test .punto { position: static; width: 0.7rem; height: 0.7rem; border: 0; border-radius: 50%; background: #2ecc71; display: inline-block; }
#jugadores-test .punto.reconectando { background: #ff9f1c; }

.acciones { display: flex; gap: 1rem; margin-top: 0.6rem; }

.overlay {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
#json-texto {
  font-size: 0.6rem;
  max-width: 90vw; max-height: 75vh;
  overflow: auto;
  background: #111; padding: 0.8rem; border-radius: 0.4rem;
}

/* Selector de pruebas */
.titulo-pruebas { margin-top: 1rem; }
.selector { display: grid; grid-template-columns: repeat(3, auto); gap: 0.5rem; justify-content: start; }
.selector .boton { font-size: 1rem; padding: 0.35rem 0.8rem; }
.boton:disabled { opacity: 0.35; cursor: default; }
.aviso { color: #ffd60a; font-size: 1rem; margin: 0.4rem 0 0; }

/* Prueba en curso */
.prueba-cabecera { display: flex; align-items: baseline; gap: 1.5rem; }
.prueba-cabecera h2 { font-size: 1.8rem; margin: 0; }
.prueba-tiempo { font-size: 1.4rem; color: #ffd60a; font-weight: 700; }
.prueba-cuerpo { flex: 1; min-height: 0; display: flex; gap: 1.5rem; margin-top: 0.6rem; }

/* Pulsador */
.pulsador-senal {
  flex: 1.3;
  display: flex; align-items: center; justify-content: center;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 4rem; font-weight: 800; text-align: center; line-height: 1.2;
}
.pulsador-senal.ya { background: #2ecc71; color: #0b1020; }
.pulsador-tabla { flex: 1; font-size: 1rem; }
.pulsador-tabla table { width: 100%; border-collapse: collapse; }
.pulsador-tabla th, .pulsador-tabla td { text-align: left; padding: 0.15rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.pulsador-tabla th { color: #ffd60a; font-weight: 700; }
.pulsador-tabla .ganador { color: #2ecc71; font-weight: 800; }

/* Joystick */
.arena {
  flex: 1.6; position: relative; overflow: hidden;
  border-radius: 1rem; border: 0.15rem solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.04);
}
.punto-jugador {
  position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; will-change: transform;
  box-shadow: 0 0 0 0.2rem rgba(255,255,255,.6);
}
.lista-joystick { flex: 1; font-size: 1rem; }
.lista-joystick p { margin: 0 0 0.6rem; }

/* Resultados */
.resultados { flex: 1; font-size: 1rem; overflow: auto; }
.resultados h3 { font-size: 1.2rem; margin: 0.4rem 0; color: #ffd60a; }
.resultados p { margin: 0.2rem 0; }

/* Inclinación: diana */
.diana {
  position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 0.3rem dashed #ffd60a; will-change: transform;
}

/* Agitar: barras de progreso */
.barra { height: 1.4rem; background: rgba(255,255,255,.12); border-radius: 0.7rem; overflow: hidden; margin-bottom: 0.8rem; }
.barra div { height: 100%; transition: width 0.15s; }

/* Selfie */
.fotos { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.foto-jugador { text-align: center; }
.foto-jugador img, .foto-vacia { width: 9rem; height: 9rem; border-radius: 1rem; object-fit: cover; display: block; }
.foto-vacia { background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.foto-jugador p { margin: 0.4rem 0 0; }

/* ---------- Juegos (motor común: js/motor/partida-tv.js) ---------- */
.selector-3 { grid-template-columns: repeat(3, auto); }
.juego-area { flex: 1; min-height: 0; position: relative; margin-top: 0.4rem; }
/* Escena de un juego: ocupa todo el área; cada juego pinta dentro con su prefijo */
.escena-juego { position: absolute; inset: 0; overflow: hidden; border-radius: 1rem; background: rgba(255,255,255,.04); border: 0.15rem solid rgba(255,255,255,.2); }
/* Piezas que mueven los juegos. :where() deja la especificidad en una clase para que el CSS de
   cada juego (cargado después) mande, y deshace la ficha de juego del sistema (tarjeta de la sala). */
:where(#juego-area) .ficha-juego { position: absolute; left: 0; top: 0; will-change: transform; display: block; flex-direction: row; gap: 0; }

/* «¿Cómo se juega?» bajo «Crear sala» */

/* Modo test: la barra de métricas y los datos técnicos de cada móvil solo se ven ahí */
body:not(.modo-test) #metricas { display: none !important; }

/* Personajes: SVG propio (círculo de color + cara). Llena su contenedor. */
.tg-personaje { display: block; width: 100%; height: 100%; }
.tg-personaje--linea { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

/* ==========================================================================
   Sala de espera (sistema «Tienda+»). Maquetas: docs/diseno/maquetas/TV-Sala*.html
   Dos aspectos: .sala--vacia (nadie dentro: QR grande) y con jugadores.
   1rem = 32 px a 1080p. Sin box-shadow ni filter; solo se anima transform.
   ========================================================================== */
#sala {
  position: fixed; inset: 0; z-index: 1;
  overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
  background: var(--tg-bg); color: var(--tg-ink);
  padding: 0 0 1.25rem;
}
#sala::-webkit-scrollbar { display: none; }
#sala p { margin: 0; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pestañas: son botones (se llega con el mando) */
#sala .tg-tab {
  appearance: none; background: none; cursor: pointer; font-family: inherit;
  border-top: 0; border-left: 0; border-right: 0; border-radius: .25rem;
}
.sala-estado { margin-left: auto; font-size: 1rem; color: var(--tg-muted); }

/* Franja de la sala */
#sala .tg-sala { margin-top: .125rem; }
#sala .tg-sala__unirse { flex: none; }
.sala-unirse-textos { display: flex; flex-direction: column; gap: .25rem; }
.sala-en { white-space: nowrap; }
.sala-titulo-vacia, .sala-primero { display: none; }
.sala-codigo-fila { display: flex; align-items: center; gap: .3125rem; }
#qr { padding: .25rem; flex: none; }
#qr img { display: block; }
#jugadores { display: flex; gap: .1875rem; }
/* Con 8 plazas la franja va justa: en la sala con jugadores, «Escanea el QR…» (sin «código»). */
#sala:not(.sala--vacia) .sala-largo { display: none; }
/* …y, con la URL real (más larga que la de la maqueta), plazas y fichas del código algo más estrechas. */
#sala:not(.sala--vacia) .tarjeta, #sala:not(.sala--vacia) .tarjeta .nombre { width: 3.125rem; max-width: 3.125rem; }
#sala:not(.sala--vacia) #codigo > span { width: 1.8125rem; height: 2.125rem; }
.tarjeta .corona svg { width: .625rem; height: .625rem; }
.tarjeta.libre .avatar > svg { width: .9375rem; height: .9375rem; }

/* «Jugar a todos» y avisos */
.sala-acciones {
  margin: 1rem 2.5rem 0; min-height: 1.875rem;
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
}
.sala-aviso { margin-right: auto !important; font-size: 1rem; color: var(--tg-ink-2); }
.sala-aviso--alerta { color: var(--tg-error); font-weight: var(--tg-w-medium); }
#btn-partida svg { width: .6875rem; height: .6875rem; }

/* Pestañas de categorías (js/motor/categorias.js): ◀ ▶ cambia la categoría al momento */
/* Siempre en una línea: si no caben, scroll horizontal (el foco lleva la pestaña a la vista). */
.sala-categorias {
  margin: .5rem 0 0; padding: .375rem 2.5rem; display: flex; gap: .5rem; /* padding: que no se corte el aro de foco */
  overflow-x: auto; scrollbar-width: none; scroll-padding: 0 2.5rem;
}
.sala-categorias::-webkit-scrollbar { display: none; }
#sala .sala-categoria { flex: none; }
#sala .sala-categoria {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 1rem; white-space: nowrap;
  height: 2rem; padding: 0 1rem; border-radius: var(--tg-r-pill);
  background: var(--tg-surface); color: var(--tg-ink);
}
#sala .sala-categoria--activa { background: var(--tg-primary); color: #FFFFFF; font-weight: var(--tg-w-medium); }
.sala--vacia .sala-categorias { display: none; }
/* Juegos con tope de jugadores (el resto mira): al final y atenuados */
.sala-juegos__aparte { grid-column: 1 / -1; font-size: 1rem; color: var(--tg-muted); }
.ficha-juego--aparte { opacity: .55; }

/* Cuadrícula de juegos en 3 columnas */
.sala-juegos { margin: .875rem 2.5rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.sala-juegos .ficha-juego {
  appearance: none; border: 0; margin: 0; padding: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left; position: relative;
}
.ficha-juego__portada { display: block; }
.ficha-juego__play svg { width: 1.3125rem; height: 1.3125rem; }
.ficha-juego__icono svg { width: 1.25rem; height: 1.25rem; }
.ficha-juego__textos { display: flex; flex-direction: column; gap: .0625rem; min-width: 0; }

.sala-pie { margin: 1.25rem 2.5rem 0; display: flex; justify-content: flex-end; }
.sala-modo-test {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: .75rem;
  height: 1.5rem; padding: 0 .75rem; border-radius: var(--tg-r-pill);
  background: var(--tg-surface); color: var(--tg-muted);
}

/* ---------- Sala vacía: unirse a lo grande (TV-SalaVacia) ---------- */
.sala--vacia .sala-pestanas, .sala--vacia .sala-acciones, .sala--vacia .sala-juegos { display: none; }
#sala:not(.sala--vacia) .sala-estado { display: none; }
.sala--vacia .tg-sala {
  height: auto; margin-top: 2.1875rem; border-bottom: 0;
  flex-wrap: wrap; justify-content: center; gap: 0;
}
.sala--vacia .tg-sala__unirse { height: auto; padding-right: 0; border-right: 0; gap: 2.5rem; }
.sala--vacia #qr { width: 13.75rem; height: 13.75rem; padding: 1.125rem; border-width: .09375rem; border-radius: 1.125rem; }
.sala--vacia .sala-unirse-textos { gap: .75rem; }
.sala--vacia .sala-titulo-vacia { display: block; font-size: 2rem; font-weight: var(--tg-w-medium); letter-spacing: -.025em; line-height: 1.05; }
.sala--vacia .tg-sala__texto { font-size: 1.25rem; line-height: 1.2; }
.sala--vacia .sala-codigo-fila { flex-direction: column; align-items: flex-start; gap: .75rem; }
.sala--vacia #codigo { gap: .4375rem; }
.sala--vacia .tg-sala__jugadores {
  flex-basis: 100%; margin: 2.8125rem 0 0; padding-top: 1.25rem;
  border-top: .0625rem solid var(--tg-line); justify-content: center;
}
.sala--vacia #jugadores { gap: 1.25rem; }
.sala--vacia .tarjeta { width: 4rem; }
.sala--vacia .tarjeta .avatar { width: 4rem; height: 4rem; border-width: .125rem; }
.sala--vacia .tarjeta.libre .avatar > svg { width: 1.375rem; height: 1.375rem; }
.sala--vacia .tarjeta.libre .nombre { display: none; }
.sala--vacia .sala-primero { display: block; flex-basis: 100%; margin-top: .875rem; text-align: center; font-size: 1.125rem; color: var(--tg-muted); }
.sala--vacia .sala-pie { position: fixed; right: 2.5rem; bottom: 1.25rem; margin: 0; }

/* Foco en la sala: en la tele no hay ratón, así que todo foco es «visible» (también el que
   pone el JS con .focus(), que algunos navegadores no marcan como :focus-visible). */
#sala button:focus { outline: .1875rem solid var(--tg-focus); outline-offset: .125rem; }
#sala .tg-focusable:focus { transform: scale(1.03); }
#sala .ficha-juego:focus { outline: none; }
#sala .ficha-juego:focus .ficha-juego__portada { outline: .1875rem solid var(--tg-focus); outline-offset: .125rem; }

/* ==========================================================================
   Pantallas comunes del motor (sistema «Tienda+»): instrucciones, cuenta atrás,
   resultado y podio. Maquetas: docs/diseno/maquetas/TV-Instrucciones, -CuentaAtras,
   -Resultado y -Podio. Durante el juego, #juego vuelve a la escena oscura de cada juego.
   ========================================================================== */
#juego.juego--comun, #juego.juego--cuenta { padding: 0; }
#juego.juego--comun { background: var(--tg-bg); color: var(--tg-ink); }
#juego.juego--cuenta { background: radial-gradient(circle at 50% 50%, #7C4DEB 0%, var(--tg-primary) 45%, #4E25B0 100%); color: #fff; }
.juego--comun .prueba-cabecera, .juego--cuenta .prueba-cabecera { display: none; }
.juego--comun .juego-area, .juego--cuenta .juego-area { margin-top: 0; }
#juego p, #juego h2, #juego ol { margin: 0; }
#juego button:focus { outline: .1875rem solid var(--tg-focus); outline-offset: .125rem; }
#juego .tg-logo__txt { font-size: 1.3125rem; }

.juego-cab { height: 3.75rem; padding: 0 2.5rem; display: flex; align-items: center; justify-content: space-between; }
.juego-cab__progreso { display: flex; align-items: center; gap: .625rem; }
.juego-cab__n { font-size: 1rem; color: var(--tg-muted); }

.juego-portada { position: relative; overflow: hidden; background: var(--fondo, var(--tg-surface)); }
.juego-portada > svg { display: block; width: 100%; height: 100%; }

/* Instrucciones */
.juego-instr { margin-top: .9375rem; padding: 0 2.5rem; display: flex; gap: 1.875rem; }
.juego-instr .juego-portada { flex: none; width: 30rem; height: 16.875rem; border-radius: 1rem; }
.juego-instr .juego-instrucciones { flex: 1; gap: .6875rem; }
.juego-instr .tg-pastilla { align-self: flex-start; }
.juego-instr .tg-pastilla svg { width: 1rem; height: 1rem; }
.juego-instr__similar { font-size: 1.375rem; color: var(--tg-muted); margin-top: -.25rem; }
.juego-instr__titulo { font-size: 2.75rem; font-weight: var(--tg-w-medium); letter-spacing: var(--tg-tracking-title); line-height: 1; }
.juego-instr ol { margin-top: .25rem; padding: 0; display: flex; flex-direction: column; gap: .5625rem; }
.juego-instr__n {
  flex: none; width: 1.625rem; height: 1.625rem; border-radius: var(--tg-r-pill); background: var(--tg-surface);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: var(--tg-w-medium); color: var(--tg-ink);
}
.juego-listos { margin: 1.5625rem 2.5rem 0; padding-top: 1.125rem; border-top: .0625rem solid var(--tg-line); display: flex; align-items: center; gap: .75rem; }
.juego-listos__textos { margin-right: .5rem; flex: none; }
.juego-listos__titulo { font-size: 1.25rem; font-weight: var(--tg-w-medium); }
.juego-listos__sub { font-size: 1rem; color: var(--tg-muted); }
.juego-listos__jugadores { display: flex; flex-wrap: wrap; gap: .75rem; }
.juego-listo { height: 3.25rem; box-sizing: border-box; border-radius: var(--tg-r-pill); background: var(--tg-surface); padding: 0 .875rem 0 .375rem; display: flex; align-items: center; gap: .5rem; }
.juego-listo.ok { background: #E6F4EA; }
.juego-listo__avatar { width: 2.5rem; height: 2.5rem; border-radius: var(--tg-r-pill); background: #fff; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.juego-listo__avatar .tg-personaje { width: 1.8125rem; height: 1.8125rem; }
.juego-listo__nombre { font-size: 1.125rem; font-weight: var(--tg-w-medium); }
.juego-listo__check { width: 1.5rem; height: 1.5rem; border-radius: var(--tg-r-pill); background: var(--tg-online); display: flex; align-items: center; justify-content: center; }
.juego-listo__check svg { width: .875rem; height: .875rem; }
.juego-listo__espera { font-size: 1rem; color: var(--tg-muted); }
/* Foto en las pantallas comunes (no en los juegos: cada uno da tamaño a su avatar) */
.juego-listo__avatar img.selfie, .juego-fila__avatar img.selfie, .podio-avatar img.selfie { width: 100%; height: 100%; object-fit: cover; border-radius: var(--tg-r-pill); }

/* Cuenta atrás */
.cuenta-cab { position: absolute; left: 2.5rem; right: 2.5rem; top: .9375rem; display: flex; align-items: center; justify-content: space-between; }
.cuenta-cab .tg-logo__txt { color: #fff; }
/* Sobre el morado, el logo va en blanco con el dibujo en morado */
.cuenta-cab .tg-logo svg .l-c { fill: #fff; stroke: #fff; }
.cuenta-cab .tg-logo svg .l-h { fill: var(--tg-primary); }
.cuenta-cab__juego { font-size: 1.125rem; font-weight: var(--tg-w-medium); color: #E8DEFF; }
.cuenta-centro { position: absolute; left: 0; right: 0; top: 4.6875rem; display: flex; flex-direction: column; align-items: center; }
#juego .juego-cuenta { position: relative; font-size: 13.125rem; }
.juego-cuenta__aro { position: absolute; inset: .9375rem; border-radius: var(--tg-r-pill); border: .4375rem solid var(--tg-primary-soft); }
.cuenta-pasos { margin-top: 1.875rem; display: flex; gap: .5rem; }
.cuenta-pasos span {
  width: 2.25rem; height: 2.25rem; box-sizing: border-box; border-radius: var(--tg-r-pill); border: .09375rem solid rgba(255, 255, 255, .5);
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: var(--tg-w-medium); color: #E8DEFF;
}
.cuenta-pasos span.actual { background: #fff; border-color: #fff; color: var(--tg-primary); font-weight: var(--tg-w-strong); }
.cuenta-frase { margin-top: .875rem !important; font-size: 1.375rem; }

/* Resultado */
.juego-res { margin-top: 1.25rem; padding: 0 2.5rem; display: flex; gap: 2.5rem; }
.juego-res__izq { width: 32.5rem; flex: none; display: flex; flex-direction: column; gap: .5rem; }
.juego-res__ante { font-size: 1rem; color: var(--tg-muted); }
.juego-res__titulo { font-size: 2.5rem; font-weight: var(--tg-w-medium); letter-spacing: var(--tg-tracking-title); line-height: 1; margin-bottom: .625rem !important; }
.juego-fila__avatar { position: relative; flex: none; width: 3.125rem; height: 3.125rem; border-radius: var(--tg-r-pill); background: #fff; display: flex; align-items: center; justify-content: center; }
.juego-fila__avatar .tg-personaje { width: 2.25rem; height: 2.25rem; }
.juego-fila__avatar .tg-medalla { position: absolute; left: -.3125rem; top: -.3125rem; color: var(--tg-ink); }
.tg-medalla--otro { background: var(--tg-surface); }
.juego-fila__textos { display: flex; flex-direction: column; min-width: 0; }
.juego-fila__nombre { font-size: 1.375rem; font-weight: var(--tg-w-medium); line-height: 1.05; white-space: nowrap; }
.juego-fila__detalle { font-size: 1rem; color: var(--tg-muted); line-height: 1.1; }
.juego-fila__total { width: 4.6875rem; flex: none; text-align: right; font-size: 1.125rem; font-weight: var(--tg-w-medium); }
.juego-fps { margin-top: .5rem !important; font-size: 1rem; color: var(--tg-muted); }
.juego-res__der { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .625rem; }
.juego-res__der .juego-portada { height: 11.25rem; border-radius: .875rem; }
.juego-res__sig { font-size: 1.5rem; font-weight: var(--tg-w-medium); letter-spacing: -.02em; }
.juego-res__cuenta { margin-top: .25rem !important; font-size: 1rem; color: var(--tg-ink-2); }
.juego-res__barra { height: .4375rem; border-radius: .21875rem; background: var(--tg-primary-soft); overflow: hidden; }
.juego-res__barra span { display: block; height: 100%; background: var(--tg-primary); transform: scaleX(0); transform-origin: left; }

/* Podio */
.podio-estallido { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* Salen de detrás del ganador (centro del podio) en abanico y luego caen. Solo transform/opacity. */
.podio-estallido span {
  position: absolute; left: 50%; top: 15.5rem; opacity: 0; will-change: transform;
  animation: confeti-estalla 1.9s both;
}
@keyframes confeti-estalla {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.3); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  2%   { opacity: 1; }
  22%  { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); animation-timing-function: cubic-bezier(.35, .1, .9, .55); }
  100% { opacity: 1; transform: translate(calc(var(--dx) * 1.35), calc(var(--dy) + 32rem)) rotate(calc(var(--r) * 3)) scale(1); }
}
.podio-lluvia { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.podio-lluvia span {
  position: absolute; top: -1.5rem; will-change: transform;
  animation-name: confeti-0; animation-timing-function: linear; animation-iteration-count: infinite; animation-fill-mode: backwards;
}
.podio-lluvia .podio-lluvia--1 { animation-name: confeti-1; }
.podio-lluvia .podio-lluvia--2 { animation-name: confeti-2; }
/* Caen de arriba abajo (33,75rem = 1080 px) con vaivén lateral y giro. Solo transform. */
@keyframes confeti-0 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(1.5rem, 9rem) rotate(180deg); }
  50%  { transform: translate(-1rem, 18rem) rotate(360deg); }
  75%  { transform: translate(1.25rem, 27rem) rotate(540deg); }
  100% { transform: translate(0, 37rem) rotate(720deg); }
}
@keyframes confeti-1 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-1.5rem, 9rem) rotate(-150deg); }
  50%  { transform: translate(1rem, 18rem) rotate(-300deg); }
  75%  { transform: translate(-1.25rem, 27rem) rotate(-450deg); }
  100% { transform: translate(0, 37rem) rotate(-600deg); }
}
@keyframes confeti-2 {
  0%   { transform: translate(0, 0) rotate(45deg) scaleX(1); }
  25%  { transform: translate(.75rem, 9rem) rotate(135deg) scaleX(.3); }
  50%  { transform: translate(-.75rem, 18rem) rotate(225deg) scaleX(1); }
  75%  { transform: translate(.75rem, 27rem) rotate(315deg) scaleX(.3); }
  100% { transform: translate(0, 37rem) rotate(405deg) scaleX(1); }
}
.podio-cab { position: absolute; left: 2.5rem; top: .9375rem; }
.podio-titulos { position: absolute; left: 0; right: 0; top: 3.75rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.podio-ante { font-size: 1.125rem; color: var(--tg-muted); }
.podio-titulo { font-size: 3.25rem; font-weight: var(--tg-w-medium); letter-spacing: -.035em; line-height: 1; }
.juego--podio .podio { position: absolute; left: 0; right: 0; bottom: 3.75rem; }
.juego--podio .juego-area::after { content: ""; position: absolute; left: 0; right: 0; bottom: 3.6875rem; height: .0625rem; background: var(--tg-line); }
.podio-avatar { position: relative; border-radius: var(--tg-r-pill); background: var(--tg-surface); display: flex; align-items: center; justify-content: center; }
.podio-1 .podio-avatar { width: 5.9375rem; height: 5.9375rem; }
.podio-2 .podio-avatar { width: 5rem; height: 5rem; }
.podio-3 .podio-avatar { width: 4.5rem; height: 4.5rem; }
.podio-avatar .tg-personaje { width: 72%; height: 72%; }
.podio-corona {
  position: absolute; left: 50%; top: -1.8125rem; width: 2.875rem; height: 2.875rem; margin-left: -1.4375rem; box-sizing: border-box;
  border-radius: var(--tg-r-pill); background: var(--tg-host); border: .15625rem solid #fff; display: flex; align-items: center; justify-content: center;
}
.podio-corona svg { width: 1.625rem; height: 1.625rem; }
.podio-nombre { font-size: 1.375rem; font-weight: var(--tg-w-medium); }

/* Entrada del podio: cada puesto lleva --ret (s) desde JS. Sube el bloque, salta el avatar
   con su nombre y al 1.º le cae la corona; después el título. Solo transform/opacity. */
.podio-puesto .tg-bloque { transform-origin: 50% 100%; animation: podio-sube .55s cubic-bezier(.25, 1.5, .5, 1) var(--ret) both; }
.podio-puesto .tg-bloque b { animation: podio-aparece .3s ease-out calc(var(--ret) + .3s) both; }
.podio-avatar, .podio-nombre { animation: podio-salta .55s cubic-bezier(.3, 1.6, .5, 1) calc(var(--ret) + .3s) both; }
.podio-1 .podio-avatar {
  animation: podio-salta .6s cubic-bezier(.3, 1.6, .5, 1) calc(var(--ret) + .3s) both,
             podio-bota 1.3s ease-in-out calc(var(--ret) + 1.6s) infinite;
}
.podio-corona { animation: corona-cae .6s cubic-bezier(.3, 1.5, .5, 1) calc(var(--ret) + .75s) both; }
.podio-titulos { animation: podio-titulo .6s cubic-bezier(.3, 1.5, .5, 1) var(--ret) both; }
@keyframes podio-sube    { 0% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes podio-aparece { 0% { opacity: 0; transform: translateY(.5rem); } 100% { opacity: 1; transform: none; } }
@keyframes podio-salta   { 0% { opacity: 0; transform: translateY(3rem) scale(.3); } 100% { opacity: 1; transform: none; } }
@keyframes podio-bota    { 0%, 100% { transform: none; } 30% { transform: translateY(-.75rem) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
@keyframes corona-cae    { 0% { opacity: 0; transform: translateY(-8rem) rotate(-40deg); } 100% { opacity: 1; transform: none; } }
@keyframes podio-titulo  { 0% { opacity: 0; transform: scale(.5); } 100% { opacity: 1; transform: none; } }
.juego--podio #juego-botones { position: absolute; left: 0; right: 0; bottom: .8125rem; margin: 0; z-index: 2; justify-content: center; gap: .75rem; }
.podio-btn { height: 2.25rem; padding: 0 1.125rem 0 .9375rem; font-size: 1.0625rem; gap: .375rem; }
.podio-btn svg { width: .875rem; height: .875rem; }
.juego--podio #btn-sala-juego { padding: 0 1.125rem; }

/* ==========================================================================
   Inicio (sistema «Tienda+», maqueta TV-Inicio). Fondo blanco a pantalla completa.
   ========================================================================== */
#inicio { position: fixed; inset: 0; z-index: 1; background: var(--tg-bg); color: var(--tg-ink); }
#inicio p, #inicio h1 { margin: 0; }
.inicio-logo { position: absolute; left: 2.5rem; top: .9375rem; }
.inicio-logo .tg-logo__tld { color: #6B3FD4; }
.inicio-centro { position: absolute; left: 0; right: 0; top: 7.1875rem; display: flex; flex-direction: column; align-items: center; gap: .875rem; text-align: center; }
.inicio-titulo { font-size: 3rem; font-weight: var(--tg-w-medium); letter-spacing: -.035em; line-height: 1; }
.inicio-sub { font-size: 1.25rem; color: var(--tg-muted); }
/* Lema rotativo (js/inicio-lema.js): las frases se apilan en la misma celda para reservar el ancho de la más larga. */
.inicio-lema--rotando { display: inline-grid; text-align: left; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.inicio-lema--rotando .inicio-lema__frase { grid-area: 1 / 1; justify-self: start; opacity: 0; transform: translateY(.6em); }
.inicio-lema__frase { display: inline-block; }
.inicio-lema__frase.es-activa { opacity: 1; transform: none; transition: opacity .35s ease-out, transform .35s ease-out; }
.inicio-lema--rotando .inicio-lema__frase.es-saliente { opacity: 0; transform: translateY(-.6em); transition: opacity .35s ease-in, transform .35s ease-in; }
.inicio-botones { display: flex; gap: 1rem; margin-top: 1.125rem; }
.inicio-btn { height: 3rem; padding: 0 1.625rem 0 1.375rem; font-size: 1.25rem; gap: .5rem; }
/* «Cómo se juega»: botón redondo «?» arriba a la derecha, a la altura del logo. */
.inicio-arriba { position: absolute; right: 2.5rem; top: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.inicio-ayuda { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%; justify-content: center; background: transparent; color: var(--tg-muted); border: .0625rem solid var(--tg-line-strong); font-size: 1.125rem; font-weight: var(--tg-w-regular); }
/* Selector de idioma: píldora a la derecha del «?», con el idioma actual; el select nativo va encima, invisible. */
.inicio-idioma { position: relative; height: 2.25rem; padding: 0 .75rem; box-sizing: border-box; display: flex; align-items: center; gap: .4rem; border-radius: 1.125rem; border: .0625rem solid var(--tg-line-strong); color: var(--tg-ink); font-size: 1rem; font-weight: var(--tg-w-medium); cursor: pointer; }
.inicio-idioma svg { width: 1.125rem; height: 1.125rem; flex: none; color: var(--tg-muted); }
.inicio-idioma .inicio-idioma__flecha { width: .875rem; height: .875rem; }
.inicio-idioma select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.inicio-idioma:focus-within { outline: .1875rem solid var(--tg-focus); outline-offset: .125rem; }
.inicio-btn svg { width: 1.125rem; height: 1.125rem; }
#inicio button:focus { outline: .1875rem solid var(--tg-focus); outline-offset: .125rem; }
.inicio-error { font-size: 1rem; color: var(--tg-error); }
.inicio-personajes { position: absolute; left: 0; right: 0; bottom: 5rem; display: flex; justify-content: center; gap: 1.375rem; }
.inicio-personajes span { width: 5rem; height: 5rem; border-radius: var(--tg-r-pill); background: var(--tg-surface); display: flex; align-items: center; justify-content: center; }
.inicio-personajes .tg-personaje { width: 3.5rem; height: 3.5rem; }
.inicio-datos { font-size: 1rem; color: var(--tg-muted); }
#inicio .inicio-datos { margin-top: .25rem; }
.inicio-datos b { color: var(--tg-primary); font-weight: var(--tg-w-medium); }
/* Vaivén de los personajes: cada uno a su ritmo, se mueve poco y vuelve a su sitio.
   Se anima el dibujo (el span ya lleva su desnivel con transform). Solo transform. */
.inicio-personajes .tg-personaje { animation: vaiven-gira 2.8s ease-in-out infinite; transform-origin: 50% 85%; }
.inicio-personajes span:nth-child(2) .tg-personaje { animation-name: vaiven-bota; animation-duration: 1.9s; animation-delay: -.4s; }
.inicio-personajes span:nth-child(3) .tg-personaje { animation-name: vaiven-lado; animation-duration: 3.3s; animation-delay: -1.1s; }
.inicio-personajes span:nth-child(4) .tg-personaje { animation-duration: 3.6s; animation-delay: -2s; animation-direction: reverse; }
.inicio-personajes span:nth-child(5) .tg-personaje { animation-name: vaiven-bota; animation-duration: 2.4s; animation-delay: -1.5s; }
.inicio-personajes span:nth-child(6) .tg-personaje { animation-name: vaiven-flota; animation-duration: 3s; animation-delay: -.7s; }
.inicio-personajes span:nth-child(7) .tg-personaje { animation-name: vaiven-lado; animation-duration: 2.6s; animation-delay: -1.8s; animation-direction: reverse; }
.inicio-personajes span:nth-child(8) .tg-personaje { animation-name: vaiven-bota; animation-duration: 2.1s; animation-delay: -.9s; }
@keyframes vaiven-gira { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes vaiven-lado { 0%, 100% { transform: translateX(-.25rem) rotate(-4deg); } 50% { transform: translateX(.25rem) rotate(4deg); } }
@keyframes vaiven-flota { 0%, 100% { transform: translateY(.1875rem); } 50% { transform: translateY(-.3125rem); } }
@keyframes vaiven-bota {
  0%, 60%, 100% { transform: translateY(0) scale(1, 1); }
  68% { transform: translateY(0) scale(1.08, .9); }
  80% { transform: translateY(-.5rem) scale(.96, 1.05); }
  92% { transform: translateY(0) scale(1.04, .96); }
}
@media (prefers-reduced-motion: reduce) { .inicio-personajes .tg-personaje { animation: none; } }

.sala-aviso__corona { display: inline-flex; width: 1.125rem; height: 1.125rem; margin-right: .375rem; vertical-align: -.1875rem; border-radius: var(--tg-r-pill); background: var(--tg-host); align-items: center; justify-content: center; }
.sala-aviso__corona svg { width: .625rem; height: .625rem; }

/* Sala con jugadores: cada plaza ocupa lo que su nombre (hasta 3,75rem) y los huecos «Libre»
   lo justo, para que quepan nombres como «Alberto». Si no hay sitio, encogen con «…». */
#sala:not(.sala--vacia) .tg-sala__jugadores, #sala:not(.sala--vacia) #jugadores { min-width: 0; }
#sala:not(.sala--vacia) .tarjeta { width: auto; min-width: 2.625rem; max-width: 3.75rem; flex: 0 1 auto; }
#sala:not(.sala--vacia) .tarjeta .nombre { width: auto; max-width: 3.75rem; }
#sala:not(.sala--vacia) .tarjeta.libre { width: 2.625rem; flex: none; }
#sala:not(.sala--vacia) #jugadores { gap: .375rem; }

/* Pausa (TV-Pausa). Capas estáticas: sin blur ni sombras. */
.juego-pausa { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; }
.juego-pausa .tg-velo { position: absolute; }
.juego-pausa .tg-dialogo {
  position: relative; width: 30rem; box-sizing: border-box; color: var(--tg-ink);
  display: flex; flex-direction: column; align-items: center; gap: .6875rem;
}
.pausa-icono { width: 4rem; height: 4rem; border-radius: var(--tg-r-pill); background: var(--tg-primary-soft); display: flex; align-items: center; justify-content: center; }
.pausa-icono svg { width: 2rem; height: 2rem; }
.pausa-juego { font-size: 1rem; color: var(--tg-muted); }
.pausa-titulo { font-size: 2.5rem; font-weight: var(--tg-w-medium); letter-spacing: -.03em; line-height: 1; }
.pausa-quien { display: flex; align-items: center; gap: .4375rem; font-size: 1.125rem; color: var(--tg-ink-2); }
.pausa-avatar { position: relative; width: 1.875rem; height: 1.875rem; border-radius: var(--tg-r-pill); background: var(--tg-surface); display: flex; align-items: center; justify-content: center; }
.pausa-avatar .tg-personaje { width: 1.3125rem; height: 1.3125rem; }
.pausa-avatar img.selfie { width: 100%; height: 100%; border-radius: var(--tg-r-pill); object-fit: cover; }
.pausa-corona { position: absolute; left: -.1875rem; top: -.25rem; width: .875rem; height: .875rem; border-radius: var(--tg-r-pill); background: var(--tg-host); border: .09375rem solid #fff; display: flex; align-items: center; justify-content: center; }
.pausa-corona svg { width: .4375rem; height: .4375rem; }
.pausa-nota { font-size: 1rem; color: var(--tg-muted); line-height: 1.35; }

/* ==========================================================================
   Fase 2 · Escenas de los juegos. Marcador común (maqueta juegos/Marcador) y área
   de juego. Mientras un juego no tiene su escena nueva, el área sigue oscura.
   ========================================================================== */
#juego.juego--escena { padding: 0; background: var(--tg-bg); color: var(--tg-ink); }
.juego--escena .juego-marcador {
  position: absolute; left: 0; right: 0; top: 0; height: 3.75rem; box-sizing: border-box;
  padding: 0 1.25rem; display: flex; align-items: center; gap: .75rem;
}
.marcador-logo { display: none; }
.juego--escena .marcador-logo { display: block; flex: none; width: 1.5rem; height: 1.5rem; }
.juego--escena #juego-titulo { margin: 0; font-size: 1.375rem; font-weight: var(--tg-w-medium); letter-spacing: -.02em; white-space: nowrap; }
.juego--escena #juego-tiempo {
  flex: none; height: 1.75rem; box-sizing: border-box; padding: 0 .6875rem 0 .5rem; border-radius: var(--tg-r-pill);
  background: var(--tg-primary-soft); color: var(--tg-primary-dark);
  display: inline-flex; align-items: center; gap: .3125rem; font-size: 1.0625rem; font-weight: var(--tg-w-strong); white-space: nowrap;
}
.juego--escena #juego-tiempo svg { width: .9375rem; height: .9375rem; }
.juego--escena #juego-tiempo.aviso { background: var(--tg-warn-bg); color: #A15300; }
.marcador-chips { margin-left: auto; display: flex; gap: .375rem; min-width: 0; }
.marcador-chip {
  flex: none; height: 2.5rem; box-sizing: border-box; padding: 0 .75rem 0 .25rem; border-radius: var(--tg-r-pill);
  background: var(--tg-surface); display: flex; align-items: center; gap: .375rem;
}
.marcador-chip__avatar { width: 2rem; height: 2rem; border-radius: var(--tg-r-pill); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.marcador-chip__avatar .tg-personaje { width: 1.375rem; height: 1.375rem; }
.marcador-chip__avatar img.selfie { width: 100%; height: 100%; object-fit: cover; }
.marcador-chip__valor { display: flex; align-items: center; gap: .1875rem; min-width: .875rem; justify-content: center; font-size: 1.25rem; font-weight: var(--tg-w-strong); line-height: 1; }
.marcador-chip__valor svg { width: .875rem; height: .875rem; color: var(--tg-rojo); }
.marcador-chip.chip--lider { background: var(--tg-primary-soft); color: var(--tg-primary-dark); }
.marcador-chip.chip--peligro { background: var(--tg-error-bg); color: var(--tg-error); }
.marcador-barra { position: absolute; left: 0; right: 0; bottom: 0; height: .25rem; background: var(--tg-primary-soft); }
.marcador-barra span { display: block; height: 100%; background: var(--tg-primary); transform: scaleX(0); transform-origin: left; }
.marcador-barra.aviso span { background: var(--tg-idle); }
/* Con muchos jugadores, chips más compactos */
.marcador-chips:has(> :nth-child(6)) .marcador-chip { padding-right: .5rem; gap: .25rem; }

.juego--escena #juego-area {
  position: absolute; left: 1.25rem; right: 1.25rem; top: 4.25rem; bottom: 1.25rem; margin: 0;
  border-radius: 1rem; overflow: hidden; background: #0b1020; color: #fff;
}
.juego--escena .escena-juego { border: 0; border-radius: 0; }

/* Momentos clave comunes a las escenas (§5): logro amarillo, punto morado, peligro rojo.
   Aparecen con scale + opacity (250 ms). */
@keyframes tg-aparece { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tg-aparece { animation: tg-aparece 250ms var(--tg-ease) both; }
.tg-logro, .tg-punto, .tg-peligro {
  height: 2.625rem; box-sizing: border-box; padding: 0 .9375rem 0 .625rem; border-radius: var(--tg-r-pill);
  border: .15625rem solid #fff; display: flex; align-items: center; gap: .375rem;
  font-size: 1.25rem; font-weight: var(--tg-w-strong); white-space: nowrap;
}
.tg-logro { background: var(--tg-host); color: var(--tg-ink); }
.tg-punto { background: var(--tg-primary); color: #fff; }
.tg-peligro { background: var(--tg-error-bg); color: var(--tg-error); }
.tg-logro svg, .tg-punto svg, .tg-peligro svg { width: 1rem; height: 1rem; }
.tg-logro[hidden], .tg-punto[hidden], .tg-peligro[hidden] { display: none; }
/* ctx.aviso(): la pastilla común, centrada arriba del área de juego */
.tg-avisos { position: absolute; left: 0; right: 0; top: 1rem; z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.tg-avisos .juego-aviso { height: auto; min-height: 2.625rem; padding: .25rem 1.1rem .25rem .8rem; max-width: 90%; white-space: normal; text-align: center; line-height: 1.15; }
.tg-avisos .juego-aviso .tg-personaje--linea, .tg-avisos .juego-aviso img { width: 1.3rem; height: 1.3rem; vertical-align: -.25rem; }

.juego--escena #juego-tiempo.equipo { background: var(--tg-warn-bg); color: var(--tg-warn-text); }

/* ---------- Tablero en pantalla táctil (móvil o tableta en lugar de la tele) ----------
   tv.js pone .tactil en <html> solo si hay pantalla táctil; la Bravia no cambia. */
#gira-pantalla { display: none; }
.tactil, .tactil body { overscroll-behavior: none; } /* sin «deslizar para recargar»: mataría la sala */
.tactil body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
@media (orientation: portrait) {
  .tactil #gira-pantalla {
    position: fixed; inset: 0; z-index: 100;
    background: var(--tg-bg); color: var(--tg-ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    font-family: var(--tg-font); text-align: center;
  }
  .tactil #gira-pantalla svg { width: 96px; height: 96px; }
  .tactil #gira-pantalla path { fill: none; stroke: var(--tg-primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .tactil #gira-pantalla p { margin: 0; font-size: 24px; font-weight: var(--tg-w-medium); }
  .tactil #gira-pantalla .gira-sub { font-size: 17px; font-weight: var(--tg-w-regular); color: var(--tg-muted); }
}
/* Móvil apaisado: 1rem = 3vh se queda en ~12 px; los botones, al menos 44 px para el dedo. */
@media (max-height: 600px) {
  .tactil .tg-btn, .tactil .tg-tab, .tactil .boton { min-height: 44px; }
  .tactil .inicio-btn { padding-left: 20px; padding-right: 20px; }
  /* Inicio: en columna y con el sitio repartido (en la tele va todo en posiciones fijas). */
  .tactil #inicio:not([hidden]) {
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 24px max(14px, env(safe-area-inset-bottom)); box-sizing: border-box;
  }
  .tactil .inicio-logo { position: static; align-self: flex-start; }
  .tactil .inicio-arriba { top: 14px; right: 24px; gap: 10px; }
  .tactil .inicio-ayuda { width: 36px; height: 36px; font-size: 16px; }
  .tactil .inicio-idioma { height: 36px; font-size: 14px; padding: 0 12px; border-radius: 18px; }
  .tactil .inicio-idioma svg { width: 16px; height: 16px; }
  .tactil .inicio-centro { position: static; flex: 1; justify-content: center; gap: 10px; }
  .tactil .inicio-botones { margin-top: 14px; gap: 12px; }
  .tactil .inicio-personajes { position: static; gap: 14px; margin-bottom: 14px; }
  .tactil .inicio-personajes span { width: 4rem; height: 4rem; }
  .tactil .inicio-personajes .tg-personaje { width: 2.75rem; height: 2.75rem; }
  .tactil .inicio-datos { font-size: max(1rem, 13px); }
  .tactil .inicio-legal { position: static; font-size: 11px; }
  .tactil .inicio-sub { font-size: max(1.25rem, 15px); }
  .tactil .inicio-btn { font-size: max(1.25rem, 16px); }
}

/* Inicio en vertical (lo normal al abrir la web en el móvil): se ve en columna, en px.
   El aviso de girar sale a partir de la sala, que sí necesita ir apaisada. */
.tactil body:has(#inicio:not([hidden])) #gira-pantalla { display: none; }
@media (orientation: portrait) {
  .tactil #inicio:not([hidden]) {
    display: flex; flex-direction: column; align-items: center; box-sizing: border-box;
    padding: max(20px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  }
  .tactil .inicio-logo { position: static; align-self: flex-start; }
  .tactil .inicio-arriba { top: max(20px, env(safe-area-inset-top)); right: 24px; gap: 10px; }
  .tactil .inicio-ayuda { width: 36px; height: 36px; font-size: 16px; }
  .tactil .inicio-idioma { height: 36px; font-size: 14px; padding: 0 12px; border-radius: 18px; }
  .tactil .inicio-idioma svg { width: 16px; height: 16px; }
  .tactil .inicio-logo svg { width: 34px; height: 34px; }
  .tactil .inicio-logo .tg-logo__txt { font-size: 24px; }
  .tactil .inicio-centro { position: static; flex: 1; justify-content: center; gap: 12px; width: 100%; }
  .tactil .inicio-titulo { font-size: 36px; line-height: 1.1; }
  .tactil .inicio-sub { font-size: 17px; line-height: 1.4; }
  .tactil .inicio-botones { flex-direction: column; width: 100%; max-width: 360px; gap: 12px; margin-top: 20px; }
  .tactil .inicio-btn { width: 100%; height: 56px; justify-content: center; font-size: 17px; padding: 0 24px; }
  .tactil .inicio-btn svg { width: 14px; height: 14px; }
  .tactil #inicio button:focus { outline-width: 3px; outline-offset: 2px; }
  .tactil .inicio-error { font-size: 15px; }
  .tactil .inicio-personajes { position: static; display: grid; grid-template-columns: repeat(4, 56px); gap: 14px 18px; margin: 8px 0 24px; }
  .tactil .inicio-personajes span { width: 56px; height: 56px; }
  .tactil .inicio-personajes .tg-personaje { width: 36px; height: 36px; }
  .tactil .inicio-datos { font-size: 14px; line-height: 1.4; }
  .tactil .inicio-legal { position: static; font-size: 12px; margin-top: -8px; }
  .tactil .inicio-legal a { display: inline-block; padding: 12px 4px; }
}
/* Botón «¡Empezar!» en la pantalla de reglas (el anfitrión también lo tiene en su móvil) */
.juego-listos__empezar { margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.juego-listos__quien { font-size: 1rem; color: var(--tg-muted); }

/* Elegir modalidad de un juego (p. ej. Rebobina: Por años / Disney). js/motor/partida-tv.js */
.tv-modos { gap: 1.5rem; }
.tv-modos__tit { margin: 0; font-size: 2rem; font-weight: var(--tg-w-strong); color: #fff; }
.tv-modos__bots { display: flex; gap: 1.5rem; }
.tv-modo {
  width: 14rem; height: 10rem; border: 0; border-radius: 1.5rem; background: #fff; color: var(--tg-ink); font: inherit;
  font-size: 1.75rem; font-weight: var(--tg-w-medium); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
}
.tv-modo__e { font-size: 4rem; line-height: 1; }
.tv-modo:focus { outline: .25rem solid var(--tg-focus); outline-offset: .25rem; }

/* Pie legal de la portada: para quien llega desde un buscador; el mando no lo recorre. */
.inicio-legal { position: absolute; left: 0; right: 0; bottom: 1.75rem; text-align: center; font-size: 0.8rem; color: var(--tg-muted); }
.inicio-legal a { color: var(--tg-muted); }
