* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
/* Garantiza que el atributo HTML "hidden" siempre gane, aunque algún selector
   por ID más abajo también fije "display" en el mismo elemento. */
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #0b1120; font-family: "Inter", "Segoe UI", Arial, sans-serif; color: #e2e8f0;
}
h1, .informe__puntaje, .btnElegir, button { font-family: "Space Grotesk", "Inter", sans-serif; }
/* touch-action:none solo en el area del canvas — NUNCA en html/body entero,
   porque eso bloquea que un toque se convierta en "click" en los botones
   del HUD en varios navegadores moviles. */
#gameRoot { position: fixed; top: 0; right: 0; bottom: 0; left: 0; touch-action: none; }
#gameRoot canvas { display: block; margin: 0 auto; }

#hud { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 10; }
#hud button { pointer-events: auto; }

.topBar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 10px; justify-content: center; }
.pill {
  background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: #38bdf8;
}
.pill--racha { color: #fb923c; border-color: rgba(251, 146, 60, 0.4); }

.timerBar { position: absolute; top: 48px; left: 10px; right: 10px; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
#timerFill { height: 100%; width: 100%; background: linear-gradient(90deg, #38bdf8, #818cf8); transition: width 0.15s linear; }

#avisoFlotante {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: rgba(15,23,42,0.95); border: 1px solid rgba(56,189,248,0.5); border-radius: 10px;
  padding: 8px 18px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none; white-space: nowrap;
}
#avisoFlotante.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
#avisoFlotante.ok { color: #4ade80; border-color: rgba(74,222,128,0.5); }
#avisoFlotante.mal { color: #f87171; border-color: rgba(248,113,113,0.5); }

/* ---------- Pantallas de aviso / informe ---------- */
/* Encontrado un bug real: estos selectores faltaban por completo —
   #pantallaElegir (¡la primera pantalla que ve cualquiera al abrir la app!)
   y las pantallas de aviso/informe de N-Back, Velocidad y Rotación no
   tenían NINGÚN estilo de posicionamiento (nada de position:fixed, fondo,
   ni centrado), así que se veían como un div normal pegado arriba a la
   izquierda en vez de la tarjeta centrada de pantalla completa. Solo
   Matrices tenía el selector correcto. */
#pantallaElegir,
#pantallaAviso, #pantallaInforme,
#pantallaAvisoNBack, #pantallaInformeNBack,
#pantallaAvisoVelocidad, #pantallaInformeVelocidad,
#pantallaAvisoRotacion, #pantallaInformeRotacion,
#pantallaAvisoStroop, #pantallaInformeStroop,
#pantallaAvisoTrivia, #pantallaInformeTrivia,
#pantallaAvisoSupremo, #pantallaInformeSupremo {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 20%, #1e293b 0%, #0b1120 70%); padding: 24px; pointer-events: auto; overflow-y: auto;
}
.avisoCard, .informeCard, #informeSupremoCard { max-width: 460px; width: 100%; text-align: center; perspective: 800px; position: relative; z-index: 1; }
#menuCard { max-width: 560px; width: 100%; text-align: center; perspective: 800px; margin: auto 0; position: relative; z-index: 1; }
#menuCard h1 {
  font-size: 32px; letter-spacing: 3px; margin: 0 0 2px; font-weight: 800;
  background: linear-gradient(135deg, #f8fafc 0%, #38bdf8 55%, #818cf8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.35));
  animation: menuTituloEntrada 0.6s ease backwards;
}
@keyframes menuTituloEntrada { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.menuSubtitulo { margin: -6px 0 14px; color: #94a3b8; font-size: 12.5px; font-weight: 600; animation: menuTituloEntrada 0.6s ease 0.05s backwards; }

/* Motas ambientales flotando de fondo en el menú — puramente decorativo
   (aria-hidden, pointer-events:none), le da profundidad "pro" a lo que
   antes era un fondo plano de un solo gradiente. */
#particulasFondo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
#particulasFondo span {
  position: absolute; bottom: -30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #38bdf8 70%);
  opacity: 0; animation: motaFlotanteMV linear infinite;
}
#particulasFondo span:nth-child(1) { left: 5%;  width: 6px;  height: 6px;  animation-duration: 14s; animation-delay: 0s; }
#particulasFondo span:nth-child(2) { left: 17%; width: 9px;  height: 9px;  animation-duration: 18s; animation-delay: 3s; }
#particulasFondo span:nth-child(3) { left: 31%; width: 5px;  height: 5px;  animation-duration: 12s; animation-delay: 5s; }
#particulasFondo span:nth-child(4) { left: 47%; width: 7px;  height: 7px;  animation-duration: 16s; animation-delay: 1s; }
#particulasFondo span:nth-child(5) { left: 62%; width: 6px;  height: 6px;  animation-duration: 20s; animation-delay: 7s; }
#particulasFondo span:nth-child(6) { left: 76%; width: 8px;  height: 8px;  animation-duration: 15s; animation-delay: 2s; }
#particulasFondo span:nth-child(7) { left: 87%; width: 5px;  height: 5px;  animation-duration: 17s; animation-delay: 9s; }
#particulasFondo span:nth-child(8) { left: 95%; width: 10px; height: 10px; animation-duration: 21s; animation-delay: 4s; }
@keyframes motaFlotanteMV {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.5; }
  50% { transform: translateY(-50vh) translateX(12px); }
  92% { opacity: 0.35; }
  100% { transform: translateY(-100vh) translateX(-10px); opacity: 0; }
}

/* ---------- Menú principal: grilla de pruebas ---------- */
#pruebasGrid { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.pruebaCard {
  --acento: #38bdf8;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: rgba(56,189,248,0.06); border: 1px solid rgba(56,189,248,0.3);
  border-left: 3px solid var(--acento);
  border-radius: 14px; padding: 12px 14px; cursor: pointer; text-align: left;
  transform-style: preserve-3d; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  animation: cardEntradaMV 0.5s cubic-bezier(.22,.75,.4,1.15) backwards;
}
/* Aparición escalonada al abrir el menú — antes las 6 tarjetas aparecían
   todas de golpe con el resto de la pantalla, ahora entran una a una. */
#pruebasGrid .pruebaCard:nth-child(1) { animation-delay: 0.08s; }
#pruebasGrid .pruebaCard:nth-child(2) { animation-delay: 0.14s; }
#pruebasGrid .pruebaCard:nth-child(3) { animation-delay: 0.20s; }
#pruebasGrid .pruebaCard:nth-child(4) { animation-delay: 0.26s; }
#pruebasGrid .pruebaCard:nth-child(5) { animation-delay: 0.32s; }
#pruebasGrid .pruebaCard:nth-child(6) { animation-delay: 0.38s; }
@keyframes cardEntradaMV { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* Franja de brillo diagonal que recorre la tarjeta al pasar el mouse —
   mismo lenguaje visual que el "shine sweep" ya usado en Sugar Tycoon. */
.pruebaCard::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.16), transparent);
  transform: skewX(-20deg); pointer-events: none; transition: left 0.55s ease;
}
.pruebaCard:hover::after { left: 130%; }
/* Cada prueba tiene su propio color de acento (antes las 6 eran idénticas
   en celeste, sin relación visual con su icono/tema). */
.pruebaCard[data-prueba="matrices"]   { --acento: #a78bfa; }
.pruebaCard[data-prueba="nback"]      { --acento: #38bdf8; }
.pruebaCard[data-prueba="velocidad"]  { --acento: #fbbf24; }
.pruebaCard[data-prueba="rotacion"]   { --acento: #34d399; }
.pruebaCard[data-prueba="stroop"]     { --acento: #f472b6; }
.pruebaCard[data-prueba="trivia"]     { --acento: #2dd4bf; }
.pruebaCard:hover {
  background: color-mix(in srgb, var(--acento) 12%, rgba(15,23,42,0.4));
  border-color: var(--acento);
  transform: rotateX(4deg) translateZ(6px) scale(1.015);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--acento) 30%, transparent);
}
.pruebaCard:active { transform: rotateX(-3deg) translateZ(-2px); }
.pruebaCard__icono {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--acento) 35%, transparent), rgba(255,255,255,0.05));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acento) 40%, transparent);
  transition: transform 0.2s ease;
}
.pruebaCard:hover .pruebaCard__icono { transform: scale(1.08) rotate(-4deg); }
.pruebaCard__info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pruebaCard__info strong { font-size: 14px; color: #e2e8f0; font-family: "Space Grotesk", sans-serif; }
.pruebaCard__desc { font-size: 11.5px; color: #94a3b8; }
.pruebaCard__record {
  flex-shrink: 0; font-size: 11px; font-weight: 800; color: #64748b; text-align: right; min-width: 40px;
}
.pruebaCard__record--conRecord { color: var(--acento); }
.pruebaCard__spark { flex-shrink: 0; width: 44px; height: 20px; }
.pruebaCard__spark polyline { fill: none; stroke: #64748b; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pruebaCard__spark--sube polyline { stroke: #4ade80; }
.avisoCard h1, .informeCard h1, #informeSupremoCard h1 { font-size: 26px; letter-spacing: 2px; margin: 0 0 14px; color: #e2e8f0; }
.aviso__texto { font-size: 14px; line-height: 1.5; color: #cbd5e1; margin-bottom: 16px; }
.racha-practica {
  display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 20px;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24; font-size: 13px; font-weight: 700;
}
.racha-practica--hito { background: rgba(251, 191, 36, 0.25); border-color: rgba(251, 191, 36, 0.8); animation: popPuntaje 0.5s cubic-bezier(.17,.89,.32,1.49); }

/* ---------- Logros ---------- */
.btn-logros {
  display: block; margin: 0 auto 16px; padding: 9px 18px; border-radius: 20px; cursor: pointer;
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8; font-size: 13px; font-weight: 700; font-family: "Space Grotesk", sans-serif;
}
.btn-logros:active { transform: translateY(2px); }
#pantallaLogros {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 10, 0.9); pointer-events: auto; padding: 20px; perspective: 900px;
}
#logrosCard {
  background: rgba(11, 17, 32, 0.97); border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px; padding: 22px; max-width: 480px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column; animation: giroEntradaCard 0.5s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes giroEntradaCard { 0% { transform: rotateY(-40deg) scale(0.85); opacity: 0; } 100% { transform: rotateY(0deg) scale(1); opacity: 1; } }
#logrosHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#logrosHeader h2 { margin: 0; font-size: 20px; color: #38bdf8; }
.btn-cerrar-logros { background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 4px 8px; }
#logrosProgreso { margin: 0 0 14px; color: #94a3b8; font-size: 12.5px; font-weight: 700; }
#logrosLista { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.logro-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: #94a3b8;
}
.logro-item__check {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; border: 1.5px solid rgba(255,255,255,0.25); background: transparent;
}
.logro-item--completo { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); color: #e2e8f0; }
.logro-item--completo .logro-item__check { background: #4ade80; border-color: #4ade80; color: #0b1120; }
/* ---------- Botón de sonido ---------- */
/* Arriba a la derecha, sobre las pantallas (z-index 20) y bajo los modales (40). */
.btn-sonido {
  position: absolute; top: 10px; right: 10px; z-index: 30; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(56,189,248,0.4); background: rgba(11,17,32,0.85); font-size: 17px; cursor: pointer; color: #e2e8f0;
}
.btn-sonido:active { transform: translateY(2px); }

/* ---------- Configuración ---------- */
#pantallaConfig {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 10, 0.9); pointer-events: auto; padding: 20px;
}
#configCard {
  background: rgba(11, 17, 32, 0.97); border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px; padding: 22px; max-width: 420px; width: 100%; max-height: 88vh; overflow-y: auto;
  animation: giroEntradaCard 0.5s cubic-bezier(.2,.8,.3,1.1);
}
#configHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#configHeader h2 { margin: 0; font-size: 20px; color: #38bdf8; }
.config-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13.5px; color: #cbd5e1;
}
.config-fila span:last-child { color: #e2e8f0; font-weight: 700; }
.config-toggle {
  background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.4); color: #38bdf8;
  border-radius: 20px; padding: 5px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.config-toggle--mudo { background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.35); color: #94a3b8; }
.config-separador { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 16px 0; }
.btn-peligro {
  display: block; width: 100%; background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.45);
  color: #f87171; font-weight: 700; font-size: 13.5px; padding: 11px; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.btn-peligro:active { transform: translateY(2px); }
.config-confirmar { margin-top: 12px; background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.25); border-radius: 10px; padding: 12px; }
.config-confirmar p { margin: 0 0 10px; font-size: 12.5px; color: #cbd5e1; line-height: 1.5; }
.config-confirmar__botones { display: flex; gap: 8px; }
.config-confirmar__botones .btn-peligro { flex: 1; }
.btn-secundario-cfg {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); color: #cbd5e1;
  font-weight: 700; font-size: 13.5px; padding: 11px; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.btn-secundario-cfg:active { transform: translateY(2px); }

/* ---------- Perfil cognitivo (barras horizontales, un solo tono) ---------- */
.menu-acciones { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.menu-acciones .btn-logros { margin: 0; }
#pantallaPerfil {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 10, 0.9); pointer-events: auto; padding: 20px;
}
#perfilCard {
  position: relative; background: rgba(11, 17, 32, 0.97); border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px; padding: 22px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto;
  animation: giroEntradaCard 0.5s cubic-bezier(.2,.8,.3,1.1);
}
#perfilHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#perfilHeader h2 { margin: 0; font-size: 20px; color: #38bdf8; }
#perfilHero { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
#perfilPromedio { font-size: 56px; font-weight: 700; line-height: 1; color: #e2e8f0; font-family: "Space Grotesk", sans-serif; }
.perfil-hero__texto { font-size: 12.5px; color: #94a3b8; line-height: 1.4; }
#perfilHechas { color: #64748b; }
#perfilBarras { display: flex; flex-direction: column; }
.perfil-fila {
  display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; height: 32px; cursor: pointer;
  border-radius: 6px; outline: none;
}
.perfil-fila:hover, .perfil-fila:focus-visible { background: rgba(255,255,255,0.04); }
.perfil-fila__nombre { font-size: 12.5px; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perfil-fila--vacia .perfil-fila__nombre { color: #64748b; }
/* Pista: un paso más claro del mismo tono que la barra; las líneas verticales
   (0 / 50 / 100 / 150) son hairlines recesivas que salen de los pseudo-elementos. */
.perfil-fila__pista { position: relative; height: 14px; border-radius: 0 4px 4px 0; background: rgba(56, 189, 248, 0.12); }
.perfil-fila__pista::before, .perfil-fila__pista::after {
  content: ""; position: absolute; top: -9px; bottom: -9px; width: 1px; background: rgba(255,255,255,0.09); pointer-events: none;
}
.perfil-fila__pista::before { left: 33.333%; }
.perfil-fila__pista::after { left: 66.666%; }
.perfil-fila__barra {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #38bdf8; border-radius: 0 4px 4px 0;
  transition: width 0.7s cubic-bezier(.2,.8,.2,1);
}
.perfil-fila__valor { font-size: 13px; font-weight: 700; color: #e2e8f0; text-align: right; font-variant-numeric: tabular-nums; }
.perfil-fila--vacia .perfil-fila__valor { color: #64748b; }
/* Misma grilla que las filas; cada etiqueta es absoluta DENTRO de la columna
   central (grid-column:2 la convierte en su bloque contenedor), así 0% y
   100% coinciden exactamente con el inicio y el final de las barras. */
#perfilEjeX { display: grid; grid-template-columns: 92px 1fr 34px; gap: 8px; position: relative; height: 14px; margin-top: 2px; font-size: 10.5px; color: #64748b; }
#perfilEjeX span { grid-column: 2 / 3; grid-row: 1; position: absolute; top: 0; transform: translateX(-50%); }
#perfilEjeX span:nth-child(1) { left: 0; }
#perfilEjeX span:nth-child(2) { left: 33.333%; }
#perfilEjeX span:nth-child(3) { left: 66.666%; }
#perfilEjeX span:nth-child(4) { left: 100%; }
#perfilInsight { margin: 16px 0 6px; font-size: 13px; color: #e2e8f0; line-height: 1.6; white-space: pre-line; }
.perfil-nota { margin: 0; font-size: 11px; color: #64748b; line-height: 1.5; }
#perfilTip {
  position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  background: #0f172a; border: 1px solid rgba(56,189,248,0.45); color: #e2e8f0; box-shadow: 0 6px 18px rgba(0,0,0,0.5); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .perfil-fila__barra { transition: none; } }
.aviso__disclaimer {
  font-size: 12px; line-height: 1.5; color: #fbbf24; background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3); border-radius: 10px; padding: 10px 14px; margin-bottom: 20px;
}
.creditos { margin: 6px 0 0; color: #64748b; font-size: 10.5px; letter-spacing: 0.3px; }
#btnEmpezar, #btnReintentar, #btnEmpezarNBack, #btnReintentarNBack, #btnEmpezarSupremo, #btnReintentarSupremo {
  background: linear-gradient(90deg, #38bdf8, #818cf8); border: none; color: #0b1120;
  font-weight: 800; padding: 12px 26px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.btnElegir {
  display: block; width: 100%; background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.35);
  color: #e2e8f0; font-weight: 700; font-size: 15px; padding: 16px; border-radius: 12px; cursor: pointer;
  margin-bottom: 12px; text-align: left; transform-style: preserve-3d;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btnElegir:hover {
  background: rgba(56,189,248,0.16); border-color: rgba(56,189,248,0.6);
  transform: rotateX(4deg) translateZ(6px); box-shadow: 0 8px 18px rgba(56,189,248,0.15);
}
.btnElegir:active { transform: rotateX(-3deg) translateZ(-2px); }
.link-volver { display: inline-block; margin-top: 14px; color: #64748b; font-size: 12px; text-decoration: none; }
.link-volver:hover { color: #94a3b8; }

/* ---------- N-Back ---------- */
.timerFillNb { height: 100%; width: 100%; background: linear-gradient(90deg, #fb923c, #f87171); transition: width 0.1s linear; }
#nbResultadoBloque {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(15,23,42,0.97); border: 1px solid rgba(56,189,248,0.4); border-radius: 14px;
  padding: 20px 28px; text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,0.4); z-index: 15;
}
#nbResultadoBloque h3 { margin: 0 0 8px; color: #38bdf8; font-size: 16px; }
#nbResultadoBloque p { margin: 2px 0; font-size: 13px; color: #cbd5e1; }
#nbBotones { position: absolute; bottom: 26px; left: 0; right: 0; display: flex; justify-content: center; gap: 24px; }
.nb-btn {
  width: 100px; height: 100px; border-radius: 20px; border: 2px solid rgba(255,255,255,0.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 28px; cursor: pointer; color: #fff;
}
.nb-btn span { font-size: 11px; font-weight: 700; }
.nb-btn--pos { background: radial-gradient(circle at 35% 30%, #38bdf8, #0369a1); }
.nb-btn--letra { background: radial-gradient(circle at 35% 30%, #a78bfa, #6d28d9); }
.nb-btn.is-activo { outline: 3px solid #fbbf24; }
@keyframes popPuntaje { 0% { transform: scale(0.5); opacity: 0.3; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.informe__puntaje { font-size: 56px; font-weight: 900; color: #38bdf8; line-height: 1; margin-top: 6px; animation: popPuntaje 0.5s cubic-bezier(.17,.89,.32,1.49); }
.informe__etiqueta { font-size: 12px; color: #94a3b8; margin: 4px 0 4px; text-transform: uppercase; letter-spacing: 1px; }
.informe__record { font-size: 12.5px; color: #94a3b8; margin: 0 0 18px; font-weight: 700; }
.informe__record--nuevo { color: #facc15; animation: popPuntaje 0.5s cubic-bezier(.17,.89,.32,1.49); }

/* ---------- Confeti al superar un récord personal (DOM/CSS, no Phaser) ---------- */
.confeti-pieza {
  position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; z-index: 30;
  animation-name: confetiCaer; animation-timing-function: ease-in; animation-fill-mode: forwards; pointer-events: none;
}
@keyframes confetiCaer {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(480px) rotate(var(--girar)); opacity: 0; }
}
.informe__stats { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; }
.informe__stats div { display: flex; flex-direction: column; }
.informe__stats strong { font-size: 20px; color: #e2e8f0; }
.informe__stats span { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ---------- Desafío Supremo: tarjeta del menú ---------- */
.supremoCard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 4px;
  padding: 16px 16px; border-radius: 16px; cursor: pointer; text-align: left; color: #fef9c3;
  background: linear-gradient(135deg, rgba(250,204,21,0.16), rgba(168,85,247,0.16) 60%, rgba(56,189,248,0.12));
  border: 1.5px solid rgba(250,204,21,0.6);
  box-shadow: 0 0 22px rgba(250,204,21,0.16), inset 0 0 18px rgba(250,204,21,0.06);
  animation: cardEntradaMV 0.5s ease 0.02s backwards, supremoLatido 3.2s ease-in-out 0.6s infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.supremoCard:hover { transform: translateY(-2px) scale(1.012); box-shadow: 0 0 30px rgba(250,204,21,0.34); }
.supremoCard:active { transform: scale(0.99); }
@keyframes supremoLatido { 0%,100% { box-shadow: 0 0 18px rgba(250,204,21,0.14), inset 0 0 18px rgba(250,204,21,0.05); } 50% { box-shadow: 0 0 34px rgba(250,204,21,0.36), inset 0 0 22px rgba(250,204,21,0.1); } }
.supremoCard__brillo {
  position: absolute; top: 0; left: -70%; width: 40%; height: 100%; pointer-events: none; transform: skewX(-20deg);
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.22), transparent); animation: supremoBrillo 4.2s ease-in-out 1s infinite;
}
@keyframes supremoBrillo { 0% { left: -70%; } 45%,100% { left: 140%; } }
.supremoCard__icono { flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: radial-gradient(circle at 35% 30%, rgba(250,204,21,0.45), rgba(255,255,255,0.05)); box-shadow: inset 0 0 0 1px rgba(250,204,21,0.5); }
.supremoCard__info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.supremoCard__info strong { font-size: 16px; letter-spacing: 1px; color: #fde047; font-family: "Space Grotesk", sans-serif; }
.supremoCard__desc { font-size: 11.5px; color: #e9d5ff; }
.supremoCard__barra { display: block; height: 5px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; margin-top: 3px; }
.supremoCard__barra > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #facc15, #f472b6); transition: width 0.6s ease; }
.supremoCard__record { flex-shrink: 0; font-size: 11px; font-weight: 800; color: #fde047; text-align: right; max-width: 96px; line-height: 1.25; }
.supremoCard--bloqueada { filter: saturate(0.55); border-style: dashed; animation: cardEntradaMV 0.5s ease 0.02s backwards; }
.supremoCard--bloqueada .supremoCard__brillo { display: none; }
.supremoCard--sacudir { animation: supremoSacudir 0.4s ease; }
@keyframes supremoSacudir { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* ---------- Desafío Supremo: resultado ---------- */
#informeSupremoCard { --tier: #fde047; padding: 6px 0 24px; }
.supremo-kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: #94a3b8; animation: menuTituloEntrada 0.5s ease backwards; }
.medallon { position: relative; width: 168px; height: 168px; margin: 8px auto 10px; display: flex; align-items: center; justify-content: center; }
.medallon__aro { position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tier) 40%, #1e293b), #0f172a 75%);
  border: 3px solid var(--tier); box-shadow: 0 0 34px color-mix(in srgb, var(--tier) 60%, transparent), inset 0 0 26px color-mix(in srgb, var(--tier) 30%, transparent);
  animation: medallonPop 0.7s cubic-bezier(.17,.89,.32,1.4) backwards; }
.medallon__rayos { position: absolute; inset: -18px; border-radius: 50%; opacity: 0.55;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tier) 55%, transparent) 0deg 6deg, transparent 6deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%, transparent 72%); mask: radial-gradient(circle, transparent 46%, #000 48%, transparent 72%);
  animation: medallonGiro 18s linear infinite; }
.medallon__emoji { position: relative; font-size: 78px; line-height: 1; animation: medallonPop 0.8s cubic-bezier(.17,.89,.32,1.5) 0.15s backwards, medallonFlota 3s ease-in-out 1s infinite; }
@keyframes medallonPop { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes medallonGiro { to { transform: rotate(360deg); } }
@keyframes medallonFlota { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
#informeSupremoCard h1 { margin: 4px 0 2px; font-size: 27px; letter-spacing: 1px; color: var(--tier); text-shadow: 0 0 18px color-mix(in srgb, var(--tier) 50%, transparent); animation: menuTituloEntrada 0.5s ease 0.3s backwards; }
.supremo-rol { margin: 0 0 10px; color: #cbd5e1; font-size: 14px; font-style: italic; }
.nivel-badge { display: inline-block; padding: 7px 18px; border-radius: 22px; font-weight: 800; font-size: 15px; letter-spacing: 1px; color: #0f172a;
  background: linear-gradient(135deg, var(--tier), color-mix(in srgb, var(--tier) 60%, #fff)); box-shadow: 0 4px 18px color-mix(in srgb, var(--tier) 45%, transparent); animation: medallonPop 0.6s ease 0.5s backwards; }
.supremo-lema { margin: 12px auto 8px; max-width: 380px; font-size: 13.5px; line-height: 1.45; color: #cbd5e1; }
#spEscalera { display: flex; justify-content: center; gap: 6px; margin: 14px 0 10px; }
.sp-escalon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); opacity: 0.4; }
.sp-escalon--superado { opacity: 0.85; border-color: var(--c); }
.sp-escalon--actual { opacity: 1; transform: scale(1.22); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 30%, #0f172a); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
#spPorTipo { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.sp-tipo { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; color: #cbd5e1; text-align: left; }
.sp-tipo > span:last-child { text-align: right; font-weight: 700; }
.sp-tipo__pista { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sp-tipo__barra { display: block; height: 100%; background: linear-gradient(90deg, var(--tier), #fff); border-radius: 4px; }
#informeSupremoCard { margin: auto; }

/* ---------- Retratos y Álbum ---------- */
#pantallaAlbum { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 45; display: flex; align-items: flex-start; justify-content: center; background: rgba(5,8,18,0.92); padding: 18px; overflow-y: auto; pointer-events: auto; }
#albumCard { width: 100%; max-width: 640px; margin: auto; background: linear-gradient(160deg, #182238, #0d1424); border: 1px solid rgba(250,204,21,0.35); border-radius: 18px; padding: 18px 16px 22px; box-shadow: 0 0 40px rgba(250,204,21,0.12); }
#albumHeader { display: flex; justify-content: space-between; align-items: center; }
#albumHeader h2 { margin: 0; font-size: 18px; color: #fde047; }
#albumProgreso { margin: 6px 0; font-size: 12.5px; color: #cbd5e1; font-weight: 700; }
.album-barra { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 14px; }
#albumBarraFill { height: 100%; width: 0; background: linear-gradient(90deg, #facc15, #f472b6, #a78bfa); transition: width 0.7s ease; }
.album-nivel { --tier: #94a3b8; margin-bottom: 16px; }
.album-nivel h3 { margin: 0 0 8px; font-size: 14px; color: var(--tier); display: flex; justify-content: space-between; font-family: "Space Grotesk", sans-serif; }
.album-nivel h3 span { color: #94a3b8; font-size: 12px; }
.album-nivel--completo h3 span { color: #4ade80; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.album-carta { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); animation: cardEntradaMV 0.4s ease backwards; }
.album-carta svg { width: 54px; height: 54px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4)); }
.album-carta small { font-size: 9.5px; color: #cbd5e1; text-align: center; line-height: 1.15; min-height: 22px; }
.album-carta--bloqueada { opacity: 0.55; }
.album-interrogante { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; color: #475569; background: radial-gradient(circle, #1e293b, #0b1120); border: 2px dashed #334155; }
.medallon__retrato { position: absolute; inset: 18px; border-radius: 50%; overflow: hidden; animation: medallonPop 0.8s cubic-bezier(.17,.89,.32,1.5) 0.15s backwards; }
.medallon__retrato svg { width: 100%; height: 100%; display: block; }
.medallon__emoji--chapa { position: absolute; right: -6px; bottom: 2px; font-size: 30px; padding: 4px 6px; border-radius: 50%; background: #0f172a; border: 2px solid var(--tier); animation: medallonPop 0.7s cubic-bezier(.17,.89,.32,1.5) 0.6s backwards; }
.sp-nuevo { margin: 4px 0 6px; font-size: 13px; font-weight: 800; color: #4ade80; animation: popPuntaje 0.6s cubic-bezier(.17,.89,.32,1.49) 0.9s backwards; }

/* ---------- Tipos de inteligencia (resultado del Supremo) ---------- */
#spInteligencia { margin: 10px 0 12px; padding: 12px 12px 10px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid color-mix(in srgb, var(--tier) 35%, transparent); text-align: left; }
.sp-int__cab strong { display: block; font-size: 15px; color: #fde047; font-family: "Space Grotesk", sans-serif; }
.sp-int__cab span { font-size: 11.5px; color: #cbd5e1; }
.sp-int__cab p { margin: 6px 0 4px; font-size: 12.5px; line-height: 1.45; color: #cbd5e1; }
.sp-int__cab em { display: block; font-size: 12px; color: #86efac; font-style: normal; margin-bottom: 8px; }
.sp-int__fila { --c: #38bdf8; display: grid; grid-template-columns: 138px 1fr 38px; align-items: center; gap: 8px; font-size: 12px; color: #cbd5e1; margin-top: 5px; }
.sp-int__fila > span:last-child { text-align: right; font-weight: 700; }
.sp-int__barra { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); }
.sp-int__fila--top { color: #fff; font-weight: 700; }
.sp-int__fila--top .sp-tipo__pista { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); }

.btn-compartir { display: block; width: 100%; margin: 4px 0 10px; padding: 11px 16px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13.5px;
  color: #fde047; background: rgba(250,204,21,0.1); border: 1.5px solid rgba(250,204,21,0.55); font-family: "Space Grotesk", sans-serif; }
.btn-compartir:active { transform: translateY(2px); }
.sp-compartido { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: #4ade80; }

/* ---------- Ayuda "Cómo jugar" y botón de salida de las pruebas ---------- */
#pantallaAyuda { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 46; display: flex; align-items: flex-start; justify-content: center; background: rgba(5,8,18,0.94); padding: 18px; overflow-y: auto; pointer-events: auto; }
#pantallaAyuda[hidden] { display: none; }
#ayudaCard { width: 100%; max-width: 560px; margin: auto; background: linear-gradient(160deg, #16233d, #0d1526); border: 1px solid rgba(120,160,255,0.25); border-radius: 22px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
#ayudaHeader { display: flex; justify-content: space-between; align-items: center; }
#ayudaHeader h2 { margin: 0; }
.ayuda__intro { color: #b9c8d6; font-size: 14px; line-height: 1.5; }
.ayuda-item { display: flex; gap: 14px; align-items: center; padding: 12px; margin-top: 10px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.ayuda-item__img { flex: 0 0 76px; }
.ayuda-item__img svg { width: 76px; height: 76px; display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.ayuda-item__txt strong { font-size: 15px; }
.ayuda-item__txt p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: #cbd8e6; }
.ayuda-item__tip { color: #fbbf24 !important; font-size: 12.5px !important; }
.btn-salir-prueba { position: fixed; top: 10px; left: 10px; z-index: 44; padding: 8px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.3); background: rgba(10,16,30,0.85); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; pointer-events: auto; }
.btn-salir-prueba[hidden] { display: none; }
.btn-salir-prueba.confirmar { background: #dc2626; border-color: #fecaca; animation: pulsoSalir 0.6s ease-in-out infinite alternate; }
@keyframes pulsoSalir { to { transform: scale(1.06); } }

/* Reto diario */
.supremoCard--diario { background: linear-gradient(135deg, rgba(20,184,166,0.28), rgba(56,189,248,0.2)); border-color: rgba(45,212,191,0.55); margin-top: 10px; }
.supremoCard--diario:hover { box-shadow: 0 0 22px rgba(45,212,191,0.4); }
.supremoCard--diario .supremoCard__record { color: #fbbf24; font-weight: 800; }

.supremoCard--reto { animation: pulsoReto 1.6s ease-in-out infinite alternate; border-color: #fbbf24; }
@keyframes pulsoReto { to { box-shadow: 0 0 22px rgba(251,191,36,0.55); } }

.ayuda__sub { margin: 22px 0 4px; font-size: 17px; color: #fff; }
.ayuda-item__emoji { display: flex; align-items: center; justify-content: center; height: 76px; border-radius: 14px; font-size: 38px; }

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
