* { 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 (si no, ese
   display gana por cascada y el elemento queda visible y bloqueando clics
   aunque el JS haya puesto hidden=true — bug real que dejaba pantallas de
   resultado "pegadas" encima del juego). */
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #2b1035; font-family: "Nunito", "Segoe UI", Arial, sans-serif; color: #3a2140;
}
/* touch-action:none solo en el area del canvas (evita scroll/zoom al tocar
   el tablero) — NUNCA en html/body entero, porque eso puede impedir que un
   toque se convierta en "click" en los botones del HUD en varios navegadores
   moviles (asi se veia "no funciona nada" en celular). */
#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, #hud .nivel-nodo { pointer-events: auto; }

/* ---------- Barra superior (dentro de un nivel) ---------- */
/* right:66px (no 10px) para dejarle el hueco al botón circular del mapa
   (.hud-btn, 46px + separación) — antes ambos anclaban a right:10px y el
   botón quedaba encima de la píldora de movimientos, tapándola. */
#topBar { position: absolute; top: 10px; left: 10px; right: 66px; display: flex; gap: 10px; align-items: flex-start; }
.pill {
  background: linear-gradient(160deg, #ffffff, #fff0f7); border-radius: 14px; padding: 9px 15px; font-weight: 800;
  font-size: 15px; box-shadow: 0 4px 0 rgba(162, 49, 122, 0.18), 0 6px 14px rgba(0,0,0,0.15);
  white-space: nowrap; color: #5a2a6a; font-family: "Baloo 2", sans-serif;
}
.pill--moves { color: #d1483f; }
#nivelCard {
  flex: 1; background: linear-gradient(160deg, #ffffff, #fff0f7); border-radius: 14px; padding: 9px 15px;
  box-shadow: 0 4px 0 rgba(162, 49, 122, 0.18), 0 6px 14px rgba(0,0,0,0.15); min-width: 0;
}
#nivelNombre { font-weight: 800; font-size: 14px; color: #a2317a; font-family: "Baloo 2", sans-serif; }
#nivelObjetivo { font-size: 12px; color: #6a4a72; margin-top: 2px; font-weight: 700; }
.hud-bar { width: 100%; height: 9px; border-radius: 6px; background: #f1e3f5; overflow: hidden; margin-top: 5px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.12); }
.hud-bar__fill { height: 100%; width: 0%; border-radius: 6px; background: linear-gradient(90deg, #ff8fc7, #ff5da2); transition: width 0.3s ease; }

.hud-btn {
  position: absolute; top: 10px; right: 10px; width: 46px; height: 46px; border-radius: 50%;
  border: none; background: linear-gradient(160deg, #ffffff, #fff0f7); font-size: 21px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(162, 49, 122, 0.18), 0 6px 14px rgba(0,0,0,0.15);
}
/* Botón de sonido: más chico y debajo del del mapa; z-index 25 para quedar
   por encima de la pantalla del mapa de niveles (z-index 20). */
.hud-btn--sonido { top: 88px; right: 13px; width: 40px; height: 40px; font-size: 18px; z-index: 25; }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(162,49,122,0.18), 0 3px 8px rgba(0,0,0,0.15); }

/* ---------- Potenciadores (Martillo / Barajar) ---------- */
#barraPoderes {
  position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 14px;
}
.poder-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 92px; padding: 8px 14px;
  border: none; border-radius: 16px; cursor: pointer; font-family: "Baloo 2", sans-serif;
  background: linear-gradient(160deg, #ffffff, #fff0f7); color: #5a2a6a;
  box-shadow: 0 4px 0 rgba(162, 49, 122, 0.25), 0 6px 14px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.poder-btn:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(162,49,122,0.25); }
.poder-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.poder-btn__icono { font-size: 22px; line-height: 1.1; }
.poder-btn__nombre { font-size: 12.5px; font-weight: 800; }
.poder-btn__costo { font-size: 11px; font-weight: 700; color: #d1830f; }
.poder-btn.is-activo {
  background: linear-gradient(160deg, #ffe08a, #ffb23d); color: #5a3a00; transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 8px 20px rgba(255,178,61,0.6);
}

/* ---------- Barra de Dulces (se llena jugando, gratis) ---------- */
.poder-dulce__barra {
  width: 66px; height: 6px; border-radius: 4px; background: rgba(90,42,106,0.18); overflow: hidden; margin-top: 2px;
}
.poder-dulce__barra-fill {
  display: block; height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, #ff8fd0, #ffd23d); transition: width 0.3s ease;
}
.poder-btn--dulce.is-lista {
  animation: pulso-dulce 0.9s ease-in-out infinite;
}
.poder-btn--dulce.is-lista .poder-dulce__barra-fill { background: linear-gradient(90deg, #ffd23d, #ff5da2); }
@keyframes pulso-dulce {
  0%, 100% { box-shadow: 0 4px 0 rgba(162,49,122,0.25), 0 6px 14px rgba(0,0,0,0.25), 0 0 0 0 rgba(255,178,61,0.55); }
  50% { box-shadow: 0 4px 0 rgba(162,49,122,0.25), 0 6px 22px rgba(255,178,61,0.75), 0 0 0 9px rgba(255,178,61,0); }
}

/* ---------- Aviso flotante ---------- */
#avisoFlotante {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: linear-gradient(160deg, #ffffff, #fff0f7); border: 2px solid #ff8fc7; border-radius: 14px; padding: 11px 20px;
  font-size: 14px; font-weight: 800; color: #a2317a; opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none; white-space: nowrap; box-shadow: 0 10px 24px rgba(0,0,0,0.25); font-family: "Baloo 2", sans-serif;
}
#avisoFlotante.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Mapa de niveles ---------- */
#pantallaNiveles {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; pointer-events: auto;
  background:
    radial-gradient(circle at 15% 8%, rgba(255,143,199,0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(56,189,248,0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 50% -10%, #4a1f5c 0%, #1c0a26 65%);
}
/* Motas de azúcar flotando de fondo — puramente decorativo (aria-hidden),
   nunca intercepta clics. 8 partículas con distinto tamaño/velocidad/retraso
   para que no se vean repetidas ni sincronizadas. */
#particulasFondo { position: absolute; top: 0; right: 0; bottom: 0; left: 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, #ff8fc7 70%);
  opacity: 0; animation: motaFlotante linear infinite;
}
#particulasFondo span:nth-child(1) { left: 6%;  width: 7px;  height: 7px;  animation-duration: 13s; animation-delay: 0s; }
#particulasFondo span:nth-child(2) { left: 18%; width: 10px; height: 10px; animation-duration: 17s; animation-delay: 2s; }
#particulasFondo span:nth-child(3) { left: 32%; width: 5px;  height: 5px;  animation-duration: 11s; animation-delay: 4s; }
#particulasFondo span:nth-child(4) { left: 48%; width: 8px;  height: 8px;  animation-duration: 15s; animation-delay: 1s; }
#particulasFondo span:nth-child(5) { left: 63%; width: 6px;  height: 6px;  animation-duration: 19s; animation-delay: 6s; }
#particulasFondo span:nth-child(6) { left: 77%; width: 9px;  height: 9px;  animation-duration: 14s; animation-delay: 3s; }
#particulasFondo span:nth-child(7) { left: 88%; width: 6px;  height: 6px;  animation-duration: 16s; animation-delay: 8s; }
#particulasFondo span:nth-child(8) { left: 95%; width: 11px; height: 11px; animation-duration: 20s; animation-delay: 5s; }
@keyframes motaFlotante {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.55; }
  50% { transform: translateY(-52vh) translateX(14px); }
  92% { opacity: 0.4; }
  100% { transform: translateY(-100vh) translateX(-10px); opacity: 0; }
}
#nivelesScroll { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: auto; overflow-x: hidden; }
#nivelesInner { max-width: 480px; margin: 0 auto; padding: 30px 20px 60px; text-align: center; }
#nivelesInner h1 {
  margin: 0; font-size: 34px; color: #fff; letter-spacing: 1px; font-family: "Baloo 2", sans-serif; font-weight: 800;
  text-shadow: 0 3px 0 #a2317a, 0 8px 18px rgba(0,0,0,0.4);
}
.subtitulo { margin: 4px 0 18px; color: #e0b3d6; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; }
.creditos { margin: 30px 0 6px; color: #8a6a92; font-size: 10.5px; letter-spacing: 0.3px; }
#dineroTotalPill { display: inline-block; margin-bottom: 24px; }

.mundo-bloque { margin-bottom: 38px; }
.mundo-titulo {
  color: #fff; font-size: 15px; font-weight: 800; margin-bottom: 16px; padding: 9px 18px;
  border-radius: 12px; display: inline-block; box-shadow: 0 4px 14px rgba(0,0,0,0.3); font-family: "Baloo 2", sans-serif;
  letter-spacing: 0.5px;
}
.nivel-fila { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; perspective: 600px; }

.nivel-nodo {
  width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.45); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; color: #fff; position: relative; font-family: "Baloo 2", sans-serif;
  box-shadow: 0 5px 0 rgba(0,0,0,0.22), 0 8px 16px rgba(0,0,0,0.3);
  transform-style: preserve-3d; transform: rotateX(8deg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nivel-nodo:active {
  transform: rotateX(28deg) translateY(3px) translateZ(-6px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.22), 0 4px 10px rgba(0,0,0,0.3);
}
.nivel-nodo.bloqueado { background: #4b3a55; color: #8a7a92; cursor: not-allowed; box-shadow: none; border-color: transparent; }
.nivel-nodo__estrellas { position: absolute; bottom: -11px; font-size: 12px; letter-spacing: 1.5px; color: #ffd23d; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }

/* Brillo pulsante en el próximo nivel jugable — guía el ojo sin necesidad de texto. */
@keyframes pulsoSiguienteNivel {
  0%, 100% { box-shadow: 0 5px 0 rgba(0,0,0,0.22), 0 8px 16px rgba(0,0,0,0.3), 0 0 0 0 rgba(255,255,255,0.6); }
  50% { box-shadow: 0 5px 0 rgba(0,0,0,0.22), 0 8px 16px rgba(0,0,0,0.3), 0 0 0 9px rgba(255,255,255,0); }
}
.nivel-nodo--siguiente { animation: pulsoSiguienteNivel 1.7s ease-out infinite; }

/* ---------- Resultado de nivel ---------- */
#pantallaResultadoNivel {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 25; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 4, 14, 0.82); pointer-events: auto; padding: 20px; perspective: 900px;
}
#resultadoCard {
  background: linear-gradient(180deg, #ffffff, #fff5fa); border-radius: 24px; padding: 32px 26px; text-align: center;
  max-width: 340px; width: 100%; box-shadow: 0 25px 60px rgba(0,0,0,0.45); position: relative;
  animation: giroEntradaTarjeta 0.5s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes giroEntradaTarjeta {
  0% { transform: rotateY(-40deg) scale(0.85); opacity: 0; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* Confeti — solo se lanza cuando el nivel se completa con 3 estrellas. */
.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; }
}
#resultadoCard h2 { margin: 0 0 12px; font-size: 24px; color: #a2317a; font-family: "Baloo 2", sans-serif; }
#resultadoEstrellas { font-size: 42px; letter-spacing: 9px; margin-bottom: 6px; text-shadow: 0 3px 6px rgba(255,210,61,0.4); }
.estrella-resultado { display: inline-block; opacity: 0.3; transform: scale(0.35); transition: transform 0.5s cubic-bezier(.17,.89,.32,1.49), opacity 0.25s ease; }
.estrella-resultado--pop { opacity: 1; transform: scale(1); }
.resultado-dinero {
  font-size: 20px; font-weight: 800; color: #d1830f; margin-bottom: 12px; min-height: 26px;
  font-family: "Baloo 2", sans-serif; text-shadow: 0 2px 3px rgba(209,131,15,0.25);
}
#resultadoTexto { font-size: 13.5px; color: #6a4a72; margin-bottom: 22px; line-height: 1.55; font-weight: 600; }
#pantallaResultadoNivel button {
  display: block; width: 100%; border: none; border-radius: 14px; padding: 14px; margin-bottom: 11px;
  font-weight: 800; font-size: 14.5px; cursor: pointer; font-family: "Baloo 2", sans-serif;
}
#btnSiguienteNivel { background: linear-gradient(90deg, #ff8fc7, #ff5da2); color: #fff; box-shadow: 0 4px 0 #c23d7c, 0 8px 16px rgba(255,93,162,0.35); }
#btnSiguienteNivel:active { transform: translateY(3px); box-shadow: 0 1px 0 #c23d7c; }
.btn-continuar { background: linear-gradient(90deg, #ffd23d, #ffb23d); color: #5a3a00; box-shadow: 0 4px 0 #c27f0f, 0 8px 16px rgba(255,178,61,0.35); }
.btn-continuar:active { transform: translateY(3px); box-shadow: 0 1px 0 #c27f0f; }
.btn-secundario { background: #fdf0f6; color: #a2317a; }
.btn-secundario:active { transform: translateY(2px); }

/* ---------- Recompensa diaria ---------- */
#pantallaRecompensaDiaria {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 4, 14, 0.85); pointer-events: auto; padding: 20px; perspective: 900px;
}
#recompensaCard {
  background: linear-gradient(180deg, #fff7e0, #ffe9b3); border-radius: 24px; padding: 34px 28px; text-align: center;
  max-width: 320px; width: 100%; box-shadow: 0 25px 60px rgba(0,0,0,0.5); animation: giroEntradaTarjeta 0.5s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes popPuntajeSugar { 0% { transform: scale(0.6); opacity: 0.4; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
#recompensaCard h2 { margin: 0 0 6px; font-size: 22px; color: #a2317a; font-family: "Baloo 2", sans-serif; }
#recompensaRachaTexto { margin: 0 0 14px; font-size: 13.5px; color: #8a5a1a; font-weight: 700; }
#recompensaMonto { font-size: 40px; font-weight: 900; color: #d1830f; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(209,131,15,0.3); }
#btnReclamarRecompensa {
  width: 100%; border: none; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 15px; cursor: pointer;
  font-family: "Baloo 2", sans-serif; background: linear-gradient(90deg, #ff8fc7, #ff5da2); color: #fff;
  box-shadow: 0 4px 0 #c23d7c, 0 8px 16px rgba(255,93,162,0.35);
}
#btnReclamarRecompensa:active { transform: translateY(3px); box-shadow: 0 1px 0 #c23d7c; }

/* ---------- Logros ---------- */
.btn-logros {
  display: block; margin: 4px auto 18px; padding: 9px 18px; border-radius: 20px; cursor: pointer;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.35);
  color: #fff; font-size: 13px; font-weight: 800; font-family: "Baloo 2", 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(20, 5, 25, 0.85); pointer-events: auto; padding: 20px; perspective: 900px;
}
#logrosCard {
  background: #fff7fb; border: 1px solid rgba(162, 49, 122, 0.25);
  border-radius: 18px; padding: 22px; max-width: 480px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column; animation: giroEntradaTarjeta 0.5s cubic-bezier(.2,.8,.3,1.1);
}
#logrosHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#logrosHeader h2 { margin: 0; font-size: 20px; color: #a2317a; font-family: "Baloo 2", sans-serif; }
.btn-cerrar-logros { background: none; border: none; color: #8a6a92; font-size: 18px; cursor: pointer; padding: 4px 8px; }
#logrosProgreso { margin: 0 0 14px; color: #8a6a92; 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(162,49,122,0.04); border: 1px solid rgba(162,49,122,0.1); font-size: 13px; color: #8a6a92; font-weight: 600;
}
.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(162,49,122,0.25); background: transparent;
}
.logro-item--completo { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.35); color: #3a2140; }
.logro-item--completo .logro-item__check { background: #4ade80; border-color: #4ade80; color: #0b1120; }

/* Aviso emergente de logro desbloqueado — arriba de la pantalla, se retira solo. */
.logro-toast {
  position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd23d, #ffb23d); color: #5a3a00; border-radius: 14px;
  padding: 12px 22px; box-shadow: 0 10px 26px rgba(0,0,0,0.35); z-index: 60; text-align: center;
  font-family: "Baloo 2", sans-serif; transition: top 0.4s cubic-bezier(.2,.8,.3,1.1); max-width: 88vw;
}
.logro-toast--visible { top: 18px; }
.logro-toast__titulo { font-size: 13px; font-weight: 800; }
.logro-toast__texto { font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.logro-toast__extra { font-size: 10.5px; font-weight: 700; opacity: 0.75; margin-top: 2px; }

@media (min-width: 700px) {
  #nivelesInner { max-width: 560px; }
}

/* ---------- Acabado "caramelo" del HUD: borde glossy + brillo interior ---------- */
.pill, #nivelCard, .hud-btn, .poder-btn {
  border: 2px solid #ffc6e2;
  box-shadow: 0 4px 0 rgba(162, 49, 122, 0.28), 0 8px 16px rgba(0,0,0,0.2), inset 0 2px 0 rgba(255,255,255,0.95), inset 0 -3px 6px rgba(255, 143, 199, 0.18);
}
.pill--money { color: #b46a00; }
.hud-bar__fill { background: linear-gradient(90deg, #ff8fc7, #ff5da2 60%, #ffb23d); box-shadow: inset 0 2px 0 rgba(255,255,255,0.45); }
.poder-btn:not(:disabled):hover { transform: translateY(-2px); }
#nivelNombre { text-shadow: 0 1px 0 rgba(255,255,255,0.8); }

/* Barra de 5 poderes: botones más compactos para que quepan en una fila en celular */
#barraPoderes { gap: 8px; padding: 0 6px; flex-wrap: nowrap; }
.poder-btn { min-width: 0; flex: 1 1 0; max-width: 92px; padding: 7px 6px; }
.poder-btn__nombre { font-size: 11px; }
.poder-btn__costo { font-size: 10.5px; }

/* ---------- Mapa de niveles: caminos serpenteantes ---------- */
.mundo-bloque { --acento: #ff5da2; margin-bottom: 44px; }
.mundo-titulo { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 380px; margin: 0 auto 6px; padding: 11px 16px; border-radius: 16px; text-align: left;
  border: 2px solid rgba(255,255,255,0.4); box-shadow: 0 5px 0 rgba(0,0,0,0.25), 0 10px 20px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.35); }
.mundo-titulo__icono { font-size: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35)); }
.mundo-titulo__nombre { flex: 1; font-size: 16px; text-shadow: 0 2px 0 rgba(0,0,0,0.25); }
.mundo-titulo__estrellas { font-size: 12.5px; background: rgba(0,0,0,0.28); padding: 3px 10px; border-radius: 12px; color: #ffe08a; }
.mundo-titulo--bloqueado { filter: grayscale(0.8) brightness(0.7); }
.camino { position: relative; width: 100%; max-width: 380px; margin: 0 auto; }
.camino__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.camino__sombra { fill: none; stroke: rgba(0,0,0,0.3); stroke-width: 12; stroke-linecap: round; transform: translateY(4px); }
.camino__linea { fill: none; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 13; opacity: 0.95; }
.camino .nivel-nodo { position: absolute; transform: translate(-50%, -50%); margin: 0; width: 72px; height: 72px; border: 3px solid rgba(255,255,255,0.75);
  background: radial-gradient(circle at 32% 24%, color-mix(in srgb, var(--nodo, #666) 55%, #fff), var(--nodo, #666) 55%, color-mix(in srgb, var(--nodo, #666) 60%, #000));
  box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 10px 18px rgba(0,0,0,0.35), inset 0 3px 0 rgba(255,255,255,0.5); animation: nodoEntrada 0.5s cubic-bezier(.2,.9,.3,1.3) backwards; }
.camino .nivel-nodo:hover:not(.bloqueado) { transform: translate(-50%, -54%) scale(1.08); }
.camino .nivel-nodo:active:not(.bloqueado) { transform: translate(-50%, -46%) scale(0.95); }
.camino .nivel-nodo.bloqueado { background: radial-gradient(circle at 32% 24%, #6b5a75, #3d2f47); box-shadow: 0 4px 0 rgba(0,0,0,0.3); font-size: 22px; }
.nivel-nodo__num { font-size: 26px; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.nivel-nodo--jefe { width: 92px !important; height: 92px !important; border-color: #ffd23d !important; box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 0 22px rgba(255,210,61,0.65), inset 0 3px 0 rgba(255,255,255,0.5) !important; }
.nivel-nodo--jefe .nivel-nodo__num { font-size: 32px; }
.nivel-nodo__corona { position: absolute; top: -26px; font-size: 26px; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.4)); animation: coronaFlota 2.4s ease-in-out infinite; }
.nivel-nodo--perfecto { border-color: #ffe08a !important; }
.camino .nivel-nodo--siguiente { animation: pulsoSiguienteNivel 1.7s ease-out infinite, nodoEntrada 0.5s backwards; }
@keyframes nodoEntrada { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }
@keyframes coronaFlota { 0%,100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.camino__sombra, .camino__linea { vector-effect: non-scaling-stroke; }

/* ---------- Cartel de presentación de nivel ---------- */
#introNivel { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 30; text-align: center; padding: 20px 34px; border-radius: 26px; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--acento, #ff5da2) 55%, #2b1035), rgba(20,8,32,0.94) 75%);
  border: 3px solid rgba(255,255,255,0.7); box-shadow: 0 0 34px color-mix(in srgb, var(--acento, #ff5da2) 70%, transparent), 0 14px 40px rgba(0,0,0,0.55), inset 0 3px 0 rgba(255,255,255,0.35); min-width: 240px; }
#introNivel[hidden] { display: none; }
.intro__jefe { font-size: 13px; font-weight: 800; letter-spacing: 3px; color: #ffd23d; margin-bottom: 4px; text-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.intro__num { font-family: "Baloo 2", sans-serif; font-size: 40px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,0.35); }
.intro__mundo { font-size: 14px; color: var(--acento, #ff5da2); filter: brightness(1.6); font-weight: 700; margin: 4px 0 10px; }
.intro__obj { font-size: 17px; color: #fff; }
.intro__obj b { color: #ffe08a; font-size: 21px; }
.intro__mov { font-size: 13px; color: #cbb8e6; margin-top: 2px; }
#introNivel.intro--entrar { animation: introEntrar 0.55s cubic-bezier(.2,.9,.3,1.25) both; }
#introNivel.intro--salir { animation: introSalir 0.45s ease-in both; }
@keyframes introEntrar { from { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-4deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes introSalir { to { opacity: 0; transform: translate(-50%, -80%) scale(0.9); } }
@media (prefers-reduced-motion: reduce) { #introNivel.intro--entrar, #introNivel.intro--salir { animation-duration: 0.01s; } }

/* ---------- Victoria: rayos giratorios, estrellas doradas y chispas ---------- */
#resultadoRayos { position: fixed; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none; opacity: 0; }
#resultadoRayos.rayos--on { opacity: 1; background: repeating-conic-gradient(from 0deg, rgba(255,140,200,0.22) 0deg 9deg, transparent 9deg 24deg); -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 62%); mask-image: radial-gradient(circle, #000 12%, transparent 62%); animation: rayosGiro 22s linear infinite; }
#resultadoRayos.rayos--oro { background: repeating-conic-gradient(from 0deg, rgba(255,214,90,0.34) 0deg 9deg, transparent 9deg 24deg); }
@keyframes rayosGiro { to { transform: rotate(360deg); } }
#pantallaResultadoNivel #resultadoCard { position: relative; }
.estrella-resultado--pop { color: #ffc61a; text-shadow: 0 0 14px rgba(255,198,26,0.8), 0 3px 0 #c98a00; animation: estrellaGira 0.6s cubic-bezier(.2,.9,.3,1.3); }
@keyframes estrellaGira { from { transform: scale(0.2) rotate(-200deg); } to { transform: scale(1) rotate(0); } }
.chispa-estrella { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #ffe9a0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); pointer-events: none; z-index: 31; animation: chispaVuela 0.65s ease-out forwards; }
@keyframes chispaVuela { from { transform: translate(0,0) scale(1.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(180deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #resultadoRayos.rayos--on { animation: none; } }

/* ---------- Evento semanal ---------- */
.evento-card { display: flex; flex-direction: column; gap: 3px; align-items: center; width: 100%; max-width: 380px; margin: 0 auto 26px; padding: 22px 16px 14px; border-radius: 20px; position: relative; cursor: pointer; font-family: inherit; color: #fff; text-align: center;
  background: linear-gradient(135deg, #7c3aed, #ec4899 55%, #f59e0b); border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 0 26px rgba(236,72,153,0.5), inset 0 3px 0 rgba(255,255,255,0.4); animation: pulsoEvento 2s ease-in-out infinite alternate; }
.evento-card strong { font-size: 20px; font-family: "Baloo 2", sans-serif; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.evento-card span { font-size: 13px; }
.evento-card__cinta { position: absolute; top: -12px; background: #fde047; color: #7c2d12; font-weight: 800; letter-spacing: 1.5px; font-size: 11px !important; padding: 3px 12px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.evento-card__pie { margin-top: 4px; background: rgba(0,0,0,0.25); padding: 3px 12px; border-radius: 12px; color: #ffe08a; font-weight: 700; }
.evento-card:active { transform: translateY(3px); }
@keyframes pulsoEvento { to { box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 0 38px rgba(245,158,11,0.7), inset 0 3px 0 rgba(255,255,255,0.4); } }

/* Tutorial de la primera partida */
#tutorialGuia { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 25; width: min(92vw, 420px); padding: 10px 14px 8px; border-radius: 16px; text-align: center;
  background: rgba(43,16,53,0.94); border: 3px solid #ffd23d; box-shadow: 0 0 22px rgba(255,210,61,0.5), 0 8px 24px rgba(0,0,0,0.5); animation: tutEntraSugar 0.35s ease-out; pointer-events: none; }
#tutorialGuia[hidden] { display: none; }
.tut__paso { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #ffd23d; font-weight: 800; }
.tut__texto { margin: 3px 0 6px; font-size: 14px; line-height: 1.35; color: #fff; font-weight: 600; }
#tutSaltar { background: transparent; border: 1px solid rgba(255,255,255,0.35); color: #e9d5ff; border-radius: 12px; padding: 3px 12px; font-size: 12px; cursor: pointer; font-family: inherit; pointer-events: auto; }
@keyframes tutEntraSugar { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%); } }
.tut-resalte { animation: tutPulsoSugar 1s ease-in-out infinite alternate !important; }
@keyframes tutPulsoSugar { to { filter: drop-shadow(0 0 14px rgba(255,210,61,0.95)); } }

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 3px solid #ffd23d; 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; }
}
