/* Nara: interfaz moderna sobre el juego de píxel. Bosque de noche: verdes profundos, pergamino y oro. */
:root {
  --bg: #0d1a1c; --bg2: #08110f; --panel: #fbf3df; --panel2: #efe2c2; --ink: #22301f; --muted: #6f7a62; --line: rgba(34,48,31,.14);
  --gold: #ffcb3c; --gold-d: #b8860b; --leaf: #8ad04a; --leaf-d: #3f7a26; --berry: #ff5a6e; --sky: #6fd2ff;
  --font: 'Fredoka', 'Baloo 2', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif; --pix: 'Fredoka', 'Baloo 2', ui-rounded, sans-serif; --pixlogo: 'Pixelify Sans', 'Fredoka', monospace;   /* letra de píxel solo en el logotipo: en tamaños pequeños la C parecía una O */
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg2); color: #fff; font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
#wrap { position: relative; width: 100vw; height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #142a26, var(--bg2) 75%); }
#stage { position: relative; flex: none; }
#game { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; background: #10162a; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
img.px.dim { opacity: .35; }
img.px.big { width: 28px; height: 28px; } img.px.huge { width: 96px; height: 96px; }

/* ---------- Botones ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 50px; padding: .45em 1.3em; border-radius: 16px; font-size: 1.12rem; font-weight: 700; color: #3a2400; text-decoration: none;
  background: linear-gradient(180deg, #ffe58a, var(--gold) 55%, #f0a500); box-shadow: 0 5px 0 var(--gold-d), 0 10px 22px rgba(255,190,40,.3), inset 0 2px 0 rgba(255,255,255,.55); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-d), inset 0 2px 0 rgba(255,255,255,.55); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn.mint { color: #082e14; background: linear-gradient(180deg, #c6ff9a, var(--leaf) 55%, #4ea52a); box-shadow: 0 5px 0 var(--leaf-d), 0 10px 22px rgba(138,208,74,.35), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.mint:active { box-shadow: 0 1px 0 var(--leaf-d), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.ghost { color: var(--ink); background: #fff; box-shadow: 0 4px 0 #d8cba8, inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8cba8, inset 0 0 0 2px var(--line); }
.btn.big { min-height: 60px; font-size: 1.4rem; padding: .4em 1.8em; border-radius: 20px; }
.btn.small { min-height: 40px; font-size: .95rem; padding: .3em .9em; border-radius: 12px; }
.btn[disabled] { filter: grayscale(.7) brightness(.85); pointer-events: none; }
.ad-ico { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.15em; padding: 0 .25em; border-radius: 5px; background: rgba(0,0,0,.18); font-size: .68em; font-weight: 700; }
.icon-btn { position: relative; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--ink); background: rgba(251,243,223,.94); box-shadow: 0 4px 0 rgba(0,0,0,.25), inset 0 0 0 2px var(--line); }
.icon-btn:active { transform: translateY(2px) scale(.96); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- Marcador (dentro del escenario) ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; font-family: var(--pix); }
#hud > * { position: absolute; }
.hud-left { left: calc(8px + var(--safe-l)); top: 8px; display: flex; flex-direction: column; gap: 4px; }
.hud-hearts, .hud-items { display: flex; gap: 3px; align-items: center; padding: 3px 7px; border-radius: 10px; background: rgba(8,12,20,.55); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); width: max-content; }
.hud-hearts img.px { width: 20px; height: 20px; } .hud-items:empty { display: none; } .hud-items img.px { width: 18px; height: 18px; }
.hud-hearts.hit { animation: shakeX .35s; }
.hud-mid { left: 50%; top: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.hud-level b { display: block; font-size: 1rem; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0,0,0,.6); white-space: nowrap; }
.hud-level span { display: inline-block; margin-top: 2px; font-size: .72rem; color: #fff; padding: 1px 8px; border-radius: 8px; background: rgba(8,12,20,.5); text-shadow: 0 1px 0 rgba(0,0,0,.6); }   /* legible sobre cualquier cielo */
.hud-combo { opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.2,1.6,.4,1); display: flex; flex-direction: column; align-items: center; }
.hud-combo.on { opacity: 1; transform: scale(1); }
.hud-combo b { font-size: 1.5rem; color: var(--gold); text-shadow: 0 3px 0 #7a4a00, 0 0 14px rgba(255,200,60,.6); }
.hud-combo.hot b { color: #ff9fb0; text-shadow: 0 3px 0 #7a1030, 0 0 16px rgba(255,90,140,.7); }
.hud-combo i { display: block; height: 3px; width: 80px; border-radius: 3px; background: var(--gold); margin-top: 2px; transition: width .1s linear; }
.hud-msg { font-size: 1rem; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.7); opacity: 0; transition: opacity .2s; padding: 2px 10px; border-radius: 8px; background: rgba(8,12,20,.5); }
.hud-msg.on { opacity: 1; animation: rise .3s ease-out; }
.hud-right { right: calc(8px + var(--safe-r)); top: 8px; display: flex; align-items: flex-start; gap: 6px; }
.hud-stats { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.hud-stats span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: rgba(8,12,20,.55); font-size: 1rem; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); }
.hud-coins b { color: var(--gold); }
.hud-time { display: flex; flex-direction: column; align-items: flex-end; padding: 3px 8px; border-radius: 10px; background: rgba(8,12,20,.55); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); font-variant-numeric: tabular-nums; }
.hud-time .t { color: var(--gold); font-size: 1rem; } .hud-time .tw { display: flex; align-items: center; gap: 3px; color: var(--gold); } .hud-time .tw svg { width: .8rem; height: .8rem; } .hud-time .t.low { color: #ff7a6a; animation: pulse .6s ease-in-out infinite alternate; } .hud-time .sc { font-size: .85rem; }
.hud-pause { pointer-events: auto; width: 40px; height: 40px; }
.hud-boss { left: 50%; bottom: 10px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 3px; }
.hud-boss.on { display: flex; animation: rise .35s ease-out; }
.hud-boss span { font-size: .95rem; color: #ffd0d8; text-shadow: 0 2px 0 rgba(0,0,0,.7); }
.hud-boss .bar { width: 180px; height: 10px; border-radius: 6px; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); overflow: hidden; }
.hud-boss .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff3b5c, #ff9a4a); transition: width .2s; }
#hud.demo { display: none !important; }
@media (min-width: 1000px) and (min-height: 560px) { #hud { zoom: 1.35; } }   /* en pantallas grandes, el marcador crece con el juego */
@media (min-width: 1600px) and (min-height: 860px) { #hud { zoom: 1.6; } }
.bump { animation: bump .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 40% { transform: scale(1.22); } }
@keyframes shakeX { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

/* Ficha del nivel */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.level-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(ellipse at center, rgba(8,16,14,.88), rgba(4,8,8,.95)); text-align: center; animation: fadeIn .3s ease-out; padding: 0 20px; }
.level-card.out { animation: fadeOut .3s ease-in forwards; }
.lc-num { font-family: var(--pix); font-size: 1rem; color: #0d2a0a; background: var(--leaf); padding: .15em .9em; border-radius: 99px; box-shadow: 0 3px 0 var(--leaf-d); animation: rise .4s .05s both cubic-bezier(.2,1.4,.4,1); }
.lc-name { font-family: var(--pix); font-weight: 700; font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1.05; color: #fff; text-shadow: 0 4px 0 #1f4a1a, 0 0 24px rgba(138,208,74,.35); animation: rise .45s .12s both cubic-bezier(.2,1.4,.4,1); }
.lc-tip { max-width: 560px; font-size: 1rem; color: var(--gold); animation: rise .45s .2s both; }
.lc-lives { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pix); font-size: 1.2rem; animation: rise .45s .28s both; }

/* ---------- Mandos táctiles ---------- */
#pad { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
body:not([data-screen=""]) #pad, body:not(.playing) #pad { display: none !important; }
#stick { position: absolute; left: 0; top: 30%; bottom: 0; width: 44%; pointer-events: auto; touch-action: none; }
#stick .base { position: absolute; left: calc(24px + var(--safe-l)); bottom: calc(20px + var(--safe-b)); width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.06), rgba(255,255,255,.16)); box-shadow: inset 0 0 0 3px rgba(255,255,255,.45); opacity: .7; }
#stick.active .base { opacity: 1; }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #fffaf0, #e8dcc0); box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 8px 16px rgba(0,0,0,.3); }
#btns button { pointer-events: auto; position: absolute; border-radius: 50%; color: #fff; font: 700 22px/1 var(--pix); touch-action: none; padding: 0; opacity: .82; box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 8px 18px rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.4); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
#btns button.on { opacity: 1; transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.4); }
#abtn { right: calc(18px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); width: 76px; height: 76px; background: radial-gradient(circle at 38% 32%, #ff9a9a, #e0303a 60%, #a01020); }
#bbtn { right: calc(104px + var(--safe-r)); bottom: calc(28px + var(--safe-b)); width: 60px; height: 60px; background: radial-gradient(circle at 38% 32%, #e6eaf6, #8a90b0 60%, #4a5070); }
#sbtn { right: calc(40px + var(--safe-r)); bottom: calc(110px + var(--safe-b)); width: 58px; height: 58px; background: radial-gradient(circle at 38% 32%, #fff0a0, #e8b020 60%, #9a6a10); }

/* ---------- Pantallas ---------- */
#screens { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#screens > .screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l)); animation: fadeIn .25s ease-out; pointer-events: auto; }
#screens > .screen.out { animation: fadeOut .17s ease-in forwards; pointer-events: none; }
.screen.modal { justify-content: center; justify-content: safe center; background: rgba(4,10,10,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; }
.screen.modal.soft { background: linear-gradient(180deg, rgba(4,10,10,.2), rgba(4,10,10,.6)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card { width: min(420px, 100%); background: var(--panel); color: var(--ink); border-radius: 24px; padding: 20px 20px 18px; box-shadow: 0 8px 0 var(--panel2), 0 24px 60px rgba(0,0,0,.4); text-align: center; animation: rise .38s cubic-bezier(.2,1.4,.4,1); }
.card h2 { margin: 0 0 6px; font-family: var(--pix); font-size: 1.8rem; line-height: 1.1; }
.sub { margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.toast { padding: 10px 16px; border-radius: 14px; background: rgba(251,243,223,.96); color: var(--ink); font-weight: 600; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: rise .3s ease-out, fadeOut .4s 2.2s forwards; }
#toasts { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 9; width: max-content; max-width: calc(100% - 24px); }

/* Portada */
.title-screen { justify-content: flex-start; background: linear-gradient(180deg, rgba(4,10,20,.35), transparent 40%, transparent 62%, rgba(4,10,10,.55)); }
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; flex-direction: column; align-items: center; margin-top: 1vh; }
.logo h1 { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .9; }
.logo .l1 { font-family: var(--pixlogo); font-weight: 700; font-size: clamp(3.6rem, 13vw, 7rem); letter-spacing: .04em; background: linear-gradient(180deg, #e6ffb8 10%, #9ee05a 50%, #4ea52a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 0 0 #163a12) drop-shadow(-3px 0 0 #163a12) drop-shadow(0 3px 0 #163a12) drop-shadow(0 -3px 0 #163a12) drop-shadow(0 7px 0 #0b220a) drop-shadow(0 14px 20px rgba(0,0,0,.5)); animation: float 3.2s ease-in-out infinite; padding: 0 .08em; }
.logo .l2 { margin-top: 8px; font-family: var(--pix); font-size: clamp(1rem, 3.4vw, 1.6rem); color: var(--gold); text-shadow: 0 3px 0 #5a3a00, 0 0 18px rgba(255,200,60,.35); }
@keyframes float { 50% { transform: translateY(-5px); } }
.title-bottom { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.best-line { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 1rem; font-weight: 600; background: rgba(251,243,223,.94); padding: .25em .9em; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.best-line svg { width: 18px; height: 18px; color: var(--gold-d); }
.menu-row { display: flex; gap: 10px; }
.menu-btn { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 14px; font-weight: 600; font-size: .95rem; color: var(--ink); background: rgba(251,243,223,.94); box-shadow: 0 4px 0 rgba(0,0,0,.22); }
.menu-btn svg { width: 20px; height: 20px; color: var(--leaf-d); }
.menu-btn:active { transform: translateY(2px); }

/* Mapa: cabecera y ficha (el mundo lo pinta el lienzo) */
.map-screen { pointer-events: none !important; justify-content: space-between; }
.map-screen > * { pointer-events: auto; }
.map-head { width: 100%; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 10px; }
.map-title { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 16px 8px; border-radius: 16px; background: rgba(8,16,24,.62); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.15); }
.map-title h2 { margin: 0; font-family: var(--pix); font-size: 1.3rem; text-shadow: 0 2px 0 rgba(0,0,0,.5); white-space: nowrap; }
.map-prog { position: relative; width: 200px; height: 16px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.map-prog i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--leaf), #d6ff9a); }
.map-prog span { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; font-size: .72rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.map-card { width: min(520px, 100%); padding: 10px 12px 12px; text-align: left; }
.mc-top { display: flex; gap: 10px; align-items: center; }
.mc-num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--pix); font-weight: 700; font-size: 1.2rem; background: var(--leaf); color: #0d2a0a; box-shadow: 0 3px 0 var(--leaf-d); }
.mc-num.boss { background: var(--gold); color: #5a3a00; box-shadow: 0 3px 0 var(--gold-d); } .mc-num svg { width: 22px; height: 22px; }
.mc-sub { font-size: .78rem; font-weight: 700; color: var(--leaf-d); text-transform: uppercase; letter-spacing: .05em; }
.map-card h3 { margin: 0; font-family: var(--pix); font-size: 1.25rem; line-height: 1.1; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mc-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--panel2); font-weight: 600; font-size: .82rem; }
.mc-tags svg { width: 14px; height: 14px; } .mc-tags .best { background: #fff1c2; color: #8a5a00; } .mc-tags .ok { background: #d9f5c4; color: #2d6a1a; }
.mc-gear { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--pix); }
.mc-gear span { display: inline-flex; align-items: center; gap: 3px; }
.mc-nav { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; align-items: center; }
.mc-nav .btn { min-height: 46px; }

/* Fin de nivel, sin vidas, final */
.end-card .cause { font-family: var(--pix); font-weight: 700; color: var(--berry); font-size: 1.2rem; }
.end-card .cause.win, .ending .cause.win { color: var(--leaf-d); font-size: 1.4rem; }
.final { font-family: var(--pix); font-weight: 700; font-size: clamp(2.6rem, 10vw, 3.4rem); line-height: 1; margin: 4px 0 6px; color: var(--ink); }
.final.record { background: linear-gradient(180deg, #ffd166, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rec { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; padding: 3px 12px; border-radius: 99px; background: #fff1c2; color: #8a5a00; font-weight: 700; }
.rec svg { width: 16px; height: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 4px; }
.stats div { padding: 6px 2px; border-radius: 12px; background: var(--panel2); }
.stats b { display: flex; align-items: center; justify-content: center; gap: 3px; font-family: var(--pix); font-size: 1rem; }
.stats span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.big-lives { display: flex; justify-content: center; gap: 4px; margin: 6px 0; } .big-lives img.px { width: 34px; height: 34px; } .big-lives.off img.px { filter: grayscale(1) opacity(.35); }
.revive-slot:not(:empty) { margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.revive-slot .hint { font-size: .82rem; color: var(--muted); }
.end-side .col { gap: 10px; }
.ending .end-nara { margin: 6px 0; animation: float 2.4s ease-in-out infinite; }

/* Paneles */
.panel-screen { background: var(--bg); }
.panel-head { width: min(640px, 100%); display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; text-align: center; font-family: var(--pix); font-size: 1.6rem; }
.panel-body { width: min(640px, 100%); flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: calc(24px + var(--safe-b)); }
.settings { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--panel); color: var(--ink); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel2); flex-wrap: wrap; justify-content: flex-end; }
.seg button { min-height: 34px; padding: 0 10px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--gold); color: #3a2400; }
.slider { display: flex; align-items: center; gap: 10px; } .slider input { width: 160px; accent-color: var(--leaf-d); } .slider b { width: 1.6em; text-align: right; font-family: var(--pix); }
.links { text-align: center; font-size: .85rem; color: var(--muted); margin: 0; } .links a { color: var(--leaf-d); }
.settings .b-erase { align-self: center; }
.keys { display: grid; gap: 6px; margin-bottom: 12px; padding: 14px; border-radius: 20px; background: var(--panel); color: var(--ink); }
.keys div { display: flex; align-items: center; gap: 10px; } .keys kbd { min-width: 92px; text-align: center; font-family: var(--pix); padding: 3px 8px; border-radius: 8px; background: var(--panel2); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.howto { background: var(--panel); color: var(--ink); border-radius: 20px; padding: 6px 20px 14px; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.howto h1 { font-size: 1.25rem; } .howto h2 { font-size: 1.1rem; color: var(--leaf-d); margin-bottom: 4px; } .howto ul { padding-left: 1.2em; margin-top: 4px; }

/* Volver al portal */
.home-link { text-decoration: none; width: auto; display: inline-flex; align-items: center; padding: 0 10px 0 4px; }
.home-link .chev { width: 18px; height: 18px; } .home-link .fizz-logo { width: 28px; height: 28px; } .home-btn .fizz-logo { width: 24px; height: 24px; }
.pause-row { flex-wrap: nowrap; } .pause-row .b-restart { flex: 1; min-width: 0; }

/* Anuncio simulado (pruebas locales) */
.dev-ad { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.75); }
.dev-ad-box { width: min(340px, 90%); padding: 20px; border-radius: 20px; background: #111; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.dev-ad-tag { font-size: .8rem; color: #aaa; }
.dev-ad-art { width: 100%; aspect-ratio: 16/9; border-radius: 12px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #333 0 12px, #2a2a2a 12px 24px); font-size: 2rem; font-weight: 700; }
.dev-ad .btn.ghost { background: #333; color: #fff; box-shadow: none; }

/* Carga */
#loader { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg2); z-index: 20; transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-leaf { width: 40px; height: 40px; border-radius: 0 50% 0 50%; background: linear-gradient(135deg, #c6ff9a, var(--leaf-d)); animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { padding: 20px; text-align: center; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* Pantallas bajas (móvil en horizontal) */
@media (max-height: 520px) {
  .btn.big { min-height: 48px; font-size: 1.15rem; }
  .card { padding: 12px 16px; } .card h2 { font-size: 1.35rem; }
  .logo .l1 { font-size: 3.6rem; } .logo .l2 { font-size: 1.05rem; margin-top: 4px; }
  .icon-btn { width: 40px; height: 40px; }
  .hud-level b { font-size: .85rem; } .hud-hearts img.px { width: 16px; height: 16px; } .hud-stats span, .hud-time .t { font-size: .85rem; } .hud-time .sc { font-size: .72rem; } .hud-pause { width: 34px; height: 34px; }
  .hud-combo b { font-size: 1.2rem; }
  .end-card { width: min(640px, 100%); display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; align-items: center; }
  .end-card .final { font-size: 2.3rem; } .stats { grid-template-columns: repeat(2, 1fr); } .revive-slot .hint { display: none; }
  .map-card { width: min(720px, 100%); padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'top nav' 'tags nav'; column-gap: 12px; align-items: center; } .mc-top { grid-area: top; } .mc-tags { grid-area: tags; margin: 4px 0 0; } .mc-gear { display: none; } .mc-nav { grid-area: nav; grid-template-columns: 40px auto 40px; } .mc-nav .btn { min-height: 44px; padding: .3em 1em; } .mc-num { width: 34px; height: 34px; font-size: 1rem; } .map-card h3 { font-size: 1.05rem; } .map-title h2 { font-size: 1.05rem; } .map-prog { height: 14px; width: 160px; }
  .lc-name { font-size: 2rem; }
  #stick .base { width: 100px; height: 100px; left: calc(16px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); }
  #abtn { width: 66px; height: 66px; bottom: calc(14px + var(--safe-b)); } #bbtn { width: 52px; height: 52px; right: calc(92px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); } #sbtn { width: 50px; height: 50px; right: calc(34px + var(--safe-r)); bottom: calc(92px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { .logo .l1, .ending .end-nara { animation: none; } }

@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
.over-pearls { display: inline-flex; gap: 3px; vertical-align: middle; } .over-pearls img.px { width: 22px; height: 22px; }
