/* =====================================================================
 *  PALABRATORIUM · Estilos
 *  Paleta: azul eléctrico, azul oscuro, violeta, turquesa, amarillo
 *  dorado, verde brillante y blanco.
 * ===================================================================== */
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --azul: #2f6bff;
  --azul-osc: #141a4a;
  --azul-med: #1f2766;
  --violeta: #7c4dff;
  --turquesa: #22d3c5;
  --oro: #ffc83d;
  --oro-osc: #b7791f;
  --verde: #4ade80;
  --coral: #ff6b6b;
  --blanco: #ffffff;
  --texto: #f4f6ff;
  --texto-suave: #c7cdf5;
  --panel: rgba(255, 255, 255, .08);
  --panel-borde: rgba(255, 255, 255, .16);
  --sombra: 0 10px 30px rgba(5, 8, 35, .45);
  --radio: 22px;
  --titulo: "Fredoka", "Nunito", "Trebuchet MS", sans-serif;
  --cuerpo: "Nunito", "Segoe UI", system-ui, sans-serif;
  --zona: var(--turquesa);
  --zona2: #0e7490;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--cuerpo); font-weight: 600; font-size: 17px; line-height: 1.45;
  color: var(--texto); background: var(--azul-osc);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 .6em; }
a { color: var(--turquesa); }
kbd { font-family: var(--titulo); background: #fff; color: var(--azul-osc); border-radius: 6px; padding: 0 .4em; box-shadow: 0 2px 0 #9aa3d6; }
:focus-visible { outline: 4px solid var(--oro); outline-offset: 3px; border-radius: 12px; }

.saltar { position: absolute; left: -999px; top: 8px; background: var(--oro); color: var(--azul-osc); padding: 8px 14px; border-radius: 10px; z-index: 100; font-weight: 800; }
.saltar:focus { left: 8px; }
.solo-lectores { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 2rem; text-align: center; }

/* ---------------------------------------------------------- fondo del laboratorio */
.fondo-lab { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% 20%, #3a2fa8 0%, transparent 60%),
    radial-gradient(800px 500px at 90% 90%, #0f5f8c 0%, transparent 60%),
    radial-gradient(700px 500px at 5% 80%, #4a1d8f 0%, transparent 60%),
    linear-gradient(180deg, #1b1f63 0%, #141a4a 60%, #0d1236 100%); }
.fondo-luz { position: absolute; inset: -20% 0 auto; height: 70%; background: radial-gradient(closest-side, rgba(120, 200, 255, .22), transparent); animation: latido 7s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .55; } }
.fondo-estantes { position: absolute; inset: 0; width: 100%; height: 100%; }
.engranaje { transform-box: fill-box; transform-origin: center; }
.engranaje.e1 > path { animation: girar 30s linear infinite; transform-box: fill-box; transform-origin: center; }
.engranaje.e2 > path { animation: girar 22s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
@keyframes girar { to { transform: rotate(360deg); } }
.burbujas-fondo span { position: absolute; bottom: -40px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(120,220,255,.25) 60%, transparent 70%);
  animation: subir 12s linear infinite; opacity: .6; }
.burbujas-fondo span:nth-child(1) { left: 8%; animation-delay: 0s; }
.burbujas-fondo span:nth-child(2) { left: 18%; width: 9px; height: 9px; animation-delay: 3s; animation-duration: 9s; }
.burbujas-fondo span:nth-child(3) { left: 33%; animation-delay: 6s; }
.burbujas-fondo span:nth-child(4) { left: 52%; width: 20px; height: 20px; animation-delay: 1.5s; animation-duration: 15s; }
.burbujas-fondo span:nth-child(5) { left: 67%; animation-delay: 4.5s; }
.burbujas-fondo span:nth-child(6) { left: 79%; width: 10px; height: 10px; animation-delay: 8s; animation-duration: 10s; }
.burbujas-fondo span:nth-child(7) { left: 90%; animation-delay: 2s; }
.burbujas-fondo span:nth-child(8) { left: 44%; width: 8px; height: 8px; animation-delay: 9s; }
@keyframes subir { to { transform: translateY(-110vh) translateX(30px); opacity: 0; } }
body[data-pantalla="p-juego"] .fondo-estantes, body[data-pantalla="p-juego"] .burbujas-fondo { opacity: .35; }

/* ---------------------------------------------------------- estructura */
main { position: relative; z-index: 1; }
.pantalla { max-width: 1120px; margin: 0 auto; padding: 16px 16px 40px; min-height: 100vh; min-height: 100dvh; animation: entrar .35s ease; }
@keyframes entrar { from { opacity: 0; transform: translateY(10px); } }
.cabecera { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.cabecera h2 { margin: 0; flex: 1; min-width: 200px; }
.nota { font-size: .88rem; color: var(--texto-suave); }
.nota-centro { text-align: center; color: var(--texto-suave); max-width: 720px; margin: 0 auto 16px; }

/* ---------------------------------------------------------- botones */
.btn { --b1: #2fe3d3; --b2: #0ea5a0; --bt: #052a2a;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 54px; padding: .55em 1.4em;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-family: var(--titulo); font-weight: 600; font-size: 1.15rem; letter-spacing: .01em; color: var(--bt);
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 10px 22px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255,255,255,.45);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 rgba(0,0,0,.28), 0 4px 10px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.45); }
.btn-principal { --b1: #ffe27a; --b2: #ffb020; --bt: #3a2300; }
.btn-sec { --b1: rgba(255,255,255,.2); --b2: rgba(255,255,255,.1); --bt: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 6px 16px rgba(0,0,0,.2); }
.btn-sec:active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn-peligro { --b1: #ff8a8a; --b2: #e5484d; --bt: #3b0505; }
.btn-mini { min-height: 40px; font-size: .95rem; padding: .3em 1em; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.btn-destacado { animation: destello 2.2s ease-in-out infinite; }
@keyframes destello { 0%, 100% { box-shadow: 0 5px 0 rgba(0,0,0,.28), 0 0 0 0 rgba(255,200,61,.6), inset 0 2px 0 rgba(255,255,255,.45); } 50% { box-shadow: 0 5px 0 rgba(0,0,0,.28), 0 0 0 12px rgba(255,200,61,0), inset 0 2px 0 rgba(255,255,255,.45); } }
.btn-volver { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: .3em 1em .3em .7em; border-radius: 999px; border: 2px solid var(--panel-borde); background: var(--panel); cursor: pointer; font-family: var(--titulo); font-weight: 600; }
.btn-volver::before { content: "‹"; font-size: 1.5em; line-height: .8; }
.btn-volver:hover { background: rgba(255,255,255,.16); }
.btn-enlace { background: none; border: 0; padding: 0; color: var(--oro); text-decoration: underline; font-weight: 800; cursor: pointer; }
.btn-icono { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: .3em .9em; border-radius: 999px; border: 2px solid var(--panel-borde); background: var(--panel); cursor: pointer; font-family: var(--titulo); font-weight: 600; font-size: .95rem; }
.btn-icono::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.btn-icono[data-sonido="efectos"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E"); }
.btn-icono[data-sonido="musica"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v10.6A4 4 0 1 0 14 17V7h4V3h-6z'/%3E%3C/svg%3E"); }
.btn-pausa { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 4h4v16H6zM14 4h4v16h-4z'/%3E%3C/svg%3E"); }
.btn-icono.apagado { opacity: .65; }
.chip { display: inline-flex; align-items: center; gap: .3em; min-height: 40px; padding: .25em .95em; border-radius: 999px; border: 2px solid var(--panel-borde); background: var(--panel); font-family: var(--titulo); font-weight: 500; font-size: .98rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--oro); color: #3a2300; border-color: var(--oro); }
.chip-info { cursor: default; }
button.chip::after { content: "✎"; font-size: .85em; opacity: .7; margin-left: .2em; }
.filtros button.chip::after, .chip-info::after { content: none; }

/* ---------------------------------------------------------- inicio */
#p-inicio { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 12px; }
.logo-playlab { position: absolute; top: 12px; left: 16px; width: clamp(110px, 14vw, 170px); height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); z-index: 2; }
.inicio-escena { position: relative; min-height: 520px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 26px; }
.inicio-escena::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 46px; border-radius: 14px 14px 6px 6px; background: linear-gradient(180deg, #a0662f 0%, #7a4a1f 40%, #4f2e12 100%); box-shadow: inset 0 4px 0 rgba(255,255,255,.25), 0 14px 24px rgba(0,0,0,.45); z-index: 1; }
.inicio-escena::before { content: ""; position: absolute; left: 10%; bottom: 40px; width: 46px; height: 60px; z-index: 2; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 60'%3E%3Cpath d='M16 2h14v4h-2v14l14 28c3 6-1 10-6 10H10c-5 0-9-4-6-10l14-28V6h-2z' fill='%23e8f6ff' fill-opacity='.4' stroke='%23e8f6ff' stroke-width='3'/%3E%3Cpath d='M6 46l8-14h18l8 14c2 5-1 9-5 9H11c-4 0-7-4-5-9z' fill='%23f472b6'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 0 12px #f472b6); }
.inicio-doctor { position: relative; z-index: 0; margin-bottom: -6px; width: min(380px, 80%); filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); animation: flotar 5s ease-in-out infinite; }
.inicio-loro { position: absolute; width: 150px; right: 4%; bottom: 14%; z-index: 2; filter: drop-shadow(0 10px 18px rgba(0,0,0,.4)); }
@keyframes flotar { 50% { transform: translateY(-8px); } }
.palabras-flotantes .pf { position: absolute; font-family: var(--titulo); font-weight: 600; font-size: 1.35rem; padding: .25em .9em; border-radius: 999px;
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: 0 0 22px currentColor, inset 0 0 0 2px rgba(255,255,255,.45); animation: flotar 4s ease-in-out infinite; }
.pf1 { top: 12%; left: 12%; background: #10b981; color: #10b981; }
.pf2 { top: 30%; left: 2%; background: #a855f7; color: #a855f7; animation-delay: -1s !important; }
.pf3 { top: 14%; right: 6%; background: #f59e0b; color: #f59e0b; animation-delay: -2s !important; }
.pf4 { top: 40%; right: 2%; background: #0ea5e9; color: #0ea5e9; animation-delay: -3s !important; }
.palabras-flotantes .pf { color: #fff !important; }
.pf1 { box-shadow: 0 0 24px #10b981, inset 0 0 0 2px rgba(255,255,255,.45); }
.pf2 { box-shadow: 0 0 24px #a855f7, inset 0 0 0 2px rgba(255,255,255,.45); }
.pf3 { box-shadow: 0 0 24px #f59e0b, inset 0 0 0 2px rgba(255,255,255,.45); }
.pf4 { box-shadow: 0 0 24px #0ea5e9, inset 0 0 0 2px rgba(255,255,255,.45); }
.inicio-panel { text-align: center; padding: 20px 8px; }
.titulo-juego { font-size: clamp(2.6rem, 6.6vw, 5rem); text-transform: uppercase; letter-spacing: .02em; margin: 0;
  color: #ffd84a; background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 45%, #ff9f1c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #4a2a00; filter: drop-shadow(0 5px 0 #2a1a6e) drop-shadow(0 12px 18px rgba(0,0,0,.45)); }
.subtitulo { display: inline-block; font-family: var(--titulo); font-weight: 600; font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: #3a2300; background: linear-gradient(180deg, #fff3d6, #f6d79a); padding: .2em 1.1em; border-radius: 10px; margin: 10px 0 12px; box-shadow: 0 4px 0 #b7791f; transform: rotate(-1.5deg); }
.lema { font-size: 1.12rem; color: var(--texto-suave); margin-bottom: 18px; }
.menu { display: grid; gap: 12px; max-width: 420px; margin: 0 auto 16px; }
.menu-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu .btn { width: 100%; }
.controles-sonido { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------- tarjetas */
.tarjetas { display: grid; gap: 18px; }
.tarjetas-3 { grid-template-columns: repeat(3, 1fr); }
.tarjeta { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radio); background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05)); border: 2px solid var(--panel-borde); box-shadow: var(--sombra); text-align: center; }
.tarjeta .btn { margin-top: auto; }
.tarjeta.seleccionada { border-color: var(--oro); box-shadow: 0 0 0 3px rgba(255,200,61,.35), var(--sombra); }
.tarjeta.seleccionada::before { content: "Tu elección"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--oro); color: #3a2300; font-family: var(--titulo); font-size: .85rem; padding: .1em .8em; border-radius: 999px; }
.ilus-modo { display: flex; align-items: center; justify-content: center; gap: 6px; height: 120px; }
.ilus-modo .ico { width: 84px; height: 84px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); animation: flotar 3.5s ease-in-out infinite; }
.ilus-modo .ico:last-child { animation-delay: -1.7s; }
.ilus-signo { font-family: var(--titulo); font-size: 3rem; font-weight: 700; color: var(--oro); text-shadow: 0 3px 0 #4a2a00; }
.ejemplo-chip { display: inline-block; align-self: center; font-family: var(--titulo); background: rgba(0,0,0,.25); padding: .2em .9em; border-radius: 999px; color: var(--oro); }
.tarjeta-nivel { padding-top: 26px; }
.nivel-num { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titulo); font-size: 2rem; font-weight: 700; color: #052a2a; background: radial-gradient(circle at 35% 30%, #c6fff9, var(--turquesa)); box-shadow: 0 5px 0 #0e7490; }
.nivel-2 .nivel-num { background: radial-gradient(circle at 35% 30%, #fff3b0, var(--oro)); box-shadow: 0 5px 0 var(--oro-osc); color: #3a2300; }
.nivel-3 .nivel-num { background: radial-gradient(circle at 35% 30%, #e9ddff, #a78bfa); box-shadow: 0 5px 0 #5b21b6; color: #1e0b4a; }
.nivel-edad { font-family: var(--titulo); color: var(--oro); font-size: 1.1rem; }
.muestra { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.muestra span { font-family: var(--titulo); text-transform: uppercase; font-size: .85rem; padding: .15em .6em; border-radius: 8px; background: rgba(255,255,255,.14); }

/* ---------------------------------------------------------- mapa */
.mapa-ajustes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.aviso { background: linear-gradient(90deg, rgba(74,222,128,.25), rgba(34,211,197,.18)); border: 2px solid rgba(74,222,128,.6); border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; }
.mapa-zonas { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: zona; }
.zona-btn { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px 16px; border-radius: var(--radio); cursor: pointer; text-align: center;
  border: 3px solid color-mix(in srgb, var(--zona) 70%, white); color: #fff;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--zona) 55%, transparent), transparent 62%), linear-gradient(180deg, color-mix(in srgb, var(--zona2) 75%, #141a4a), #141a4a 95%);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--zona2) 70%, black), var(--sombra); transition: transform .15s; }
.zona-btn:hover { transform: translateY(-3px) rotate(-.4deg); }
.zona-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 color-mix(in srgb, var(--zona2) 70%, black); }
.zona-num { position: absolute; top: 10px; left: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titulo); font-weight: 700; background: rgba(0,0,0,.35); }
.zona-ilus { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.zona-ilus .ico { width: 96px; height: 96px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.4)); }
.zona-ilus .candado { position: absolute; width: 56px; height: 56px; right: -6px; bottom: -4px; }
.zona-nombre { font-family: var(--titulo); font-weight: 700; font-size: 1.3rem; }
.zona-estado { display: inline-flex; align-items: center; gap: 4px; font-size: .95rem; color: #e8ecff; }
.zona-estado .ico { width: 18px; height: 18px; }
.zona-barra { width: 80%; height: 8px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; margin-top: 4px; }
.zona-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--oro), #fff2a8); border-radius: inherit; }
.bloqueada .zona-btn { filter: grayscale(.75) brightness(.75); cursor: help; }
.bloqueada .zona-ilus .ico:first-child { opacity: .5; }
.completada .zona-btn::after { content: "✓"; position: absolute; top: 8px; right: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--verde); color: #053b1c; font-weight: 800; }
.nueva .zona-btn { animation: destello 2s ease-in-out infinite; }
.mapa-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.estante { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; border-radius: 14px; background: linear-gradient(180deg, transparent 70%, #6b3f1d 70%, #4a2a12); min-height: 64px; }
.estante-titulo { font-family: var(--titulo); }
.estante-obj .ico { width: 48px; height: 48px; }
.estante-vacio { color: var(--texto-suave); font-size: .9rem; }

/* ---------------------------------------------------------- zona */
#p-zona .cabecera h2 { color: color-mix(in srgb, var(--zona) 75%, white); }
.zona-intro { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: var(--radio); margin-bottom: 20px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--zona2) 55%, transparent), rgba(255,255,255,.05)); border: 2px solid color-mix(in srgb, var(--zona) 50%, transparent); }
.zona-ilus-grande .ico { width: 130px; height: 130px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.4)); }
.zona-datos { display: flex; flex-wrap: wrap; gap: 8px; }
.zona-datos span { background: rgba(0,0,0,.25); border-radius: 999px; padding: .15em .8em; font-size: .9rem; }
.zona-progreso { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--titulo); }
.estrellas { display: inline-flex; gap: 2px; vertical-align: middle; }
.estrellas .ico { width: 26px; height: 26px; }
.zona-progreso .estrellas .ico { width: 20px; height: 20px; }
.exp-ilus { height: 120px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.exp-ilus .ico { width: 70px; height: 70px; }
.exp-ilus .loro { width: 100px; }
.mini-maq { width: 90px; height: 70px; border-radius: 14px; background: linear-gradient(180deg, #9aa7b8, #4b5668); display: grid; place-items: center; box-shadow: inset 0 0 0 3px #2b3240; }
.mini-maq span { font-family: var(--titulo); font-weight: 700; color: #3a2300; background: linear-gradient(180deg, #ffe7a0, #e0a83a); padding: .1em .5em; border-radius: 6px; }
.mini-mez { display: grid; grid-template-columns: 30px 60px 30px; grid-template-rows: repeat(3, 26px); gap: 8px 6px; align-items: center; }
.mini-mez span { height: 22px; border-radius: 8px; background: rgba(255,255,255,.75); }
.mini-mez span:nth-child(1) { grid-column: 1; grid-row: 1; } .mini-mez span:nth-child(2) { grid-column: 1; grid-row: 2; } .mini-mez span:nth-child(3) { grid-column: 1; grid-row: 3; }
.mini-mez svg { grid-column: 2; grid-row: 1 / 4; width: 60px; height: 90px; stroke: var(--oro); }
.mini-mez span:nth-child(5) { grid-column: 3; grid-row: 1; } .mini-mez span:nth-child(6) { grid-column: 3; grid-row: 2; } .mini-mez span:nth-child(7) { grid-column: 3; grid-row: 3; }
.exp-record { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--titulo); }

/* ---------------------------------------------------------- HUD de juego */
.pantalla-juego { padding-top: 10px; padding-bottom: 24px; }
.hud { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: 18px; background: rgba(10, 14, 50, .65); border: 2px solid var(--panel-borde); backdrop-filter: blur(6px); }
.hud-info { flex: 1 1 260px; min-width: 0; }
.hud-zona { font-family: var(--titulo); font-weight: 600; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-progreso { display: flex; align-items: center; gap: 10px; }
.hud-barra { flex: 1; height: 14px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
.hud-barra span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--turquesa), var(--verde)); transition: width .5s ease; }
.hud-texto { font-family: var(--titulo); font-size: .95rem; min-width: 52px; text-align: right; }
.hud-datos { display: flex; gap: 8px; margin: 0; }
.hud-datos > div { min-width: 76px; text-align: center; padding: 4px 10px; border-radius: 12px; background: rgba(255,255,255,.08); }
.hud-datos dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); }
.hud-datos dd { margin: 0; font-family: var(--titulo); font-weight: 700; font-size: 1.35rem; color: var(--oro); }
.hud-botones { display: flex; gap: 8px; }
.juego-cuerpo { display: grid; grid-template-columns: 210px 1fr; gap: 18px; margin-top: 16px; align-items: start; }
.juego-doctor { position: sticky; top: 12px; text-align: center; }
.juego-doctor .doctor { width: 190px; margin: 0 auto; filter: drop-shadow(0 12px 18px rgba(0,0,0,.4)); }
.bocadillo { position: relative; background: #fff; color: #1b1f4a; border-radius: 18px; padding: 10px 14px; font-weight: 800; font-size: 1rem; min-height: 3.2em; margin-top: 10px; box-shadow: var(--sombra); }
.bocadillo::before { content: ""; position: absolute; top: -12px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom: 12px solid #fff; }
.escenario { min-width: 0; }
.reto { font-family: var(--titulo); font-size: clamp(1.25rem, 2.6vw, 1.7rem); text-align: center; margin: 0 0 12px; }
.reto strong { color: var(--oro); }
.tecla { position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-family: var(--titulo); font-size: .8rem; background: rgba(0,0,0,.35); color: #fff; }

/* ---------------------------------------------------------- Transformador: máquina */
.maquina { position: relative; margin: 0 auto 34px; max-width: 760px; min-height: 210px; padding: 54px 70px 22px; border-radius: 28px;
  background: linear-gradient(180deg, #a9b6c8 0%, #6f7d93 45%, #46526a 100%);
  box-shadow: inset 0 0 0 4px #2b3346, inset 0 8px 0 rgba(255,255,255,.35), 0 14px 0 #1d2335, 0 20px 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.maquina::before, .maquina::after { content: ""; position: absolute; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #8b97a8 60%, #3b4558); }
.maquina::before { left: 16px; } .maquina::after { right: 16px; }
.maq-luces { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.maq-luces span { width: 16px; height: 16px; border-radius: 50%; background: #2b3346; box-shadow: inset 0 2px 3px rgba(0,0,0,.6); }
.maquina.activa .maq-luces span { animation: luz .5s ease-in-out infinite alternate; }
.maquina.activa .maq-luces span:nth-child(1) { --c: #22d3c5; } .maquina.activa .maq-luces span:nth-child(2) { --c: #facc15; animation-delay: .1s; }
.maquina.activa .maq-luces span:nth-child(3) { --c: #f472b6; animation-delay: .2s; } .maquina.activa .maq-luces span:nth-child(4) { --c: #4ade80; animation-delay: .3s; }
.maquina.activa .maq-luces span:nth-child(5) { --c: #60a5fa; animation-delay: .4s; }
@keyframes luz { to { background: var(--c); box-shadow: 0 0 14px var(--c), inset 0 -2px 3px rgba(0,0,0,.2); } }
.maq-tubo { position: absolute; bottom: 18px; width: 30px; height: 70%; border-radius: 16px; background: rgba(200, 240, 255, .25); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55), inset 6px 0 0 rgba(255,255,255,.25); overflow: hidden; }
.maq-tubo-i { left: 20px; } .maq-tubo-d { right: 20px; }
.maq-tubo span { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(180deg, var(--zona), color-mix(in srgb, var(--zona) 60%, #000)); transition: height .7s ease; }
.maquina.activa .maq-tubo span { height: 92%; }
.maq-engranaje { position: absolute; width: 64px; height: 64px; right: 64px; bottom: -22px; fill: #c0cad8; stroke: #2b3346; stroke-width: 3; }
.maq-engranaje circle { fill: #46526a; }
.maquina.activa .maq-engranaje { animation: girar 1.2s linear infinite; }
.maq-manometro { position: absolute; width: 54px; height: 54px; left: 64px; bottom: -18px; }
.maq-manometro circle { fill: #f8fafc; stroke: #2b3346; stroke-width: 4; }
.maq-manometro path { stroke: #ef4444; }
.maq-manometro .aguja { stroke: #1b1f4a; stroke-width: 4; stroke-linecap: round; transform-origin: 30px 30px; transition: transform .6s cubic-bezier(.3, 1.6, .6, 1); }
.maquina.activa .aguja { transform: rotate(120deg); }
.placa { position: relative; z-index: 1; min-width: min(420px, 100%); max-width: 100%; padding: 16px 28px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, #fff2c2 0%, #f3cf72 50%, #d79c2e 100%); box-shadow: inset 0 0 0 4px #8a5a12, inset 0 6px 0 rgba(255,255,255,.6), 0 8px 0 #5c3a07, 0 0 0 6px rgba(0,0,0,.18); perspective: 600px; }
.placa-palabra { display: inline-block; font-family: var(--titulo); font-weight: 700; font-size: clamp(2rem, 6vw, 3.4rem); color: #3a2300; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; overflow-wrap: anywhere; }
.placa-palabra.placa-def { font-size: clamp(1.15rem, 2.6vw, 1.6rem); text-transform: none; letter-spacing: 0; line-height: 1.25; }
.placa-palabra.girando { animation: girarPlaca .5s ease-in forwards; }
.placa-origen { display: block; font-family: var(--titulo); font-size: .95rem; color: #7a4a00; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; animation: entrar .4s ease; }
.placa-palabra.transformada { color: #065f46; animation: aparecer .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes girarPlaca { to { transform: rotateX(90deg); opacity: .2; } }
@keyframes aparecer { from { transform: rotateX(-90deg) scale(.6); } }
.maquina.activa .placa { box-shadow: inset 0 0 0 4px #8a5a12, inset 0 6px 0 rgba(255,255,255,.6), 0 8px 0 #5c3a07, 0 0 34px 8px rgba(74, 222, 128, .65); }
.maquina.final { animation: temblor .12s linear 6; }
@keyframes temblor { 25% { transform: translate(2px, -1px); } 75% { transform: translate(-2px, 1px); } }
.maq-contexto { position: relative; z-index: 1; margin: 14px 0 0; padding: 8px 14px; border-radius: 12px; background: rgba(13, 18, 54, .78); font-size: 1.05rem; text-align: center; max-width: 100%; }
.maq-contexto mark, .bb-contexto mark { background: var(--oro); color: #3a2300; border-radius: 4px; padding: 0 .2em; font-weight: 800; }

/* matraces */
.matraces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.matraces.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.matraz-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 14px; border-radius: 22px; cursor: pointer; border: 3px solid rgba(255,255,255,.25);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); box-shadow: 0 6px 0 rgba(0,0,0,.3); transition: transform .15s, border-color .15s, background .15s; touch-action: manipulation; }
.matraz-btn:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.6); }
.matraz-btn:active { transform: translateY(3px) scale(.97); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.matraz-svg { width: 92px; height: 110px; overflow: visible; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.mz-vidrio { fill: rgba(220, 245, 255, .28); stroke: #e8f6ff; stroke-width: 4; stroke-linejoin: round; }
.mz-burbuja { fill: rgba(255,255,255,.75); animation: burbujea 2.4s ease-in infinite; }
.mz-burbuja.b2 { animation-delay: .8s; } .mz-burbuja.b3 { animation-delay: 1.6s; }
@keyframes burbujea { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-60px); opacity: 0; } }
.matraz-palabra { font-family: var(--titulo); font-weight: 700; font-size: clamp(1.05rem, 2.5vw, 1.5rem); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; text-align: center; line-height: 1.1; }
.matraz-btn.correcta { border-color: var(--verde); background: linear-gradient(180deg, rgba(74,222,128,.45), rgba(74,222,128,.12)); box-shadow: 0 0 0 4px rgba(74,222,128,.35), 0 0 30px rgba(74,222,128,.6); animation: salto .5s cubic-bezier(.3, 1.6, .5, 1); }
.matraz-btn.correcta::after, .matraz-btn.revelada::after, .comida.revelada::after { content: "✓"; position: absolute; top: -12px; right: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: var(--verde); color: #053b1c; box-shadow: 0 3px 0 #15803d; }
.matraz-btn.incorrecta { border-color: var(--coral); opacity: .55; filter: grayscale(.6); animation: sacudir .4s ease; cursor: not-allowed; }
.matraz-btn.incorrecta::after, .comida.comida-rechazada::after { content: "✗"; position: absolute; top: -12px; right: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; background: var(--coral); color: #3b0505; box-shadow: 0 3px 0 #b91c1c; }
.matraz-btn.revelada { border-color: var(--verde); border-style: dashed; }
.matraz-btn[aria-disabled="true"]:not(.correcta):not(.revelada):not(.incorrecta) { opacity: .7; }
@keyframes salto { 40% { transform: translateY(-14px) scale(1.06); } }
@keyframes sacudir { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------------------------------------------------------- Burbujas */
.bb-escena { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 16px; max-width: 780px; margin: 0 auto 16px; }
.bb-loro .loro { width: 210px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.45)); }
.bb-bocadillo { position: relative; background: #fff; color: #1b1f4a; border-radius: 26px; padding: 18px 22px; box-shadow: var(--sombra); }
.bb-bocadillo::before { content: ""; position: absolute; left: -18px; top: 40%; border: 14px solid transparent; border-left: 0; border-right: 20px solid #fff; }
.bb-bocadillo p { margin: 0; font-family: var(--titulo); font-size: clamp(1.25rem, 2.8vw, 1.8rem); font-weight: 600; }
.bb-bocadillo strong { color: #7c3aed; }
.pal-pedida { text-transform: uppercase; }
.bb-contexto { margin-top: 8px !important; font-family: var(--cuerpo) !important; font-size: 1rem !important; color: #374151; }
.comidas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.comidas.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.comida { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 24px; border: 3px solid rgba(255,255,255,.22); background: rgba(255,255,255,.07); cursor: pointer; transition: transform .15s; touch-action: manipulation; }
.comida:hover { transform: translateY(-4px) rotate(-1deg); }
.comida:active { transform: scale(.96); }
.comida-bola { position: relative; display: block; width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 8%, var(--c1) 25%, var(--c2) 100%); box-shadow: inset -8px -10px 0 rgba(0,0,0,.15), 0 10px 14px rgba(0,0,0,.35); animation: flotar 2.6s ease-in-out infinite; }
.comida:nth-child(2) .comida-bola { animation-delay: -.8s; } .comida:nth-child(3) .comida-bola { animation-delay: -1.6s; }
.comida-hoja { position: absolute; top: -10px; left: 50%; width: 26px; height: 16px; border-radius: 0 100% 0 100%; background: var(--hoja, #16a34a); transform: translateX(-20%) rotate(-20deg); }
.comida-brillo { position: absolute; inset: 14% 50% 50% 18%; border-radius: 50%; background: rgba(255,255,255,.55); }
.comida-palabra { font-family: var(--titulo); font-weight: 700; font-size: clamp(1.05rem, 2.5vw, 1.45rem); text-transform: uppercase; overflow-wrap: anywhere; text-align: center; line-height: 1.1; }
.comida.comida-ida .comida-bola { opacity: 0; transition: opacity .1s; }
.comida.comida-elegida { border-color: var(--verde); box-shadow: 0 0 24px rgba(74,222,128,.55); }
.comida.comida-rechazada { border-color: var(--coral); animation: sacudir .4s ease; }
.comida.comida-rechazada .comida-bola { filter: grayscale(.8); opacity: .5; }
.comida.revelada { border-color: var(--verde); border-style: dashed; }
.volador { position: fixed; z-index: 60; pointer-events: none; }
.volador .comida-bola { width: 70px; height: 70px; animation: none; }

/* ---------------------------------------------------------- Mezclador */
.mz-tablero { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 12vw, 160px); max-width: 760px; margin: 0 auto; padding: 18px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: 2px solid var(--panel-borde); }
.mz-lineas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mz-linea { fill: none; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 6px currentColor); stroke-dasharray: 600; stroke-dashoffset: 600; animation: trazar .5s ease forwards; }
@keyframes trazar { to { stroke-dashoffset: 0; } }
.mz-col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.mz-pal { position: relative; min-height: 56px; padding: .4em .8em; border-radius: 16px; cursor: pointer; border: 3px solid rgba(255,255,255,.3); background: linear-gradient(180deg, #2b3384, #1f2766); color: #fff;
  font-family: var(--titulo); font-weight: 700; font-size: clamp(1rem, 2.3vw, 1.3rem); text-transform: uppercase; letter-spacing: .02em; box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .12s, border-color .12s, background .12s; overflow-wrap: anywhere; touch-action: manipulation; }
.mz-pal:hover { border-color: rgba(255,255,255,.7); }
.mz-pal[aria-pressed="true"] { border-color: var(--oro); background: linear-gradient(180deg, #ffe27a, #ffb020); color: #3a2300; transform: scale(1.04); box-shadow: 0 0 0 4px rgba(255,200,61,.35), 0 5px 0 rgba(0,0,0,.35); }
.mz-pal.conectada { border-color: var(--color-par); background: color-mix(in srgb, var(--color-par) 28%, #1f2766); cursor: default; }
.mz-pal.conectada::after { content: "✓"; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border: 2px solid #141a4a; border-radius: 50%; display: grid; place-items: center; background: var(--color-par); color: #111; font-size: .95rem; }
#mz-izq .mz-pal.conectada::after { right: auto; left: -9px; }
.mz-pal.mz-error { border-color: var(--coral); background: linear-gradient(180deg, #7f1d1d, #4c0d0d); animation: sacudir .4s ease; }
.mz-tablero-n { display: inline-block; font-size: .8em; padding: .1em .7em; margin-left: .4em; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; }
.mz-maquina { display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 520px; margin: 18px auto 0; padding: 12px 18px; border-radius: 18px; background: linear-gradient(180deg, #8d9bb0, #4b5668); box-shadow: inset 0 0 0 3px #2b3346, 0 8px 0 #1d2335; }
.mz-maq-titulo { font-family: var(--titulo); font-weight: 700; color: #1b1f4a; text-transform: uppercase; letter-spacing: .08em; }
.mz-luces { display: flex; gap: 8px; }
.mz-luces span { width: 18px; height: 18px; border-radius: 50%; background: #2b3346; box-shadow: inset 0 2px 3px rgba(0,0,0,.6); transition: background .3s, box-shadow .3s; }
.mz-luces span.on { background: var(--verde); box-shadow: 0 0 12px var(--verde); }
.mz-maquina.activa { animation: temblor .12s linear 6; box-shadow: inset 0 0 0 3px #2b3346, 0 8px 0 #1d2335, 0 0 30px rgba(74,222,128,.7); }

/* ---------------------------------------------------------- panel de explicación */
.panel-feedback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); animation: subirPanel .3s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes subirPanel { from { transform: translateY(100%); } }
.panel-caja { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 22px;
  background: #fbfcff; color: #1b1f4a; box-shadow: 0 -6px 30px rgba(0,0,0,.35); border: 4px solid var(--verde); }
.panel-mal .panel-caja { border-color: var(--coral); }
.panel-icono { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; background: var(--verde); color: #053b1c; }
.panel-mal .panel-icono { background: var(--coral); color: #3b0505; }
.panel-titulo { font-family: var(--titulo); font-weight: 700; font-size: 1.3rem; margin-bottom: .2em; }
.panel-texto p:last-child { margin-bottom: 0; }
.panel-ejemplo { color: #4b5280; font-style: italic; }
.palabra-clave { text-transform: uppercase; color: #047857; }
.panel-botones { display: flex; flex-direction: column; gap: 8px; }
.panel-botones .btn-sec { --b1: #e8ebff; --b2: #d4d9fb; --bt: #1b1f4a; box-shadow: 0 4px 0 #a5acd9; }

/* ---------------------------------------------------------- resultado */
.resultado { max-width: 920px; margin: 0 auto; }
.res-cabecera { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; text-align: center; margin-bottom: 14px; }
.res-doctor .doctor { width: 210px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.4)); }
.res-sub { color: var(--texto-suave); }
.res-estrellas .ico { width: 64px; height: 64px; animation: estrellaAparece .5s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.res-estrellas .ico:nth-child(2) { animation-delay: .25s; } .res-estrellas .ico:nth-child(3) { animation-delay: .5s; }
@keyframes estrellaAparece { from { transform: scale(0) rotate(-90deg); } }
.res-puntos { font-family: var(--titulo); font-weight: 700; font-size: clamp(2.4rem, 7vw, 3.6rem); color: var(--oro); margin: 0; text-shadow: 0 4px 0 #4a2a00; }
.res-puntos small { font-size: .4em; color: #fff; text-shadow: none; }
.res-record { display: inline-block; background: var(--verde); color: #053b1c; padding: .2em 1em; border-radius: 999px; font-family: var(--titulo); }
.res-cuerpo { display: grid; gap: 14px; }
.res-caja { padding: 16px 18px; border-radius: var(--radio); background: var(--panel); border: 2px solid var(--panel-borde); }
.desglose { margin: 0 0 8px; }
.desglose > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.18); }
.desglose dd { margin: 0; font-family: var(--titulo); color: var(--oro); }
.desglose .total { border-bottom: 0; font-family: var(--titulo); font-size: 1.2rem; }
.res-stats { color: var(--texto-suave); font-size: .95rem; margin: 0; }
.res-novedades ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res-novedades li { display: flex; align-items: center; gap: 12px; animation: entrar .5s ease backwards; }
.res-novedades .ico { width: 52px; height: 52px; flex: none; }
.fila-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.fila-form input { flex: 1 1 220px; min-height: 54px; padding: 0 16px; border-radius: 16px; border: 3px solid rgba(255,255,255,.35); background: #fff; color: #1b1f4a; font: 700 1.15rem var(--cuerpo); }
.fila-form input[aria-invalid="true"] { border-color: var(--coral); }
.res-ranking-msg { min-height: 1.4em; margin: 6px 0 0; font-weight: 800; }
.res-ranking-msg.ok { color: var(--verde); } .res-ranking-msg.error { color: #ffb4b4; } .res-ranking-msg.aviso { color: var(--oro); }
.res-botones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

/* ---------------------------------------------------------- colección */
.col-resumen { text-align: center; margin-bottom: 18px; }
.col-cat h3 { margin: 18px 0 10px; }
.col-lista { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.col-obj { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px; border-radius: 20px; text-align: center; background: var(--panel); border: 2px solid var(--panel-borde); }
.col-obj.conseguido { background: linear-gradient(180deg, rgba(255,200,61,.18), rgba(255,255,255,.05)); border-color: rgba(255,200,61,.5); }
.col-obj.equipado { box-shadow: 0 0 0 3px var(--verde); }
.col-ico { position: relative; width: 74px; height: 74px; }
.col-ico .ico { width: 74px; height: 74px; }
.col-ico .candado { position: absolute; width: 34px; height: 34px; right: -8px; bottom: -6px; }
.col-obj.bloqueado .col-ico .ico:first-child { filter: grayscale(1) brightness(.6); opacity: .55; }
.col-nombre { font-family: var(--titulo); font-weight: 600; margin: 0; }
.col-como { font-size: .85rem; color: var(--texto-suave); margin: 0; }
.col-meta { position: relative; width: 100%; height: 18px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; margin-top: 4px; }
.col-meta span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--turquesa), var(--verde)); }
.col-meta em { position: relative; font-style: normal; font-size: .75rem; font-weight: 800; }

/* ---------------------------------------------------------- clasificación */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.ranking-lista { max-width: 860px; margin: 12px auto; }
.tabla-ranking { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.tabla-ranking th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); padding: 0 10px; }
.tabla-ranking td { padding: 10px; background: var(--panel); font-weight: 700; }
.tabla-ranking td:first-child { border-radius: 14px 0 0 14px; } .tabla-ranking td:last-child { border-radius: 0 14px 14px 0; }
.tabla-ranking .pos { font-family: var(--titulo); font-size: 1.3rem; text-align: center; width: 60px; }
.tabla-ranking .num { font-family: var(--titulo); color: var(--oro); font-size: 1.15rem; }
.tabla-ranking .estrellas .ico { width: 18px; height: 18px; }
.pos-1 td { background: rgba(255,200,61,.22); } .pos-2 td { background: rgba(203,213,225,.2); } .pos-3 td { background: rgba(217,119,6,.2); }
.cargando, .vacio { text-align: center; color: var(--texto-suave); padding: 24px; }

/* ---------------------------------------------------------- ayuda */
.ayuda { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; }
.ayuda-caja { padding: 16px 20px; border-radius: var(--radio); background: var(--panel); border: 2px solid var(--panel-borde); }
.ayuda-lista dt { font-family: var(--titulo); color: var(--oro); margin-top: 8px; }
.ayuda-lista dd { margin: 0; }
.tabla-puntos { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.tabla-puntos td { padding: 6px 4px; border-bottom: 1px dashed rgba(255,255,255,.2); }
.tabla-puntos td:last-child { text-align: right; font-family: var(--titulo); color: var(--oro); }
.ayuda-pie { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; color: var(--texto-suave); font-size: .9rem; text-align: center; }
.ayuda .controles-sonido { justify-content: flex-start; margin-bottom: 10px; }

/* ---------------------------------------------------------- modales y avisos */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 30, .72); backdrop-filter: blur(4px); }
.modal-caja { width: min(440px, 100%); display: grid; gap: 12px; padding: 24px; border-radius: 26px; background: linear-gradient(180deg, #2a3190, #1a2068); border: 3px solid rgba(255,255,255,.25); box-shadow: var(--sombra); text-align: center; animation: entrar .25s ease; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 16px; background: #fff; color: #1b1f4a; font-weight: 800; box-shadow: var(--sombra); text-align: center; animation: entrar .25s ease; }

/* ---------------------------------------------------------- efectos */
.capa-efectos { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.particula { position: fixed; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; animation: estallar .9s ease-out forwards; }
.particula-estrella { width: auto; height: auto; background: none !important; font-size: 22px; line-height: 1; margin: -11px 0 0 -8px; text-shadow: 0 0 8px currentColor; }
@keyframes estallar { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
.puntos-flotantes { position: fixed; transform: translate(-50%, 0); font-family: var(--titulo); font-weight: 700; font-size: 1.7rem; color: var(--oro); text-shadow: 0 3px 0 #4a2a00, 0 0 12px rgba(0,0,0,.5); white-space: nowrap; animation: flotarPuntos 1.3s ease-out forwards; }
.puntos-flotantes.bonus { font-size: 1.25rem; color: #fff; background: linear-gradient(90deg, var(--violeta), #db2777); padding: .15em .8em; border-radius: 999px; text-shadow: none; }
@keyframes flotarPuntos { from { opacity: 0; margin-top: 10px; } 20% { opacity: 1; } to { opacity: 0; margin-top: -70px; } }
.humo { position: fixed; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle, rgba(220,220,230,.9), rgba(160,160,175,.4) 60%, transparent 70%); animation: humear 1.2s ease-out forwards; }
@keyframes humear { from { transform: scale(.4); opacity: .9; } to { transform: translateY(-80px) scale(1.8); opacity: 0; } }
.confeti { position: fixed; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: caer 2s linear forwards; }
@keyframes caer { to { transform: translateY(110vh) rotate(var(--giro)); } }

/* ---------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .tarjetas-3, .mapa-zonas { grid-template-columns: repeat(2, 1fr); }
  .tarjeta-modo:last-child, .tarjeta-nivel:last-child { grid-column: 1 / -1; }
  .juego-cuerpo { grid-template-columns: 1fr; }
  .juego-doctor { position: static; display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; text-align: left; }
  .juego-doctor .doctor { width: 74px; }
  .bocadillo { margin: 0; min-height: 4.6em; display: flex; align-items: center; font-size: .92rem; line-height: 1.3; padding: 6px 12px; }
  .bocadillo::before { top: 50%; left: -10px; margin: -9px 0 0; border: 9px solid transparent; border-left: 0; border-right: 11px solid #fff; }
}
@media (max-width: 760px) {
  #p-inicio { grid-template-columns: 1fr; padding-top: 70px; }
  .logo-playlab { width: 104px; top: 8px; left: 10px; }
  .inicio-escena { min-height: 300px; order: -1; }
  .inicio-doctor { width: min(250px, 62%); }
  .inicio-loro { width: 96px; bottom: 12%; right: 2%; }
  .palabras-flotantes .pf { font-size: 1rem; }
  .pf2 { top: 40%; } .pf4 { top: 36%; }
  .inicio-escena::after { height: 34px; }
  .inicio-escena::before { width: 34px; height: 44px; bottom: 30px; }
  .inicio-panel { padding-top: 0; }
  .hud { gap: 8px; padding: 8px 10px; }
  .hud-info { flex-basis: 100%; }
  .hud-datos > div { min-width: 64px; padding: 2px 8px; }
  .hud-datos dd { font-size: 1.15rem; }
  .hud-mejor { display: none; }
  .hud-botones { margin-left: auto; }
  .hud-botones .btn-icono { font-size: 0; gap: 0; padding: .3em .7em; }
  .hud-botones .btn-icono::before { width: 22px; height: 22px; }
  .maquina { padding: 46px 48px 18px; min-height: 170px; }
  .maq-tubo { width: 20px; } .maq-tubo-i { left: 12px; } .maq-tubo-d { right: 12px; }
  .maq-engranaje { width: 46px; height: 46px; right: 40px; bottom: -16px; }
  .maq-manometro { width: 40px; height: 40px; left: 40px; bottom: -14px; }
  .placa { padding: 12px 14px; min-width: 0; width: 100%; }
  .matraces, .comidas { gap: 10px; }
  .matraces.n4, .comidas.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matraz-svg { width: 64px; height: 78px; }
  .comida-bola { width: 64px; height: 64px; }
  .bb-escena { grid-template-columns: 120px 1fr; gap: 12px; }
  .bb-loro .loro { width: 120px; }
  .bb-bocadillo { padding: 12px 14px; }
  .mz-tablero { gap: 36px; padding: 12px; }
  .mz-pal { min-height: 50px; font-size: .98rem; padding: .3em .5em; }
  .mz-pal.conectada::after { width: 22px; height: 22px; font-size: .75rem; }
  .panel-caja { grid-template-columns: auto 1fr; padding: 12px 14px; }
  .panel-icono { width: 40px; height: 40px; font-size: 1.3rem; }
  .panel-botones { grid-column: 1 / -1; flex-direction: row; }
  .panel-botones .btn { flex: 1; }
  .panel-titulo { font-size: 1.1rem; }
  .res-cabecera { grid-template-columns: 1fr; }
  .res-doctor .doctor { width: 140px; margin: 0 auto; }
  .zona-intro { grid-template-columns: 1fr; text-align: center; }
  .zona-ilus-grande .ico { width: 90px; height: 90px; }
  .zona-datos, .zona-progreso { justify-content: center; }
  .tabla-ranking .col-est, .tabla-ranking .col-fecha { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .tarjetas-3, .mapa-zonas { grid-template-columns: 1fr; }
  .tarjeta-modo:last-child, .tarjeta-nivel:last-child { grid-column: auto; }
  .zona-btn { flex-direction: row; flex-wrap: wrap; text-align: left; padding: 12px 14px 12px 52px; justify-content: flex-start; }
  .zona-num { top: 50%; transform: translateY(-50%); }
  .zona-ilus { width: 64px; height: 64px; }
  .zona-ilus .ico { width: 58px; height: 58px; }
  .zona-ilus .candado { width: 34px; height: 34px; }
  .zona-nombre { font-size: 1.1rem; flex: 1 1 140px; }
  .zona-estado { flex-basis: 100%; }
  .zona-barra { width: 100%; }
  .menu-fila { grid-template-columns: 1fr 1fr; }
  .btn { font-size: 1.05rem; min-height: 52px; padding: .5em 1em; }
  .matraz-btn, .comida { padding: 10px 4px 12px; border-radius: 18px; }
  .tecla { display: none; }
  .ilus-modo { height: 90px; } .ilus-modo .ico { width: 64px; height: 64px; }
}
@media (max-width: 420px) {
  .titulo-juego { font-size: clamp(2rem, 10.2vw, 2.6rem); -webkit-text-stroke-width: 1.5px; }
  .juego-cuerpo { gap: 10px; margin-top: 10px; }
  .juego-doctor { grid-template-columns: 58px 1fr; }
  .juego-doctor .doctor { width: 58px; }
  .reto { margin-bottom: 8px; }
  .maquina { padding: 38px 36px 14px; min-height: 0; margin-bottom: 26px; border-radius: 22px; }
  .maq-luces { top: 12px; } .maq-luces span { width: 12px; height: 12px; }
  .maq-tubo { width: 16px; height: 60%; } .maq-tubo-i { left: 10px; } .maq-tubo-d { right: 10px; }
  .placa-palabra { font-size: clamp(1.6rem, 9vw, 2.2rem); }
  .matraz-svg { width: 50px; height: 60px; }
  .matraz-btn { gap: 2px; padding: 8px 4px 10px; }
  .comida-bola { width: 54px; height: 54px; }
  .bb-escena { grid-template-columns: 96px 1fr; }
  .bb-loro .loro { width: 96px; }
  .mz-tablero { gap: 28px; padding: 10px; }
  .mz-col { gap: 9px; }
  .mz-pal { min-height: 46px; font-size: .9rem; border-radius: 12px; }
}
@media (hover: none) { .tecla { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .burbujas-fondo, .particula, .confeti { display: none; }
}
