:root {
  --fondo: #f6f4ef;
  --tarjeta: #ffffff;
  --texto: #1d2230;
  --tenue: #6b7280;
  --borde: #d8d5cc;
  --marca: #1f2a44;
  --acento: #3157d5;
  --verde: #2e9e5b;
  --amarilla: #d9a21b;
  --gris: #7a808c;
  --tecla: #e3e0d8;
  --yo: #e8eefc;
  --tecla-no: #4a4f59;
  --tecla-no-texto: #a9aeb8;
  --radio: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #12151d;
    --tarjeta: #1c212c;
    --texto: #eceef3;
    --tenue: #9aa1ad;
    --borde: #353c4a;
    --marca: #0d1018;
    --acento: #7d9bff;
    --verde: #34a463;
    --amarilla: #c99a1e;
    --gris: #4a505c;
    --tecla: #3a4150;
    --yo: #24304d;
    --tecla-no: #23272f;
    --tecla-no-texto: #6c727d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
/* iPhone con la app instalada: alto de la pantalla entera (ver ajustarAlto en instalacion.js). */
html.alto-pantalla, html.alto-pantalla body { height: var(--alto-app); overflow: hidden; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h2 { margin: 0 0 .4em; font-size: 1.3rem; }
h3 { margin: 1.1em 0 .4em; font-size: 1.05rem; }
h3:first-child { margin-top: 0; }
p { margin: .5em 0; }
a { color: var(--acento); }

.barra {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  padding: calc(env(safe-area-inset-top) + .55rem) 1rem .55rem;
  background: var(--marca); color: #fff;
}
.logo { margin: 0; line-height: 1; }
.firma { margin: 0; font-size: .72rem; color: #c9cfdc; letter-spacing: .02em; }
.corazon { color: #ff5a6e; }
.logo .fichas { display: flex; gap: 4px; text-decoration: none; perspective: 400px; }
.logo .fichas span {
  display: grid; place-items: center; width: 31px; height: 35px; border-radius: 6px;
  color: #fff; font: 800 1.2rem/1 system-ui, sans-serif;
  box-shadow: inset 0 -3px 0 #0003, 0 2px 4px #0004;
  text-shadow: 0 1px 1px #0003;
  animation: logo-girar .5s calc(var(--i) * 70ms) both;
}
.logo .fichas span.cG { background: #5b6474; }
@keyframes logo-girar { 0% { transform: rotateX(90deg); } 60% { transform: rotateX(-12deg); } 100% { transform: rotateX(0); } }
@media (prefers-reduced-motion: reduce) { .logo .fichas span { animation: none; } }
@media (max-width: 340px) { .logo .fichas span { width: 27px; height: 31px; font-size: 1.05rem; } }
/* Engranaje del administrador: a la derecha, a la altura de las fichas del logo y casi tan alto. */
.engranaje {
  position: absolute; right: 10px; top: calc(env(safe-area-inset-top) + .55rem); height: 35px;
  display: flex; align-items: center; color: #c9cfdc;
}
.engranaje[hidden] { display: none; }
.engranaje .globo {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font: 800 .66rem/18px system-ui, sans-serif; text-align: center;
}
/* Azul, en la otra esquina: grupos creados por jugadores que esperan aprobación. */
.engranaje .globo.globo-azul { right: auto; left: -8px; background: #2f6fed; }
.engranaje svg { width: 31px; height: 31px; transition: transform .3s; }
.engranaje:hover, .engranaje.activo { color: #fff; }
.engranaje:hover svg { transform: rotate(45deg); }
@media (max-width: 340px) { .engranaje { height: 31px; right: 6px; } .engranaje svg { width: 26px; height: 26px; } }
/* Botón «Anular partidas» del administrador en la clasificación: a la izquierda, frente al
   engranaje y del mismo tamaño. Rojo mientras se ven los botones de anular. */
.anular-admin-barra {
  position: absolute; left: 10px; top: calc(env(safe-area-inset-top) + .55rem); height: 35px;
  display: flex; align-items: center; padding: 0; border: 0; background: none; color: #c9cfdc; cursor: pointer;
}
.anular-admin-barra[hidden] { display: none; }
.anular-admin-barra svg { width: 29px; height: 29px; }
.anular-admin-barra:hover { color: #fff; }
.anular-admin-barra[aria-pressed="true"] { color: #ff6b62; }
@media (max-width: 340px) { .anular-admin-barra { height: 31px; left: 6px; } .anular-admin-barra svg { width: 25px; height: 25px; } }
.etiqueta { position: absolute; left: 4px; bottom: 3px; background: var(--amarilla); color: #000; border-radius: 6px; padding: 0 .4em; font-size: .6rem; line-height: 1.3; }

main {
  flex: 1; overflow-y: auto; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 1rem 1rem 1.5rem; display: flex; flex-direction: column;
}

.menu {
  display: flex; justify-content: space-around; background: var(--tarjeta);
  border-top: 1px solid var(--borde); padding-bottom: env(safe-area-inset-bottom);
}
.menu a {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: .45rem 0 .5rem;
  color: var(--tenue); text-decoration: none; font-size: .78rem;
}
.menu a span { font-size: 1.3rem; line-height: 1.2; }
/* Globo de novedades sin leer, como el del chat. */
.menu a span { position: relative; }
.menu a .globo {
  position: absolute; top: -3px; left: calc(100% - 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font: 800 .66rem/18px system-ui, sans-serif; box-shadow: 0 0 0 2px var(--tarjeta);
}
.menu a.activo { color: var(--acento); font-weight: 600; }
/* Con novedades o mensajes del chat sin leer: el icono (con su globo) vibra un instante cada 4 segundos. */
.menu a.vibra > span, .boton-chat.vibra { animation: vibrar-icono 4s ease-in-out 1s infinite; }
@keyframes vibrar-icono {
  0%, 12%, 100% { transform: none; }
  2% { transform: rotate(-12deg); } 4% { transform: rotate(10deg); } 6% { transform: rotate(-8deg); }
  8% { transform: rotate(6deg); } 10% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) { .menu a.vibra > span, .boton-chat.vibra { animation: none; } }
/* Jugar: casillas como las del juego, en verde, amarillo y gris, igual esté seleccionado o no. */
.menu .icono-jugar { display: block; width: 1.55rem; height: 1.55rem; }
.menu .icono-jugar rect[fill=currentColor] { fill: var(--tenue); opacity: .55; }
.menu a[hidden] { display: none; }
.fecha-novedades { margin: .6rem 0 .5rem; }
#ver-anteriores { display: block; margin: 1.6rem auto 1rem; }
#novedades-anteriores { margin-top: 1.6rem; padding-top: .6rem; border-top: 1px solid var(--borde); }
/* Alta (nombre y código de invitación): lo que se escribe, centrado. */
#f-perfil [name=alias], #f-perfil [name=codigo] { text-align: center; }
.bloque-novedades + .bloque-novedades { margin-top: 1.6rem; padding-top: .6rem; border-top: 1px solid var(--borde); }
.novedad h3 { margin: 0 0 .4rem; }
.novedad p { margin: 0; }
.novedad .banderas-novedad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: .2rem 0 .7rem; }
.novedad .bandera, .banderas-grupo .bandera, .idiomas-grupo .bandera {
  display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 30px; border-radius: 7px;
  font: 800 .8rem/1 system-ui, sans-serif; letter-spacing: .04em;
}
.novedad img {
  display: block; width: 100%; max-width: 360px; margin: .8rem auto 0; border-radius: 10px;
  border: 1px solid var(--borde);
}
/* Banderas de los idiomas (.bandera con data-idioma): en el selector de abajo, en Novedades, en los
   idiomas de un grupo y en las casillas para elegirlos. La etiqueta corta (CAS, VAL…) va encima. */
.bandera {
  color: #1d2230; text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; box-shadow: 0 1px 3px #0004, inset 0 0 0 1px #0002;
}
/* España (rojo, amarillo y rojo) y la Senyera (franjas rojas y amarillas con la franja azul junto al mástil). */
.bandera[data-idioma=es] { background: linear-gradient(#c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75%); }
.bandera[data-idioma=va] {
  padding-left: 10px;
  background: linear-gradient(to right, #0b4ea2 0 18%, transparent 18%),
    repeating-linear-gradient(#fcd116 0 11.111%, #da121a 11.111% 22.222%);
}
/* Reino Unido (Union Jack) y Francia (azul, blanco y rojo). */
.bandera[data-idioma=en] {
  background: #012169 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30' preserveAspectRatio='none'%3E%3CclipPath id='t'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cpath d='M0 0h60v30H0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23t)' stroke='%23c8102e' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23c8102e' stroke-width='6'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.bandera[data-idioma=fr] { background: linear-gradient(to right, #0055a4 0 33.33%, #fff 33.33% 66.67%, #ef4135 66.67%); }
/* Dinamarca (cruz nórdica blanca sobre rojo) e Italia (verde, blanco y rojo). */
.bandera[data-idioma=da] {
  background: linear-gradient(to right, transparent 0 32%, #fff 32% 43%, transparent 43%),
    linear-gradient(#c8102e 0 43%, #fff 43% 57%, #c8102e 57%);
}
.bandera[data-idioma=it] { background: linear-gradient(to right, #009246 0 33.33%, #fff 33.33% 66.67%, #ce2b37 66.67%); }
/* Alemania (negro, rojo y oro) y Portugal (verde y rojo, con la esfera armilar amarilla en la unión). */
.bandera[data-idioma=de] { background: linear-gradient(#000 0 33.33%, #dd0000 33.33% 66.67%, #ffce00 66.67%); }
.bandera[data-idioma=pt] {
  background: radial-gradient(circle at 40% 50%, #ffd200 0 5px, #ffd20000 5.5px),
    linear-gradient(to right, #046a38 0 40%, #da291c 40%);
}

/* Selector de idioma, a la izquierda de la barra de abajo: siempre del mismo tamaño. Solo se ve la bandera
   del idioma elegido con una flechita debajo; al pulsarla se despliega hacia arriba la lista con los demás. */
.selector-idioma { flex: none; align-self: center; position: relative; margin-left: 8px; }
.idioma-actual {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 4px 1px; border: 0;
  border-radius: 10px; background: var(--tecla); color: var(--tenue); cursor: pointer;
}
.idioma-actual .bandera { width: 46px; height: 24px; }
.idioma-actual .flechita { font-size: .6rem; line-height: 1; transition: transform .15s; }
.idioma-actual[aria-expanded=true] .flechita { transform: rotate(180deg); }
.selector-idioma .bandera, .idioma-menu .bandera {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
  font: 800 .72rem/1 system-ui, sans-serif; letter-spacing: .04em;
}
.idioma-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 170px;
  padding: 5px; border-radius: 12px; background: var(--tarjeta); border: 1px solid var(--borde);
  box-shadow: 0 6px 24px #0005;
}
.idioma-menu[hidden] { display: none; }
.idioma-menu button {
  display: flex; align-items: center; gap: .6rem; padding: 5px 8px 5px 5px; border: 0; border-radius: 8px;
  background: none; color: var(--texto); font: inherit; font-size: .92rem; text-align: left; cursor: pointer;
}
.idioma-menu button:hover, .idioma-menu button:focus-visible { background: var(--tecla); }
.idioma-menu .bandera { width: 44px; height: 24px; flex: none; }
.selector-idioma .largo { display: none; }
/* Pantallas de entrar: la barra solo lleva el selector, centrado y con el nombre del idioma al lado. */
.menu.sin-enlaces { justify-content: center; padding-top: .5rem; padding-bottom: calc(env(safe-area-inset-bottom) + .5rem); }
.menu.sin-enlaces a { display: none; }
.menu.sin-enlaces .selector-idioma { margin: 0; }
.menu.sin-enlaces .idioma-actual { flex-direction: row; gap: .5rem; padding: 4px 10px 4px 4px; }
.menu.sin-enlaces .idioma-actual .largo { display: inline; color: var(--texto); font-size: .9rem; }
.menu.sin-enlaces .idioma-menu { left: 50%; transform: translateX(-50%); }

.tarjeta {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.1rem; margin-bottom: 1rem;
}
.centro { text-align: center; }
.tenue { color: var(--tenue); }
.pequeño { font-size: .85rem; }
/* Jugar, bajo «Empezar»: los días de racha, algo más grandes que la letra pequeña. */
.texto-rachas { font-size: 1rem; }

.form { display: grid; gap: .8rem; margin-top: 1rem; }
.form label { display: grid; gap: .25rem; font-size: .9rem; color: var(--tenue); }
input, textarea {
  font: inherit; color: var(--texto); background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 10px; padding: .7rem .8rem;
}
input:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; font-size: .95rem; cursor: pointer; }
/* Idiomas de un grupo (crear grupo): casillas en dos columnas. */
/* Idiomas de un grupo (crear grupo, cambiar sus idiomas): las banderas en cuatro columnas; las no elegidas,
   apagadas, y las elegidas, con su color, un borde y una marca ✓. */
.idiomas-grupo { border: 0; padding: 8px 8px 2px; margin: 0; display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: .8rem .4rem; }
.idiomas-grupo legend { padding: 0; font-size: .9rem; color: var(--tenue); margin-bottom: .5rem; }
.form .idiomas-grupo label.casilla-bandera { display: block; position: relative; cursor: pointer; border-radius: 9px; padding: 2px; }
.casilla-bandera input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.casilla-bandera .bandera { filter: grayscale(1); opacity: .45; transition: filter .15s, opacity .15s; }
.casilla-bandera:has(input:checked) { box-shadow: 0 0 0 2px var(--acento); }
.casilla-bandera:has(input:checked) .bandera { filter: none; opacity: 1; }
.casilla-bandera:has(input:checked)::after {
  content: '✓'; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--acento); color: #fff; font: 800 .7rem/18px system-ui, sans-serif; text-align: center;
}
.casilla-bandera:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
/* Idiomas de un grupo ya hecho: sus banderas, en fila. */
.banderas-grupo { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.banderas-grupo .bandera { width: 50px; height: 26px; font-size: .74rem; }
.caja-grupo-listo .banderas-grupo { justify-content: center; }
.check.centro-check { justify-content: center; margin: .4rem 0 0; }
.check input { width: 1.3rem; height: 1.3rem; padding: 0; accent-color: var(--acento); flex: none; }
input.solo-lectura { background: transparent; border-style: dashed; color: var(--tenue); pointer-events: none; }
.enlaces { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: 1rem; text-align: center; }
/* Pantallas de cuenta: el cuadro queda centrado en vertical en el móvil. */
.centrar { margin: auto 0; }
.pie { margin: 1rem 0 calc(env(safe-area-inset-bottom) * .5); text-align: center; font-size: .75rem; color: var(--tenue); }
/* El pie va siempre abajo del todo, justo encima de la barra de botones: si la pantalla tiene poco
   contenido, el hueco que sobra queda por encima del pie (y si tiene mucho, sale al final al desplazarse). */
main > .pie { margin-top: auto; padding-top: 1rem; }
main:has(> .pie:last-child) { padding-bottom: .5rem; }
.pie-email { display: inline-flex; vertical-align: middle; color: inherit; padding: .2rem; }
.pie-email svg { width: 1.1rem; height: 1.1rem; }
/* Código de invitación: que no se confunda con los otros campos. */
.campo-codigo { background: color-mix(in srgb, var(--acento) 8%, transparent); border: 2px dashed var(--acento);
  border-radius: 12px; padding: .6rem .7rem; color: var(--texto) !important; font-weight: 600; }
.campo-codigo input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em;
  background: var(--tarjeta); border-color: var(--acento); }
.campo-codigo input::placeholder { font-family: system-ui, sans-serif; letter-spacing: normal; font-weight: 400; }
.bienvenida { border-color: var(--acento); }
.bienvenida > p { margin-top: 0; }
.bienvenida #ayuda { margin-top: .4rem; }
.nota { background: var(--fondo); border: 1px solid var(--borde); border-radius: 10px; padding: .7rem .8rem; font-size: .9rem; }

.boton {
  display: block; width: 100%; font: inherit; font-weight: 600; text-align: center; text-decoration: none;
  padding: .8rem 1rem; border: 0; border-radius: 12px; background: var(--acento); color: #fff;
  cursor: pointer; margin: .6rem 0;
}
.boton.grande { font-size: 1.15rem; padding: 1rem; }
.boton.secundario { background: transparent; color: var(--acento); border: 1px solid var(--borde); }
.boton:disabled { opacity: .55; }
/* Compartir el resultado: texto y, a su lado, WhatsApp y Telegram. */
.compartir { display: flex; align-items: center; justify-content: center; gap: .9rem; margin: .8rem 0; padding-top: .8rem;
  border-top: 1px solid var(--borde); font-weight: 600; }
.compartir a { display: flex; border-radius: 50%; }
.compartir svg { width: 2.6rem; height: 2.6rem; display: block; }
.compartir a:active { transform: scale(.92); }
.boton.peligro { background: #d4433f; }
.hueco-borrar { margin-top: 1.2rem; padding-top: .6rem; border-top: 1px solid var(--borde); }
.hueco-borrar .boton.salir { margin-bottom: 0; }
/* Cuenta: «Borrar usuario» del tamaño justo, y «Cerrar» separado con una línea para no confundirlos. */
#borrar-cuenta { display: block; width: auto; margin: .6rem auto 0; padding: .55rem 1.1rem; font-size: .92rem; }
.aviso-borrar { border-color: #d4433f; margin: 0; }
.aviso-borrar h3 { color: #d4433f; }
.historico { margin: .4rem 0; padding-left: 1.1rem; font-size: .9rem; }
.historico li + li { margin-top: .4rem; }
.boton.salir { background: transparent; color: #d4433f; border: 1px solid currentColor; margin-bottom: 1rem; }
/* Tarjeta plegable («Cómo se juega»): cerrada de entrada, se abre al tocar el título. */
.plegable summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.plegable summary::-webkit-details-marker { display: none; }
.plegable summary h3 { margin: 0; }
.plegable summary::after { content: '▾'; color: var(--tenue); font-size: 1.1rem; transition: transform .2s; }
.plegable[open] summary::after { transform: rotate(180deg); }
.plegable[open] summary { margin-bottom: .6rem; }
/* Yo: títulos centrados en las tarjetas de grupos (la flecha de las plegables, a la derecha). */
.titulo-centrado > h3 { text-align: center; }
.plegable.titulo-centrado summary { justify-content: center; position: relative; padding: 0 1.4rem; }
.plegable.titulo-centrado summary h3 { text-align: center; }
.plegable.titulo-centrado summary::after { position: absolute; right: 0; }
/* Yo, «Tus palabras»: un día por fila; la principal y las extras, una al lado de otra. */
.mis-palabras { list-style: none; margin: .4rem 0; padding: 0; }
.mis-palabras li { display: flex; gap: .6rem; align-items: baseline; padding: .4rem 0; border-top: 1px solid var(--borde); font-size: .9rem; }
.mis-palabras li > span:first-child { flex: 0 0 5.6rem; font-size: .8rem; }
.mis-palabras li > span:last-child { display: flex; flex-wrap: wrap; gap: .2rem .9rem; min-width: 0; }
.mi-palabra { display: inline-flex; align-items: baseline; gap: .3rem; }
.mi-palabra b { letter-spacing: .06em; }
.mi-palabra b.acertada { color: var(--verde); }
.mi-palabra b.fallada { color: #d4433f; }
.mi-palabra small { font-size: .72rem; }

.aviso {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: calc(100% - 2rem); width: max-content; z-index: 30; text-align: center;
  font-size: 1.4rem; font-weight: 800; padding: 1rem 1.6rem; border-radius: 16px;
  box-shadow: 0 8px 28px #0006; animation: aviso-entra .35s ease-out;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; /* info: azul */
}
.aviso.acierto { background: linear-gradient(135deg, #2fbf6b, #1f9d8a); font-size: 1.5rem; }
.aviso.exito { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.aviso.fallo { background: linear-gradient(135deg, #f43f5e, #be123c); }
.aviso.error { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.aviso.atencion { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1d2230; }
@keyframes aviso-entra { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.aviso.arriba {
  top: calc(env(safe-area-inset-top) + 3.6rem); transform: translateX(-50%);
  font-size: 1.1rem; padding: .6rem 1.1rem; animation-name: aviso-baja;
}
@keyframes aviso-baja { from { transform: translate(-50%, -.6rem); opacity: 0; } }

/* ---------------------------------------------------------------- juego */
.cabecera-juego { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.crono { font-variant-numeric: tabular-nums; font-weight: 700; }
.crono-caja { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.crono-caja .crono { padding: 0 .35em; border-radius: 6px; transition: background .3s; }
.crono.verde { background: var(--verde); color: #fff; }
.crono.amarillo { background: var(--amarilla); color: #fff; }
.potencial { font-size: 1em; color: var(--tenue); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tablero {
  --hueco: 6px;
  display: grid; gap: var(--hueco); margin: 0 auto 1rem;
  width: min(100%, calc(var(--n) * 62px), calc((100dvh - 380px) / 6 * var(--n)));
  min-width: calc(var(--n) * 38px);
}
/* Partida en curso: cabecera, tablero y teclado caben siempre sin desplazarse. El tablero
   toma el alto que queda libre y cada casilla mide lo que permitan ese alto y el ancho. */
main:has(> .juego) { padding-bottom: .6rem; }
.juego { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.zona-tablero { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; margin-bottom: .6rem; }
.zona-tablero .tablero {
  --t: min((100cqw - (var(--n) - 1) * var(--hueco)) / var(--n), 62px, (100cqh - 5 * var(--hueco)) / 6);
  width: calc(var(--n) * var(--t) + (var(--n) - 1) * var(--hueco));
  min-width: 0; margin: 0;
}
.zona-tablero .casilla { font-size: calc(var(--t) * .5); border-radius: calc(var(--t) * .15); }
.zona-tablero .cabecera-juego, .juego .cabecera-juego { flex: none; }
/* Pantallas bajas (iPhone SE, Safari con barras): teclado algo más bajo y cabecera más justa. */
@media (max-height: 700px) {
  .teclado button { height: 50px; }
  .juego .cabecera-juego { margin-bottom: .5rem; }
}
@media (max-height: 600px) {
  .teclado { gap: 6px; }
  .teclado button { height: 46px; }
}
.fila { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--hueco); }
.casilla {
  aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--borde); border-radius: 8px;
  font-weight: 800; font-size: clamp(1.1rem, 6vw, 1.9rem); text-transform: uppercase; user-select: none;
}
.casilla.llena { border-color: var(--tenue); animation: latido .12s; }
/* Hueco donde va la siguiente letra (se elige tocándolo). */
.fila.actual .casilla { cursor: pointer; }
.fila.actual .casilla.cursor { border-color: var(--acento); box-shadow: inset 0 -3px 0 var(--acento); }
.casilla.cV, .casilla.cA, .casilla.cG { color: #fff; border-color: transparent; }
.cV { background: var(--verde); }
.cA { background: var(--amarilla); }
.cG { background: var(--gris); }
.revelar .casilla { animation: girar .45s both; animation-delay: calc(var(--j) * .12s); }
.sacudir { animation: sacudir .35s; }
@keyframes latido { 50% { transform: scale(1.08); } }
@keyframes girar { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes sacudir { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.teclado { margin-top: auto; display: grid; gap: 7px; user-select: none; }
.teclado div { display: flex; gap: 5px; justify-content: center; }
.teclado button {
  flex: 1; max-width: 44px; height: 56px; border: 0; border-radius: 7px; padding: 0;
  background: var(--tecla); color: var(--texto); font: 600 1.05rem system-ui, sans-serif; cursor: pointer;
  touch-action: manipulation;
}
.teclado button.ancha { max-width: 68px; flex: 1.5; font-size: .8rem; }
.teclado button.ancha { background: var(--acento); color: #fff; }
/* Teclas ya usadas: más oscuras que en el tablero; las que no están, casi apagadas. */
.teclado button.cV { background: color-mix(in srgb, var(--verde) 78%, #000); color: #fff; }
.teclado button.cA { background: color-mix(in srgb, var(--amarilla) 78%, #000); color: #fff; }
.teclado button.cG { background: var(--tecla-no); color: var(--tecla-no-texto); }
.teclado button:active { filter: brightness(.85); }

.resultado .solucion { font-size: 1.3rem; font-weight: 700; margin-top: 0; }
.resultado .solucion span { display: block; font-size: 1rem; font-weight: 400; color: var(--tenue); }
.resultado .solucion b { font-weight: 800; }
.resultado .solucion b.acertada { color: var(--verde); }
.resultado .solucion b.fallada { color: #d4433f; }
.cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0; text-align: center; }
.cifras b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cifras span { font-size: .75rem; color: var(--tenue); }
.cifras .desglose { white-space: nowrap; }

/* ---------------------------------------------------------------- clasificación */
.pestanas { display: flex; background: var(--tecla); border-radius: 12px; padding: 3px; margin-bottom: 1rem; }
.pestanas button {
  flex: 1; border: 0; background: none; font: inherit; font-size: .88rem; padding: .5rem 0;
  border-radius: 9px; color: var(--texto); cursor: pointer;
}
.pestanas button[aria-selected=true] { background: var(--tarjeta); font-weight: 700; box-shadow: 0 1px 3px #0002; }

.clasif { list-style: none; margin: 0; padding: 0; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.clasif li { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-top: 1px solid var(--borde); }
.clasif li:first-child { border-top: 0; }
.clasif li.yo { background: var(--yo); }
.clasif .pos { width: 1.8rem; text-align: center; font-weight: 700; }
.clasif .nombre { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.clasif .nombre small { display: block; font-weight: 400; color: var(--tenue); }
.clasif .pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.racha { font-size: .8rem; font-weight: 600; }
/* Racha de findes: la llama de la racha, pero azul. */
.racha-finde { display: inline-block; filter: hue-rotate(195deg) saturate(1.4); }
.mini { display: grid; gap: 1px; }
.mini i { display: flex; gap: 1px; }
.mini b { width: 7px; height: 7px; border-radius: 1px; }
.minis { display: flex; gap: 5px; align-items: flex-start; }

/* «Yo»: estadísticas de las palabras de 5 y de 6 letras, en dos columnas. */
.por-longitud { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.por-longitud > div { min-width: 0; }
.por-longitud > div + div { border-left: 1px solid var(--borde); padding-left: .6rem; }
.por-longitud h3 { margin: .2rem 0 0; text-align: center; font-size: 1rem; }
.por-longitud h4 { margin: 0 0 .4rem; font-size: .8rem; font-weight: 600; color: var(--tenue); }
.mini-cifras { grid-template-columns: repeat(3, 1fr); gap: .2rem; margin: .4rem 0 .7rem; }
.mini-cifras b { font-size: 1.05rem; }
.mini-cifras span { font-size: .68rem; }
.mini-cifras.dos { grid-template-columns: repeat(2, 1fr); }
.titulo-extras { margin: 0; }
/* Yo › Tus victorias: semana, finde y mes. */
.victorias { padding: .7rem .8rem .6rem; margin: .4rem 0 .8rem; border-radius: 12px; background: var(--fondo); border: 1px solid var(--borde); }
.victorias h3 { margin: 0; font-size: 1rem; }
.victorias .cifras { grid-template-columns: repeat(3, 1fr); max-width: 20rem; margin: .4rem auto; }
.victorias .cifras b { color: #c98a0b; font-size: 1.6rem; }
.victorias > p { margin: 0; }
/* Con grupos de los dos idiomas: castellano a la izquierda y valenciano a la derecha. */
.victorias-idiomas { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .3rem 0; }
.victorias-idiomas > div { min-width: 0; }
.victorias-idiomas > div:nth-child(even) { border-left: 1px solid var(--borde); padding-left: .5rem; }
/* Con dos columnas, las etiquetas largas («Wochenenden») parten con guion en vez de salirse. */
.victorias-idiomas .cifras span { font-size: .7rem; overflow-wrap: anywhere; hyphens: auto; }
.victorias-idiomas h4 { margin: 0; text-align: center; font-size: .8rem; color: var(--tenue); font-weight: 600; }
.victorias-idiomas .cifras { margin: .3rem auto 0; gap: .2rem; }
.victorias-idiomas .cifras b { font-size: 1.3rem; }
.victorias-idiomas .cifras span { font-size: .68rem; }
.cifras-extras { grid-template-columns: repeat(2, 1fr); max-width: 14rem; margin: .2rem auto .8rem; }
/* Móviles muy estrechos: letra algo menor para que las cifras no se monten. */
@media (max-width: 359px) {
  .cifras span { font-size: .68rem; }
  .mini-cifras b { font-size: .95rem; }
  .mini-cifras span { font-size: .6rem; }
  .por-longitud h4 { font-size: .72rem; }
}
/* Línea entre los bloques de la tarjeta de estadísticas. */
.separado { border-top: 1px solid var(--borde); padding-top: .8rem; margin-top: .8rem; }
.barras { display: grid; gap: 4px; }
.barras div { display: flex; align-items: center; gap: .5rem; }
.barras span { width: 1rem; text-align: right; font-weight: 600; }
.barras i {
  font-style: normal; background: var(--verde); color: #fff; font-size: .8rem; font-weight: 700;
  text-align: right; padding: 1px 6px; border-radius: 4px; min-width: 1.6rem;
}
.ejemplo { display: flex; gap: 5px; margin: .6rem 0; }
.ejemplo .casilla { width: 40px; font-size: 1.2rem; }
/* «Cómo se juega»: partida de ejemplo, con cada intento y lo que significan sus colores al lado. */
.partida-ejemplo { margin: .4rem 0 .9rem; padding: .7rem .75rem; border-radius: 12px; border: 1px solid var(--borde);
  background: color-mix(in srgb, var(--borde) 18%, transparent); }
.partida-ejemplo h4 { margin: 0 0 .55rem; font-size: .9rem; font-weight: 600; }
.fila-ejemplo { display: flex; align-items: center; gap: .65rem; }
.fila-ejemplo + .fila-ejemplo { margin-top: 5px; }
.fila-ejemplo .fila { --hueco: 4px; flex: none; width: calc(5 * 32px + 4 * 4px); }
.fila-ejemplo .casilla { font-size: 1rem; border-radius: 6px; }
.fila-ejemplo small { font-size: .8rem; line-height: 1.3; color: var(--tenue); }

/* ---------------------------------------------------------------- instalación */
.instalar { border-style: dashed; margin-top: 0; }
dialog.hoja {
  width: min(100% - 2rem, 480px); max-height: 85dvh; overflow-y: auto; border: 0; padding: 1.2rem;
  border-radius: var(--radio); background: var(--tarjeta); color: var(--texto);
}
dialog.hoja::backdrop { background: #0008; }
dialog.hoja h3 { margin-top: 1em; }
.pasos { padding-left: 1.2rem; display: grid; gap: .5rem; }

/* ---------------------------------------------------------------- versión nueva */
.franja-version {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .55rem 1rem; background: var(--marca); color: #fff;
}
.franja-version b { display: block; font-size: .9rem; }
.franja-version small { color: #c9cfdc; font-size: .78rem; }
.franja-version button {
  flex: none; border: 0; border-radius: 9px; padding: .5rem .9rem; font: 600 .9rem system-ui, sans-serif;
  background: var(--verde); color: #fff; cursor: pointer;
}

/* ---------------------------------------------------------------- días pasados */
.volver { display: inline-block; margin-bottom: .5rem; font-size: .9rem; text-decoration: none; }
.sello {
  display: inline-block; vertical-align: middle; margin-left: .3rem; padding: 0 .45em; border-radius: 6px;
  background: var(--amarilla); color: #1d2230; font-size: .72rem; font-weight: 700;
}
.cuenta-atras {
  display: flex; align-items: center; justify-content: center; gap: .6rem; margin: -.2rem 0 .9rem;
  padding: .6rem 1rem; border-radius: 12px; background: var(--marca); color: #fff;
}
.cuenta-atras span { font-size: .9rem; color: #c9cfdc; }
.cuenta-atras b { font-size: 1.5rem; letter-spacing: .03em; }
.pendientes .pendiente {
  display: flex; justify-content: space-between; align-items: center; padding: .65rem .2rem;
  border-top: 1px solid var(--borde); color: var(--texto); text-decoration: none;
}
.pendientes .pendiente span:last-child { color: var(--acento); font-weight: 600; }
.pendientes .pendiente span.medias { color: var(--amarilla); }

/* ---------------------------------------------------------------- grupos */
.grupo-barra {
  display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: .9rem;
  padding: .55rem .6rem; border-radius: var(--radio); background: var(--tarjeta); border: 1px solid var(--borde);
}
.grupo-nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.grupo-nombre small { color: var(--tenue); font-size: .72rem; }
.grupo-nombre b, .grupo-nombre select { font-size: 1.15rem; font-weight: 800; }
.grupo-nombre select {
  max-width: 100%; border: 0; background: transparent; color: var(--texto); font-family: inherit;
  text-align: center; text-align-last: center; padding: .1rem 1.2rem .1rem .2rem; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--tenue) 50%), linear-gradient(135deg, var(--tenue) 50%, transparent 50%);
  background-position: right .45rem center, right .15rem center; background-size: 5px 5px; background-repeat: no-repeat;
}
/* El nombre de la GLOBAL es largo: algo más pequeño para que quepa entero en el móvil. */
.grupo-nombre.es-global b, .grupo-nombre.es-global select { font-size: .92rem; }
.grupo-barra .flecha {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--borde);
  background: var(--fondo); color: var(--acento); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lista-grupos { list-style: none; padding: 0; margin: .3rem 0 0; }
.lista-grupos li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--borde); }
.lista-grupos li:first-child { border-top: 0; }
.lista-grupos li.pendiente b { color: var(--tenue); font-weight: 600; }
.lista-grupos li:has(.grupo-fila) { padding: 0; }
.grupo-fila { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  width: 100%; padding: .55rem .2rem; cursor: pointer; border-radius: 8px; text-align: left; }
.grupo-fila:hover, .grupo-fila:focus-visible { background: color-mix(in srgb, var(--borde) 45%, transparent); }
.grupo-fila .flecha { font-size: 1.2rem; font-weight: 700; margin-left: .2rem; }
/* Yo › Tus grupos: ventana de un grupo. */
/* Separación entre el nombre del grupo y sus datos: una línea con degradado y 👥 en medio. */
.caja-grupo h2 { margin-bottom: .6rem; }
.separador-grupo { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.1rem; font-size: 1.1rem; }
.separador-grupo::before, .separador-grupo::after { content: ''; flex: 1; height: 2px; border-radius: 2px; }
.separador-grupo::before { background: linear-gradient(to right, transparent, var(--borde)); }
.separador-grupo::after { background: linear-gradient(to left, transparent, var(--borde)); }
.datos-grupo { margin: 0 0 1rem; }
.datos-grupo dt { font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tenue); margin-top: .8rem; }
.datos-grupo dt:first-child { margin-top: 0; }
.datos-grupo dd { margin: .25rem 0 0; }
.codigo-grupo { display: flex; align-items: center; gap: .5rem; }
.codigo-grupo code { font-size: 1.15rem; font-weight: 700; padding: .25rem .6rem; border-radius: 8px; border: 1px dashed var(--borde);
  user-select: all; word-break: break-all; }
.codigo-grupo .enlace-grupo { flex: 1; min-width: 0; font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; word-break: normal; padding: .45rem .6rem; }
.copiar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--borde); background: transparent; color: inherit; }
.copiar svg { width: 20px; height: 20px; }
.copiar:active { transform: scale(.94); }
.jugadores-grupo { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.jugadores-grupo li { padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--borde); font-size: .92rem; }
.jugadores-grupo li.tenue { border: 0; padding-left: 0; }
.jugadores-grupo li.yo { font-weight: 700; border-color: var(--verde); }

/* ---------------------------------------------------------------- administrador */
.admin h2 { margin-bottom: .8rem; }
.admin-grupos, .admin-usuarios { list-style: none; padding: 0; margin: 0; }
.admin-grupos li, .admin-usuarios li { padding: .7rem 0; border-top: 1px solid var(--borde); }
.admin-grupos li:first-child, .admin-usuarios li:first-child { border-top: 0; }
.admin-grupos li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.admin-grupo-datos, .admin-usuario { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.admin-grupo-datos span { font-size: .85rem; color: var(--tenue); }
.admin-acciones { display: flex; gap: .4rem; flex: none; }
/* Grupos: los ajustes de arriba, separados de la lista; quién creó cada grupo. */
.admin-ajustes { padding-bottom: .9rem; border-bottom: 1px solid var(--borde); }
.admin-subtitulo { margin: .9rem 0 .4rem; }
.admin .sello-origen { font-size: .65rem; background: var(--tecla); color: var(--tenue); font-weight: 600; }
.admin .sello-jugador { background: var(--acento); color: #fff; }
.chip-jugador { border-style: dashed; }
.admin-partidas { list-style: none; padding: 0; margin: .5rem 0 0; border: 1px solid var(--borde); border-radius: 10px; }
.admin-usuarios .admin-partidas li {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .45rem .6rem; font-size: .85rem;
}
.admin-partidas li > span { min-width: 0; }
.admin-partidas small { display: block; }
.admin-partidas .mini-boton { flex: none; }
/* Botones de anular partidas en la clasificación (solo administrador). */
.clasif .anular-admin { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.clasif .anular-admin .mini-boton { padding: .2rem .5rem; font-size: .75rem; }
/* Panel: palabras de días anteriores. */
.filtro input[type=search] {
  flex: 1; min-width: 0; font: inherit; color: var(--texto); background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 10px; padding: .5rem .6rem;
}
.filtro select:disabled { opacity: .5; }
.admin-palabras { list-style: none; padding: 0; margin: .5rem 0 0; }
.admin-palabras > li { padding: .55rem 0; border-top: 1px solid var(--borde); }
.admin-palabras > li:first-child { border-top: 0; }
.ap-fecha { font-size: .85rem; margin-bottom: .3rem; }
.ap-fila { display: flex; align-items: flex-start; gap: .5rem; padding: .15rem 0; }
.ap-fila .bandera { flex: none; }
.ap-palabras { display: flex; flex-wrap: wrap; gap: .25rem .7rem; min-width: 0; }
.ap-palabra { display: inline-flex; align-items: baseline; gap: .25rem; font-size: .85rem; }
.ap-palabra b { letter-spacing: .05em; font-weight: 600; }
.ap-palabra.principal b { font-weight: 800; }
.ap-palabra > small:first-child { color: var(--tenue); font-size: .68rem; font-weight: 700; }
.ap-palabra .sello { font-size: .62rem; padding: .05rem .3rem; }
.ap-palabra small.tenue { font-size: .72rem; }
.admin-usuario-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.admin-usuario-cabeza .mini-boton { flex: none; }
code { font-family: ui-monospace, monospace; background: var(--fondo); padding: 0 .3em; border-radius: 4px; color: var(--texto); }
.mini-boton {
  border: 1px solid var(--borde); background: var(--fondo); color: var(--acento); border-radius: 8px;
  padding: .35rem .6rem; font: 600 .82rem system-ui, sans-serif; cursor: pointer;
}
.mini-boton.peligro { color: #c2413b; }
.filtro { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--tenue); margin: .2rem 0 .4rem; }
.filtro select, .form select {
  flex: 1; font: inherit; color: var(--texto); background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 10px; padding: .5rem .6rem;
}
/* Desplegable en el que también se escribe para buscar. */
.combo { position: relative; flex: 1; min-width: 0; }
.combo input { width: 100%; padding: .5rem 2.2rem .5rem .6rem; }
.combo-flecha {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 2rem; border: 0; background: transparent;
  color: var(--tenue); font-size: .9rem; cursor: pointer;
}
.combo-lista {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 16rem; overflow-y: auto;
  list-style: none; margin: 0; padding: .25rem 0; background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / .15);
}
.combo-lista li { padding: .5rem .7rem; color: var(--texto); cursor: pointer; overflow-wrap: anywhere; }
.combo-lista li small { color: var(--tenue); }
.combo-lista li[aria-selected=true] { font-weight: 600; }
.combo-lista li.marcada, .combo-lista li[data-v]:hover { background: color-mix(in srgb, var(--acento) 12%, transparent); }
.combo-lista li.combo-nada { color: var(--tenue); cursor: default; }
.nuevo-grupo { margin-top: 1rem; }
/* Yo: «¿Te han invitado con un código?» e «Invitar a un amigo», cada uno con su formulario. */
.caja-grupos { margin-top: 0; }
#f-sugerir textarea { resize: vertical; min-height: 8rem; }
/* Yo › Sugerencias/Peticiones: un toque del color de acento para distinguirlo de los demás. */
.boton-hoja.boton-sugerir { border-color: color-mix(in srgb, var(--acento) 45%, var(--borde)); }
.titulo-envio { margin: .4rem 0 0; font-size: 1rem; text-align: center; }
.canales { display: flex; justify-content: center; gap: 1.4rem; }
.canal {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; border: 0; background: none; padding: .2rem;
  font: 600 .8rem system-ui, sans-serif; color: var(--tenue); cursor: pointer;
}
.canal svg { width: 52px; height: 52px; transition: transform .15s; }
.canal:active svg { transform: scale(.92); }
.canal:disabled { opacity: .5; }
.check-aviso { align-items: flex-start; margin-top: .7rem; }
.check-aviso small { font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.chip {
  border: 1px solid var(--borde); background: var(--fondo); color: var(--tenue); border-radius: 999px;
  padding: .35rem .75rem; font: 600 .82rem system-ui, sans-serif; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--verde); border-color: var(--verde); color: #fff; }
.chip:disabled { opacity: .5; }

/* ---------------------------------------------------------------- guía de instalación en iPhone */
.guia-ios { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 1.1rem; }
.paso-cabecera { display: flex; align-items: center; gap: .6rem; font-size: 1.02rem; }
.paso-num {
  flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--acento); color: #fff; font-weight: 800; font-size: .95rem;
}
.paso-ios p { margin: .3rem 0 .5rem 2.4rem; font-size: .9rem; color: var(--tenue); }
.maqueta { margin-left: 2.4rem; }
.maqueta svg { width: 24px; height: 24px; display: block; }
.copiar-enlace { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 0; }
.copiar-enlace svg { width: 20px; height: 20px; }
/* Dibujos con aspecto de iOS (en claro y oscuro) */
.ios-barra, .ios-menu, .ios-anadir {
  --ios-fondo: #f2f2f7; --ios-linea: #d1d1d6; --ios-azul: #0a84ff; --ios-texto: #1c1c1e;
  border-radius: 14px; background: var(--ios-fondo); color: var(--ios-texto); border: 1px solid var(--ios-linea);
}
@media (prefers-color-scheme: dark) {
  .ios-barra, .ios-menu, .ios-anadir { --ios-fondo: #1c1c1e; --ios-linea: #38383a; --ios-texto: #f2f2f7; }
}
.ios-barra { display: flex; justify-content: space-around; align-items: center; padding: .55rem .4rem; color: var(--ios-azul); }
.ios-barra span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.ios-menu div {
  display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem;
  border-top: 1px solid var(--ios-linea); font-size: .92rem;
}
.ios-menu div:first-child { border-top: 0; }
.ios-anadir-barra { display: flex; justify-content: space-between; align-items: center; padding: .55rem .7rem; font-size: .85rem; border-bottom: 1px solid var(--ios-linea); }
.ios-anadir-barra span { color: var(--ios-azul); }
.ios-anadir-barra .resalta { font-weight: 700; padding: .15rem .5rem; border-radius: 8px; }
.ios-anadir-app { display: flex; align-items: center; gap: .7rem; padding: .7rem; }
.ios-anadir-app img, .ios-icono img { width: 48px; height: 48px; border-radius: 11px; }
.ios-icono { display: inline-flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .8rem; }
/* Lo que hay que tocar: fondo amarillo, borde y un latido que nunca lo oculta */
.resalta {
  background: color-mix(in srgb, var(--amarilla) 28%, transparent);
  outline: 2.5px solid var(--amarilla); outline-offset: 1px;
  animation: resaltar 1.4s ease-in-out infinite;
}
.ios-menu .resalta { color: var(--ios-azul); font-weight: 700; border-radius: 8px; animation-name: resaltar-fila; }
@keyframes resaltar { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--amarilla) 35%, transparent); transform: scale(1.08); } }
@keyframes resaltar-fila { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amarilla) 35%, transparent); } }
/* Campo de contraseña al llegar desde el correo de recuperarla. */
.destacar { border-radius: 10px; padding: .5rem; margin: 0 -.5rem; background: color-mix(in srgb, var(--amarilla) 14%, transparent);
  animation: resaltar-fila 1.4s ease-in-out 3; }
.destacar p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .resalta, .destacar { animation: none; } }

/* ---------------------------------------------------------------- palabras extra */
.sello-extra { background: var(--acento); color: #fff; }

/* ---------------------------------------------------------------- palabra de inicio repetida */
.nota-vetadas { margin: .2rem 0 .9rem; border-color: #e5484d; background: color-mix(in srgb, #e5484d 8%, var(--fondo)); }
.caja-veto p { margin: 0 0 .8rem; }
.caja-veto .check { margin: .2rem 0 .9rem; }

/* ---------------------------------------------------------------- nivel superior */
.sello-superior { background: linear-gradient(135deg, #f5b301, #e8590c); color: #fff; }
.nivel-superior {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; margin: .2rem 0 .9rem;
  padding: .8rem 1rem; border-radius: 12px; color: #fff; text-align: center;
  background: linear-gradient(135deg, #f5b301, #e8590c 60%, #c2255c);
  box-shadow: 0 4px 14px color-mix(in srgb, #e8590c 35%, transparent);
  animation: brillo-superior 2.4s ease-in-out infinite;
}
.nivel-superior .estrellas { font-size: 1.3rem; letter-spacing: .25em; line-height: 1; text-shadow: 0 1px 2px #0004; }
.nivel-superior > b { font-size: 1.1rem; }
.nivel-superior > span:last-child { font-size: .92rem; }
.nivel-superior span b { font-size: 1.05rem; }
@keyframes brillo-superior {
  50% { box-shadow: 0 4px 22px color-mix(in srgb, #f5b301 60%, transparent); transform: scale(1.015); }
}
@media (prefers-reduced-motion: reduce) { .nivel-superior { animation: none; } }
.sello-idioma { font-size: .65rem; vertical-align: middle; background: var(--tecla); color: var(--texto); }
.extras .fila-extra {
  display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .5rem .2rem;
  border-top: 1px solid var(--borde);
}
.extras .fila-extra b.acertada { color: var(--verde); letter-spacing: .06em; }
.extras .fila-extra b.fallada { color: #d4433f; letter-spacing: .06em; }
.extras .fila-extra > span:last-child { white-space: nowrap; color: var(--tenue); }
.extras .fila-extra > span:last-child b { color: var(--texto); }
/* «Ver clasificación» al terminar: botón dorado con trofeo, que invite a ir a verla. */
.boton.ver-clasif {
  display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1rem;
  background: linear-gradient(135deg, #f7c948, #e8a317); color: #3b2a05; font-size: 1.08rem;
  padding: .95rem 1rem; box-shadow: 0 3px 12px color-mix(in srgb, #e8a317 40%, transparent);
}
.boton.ver-clasif::before { content: '🏆'; font-size: 1.25rem; }
.boton.ver-clasif span { font-size: 1.3rem; line-height: 1; }
.boton.ver-clasif:active { transform: scale(.98); }
.extras .fila-extra:last-of-type { margin-bottom: .3rem; }
.extras h3 { font-size: 1.3rem; }
/* Clasificación: grupo, modo y periodo quedan fijos arriba; solo se desplaza la lista. */
main:has(> .clasificacion) { padding-bottom: 0; }
.clasificacion { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.clasificacion > :not(#tabla) { flex: none; }
#tabla { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 1rem; margin: 0 -1rem; padding-inline: 1rem; }
@media (max-height: 420px) { /* móvil tumbado: no hay sitio para dejar la cabecera fija */
  .clasificacion, #tabla { flex: none; overflow: visible; }
}
.modos { display: flex; gap: .5rem; margin-bottom: .6rem; }
.modos button {
  flex: 1; border: 1px solid var(--borde); background: var(--tarjeta); color: var(--texto);
  border-radius: 10px; padding: .45rem 0; font: 600 .9rem system-ui, sans-serif; cursor: pointer;
}
.modos button[aria-selected=true] { background: var(--marca); border-color: var(--marca); color: #fff; }

/* Recordatorio de instalar (móvil, desde el navegador). */
.aviso-instalar { border: 2px solid var(--acento); text-align: center; }
.aviso-instalar p { margin: 0 0 .4rem; }
.aviso-instalar-otros { font-size: .85rem; color: var(--tenue); margin: .2rem 0 0 !important; }
#f-idiomas-grupo { margin-top: .4rem; }
#grupo-cambiar-idiomas { margin-left: .3rem; font-size: .9rem; }
button.enlace { background: none; border: 0; padding: .3rem .2rem; font: inherit; color: var(--acento); text-decoration: underline; cursor: pointer; }
/* Los días de recordatorio, el botón late y le cruza un brillo (unas cuantas veces, no siempre). */
.instalar.llamativo { position: relative; overflow: hidden; animation: llamar 1.6s ease-in-out .6s 5; }
.instalar.llamativo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, #ffffff8c 50%, transparent 65%);
  transform: translateX(-100%); animation: brillo 1.6s ease-in-out .6s 5;
}
.boton.secundario.instalar.llamativo { border-color: var(--acento); }
@keyframes llamar { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
  45% { transform: scale(1.04); box-shadow: 0 0 0 6px color-mix(in srgb, var(--acento) 25%, transparent); } }
@keyframes brillo { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .instalar.llamativo, .instalar.llamativo::after { animation: none; } }

/* ------------------------------------------------------------ Chat del grupo */
.boton-chat {
  flex: none; position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--borde);
  background: var(--fondo); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0;
}
.boton-chat .globo {
  position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #e5484d; color: #fff; font: 800 .7rem/20px system-ui, sans-serif; box-shadow: 0 0 0 2px var(--tarjeta);
}
body.con-chat { overflow: hidden; }
.chat-fondo {
  position: fixed; inset: 0; z-index: 20; background: #0007; display: flex; flex-direction: column; justify-content: flex-end;
  animation: chat-aparece .18s ease-out;
}
.chat-fondo.saliendo { animation: chat-aparece .18s ease-in reverse forwards; }
@keyframes chat-aparece { from { opacity: 0; } }
.chat {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; margin: 0 auto;
  height: calc(100% - max(7vh, env(safe-area-inset-top) + 3rem)); background: var(--fondo);
  border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px #0004; overflow: hidden;
  animation: chat-sube .22s ease-out;
}
.chat-fondo.saliendo .chat { animation: chat-sube .18s ease-in reverse forwards; }
@keyframes chat-sube { from { transform: translateY(40%); } }
.chat-cabecera {
  display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem .7rem 1rem;
  background: var(--tarjeta); border-bottom: 1px solid var(--borde);
}
.chat-cabecera { position: relative; justify-content: center; padding: .7rem 3.4rem; }
.chat-cabecera h2 { min-width: 0; margin: 0; font-size: 1.05rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-cerrar {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #f43f5e, #be123c); color: #fff; font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 2px 6px #be123c66;
}
.chat-cerrar:active { transform: translateY(-50%) scale(.92); }
.chat-lista { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .6rem .8rem 1rem; }
.chat-vacio { margin-top: 3rem; line-height: 1.6; }
.chat-dia { text-align: center; margin: .8rem 0 .4rem; }
.chat-dia span {
  font-size: .72rem; font-weight: 700; color: var(--tenue); background: var(--tecla);
  padding: .15rem .6rem; border-radius: 10px;
}
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; margin-top: .55rem; }
.chat-msg small { font-size: .7rem; color: var(--tenue); margin: 0 .5rem .12rem; }
.chat-burbuja-fila { display: flex; align-items: center; gap: .25rem; max-width: 85%; }
.chat-burbuja {
  margin: 0; padding: .45rem .75rem; border-radius: 4px 16px 16px 16px; background: var(--tarjeta);
  border: 1px solid var(--borde); overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.35;
}
/* Reacciones: tocando la burbuja sale la fila de emoticonos; debajo, las que lleva el mensaje. */
.chat-burbuja[data-reaccionar] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chat-burbuja[aria-expanded="true"] { outline: 2px solid var(--acento); outline-offset: 1px; }
.chat-reaccionar {
  display: flex; gap: .05rem; padding: .2rem .35rem;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 20px;
}
.chat-msg .emojis-marco { margin-top: .3rem; }
/* Filas de emoticonos (escribir y reaccionar): una sola línea que se desliza a derecha e izquierda.
   Si quedan más por un lado, ese borde se difumina y sale una flecha (app.js: senalesEmojis). */
.emojis-marco { position: relative; max-width: 100%; min-width: 0; }
.emojis-desliza { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.emojis-desliza::-webkit-scrollbar { display: none; }
.emojis-desliza.mas-der { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent calc(100% - 8px)); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent calc(100% - 8px)); }
.emojis-desliza.mas-izq { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent calc(100% - 8px)); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent calc(100% - 8px)); }
.emojis-desliza.mas-izq.mas-der { -webkit-mask-image: linear-gradient(to right, transparent 8px, #000 44px, #000 calc(100% - 44px), transparent calc(100% - 8px)); mask-image: linear-gradient(to right, transparent 8px, #000 44px, #000 calc(100% - 44px), transparent calc(100% - 8px)); }
.emojis-mas {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 24px; height: 24px; padding: 0 0 2px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--borde); background: var(--tarjeta);
  color: var(--acento); font-size: 1.05rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgb(0 0 0 / .18);
}
.emojis-mas[hidden] { display: none; }
.emojis-mas.izq { left: -3px; }
.emojis-mas.der { right: -3px; }
.emojis-mas:active { transform: translateY(-50%) scale(.9); }
.chat-reaccionar button {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none;
  font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0; color: inherit;
}
.chat-reaccionar button:active, .chat-reaccionar button.mia { background: var(--tecla); }
.chat-reaccionar .emoji-palabros { width: 24px; height: 24px; vertical-align: middle; }
.chat-reacciones { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 85%; margin: .2rem .3rem 0; }
.chat-msg.mio .chat-reacciones { justify-content: flex-end; }
.chat-reaccion {
  display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .45rem; border-radius: 12px;
  border: 1px solid var(--borde); background: var(--tarjeta); color: inherit; font: inherit; font-size: .8rem;
  line-height: 1.5; cursor: pointer;
}
.chat-reaccion b { font-size: .72rem; font-variant-numeric: tabular-nums; }
.chat-reaccion.mia { border-color: var(--acento); background: color-mix(in srgb, var(--acento) 12%, var(--tarjeta)); }
.chat-reaccion .emoji-palabros { width: 1.1em; height: 1.1em; vertical-align: middle; }
.chat-quienes { margin: .2rem .5rem 0; max-width: 85%; font-size: .75rem; line-height: 1.5; color: var(--tenue); }
.chat-msg.mio .chat-quienes { text-align: right; }
.chat-msg.mio { align-items: flex-end; }
.chat-msg.mio .chat-burbuja-fila { flex-direction: row-reverse; }
.chat-msg.mio .chat-burbuja { border-radius: 16px 4px 16px 16px; background: var(--yo); border-color: transparent; }
.chat-msg.oculto .chat-burbuja { font-style: italic; color: var(--tenue); background: repeating-linear-gradient(-45deg, var(--tarjeta) 0 8px, var(--tecla) 8px 16px); }
.chat-borrar {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none;
  font-size: .9rem; opacity: .55; cursor: pointer; padding: 0;
}
.chat-borrar:hover { opacity: 1; background: var(--tecla); }
.chat-escribir {
  background: var(--tarjeta); border-top: 1px solid var(--borde);
  padding: .45rem .7rem calc(env(safe-area-inset-bottom) + .35rem);
}
.chat-emojis { display: flex; gap: .15rem; }
form .emojis-marco { margin-bottom: .4rem; }
.chat-emojis button {
  flex: none; width: 38px; height: 34px; border: 0; border-radius: 9px; background: none;
  font-size: 1.3rem; cursor: pointer; padding: 0;
}
.chat-emojis button:active { background: var(--tecla); }
/* Icono del juego como emoticono: en la fila de emoticonos y dentro de los mensajes. */
.emoji-palabros { width: 1.25em; height: 1.25em; border-radius: 22%; vertical-align: -.25em; }
.chat-emojis .emoji-palabros { width: 26px; height: 26px; vertical-align: middle; }
.chat-fila { display: flex; gap: .45rem; }
.chat-fila input { flex: 1; min-width: 0; border-radius: 22px; padding: .6rem .95rem; }
.chat-enviar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--acento);
  color: #fff; font-size: 1.15rem; cursor: pointer;
}
.chat-enviar:disabled { opacity: .5; }
.chat-cuenta { display: block; text-align: right; font-size: .68rem; color: var(--tenue); margin: .15rem .4rem 0; }
.chat-cuenta.casi { color: #d4433f; font-weight: 700; }
.chat-solo-leer { padding: .8rem 1rem calc(env(safe-area-inset-bottom) + .8rem); margin: 0; background: var(--tarjeta); border-top: 1px solid var(--borde); }

/* Instalar: por qué merece la pena, antes de los pasos. */
.ventajas-instalar { margin: 0 0 1rem; border-color: var(--acento); background: color-mix(in srgb, var(--acento) 8%, var(--fondo)); }
.ventajas-instalar p { margin: 0 0 .3rem; text-align: center; }
.ventajas-instalar ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.ventajas-instalar img { width: 1.15em; height: 1.15em; border-radius: 22%; vertical-align: -.2em; }

/* Yo: botones que abren ventanas emergentes (unirse, invitar, instalar y cuenta), todos iguales:
   fondo de tarjeta y título centrado. */
.boton-hoja, .en-yo .boton.secundario.instalar {
  display: block; width: 100%; margin: 0 0 1rem; padding: 1rem 1.1rem; cursor: pointer;
  background: var(--tarjeta); color: var(--texto); border: 1px solid var(--borde); border-radius: var(--radio);
  font: inherit; font-size: 1.05rem; font-weight: 700; text-align: center;
}
.en-yo .boton.secundario.instalar.llamativo { border-color: var(--acento); }
.boton-hoja:active, .en-yo .boton.secundario.instalar:active { transform: scale(.985); }
dialog.hoja-yo h2 { text-align: center; margin: .2rem 2.2rem 1rem; font-size: 1.2rem; }
.hoja-cerrar {
  position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #f43f5e, #be123c); color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: 0 2px 6px #be123c66;
}

/* Admin › Recursos y Uso: barras de uso frente a los límites del plan gratuito. */
.medidor { margin: .2rem 0 .9rem; }
.medidor-cabeza { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .9rem; margin-bottom: .3rem; }
.medidor-cabeza span { color: var(--tenue); }
.medidor-barra { height: 10px; border-radius: 5px; background: var(--tecla); overflow: hidden; }
.medidor-barra i { display: block; height: 100%; border-radius: 5px; background: var(--verde); }
.medidor-barra.medio i { background: var(--amarilla); }
.medidor-barra.alto i { background: #d4433f; }
/* Admin › Sugerencias/Peticiones: las sin leer, con borde del color de acento. */
#bloque-sugerencias h3 .globo {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; vertical-align: middle;
  background: #e5484d; color: #fff; font: 800 .72rem/20px system-ui, sans-serif; text-align: center;
}
#bloque-sugerencias h3 .globo[hidden] { display: none; }
.sugerencias { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .6rem; }
.sugerencias li { display: grid; gap: .25rem; justify-items: start; padding: .7rem .8rem; border-radius: 10px;
  background: var(--fondo); border: 1px solid var(--borde); }
.sugerencias li.sin-leer { border-color: var(--acento); box-shadow: inset 3px 0 0 var(--acento); }
.sugerencias li.leida { opacity: .8; }
.sugerencia-texto { margin: .3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--texto); }
.sello-nueva { background: var(--acento); color: #fff; }
.recursos-chat { display: grid; gap: .15rem; padding: .7rem .8rem; border-radius: 10px; background: var(--fondo); border: 1px solid var(--borde); font-size: .9rem; margin-bottom: .6rem; }
/* Admin › Recursos y Uso: jugadores por día y por semana. */
.grafico-barras { margin: .2rem 0 1rem; padding: .7rem .8rem .5rem; border-radius: 10px; background: var(--fondo); border: 1px solid var(--borde); }
.grafico-barras figcaption { font-size: .9rem; font-weight: 700; margin-bottom: .5rem; }
.gb-barras { display: flex; align-items: stretch; gap: 2px; height: 130px; }
.gb-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.gb-zona { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.gb-col b { font-size: .8rem; color: var(--texto); margin-bottom: .2rem; }
.gb-col i { display: block; width: 70%; max-width: 44px; min-height: 2px; border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--verde) 55%, var(--fondo)); }
.gb-col span { font-size: .72rem; color: var(--tenue); margin-top: .25rem; padding-top: .2rem; border-top: 1px solid var(--borde);
  width: 100%; text-align: center; white-space: nowrap; }
.grafico-barras > small { display: block; font-size: .75rem; margin-top: .4rem; }
.grafico-barras.densa .gb-barras { gap: 1px; }
.grafico-barras.densa .gb-col b { font-size: .62rem; }
.grafico-barras.densa .gb-col i { width: 80%; }
.grafico-barras.densa .gb-col span { font-size: .6rem; }
.recursos-tablas { margin: .4rem 0 .6rem; font-size: .88rem; }
.recursos-tablas summary { cursor: pointer; color: var(--acento); }
.recursos-tablas table { width: 100%; border-collapse: collapse; margin: .4rem 0 .3rem; }
.recursos-tablas th, .recursos-tablas td { text-align: right; padding: .25rem .3rem; border-bottom: 1px solid var(--borde); }
.recursos-tablas th:first-child, .recursos-tablas td:first-child { text-align: left; }
.recursos-tablas th { color: var(--tenue); font-weight: 600; }

/* Mensajes del administrador («Palabro Master»): en negrita y con borde de color. */
.chat-msg.oficial .chat-burbuja { font-weight: 800; border: 2px solid var(--acento); background: color-mix(in srgb, var(--acento) 10%, var(--tarjeta)); }
.chat-msg.oficial small b { color: var(--acento); }
/* El nombre de los ganadores en los anuncios de Palabro Master: en una píldora dorada. */
.destacado { display: inline-block; padding: 0 .4em; border-radius: 6px; background: #f6c445; color: #3d2a00; font-weight: 800; }
.chat-msg small .emoji-palabros { width: 1.15em; height: 1.15em; }
/* Admin › Mensaje a todos los chats. */
.difusion-escribir { border: 1px solid var(--borde); border-radius: 12px; padding: .5rem .6rem .3rem; margin: .4rem 0 .8rem; }
.difusiones { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.difusiones li { padding: .6rem .7rem; border-radius: 10px; background: var(--fondo); border: 1px solid var(--borde); display: grid; gap: .3rem; justify-items: start; }
.difusiones p { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* «Último paso»: alta sin invitación, separada del formulario del código por una línea. */
.sin-codigo { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--borde); text-align: center; }
.sin-codigo h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.sin-codigo p { margin: 0 0 .9rem; font-size: .92rem; }
.sin-codigo .boton-hoja { width: 100%; }
.sin-codigo .boton { width: 100%; margin: 0; }
.separador-sin-codigo { border: 0; border-top: 1px solid var(--borde); margin: 1.2rem 0 1.1rem; }
.sin-codigo p.pequeño { margin: .7rem 0 0; font-size: .82rem; }
.nota-sin-grupo { margin: 1.2rem auto 0; max-width: 28rem; padding: .8rem 1rem; border: 1px dashed var(--borde); border-radius: 12px; text-align: center; font-size: .9rem; }
.nota-sin-grupo p { margin: 0 0 .4rem; }
.nota-sin-grupo p:last-child { margin: 0; }
.caja-grupo-listo .datos-grupo { margin: 0 0 .9rem; text-align: center; }
.caja-grupo-listo .codigo-listo { font-size: 1.15rem; font-weight: 700; padding: .2rem .6rem; border-radius: 8px; border: 1px dashed var(--borde); }
.nota-invitar { margin: 0 0 .6rem; padding: .7rem .8rem; border-radius: 10px; text-align: center; font-size: .92rem;
  background: color-mix(in srgb, var(--acento) 12%, transparent); border: 1px solid color-mix(in srgb, var(--acento) 40%, var(--borde)); }
/* Yo › ¿Quieres crear un grupo…?: con color y un brillo que pasa de vez en cuando, para que se vea bien. */
.boton-hoja.boton-crear {
  position: relative; overflow: hidden; flex-shrink: 0; color: #fff; border: 0;
  background: linear-gradient(135deg, #3157d5, #7c3aed 55%, #db2777);
  box-shadow: 0 4px 14px #7c3aed55; text-shadow: 0 1px 2px #0004;
  animation: crear-latido 2.8s ease-in-out infinite;
}
.boton-hoja.boton-crear::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, #fff6, transparent); transform: skewX(-20deg);
  animation: crear-brillo 3.5s ease-in-out infinite;
}
@keyframes crear-brillo { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes crear-latido { 0%, 100% { box-shadow: 0 4px 14px #7c3aed55; } 50% { box-shadow: 0 4px 22px #db277788; } }
@media (prefers-reduced-motion: reduce) { .boton-hoja.boton-crear, .boton-hoja.boton-crear::after { animation: none; } }
/* Ventana de invitar tras crear un grupo. */
.nota-creado { margin: -.3rem 0 .9rem; padding: .7rem .8rem; border-radius: 10px; text-align: center; font-size: .92rem;
  background: color-mix(in srgb, var(--verde) 14%, transparent); border: 1px solid color-mix(in srgb, var(--verde) 45%, var(--borde)); }
/* Panel › Grupos por aprobar: en azul, como su globo del engranaje. */
.tarjeta-pendientes { border: 1px solid #2f6fed; box-shadow: 0 0 0 3px #2f6fed22; }
.tarjeta-pendientes h3 .globo-azul {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; vertical-align: middle;
  background: #2f6fed; color: #fff; font: 800 .72rem/20px system-ui, sans-serif; text-align: center;
}
.mini-boton.aprobar { color: var(--verde); }
/* Ventana «¡Tu grupo está aprobado!» al entrar en la app. */
.caja-aprobado .aprobado-icono { font-size: 3rem; text-align: center; line-height: 1; margin-top: .4rem; }
.caja-aprobado p { margin: 0 0 1rem; }
/* Versión de pruebas (DEV) con datos reales: etiqueta y franja rojas. */
.etiqueta.dev { background: #e5484d; color: #fff; font-weight: 800; letter-spacing: .06em; }
.etiqueta.dev { font-size: .72rem; padding: .05em .5em; }
body.entorno-dev .barra { border-bottom: 4px solid #e5484d; }

/* ---------------------------------------------------------------- temas de temporada (js/temas.js) */
/* Navidad: gorro de Papá Noel en la «P», nieve sobre las fichas, copos cayendo por la barra y
   una ramita de acebo en la «S». Solo con la clase tema-navidad en <html>. */
.tema-navidad .logo .fichas span { position: relative; }
/* Nieve acumulada encima de cada ficha (menos la «P», que lleva el gorro). */
.tema-navidad .logo .fichas span:not(:first-child)::after {
  content: ''; position: absolute; left: -2px; right: -2px; top: -4px; height: 10px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 10' preserveAspectRatio='none'%3E%3Cpath d='M0 6.5C0 2.5 2.5.8 6 .8h23c3.5 0 6 1.7 6 5.7-1.8 1.6-3.6.4-5.3 1-1.6.6-2 2.4-3.9 2.3-1.8 0-2.1-2.4-4.1-2.5-2.2-.1-3 1.9-5.1 1.8-1.9 0-2.4-1.9-4.3-2-2 0-3 2.3-5 2.2C5.5 10.2 5 7.8 3.2 7.5 1.8 7.3.9 7.9 0 6.5Z' fill='%23fbfdff'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px #0003);
}
/* Gorro de Papá Noel, ladeado sobre la «P». */
.tema-navidad .logo .fichas span:first-child::before {
  content: ''; position: absolute; left: -8px; top: -12px; width: 33px; height: 25px; pointer-events: none;
  transform: rotate(-16deg); filter: drop-shadow(0 2px 1px #0004);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M5 22C6.5 12.5 13 5.2 22.5 3.6c6.5-1.1 11.6 2.6 12.6 9.4l-3.4.6c-1-3.7-3.7-5.5-7-4.8-3.6.8-4.6 5.5-3.8 13.2Z' fill='%23d42a35'/%3E%3Cpath d='M22.5 3.6c6.5-1.1 11.6 2.6 12.6 9.4l-3.4.6c-1-3.7-3.7-5.5-7-4.8Z' fill='%23b81f2a'/%3E%3Crect x='2' y='19.5' width='24' height='8' rx='4' fill='%23fbfdff'/%3E%3Ccircle cx='34' cy='15.5' r='4.6' fill='%23fbfdff'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Ramita de acebo en la esquina de abajo a la derecha de la «S». */
.tema-navidad .logo .fichas span:last-of-type::before {
  content: ''; position: absolute; right: -9px; bottom: -8px; width: 22px; height: 18px; pointer-events: none;
  filter: drop-shadow(0 1px 1px #0005);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M12 11C9 6 4.5 4.5 1 6c1.6.9 1.3 2.6 0 3.3 1.7.8 1.6 2.6.2 3.3 3.8 1.7 8.2.6 10.8-1.6Z' fill='%23247a3f'/%3E%3Cpath d='M12 11c3-5 7.5-6.5 11-5-1.6.9-1.3 2.6 0 3.3-1.7.8-1.6 2.6-.2 3.3-3.8 1.7-8.2.6-10.8-1.6Z' fill='%232e9e5b'/%3E%3Ccircle cx='9.6' cy='13.6' r='2.6' fill='%23e0262f'/%3E%3Ccircle cx='14.4' cy='13.6' r='2.6' fill='%23e0262f'/%3E%3Ccircle cx='12' cy='16.9' r='2.6' fill='%23c81d26'/%3E%3Ccircle cx='9' cy='12.9' r='.8' fill='%23fff9'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Copos cayendo despacio por la barra (pocos y pequeños; quietos si se pide menos movimiento). */
.tema-navidad .barra::before, .tema-navidad .barra::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2.4px 2.4px at 10% 20%, #fffc 50%, transparent 52%),
    radial-gradient(2px 2px at 28% 70%, #fffa 50%, transparent 52%),
    radial-gradient(2.8px 2.8px at 47% 35%, #fffb 50%, transparent 52%),
    radial-gradient(2.1px 2.1px at 66% 80%, #fff9 50%, transparent 52%),
    radial-gradient(2.6px 2.6px at 84% 25%, #fffc 50%, transparent 52%),
    radial-gradient(2px 2px at 93% 62%, #fffa 50%, transparent 52%);
  background-size: 180px 60px;
  animation: nieve-caer 9s linear infinite;
}
.tema-navidad .barra::after { background-size: 130px 46px; background-position: 40px 0; animation-duration: 6.5s; opacity: .7; }
@keyframes nieve-caer { from { background-position-y: 0; } to { background-position-y: 60px; } }
.tema-navidad .barra::after { animation-name: nieve-caer-2; }
@keyframes nieve-caer-2 { from { background-position: 40px 0; } to { background-position: 30px 46px; } }
.tema-navidad .barra > * { position: relative; z-index: 1; }
.tema-navidad .barra > .engranaje, .tema-navidad .barra > .anular-admin-barra, .tema-navidad .barra > .etiqueta { position: absolute; }
@media (prefers-reduced-motion: reduce) { .tema-navidad .barra::before, .tema-navidad .barra::after { animation: none; } }

/* Luces de Navidad: guirnalda que une las fichas por arriba, con bombillas en los huecos y las
   fichas iluminándose. js/temas.js pone las bombillas y da a cada luz un ritmo y un retraso al azar
   (--dur, --retraso), así se encienden sin ningún orden. */
.tema-navidad .logo .fichas { position: relative; }
.tema-navidad .logo .fichas::before {
  content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 14px; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 276 14' preserveAspectRatio='none'%3E%3Cpath d='M15.5 3 Q33 13 50.5 3 Q68 13 85.5 3 Q103 13 120.5 3 Q138 13 155.5 3 Q173 13 190.5 3 Q208 13 225.5 3 Q243 13 260.5 3' fill='none' stroke='%231d4d2c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.tema-navidad .logo .fichas .bombilla {
  position: absolute; top: 1px; width: 5px; height: 7px; margin-left: -2.5px; border-radius: 50% 50% 45% 45%;
  background: var(--color); z-index: 3; pointer-events: none;
  box-shadow: 0 0 4px 1px var(--color);
  animation: bombilla var(--dur, 1.6s) var(--retraso, 0s) ease-in-out infinite alternate;
}
@keyframes bombilla {
  from { opacity: 1; box-shadow: 0 0 6px 2px var(--color); }
  to { opacity: var(--min, .3); box-shadow: 0 0 1px 0 var(--color); }
}
.tema-navidad .logo .fichas span.cV { --luz: #3ddc84; }
.tema-navidad .logo .fichas span.cA { --luz: #ffc94d; }
.tema-navidad .logo .fichas span.cG { --luz: #c9d3ff; }
.tema-navidad .logo .fichas span {
  animation: logo-girar .5s calc(var(--i) * 70ms) both, luz-ficha var(--dur, 2.8s) var(--retraso, .8s) ease-in-out infinite;
}
@keyframes luz-ficha {
  0%, 100% { box-shadow: inset 0 -3px 0 #0003, 0 2px 4px #0004; filter: none; }
  50% { box-shadow: inset 0 -3px 0 #0003, 0 2px 4px #0004, 0 0 14px 2px var(--luz); filter: brightness(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .tema-navidad .logo .fichas span, .tema-navidad .logo .fichas .bombilla { animation: none; }
}

/* Nochebuena y Navidad: estrella dorada que titila arriba a la derecha de la «S». */
.tema-nochebuena .logo .fichas::after {
  content: ''; position: absolute; left: 100%; margin-left: -12px; top: -19px; width: 34px; height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5l3 6.6 7.2.8-5.4 4.9 1.5 7.1L12 17.3l-6.3 3.6 1.5-7.1L1.8 8.9l7.2-.8z' fill='%23ffd23f' stroke='%23b7791f' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px #ffd23fcc); z-index: 4;
  animation: estrella 2.2s ease-in-out infinite alternate;
}
@keyframes estrella { from { transform: scale(.9) rotate(-8deg); filter: drop-shadow(0 0 4px #ffd23faa); } to { transform: scale(1.1) rotate(8deg); filter: drop-shadow(0 0 12px #ffd23f) drop-shadow(0 0 4px #fff8); } }

/* Nochevieja y Año Nuevo: el año que empieza (data-anio, js/temas.js) delante del logo, grande
   (casi la mitad de su anchura) y como un letrero de neón: tubo claro, halo rosa y algún parpadeo. */
.tema-nochevieja .logo .fichas::after {
  content: attr(data-anio); position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-6deg);
  font: 400 2.95rem/1 "Trebuchet MS", system-ui, sans-serif; letter-spacing: .12em; padding: .08em .2em .1em .32em;
  color: #fff4fd; white-space: nowrap; border-radius: 14px;
  background: radial-gradient(closest-side, #1f2a44e6 55%, #1f2a4400);
  text-shadow: 0 0 2px #fff, 0 0 6px #ff7ae0, 0 0 12px #ff3fcf, 0 0 22px #ff2fb0, 0 0 38px #c026d3;
  animation: neon 4.5s linear infinite;
}
@keyframes neon {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; text-shadow: 0 0 2px #fff, 0 0 6px #ff7ae0, 0 0 12px #ff3fcf, 0 0 22px #ff2fb0, 0 0 38px #c026d3; }
  20%, 24%, 55% { opacity: .55; text-shadow: 0 0 1px #fff, 0 0 4px #ff7ae0; }
}
@media (prefers-reduced-motion: reduce) { .tema-nochevieja .logo .fichas::after { animation: none; } }
.confeti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1000; }
.confeti i {
  position: absolute; top: -20px; border-radius: 2px; opacity: .95;
  animation-name: confeti-caer; animation-timing-function: cubic-bezier(.25, .6, .5, 1); animation-fill-mode: forwards;
}
@keyframes confeti-caer {
  to { transform: translate(var(--lado), 105vh) rotate(var(--giro)); opacity: .8; }
}

/* Reyes y Nochebuena: la barra crece un poco por arriba para que quepan las coronas y la estrella (y el engranaje y el botón de
   anular bajan lo mismo, para seguir a la altura de las fichas). */
.tema-reyes .barra, .tema-nochebuena .barra { padding-top: calc(env(safe-area-inset-top) + 1.15rem); }
.tema-reyes .engranaje, .tema-reyes .anular-admin-barra,
.tema-nochebuena .engranaje, .tema-nochebuena .anular-admin-barra { top: calc(env(safe-area-inset-top) + 1.15rem); }
/* Reyes: las tres coronas de los Reyes Magos, en la «P» (en lugar del gorro), la «A» del centro y
   la «O», cada una con sus piedras y un poco ladeada. */
.tema-reyes .logo .fichas span:first-child::before,
.tema-reyes .logo .fichas span:nth-of-type(4)::before,
.tema-reyes .logo .fichas span:nth-of-type(7)::before {
  content: ''; position: absolute; width: 40px; height: 26px; pointer-events: none; z-index: 3;
  filter: drop-shadow(0 1px 2px #0006);
}
.tema-reyes .logo .fichas span:first-child::before {
  left: -5px; top: -19px; transform: rotate(-12deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 26'%3E%3Cpath d='M4 22 2 6l9 7 9-11 9 11 9-7-2 16Z' fill='%23ffd23f' stroke='%23b7791f' stroke-width='1.4' stroke-linejoin='round'/%3E%3Crect x='4' y='19.5' width='32' height='5' rx='1.5' fill='%23d9a21b' stroke='%23b7791f' stroke-width='1'/%3E%3Ccircle cx='20' cy='13.5' r='2.6' fill='%23e5484d'/%3E%3Ccircle cx='11' cy='16' r='1.9' fill='%234dc3ff'/%3E%3Ccircle cx='29' cy='16' r='1.9' fill='%232e9e5b'/%3E%3Ccircle cx='2' cy='6' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='20' cy='2' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='38' cy='6' r='1.9' fill='%23ffd23f'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tema-reyes .logo .fichas span:nth-of-type(4)::before {
  left: 50%; top: -20px; transform: translateX(-50%) rotate(5deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 26'%3E%3Cpath d='M4 22 2 6l9 7 9-11 9 11 9-7-2 16Z' fill='%23ffd23f' stroke='%23b7791f' stroke-width='1.4' stroke-linejoin='round'/%3E%3Crect x='4' y='19.5' width='32' height='5' rx='1.5' fill='%23d9a21b' stroke='%23b7791f' stroke-width='1'/%3E%3Ccircle cx='20' cy='13.5' r='2.6' fill='%232e9e5b'/%3E%3Ccircle cx='11' cy='16' r='1.9' fill='%23e5484d'/%3E%3Ccircle cx='29' cy='16' r='1.9' fill='%23c084fc'/%3E%3Ccircle cx='2' cy='6' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='20' cy='2' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='38' cy='6' r='1.9' fill='%23ffd23f'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tema-reyes .logo .fichas span:nth-of-type(7)::before {
  left: 50%; top: -19px; transform: translateX(-50%) rotate(-7deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 26'%3E%3Cpath d='M4 22 2 6l9 7 9-11 9 11 9-7-2 16Z' fill='%23ffd23f' stroke='%23b7791f' stroke-width='1.4' stroke-linejoin='round'/%3E%3Crect x='4' y='19.5' width='32' height='5' rx='1.5' fill='%23d9a21b' stroke='%23b7791f' stroke-width='1'/%3E%3Ccircle cx='20' cy='13.5' r='2.6' fill='%234dc3ff'/%3E%3Ccircle cx='11' cy='16' r='1.9' fill='%23ffffff'/%3E%3Ccircle cx='29' cy='16' r='1.9' fill='%23e5484d'/%3E%3Ccircle cx='2' cy='6' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='20' cy='2' r='1.9' fill='%23ffd23f'/%3E%3Ccircle cx='38' cy='6' r='1.9' fill='%23ffd23f'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: reduce) { .tema-nochebuena .logo .fichas::after { animation: none; } }

/* ---------------------------------------------------------------- palabra temática de Navidad */
/* Sello de la cabecera y aviso antes de empezar: rojo y verde de Navidad, una guirnalda de luces
   arriba (que parpadean al azar, con retrasos distintos), copos de fondo y el árbol. */
.sello-navidad { background: linear-gradient(135deg, #c81d26, #1f7a3f); color: #fff; }
.aviso-navidad {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: .2rem; margin: .2rem 0 .9rem;
  padding: 1.35rem 1rem .9rem; border-radius: 12px; color: #fff; text-align: center;
  background:
    radial-gradient(2px 2px at 12% 70%, #fff9 50%, transparent 55%),
    radial-gradient(2.5px 2.5px at 28% 40%, #fffb 50%, transparent 55%),
    radial-gradient(2px 2px at 72% 78%, #fff9 50%, transparent 55%),
    radial-gradient(2.5px 2.5px at 88% 45%, #fffb 50%, transparent 55%),
    radial-gradient(1.8px 1.8px at 55% 88%, #fff8 50%, transparent 55%),
    linear-gradient(135deg, #b3141d, #8e1018 45%, #1f6b3a);
  box-shadow: 0 4px 14px #b3141d55, inset 0 0 0 2px #ffd23f55;
}
.aviso-navidad-luces {
  position: absolute; left: 0; right: 0; top: 0; height: 18px; display: flex; justify-content: space-around; align-items: flex-start;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 2Q5.5 9 11 2T22 2T33 2T44 2T55 2T66 2T77 2T88 2T100 2' fill='none' stroke='%23124d26' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 100% 10px no-repeat;
}
.aviso-navidad-luces i {
  width: 8px; height: 12px; margin-top: 5px; border-radius: 50% 50% 45% 45%; background: var(--c);
  box-shadow: 0 0 6px 2px var(--c); animation: luz-aviso 1.4s ease-in-out infinite alternate;
}
.aviso-navidad-luces i:nth-child(3n+1) { --c: #ffd23f; animation-delay: .3s; }
.aviso-navidad-luces i:nth-child(3n+2) { --c: #4dc3ff; animation-delay: .9s; animation-duration: 1.1s; }
.aviso-navidad-luces i:nth-child(3n) { --c: #ff6b6b; animation-delay: .5s; animation-duration: 1.7s; }
.aviso-navidad-luces i:nth-child(2n) { margin-top: 3px; }
@keyframes luz-aviso { to { opacity: .3; box-shadow: 0 0 1px 0 var(--c); } }
.aviso-navidad-arbol { font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 2px 3px #0005); }
.aviso-navidad > b { font-size: 1.12rem; text-shadow: 0 1px 2px #0005; }
.aviso-navidad > span:last-child { font-size: .92rem; }
.aviso-navidad span b { font-size: 1.05rem; color: #ffe58a; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .aviso-navidad-luces i { animation: none; } }

/* ---------------------------------------------------------------- elecciones (tema y palabra temática) */
/* Decorado del logo el día de elecciones: una urna transparente con la tapa azul, grande y en medio
   del logo (como el año de Nochevieja), y un sobre que cae una y otra vez por la ranura. La barra crece
   un poco por arriba para que se vea caer el sobre. Colores neutros: nada de partidos. */
.tema-elecciones .logo .fichas { position: relative; }
.tema-elecciones .barra { padding-top: calc(env(safe-area-inset-top) + 1.15rem); }
.tema-elecciones .engranaje, .tema-elecciones .anular-admin-barra { top: calc(env(safe-area-inset-top) + 1.15rem); }
.tema-elecciones .logo .fichas::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px 0 0 -33px; z-index: 5;
  pointer-events: none; filter: drop-shadow(0 0 6px #1f2a44) drop-shadow(0 3px 4px #0006);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect x='3' y='9' width='24' height='19' rx='2' fill='%23e8f2ff' /%3E%3Cg transform='rotate(7 9.1 23.5)'%3E%3Crect x='4.6' y='20.4' width='9' height='6.2' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M5.0 20.799999999999997 9.1 24.1 13.2 20.799999999999997' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='rotate(-6 20.0 23.7)'%3E%3Crect x='15.2' y='20.6' width='9.6' height='6.2' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M15.6 21.0 20.0 24.3 24.4 21.0' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='rotate(-13 14.5 20.7)'%3E%3Crect x='10' y='17.6' width='9' height='6.2' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M10.4 18.0 14.5 21.3 18.6 18.0' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='rotate(16 9.4 17.0)'%3E%3Crect x='5.4' y='14.2' width='8' height='5.6' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M5.800000000000001 14.6 9.4 17.6 13.0 14.6' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='rotate(10 20.6 17.5)'%3E%3Crect x='16.4' y='14.6' width='8.4' height='5.8' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M16.799999999999997 15.0 20.6 18.1 24.4 15.0' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='rotate(-4 14.8 14.9)'%3E%3Crect x='11' y='12.2' width='7.6' height='5.4' rx='.8' fill='%23fff' stroke='%23b8c2d4' stroke-width='.7'/%3E%3Cpath d='M11.4 12.6 14.8 15.4 18.200000000000003 12.6' fill='none' stroke='%23b8c2d4' stroke-width='.7'/%3E%3C/g%3E%3Crect x='3' y='9' width='24' height='19' rx='2' fill='%23cfe3ff30' stroke='%23a9c8f0' stroke-width='1.2'/%3E%3Cpath d='M5.5 12v13' stroke='%23fff9' stroke-width='1.4' stroke-linecap='round'/%3E%3Crect x='1' y='5' width='28' height='5.5' rx='1.6' fill='%232f6fed' stroke='%231f4fb8' stroke-width='1'/%3E%3Crect x='9' y='7' width='12' height='1.6' rx='.8' fill='%23102660'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: urna-vibrar 3.2s 1s linear infinite;
}
/* El sobre: blanco con la solapa marcada; baja hasta la ranura y desaparece dentro, y la urna (con
   varios sobres ya dentro) vibra un poquito al recibirlo. */
.tema-elecciones .logo .fichas::before {
  content: ''; position: absolute; left: 50%; top: -16px; width: 22px; height: 16px; margin-left: -11px; z-index: 4;
  pointer-events: none; filter: drop-shadow(0 1px 1px #0004);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Crect x='.5' y='.5' width='11' height='8' rx='1' fill='%23fff' stroke='%23b8c2d4'/%3E%3Cpath d='M.8 1 6 5.2 11.2 1' fill='none' stroke='%23b8c2d4' stroke-width='.9'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: sobre-urna 3.2s 1s ease-in infinite;
}
@keyframes sobre-urna {
  0% { transform: translateY(-30px) rotate(-12deg); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translateY(0) rotate(0); opacity: 1; }
  72%, 100% { transform: translateY(12px) rotate(0); opacity: 0; }
}
/* La urna vibra un poquito cada vez que el sobre cae dentro (mismo ritmo y retraso que el sobre). */
@keyframes urna-vibrar {
  0%, 58%, 76%, 100% { transform: none; }
  61% { transform: translateY(1px) rotate(-2.5deg); }
  64% { transform: translateY(1px) rotate(2deg); }
  67% { transform: rotate(-1.5deg); }
  70% { transform: rotate(1deg); }
  73% { transform: rotate(-.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tema-elecciones .logo .fichas::before { animation: none; opacity: 0; }
  .tema-elecciones .logo .fichas::after { animation: none; }
}

/* Palabra temática de elecciones: sello y aviso antes de empezar, en azul institucional, con
   sobres que caen despacio por detrás (al azar, con retrasos distintos) y la urna. */
.sello-elecciones { background: linear-gradient(135deg, #2f6fed, #1b2f6e); color: #fff; }
.aviso-elecciones {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: .2rem; margin: .2rem 0 .9rem;
  padding: 1.1rem 1rem .9rem; border-radius: 12px; color: #fff; text-align: center;
  background: linear-gradient(135deg, #2f6fed, #1d3f9e 50%, #172a63);
  box-shadow: 0 4px 14px #2f6fed55, inset 0 0 0 2px #ffffff33;
}
.aviso-elecciones > :not(.aviso-elecciones-sobres) { position: relative; }
.aviso-elecciones-sobres { position: absolute; inset: 0; pointer-events: none; }
.aviso-elecciones-sobres i {
  position: absolute; top: -14px; width: 14px; height: 10px; opacity: .22;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Crect x='.5' y='.5' width='11' height='8' rx='1' fill='%23fff'/%3E%3Cpath d='M.8 1 6 5.2 11.2 1' fill='none' stroke='%232f6fed' stroke-width='.9'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: sobre-aviso 6s linear infinite;
}
.aviso-elecciones-sobres i:nth-child(1) { left: 6%; animation-delay: -1s; }
.aviso-elecciones-sobres i:nth-child(2) { left: 20%; animation-delay: -4s; animation-duration: 7.5s; }
.aviso-elecciones-sobres i:nth-child(3) { left: 34%; animation-delay: -2.5s; animation-duration: 5.2s; }
.aviso-elecciones-sobres i:nth-child(4) { left: 62%; animation-delay: -5.5s; animation-duration: 6.8s; }
.aviso-elecciones-sobres i:nth-child(5) { left: 76%; animation-delay: -.5s; animation-duration: 5.8s; }
.aviso-elecciones-sobres i:nth-child(6) { left: 89%; animation-delay: -3.2s; animation-duration: 7s; }
.aviso-elecciones-sobres i:nth-child(7) { left: 48%; animation-delay: -6.4s; animation-duration: 8s; }
@keyframes sobre-aviso { from { transform: translateY(0) rotate(-15deg); } to { transform: translateY(190px) rotate(20deg); } }
.aviso-elecciones-urna { font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 2px 3px #0005); }
.aviso-elecciones > b { font-size: 1.12rem; text-shadow: 0 1px 2px #0005; }
.aviso-elecciones > span:last-child { font-size: .92rem; }
.aviso-elecciones span b { font-size: 1.05rem; color: #ffe58a; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .aviso-elecciones-sobres i { animation: none; top: 30%; } }

/* Inocentada del 28 de diciembre (js/app.js, «inocentada»): el monigote de papel a pantalla completa,
   que cae, se queda colgando del celo y se balancea; luego, el título y el botón para jugar de verdad. */
.inocentada {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem;
  padding: calc(env(safe-area-inset-top) + 1.5rem) 1.5rem calc(env(safe-area-inset-bottom) + 1.5rem);
  text-align: center; color: #fff;
  background: radial-gradient(circle at 50% 30%, #ff9f43, #e8590c 55%, #a83207);
  animation: inocentada-fondo .3s ease-out;
}
@keyframes inocentada-fondo { from { opacity: 0; } }
.monigote {
  width: min(52vw, 230px); height: auto; color: #2a2a2a; flex: none;
  transform-origin: 50% 2%; filter: drop-shadow(0 10px 14px #0006);
  animation: monigote-cae .9s cubic-bezier(.3, 1.4, .5, 1) both, monigote-balanceo 2.4s ease-in-out .9s infinite;
}
.monigote-papel { fill: #fffdf6; stroke: #2a2a2a; stroke-width: 2.2; stroke-dasharray: 5 3; stroke-linejoin: round; }
.monigote circle { fill: currentColor; }
.monigote-celo { fill: #f6e7a6; opacity: .85; }
@keyframes monigote-cae { from { transform: translateY(-110vh) rotate(-25deg); } }
@keyframes monigote-balanceo { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.inocentada h2 {
  margin: 0; font-size: clamp(1.7rem, 8vw, 2.6rem); line-height: 1.1; letter-spacing: .02em;
  text-shadow: 0 3px 0 #7a2405, 0 6px 16px #0005;
  animation: inocentada-titulo .5s cubic-bezier(.3, 1.6, .5, 1) .7s both;
}
@keyframes inocentada-titulo { from { transform: scale(.2) rotate(-8deg); opacity: 0; } }
.inocentada p { margin: 0; max-width: 26rem; font-size: 1.02rem; line-height: 1.45; animation: inocentada-fondo .4s 1.1s both; }
.inocentada .boton { width: auto; min-width: 15rem; background: #fff; color: #c2410c; box-shadow: 0 6px 18px #0004; animation: inocentada-fondo .4s 1.3s both; }
@media (prefers-reduced-motion: reduce) { .monigote, .inocentada h2, .inocentada p, .inocentada .boton { animation: none; } }
