*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
body{background:#050a24 radial-gradient(ellipse at 50% 0,#1b2862,#050a24 65%) no-repeat;color:#f4f0e4;font:17px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif;min-height:100vh}
header{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.7rem 1rem;max-width:1100px;margin:auto}
header a,.fuente a{color:#ffdf8e;text-decoration:none}
button,.boton{font:inherit;font-size:.95rem;color:#f4f0e4;background:rgba(255,255,255,.07);border:1px solid rgba(255,223,142,.35);border-radius:999px;padding:.55rem 1.05rem;min-height:44px;cursor:pointer;text-decoration:none;display:inline-block;text-align:center}
button[aria-pressed=true]{background:#ffdf8e;color:#14163a}
button:disabled{opacity:.35;cursor:default}
.principal{background:linear-gradient(135deg,#ffe6a3,#e8ae45);color:#1b1534;border:0;font-weight:700}
:focus-visible{outline:3px solid #fff;outline-offset:2px}
#titulo:focus{outline:0}
main{max-width:1100px;margin:auto;padding:0 .8rem 2rem}
h1{font:600 clamp(1.7rem,5vw,2.5rem)/1.15 Georgia,"Times New Roman",serif;text-align:center;color:#ffdf8e;margin:.2rem 0 .9rem}
h1 span{display:block;font:400 .95rem/1.5 system-ui,sans-serif;color:#c9c8ee}
#escenario{position:relative;aspect-ratio:1;border-radius:22px;overflow:hidden;border:1px solid rgba(255,223,142,.3);box-shadow:0 20px 60px rgba(0,0,0,.55),0 0 40px rgba(255,200,90,.1)}
#dibujo{display:block;width:100%;height:100%;touch-action:manipulation}
#dibujo.entra{animation:entra .9s ease both}
.fig{cursor:pointer;outline:none}
.fig:hover,.fig:focus-visible{filter:drop-shadow(0 0 7px #ffe29a)}
.toque{fill:transparent}
[fill="url(#halo)"],[fill="url(#calor)"]{pointer-events:none}
.onda{pointer-events:none;fill:none;stroke:#fff3c4;stroke-width:2;animation:onda 2.2s ease-out infinite;transform-box:fill-box;transform-origin:center}
.centro{fill:#fff8d8;stroke:#e8ae45;stroke-width:1.5}
.reto{cursor:pointer;outline:none}
.reto:focus-visible{filter:drop-shadow(0 0 7px #fff)}
.reto.hallado{filter:drop-shadow(0 0 10px #ffe29a)}
#modo{font-size:.85rem;line-height:1.4;color:#1b1534;background:#ffdf8e;border-radius:12px;padding:.45rem .8rem;margin-bottom:.5rem}
#juego{scroll-margin-top:.5rem}
#retos{display:flex;flex-wrap:wrap;justify-content:center;gap:.2rem .9rem;font-size:.85rem;color:#c9c8ee;margin-top:.55rem}
#retos>span:first-child{color:#ffdf8e;font-weight:700}
#medalla{text-align:center;border:2px solid #ffdf8e;border-radius:16px;padding:.9rem;margin:.6rem 0;background:rgba(255,223,142,.1)}
#medalla button{margin-top:.5rem}
body.narrador #texto p{font-size:1.35rem;line-height:1.55}
#final p{text-align:center;color:#ffdf8e}
details.fuente summary{cursor:pointer;min-height:32px;color:#ffdf8e}
details.fuente p{margin-top:.4rem}
.fig.vista>.destello{display:none}
.titila{animation:titila 3.2s ease-in-out infinite}.t1{animation-delay:.8s}.t2{animation-delay:1.6s}.t3{animation-delay:2.4s}
.guia{animation:brilla 3s ease-in-out infinite}
.llama{animation:llama .45s ease-in-out infinite alternate}
.ventana{animation:titila 4s ease-in-out infinite}
#ficha{position:absolute;left:.6rem;right:.6rem;bottom:.6rem;background:rgba(12,16,48,.95);border:1px solid #ffdf8e;border-radius:16px;padding:.9rem 3.2rem .8rem 1rem;max-height:calc(100% - 1.2rem);overflow:auto;animation:sube .3s ease both}
#ficha h3{font:600 1.25rem Georgia,serif;color:#ffdf8e}
#ficha p{font-size:.95rem;line-height:1.5}
#ficha small{display:block;margin-top:.4rem;color:#a9a8d6;font-size:.75rem}
#ficha-cerrar{position:absolute;top:.5rem;right:.5rem;width:44px;padding:0}
#relato{padding:1rem .3rem 0}
#aviso{grid-column:1/-1;font-size:.82rem;line-height:1.45;color:#c9c8ee;background:rgba(255,255,255,.05);border:1px solid rgba(255,223,142,.25);border-radius:12px;padding:.55rem .8rem;margin-bottom:.8rem}
#aviso strong{color:#ffdf8e}
.meta{color:#a9a8d6;font-size:.85rem;text-transform:uppercase;letter-spacing:.06em}
h2{font:600 1.7rem/1.25 Georgia,serif;margin:.15rem 0 .6rem}
#texto p{margin-bottom:.7rem}
body.peques #texto p{font-size:1.28rem;line-height:1.55}
.pista{color:#ffdf8e;font-size:.9rem}
nav{display:flex;gap:.6rem;margin-top:1rem}
nav button{flex:1}
#puntos{display:flex;justify-content:center;flex-wrap:wrap;margin:.6rem 0}
#puntos button{width:34px;min-height:34px;padding:0;border:0;background:none;position:relative}
#puntos button::after{content:"";position:absolute;inset:12px;border-radius:50%;background:#59598f}
#puntos button[aria-current=step]::after{inset:10px;background:#ffdf8e;box-shadow:0 0 10px #ffdf8e}
#final{display:flex;flex-direction:column;gap:.6rem;margin:.4rem 0 1rem}
.fuente{font-size:.78rem;color:#9796c4;margin-top:1rem}
@media (min-width:900px){
  main{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);column-gap:1.8rem;align-items:start}
  h1{grid-column:1/-1}
  #juego{width:100%;max-width:max(420px,calc(100vh - 300px));justify-self:end}
  #relato{padding-top:0}
}
@keyframes entra{from{opacity:0;transform:scale(1.04)}to{opacity:1;transform:none}}
@keyframes sube{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@keyframes onda{0%{transform:scale(.45);opacity:1}100%{transform:scale(1.7);opacity:0}}
@keyframes titila{50%{opacity:.35}}
@keyframes brilla{50%{opacity:.75}}
@keyframes llama{to{transform:scale(1.07,.92) skewX(4deg)}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}
