/* Balcony Splash: estilos de la interfaz (verano: mar turquesa, coral y arena). El juego se dibuja en el lienzo 3D (#c). */
:root {
  --bg: #0f2a4a; --bg2: #0a1d36; --panel: #fffaf0; --panel2: #f3ead8; --ink: #1d2b4a; --muted: #6b7591; --line: rgba(29,43,74,.12);
  --accent: #ffb703; --accent2: #ff6b6b; --accent-text: #3a2400; --sea: #19b3d6; --sea2: #0b7fb3; --mint: #2fcf8f; --danger: #ff4d6d;
  --font: 'Fredoka', 'Baloo 2', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --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(--bg); 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; }
#app { position: fixed; inset: 0; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.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(--accent); outline-offset: 3px; }
a { color: var(--sea2); }

/* ---------- Botones ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 52px; padding: .5em 1.3em; border-radius: 18px; font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; color: var(--accent-text); text-decoration: none;
  background: linear-gradient(180deg, #ffe08a, var(--accent) 55%, #f29500); box-shadow: 0 5px 0 #b86a00, 0 10px 22px rgba(255,170,0,.35), 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 #b86a00, inset 0 2px 0 rgba(255,255,255,.55); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn.mint { color: #053b26; background: linear-gradient(180deg, #a7ffd8, var(--mint) 55%, #18a56c); box-shadow: 0 5px 0 #0b6e47, 0 10px 22px rgba(47,207,143,.35), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.mint:active { box-shadow: 0 1px 0 #0b6e47, inset 0 2px 0 rgba(255,255,255,.6); }
.btn.ghost { color: var(--ink); background: #fff; box-shadow: 0 4px 0 #d9cfbb, inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9cfbb, inset 0 0 0 2px var(--line); }
.btn.big { min-height: 62px; font-size: 1.45rem; padding: .45em 1.8em; border-radius: 22px; }
.btn.small { min-height: 40px; font-size: .95rem; padding: .3em .9em; border-radius: 13px; }
.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: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--ink); background: rgba(255,250,240,.92); box-shadow: 0 4px 0 rgba(0,0,0,.18), inset 0 0 0 2px var(--line); }
.icon-btn:active { transform: translateY(2px) scale(.96); }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Marcador ---------- */
#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; z-index: 2; }
#hud > * { pointer-events: auto; }
.hud-left, .hud-right, .hud-mid { display: flex; align-items: center; gap: 8px; }
.hud-left { flex-direction: column; align-items: flex-start; gap: 5px; }
.hud-mid { position: absolute; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); }
.hud-lives { display: flex; align-items: center; gap: 2px; height: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.hud-lives svg { width: 26px; height: 26px; }
.hud-lives b { font-size: 1.2rem; text-shadow: 0 2px 0 rgba(0,0,0,.4); margin-left: 3px; }
.hp { width: 120px; height: 13px; border-radius: 99px; background: rgba(10,20,40,.55); box-shadow: inset 0 0 0 2px rgba(255,255,255,.85); overflow: hidden; }
.hp i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(180deg, #8affc1, #22c47a); transition: width .25s; }
.hp.low i { background: linear-gradient(180deg, #ffa3a3, #ff3b3b); animation: blink .6s infinite; }
.hp.hit { animation: shakeX .3s; }
.pill-box, .hud-time, .hud-ice { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border-radius: 14px; background: rgba(255,250,240,.92); color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.18); font-weight: 700; font-size: 1.3rem; }
.hud-time svg { width: 22px; height: 22px; color: var(--sea2); }
.hud-time b { min-width: 2.1ch; text-align: center; font-variant-numeric: tabular-nums; }
.hud-time.low { color: #fff; background: var(--danger); animation: pulse .5s ease-in-out infinite alternate; }
.hud-time.low svg { color: #fff; }
.hud-ice svg { width: 26px; height: 26px; }
.hud-turbo { display: none; align-items: center; gap: 5px; height: 40px; padding: 0 10px 0 6px; border-radius: 14px; background: linear-gradient(90deg, #ff3d9a, #ff8a3d); box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 0 18px rgba(255,61,154,.6); }
.hud-turbo.on { display: inline-flex; animation: rise .25s cubic-bezier(.2,1.5,.4,1); }
.hud-turbo svg { width: 26px; height: 26px; }
.hud-turbo i { display: block; width: 46px; height: 8px; border-radius: 9px; background: #fff; transition: width .2s linear; }
.bump { animation: bump .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes shakeX { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
@keyframes blink { 50% { opacity: .55; } }
@keyframes pulse { to { transform: scale(1.08); } }

/* ---------- Bocadillos y textos ---------- */
#fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.bubble { position: absolute; left: 0; top: 0; padding: 3px 9px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700; font-size: .9rem; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.2); will-change: transform; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.bubble.warn { background: #ffe066; } .bubble.warn::after { border-top-color: #ffe066; }
.bubble.stop { background: var(--danger); color: #fff; } .bubble.stop::after { border-top-color: var(--danger); }
.bubble.cheer { background: var(--mint); color: #053b26; } .bubble.cheer::after { border-top-color: var(--mint); }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.25rem; color: var(--c, #fff); white-space: nowrap; -webkit-text-stroke: 1px rgba(0,0,0,.35); text-shadow: 0 3px 0 rgba(0,0,0,.35); animation: popUp 1.2s ease-out forwards; }
.pop.big { font-size: 1.9rem; color: #fff; -webkit-text-stroke: 2px #b8460b; text-shadow: 0 4px 0 #7a2508, 0 0 18px rgba(255,180,40,.7); }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -120%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(.95); } }
.level-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; animation: cardIn 2.2s cubic-bezier(.2,1.2,.4,1) forwards; white-space: nowrap; }
.lc-isl { display: inline-block; font-weight: 700; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--accent); padding: .2em .9em; border-radius: 99px; box-shadow: 0 3px 0 #b86a00; }
.lc-name { margin-top: 8px; font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 700; line-height: 1.05; color: #fff; -webkit-text-stroke: 2px var(--sea2); text-shadow: 0 5px 0 #08507a, 0 10px 26px rgba(0,0,0,.35); }
.lc-goal { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; font-size: 1.1rem; background: rgba(8,30,60,.6); padding: .25em .9em; border-radius: 99px; }
.lc-goal svg { width: 22px; height: 22px; color: #7fe0ff; }
@keyframes cardIn { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(.96); } }

/* ---------- Avisos ---------- */
#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); }
.toast { padding: 10px 16px; border-radius: 14px; background: rgba(255,250,240,.96); color: var(--ink); font-weight: 600; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: rise .3s ease-out, fadeOut .4s 2.2s forwards; }

/* ---------- Mandos táctiles ---------- */
#pad { position: absolute; inset: 0; z-index: 1; display: flex; touch-action: none; }
.pad-zone { flex: 1; position: relative; }
.stick { position: absolute; left: calc(26px + var(--safe-l)); bottom: calc(22px + var(--safe-b)); width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,.2)); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55), 0 6px 18px rgba(0,0,0,.2); transition: opacity .2s; opacity: .75; }
.stick.active { opacity: 1; }
.knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e8e2d6); box-shadow: 0 5px 0 rgba(0,0,0,.25), 0 8px 18px rgba(0,0,0,.25); transition: transform .05s; }
.ar { position: absolute; width: 0; height: 0; border: 8px solid transparent; opacity: .7; }
.ar.l { left: 8px; top: 50%; margin-top: -8px; border-right: 10px solid #fff; border-left: 0; }
.ar.r { right: 8px; top: 50%; margin-top: -8px; border-left: 10px solid #fff; border-right: 0; }
.ar.u { top: 8px; left: 50%; margin-left: -8px; border-bottom: 10px solid #fff; border-top: 0; }
.ar.d { bottom: 8px; left: 50%; margin-left: -8px; border-top: 10px solid #fff; border-bottom: 0; }
.stick[data-dir*="l"] .ar.l, .stick[data-dir*="r"] .ar.r, .stick[data-dir*="u"] .ar.u, .stick[data-dir*="d"] .ar.d { opacity: 1; filter: drop-shadow(0 0 6px var(--accent)); }
.jump-btn { position: absolute; right: calc(28px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; color: var(--accent-text); background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--accent) 60%, #f29500); box-shadow: 0 7px 0 #b86a00, 0 12px 26px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.6); opacity: .9; transition: transform .06s, box-shadow .06s; }
.jump-btn.down { transform: translateY(5px) scale(.96); box-shadow: 0 2px 0 #b86a00, inset 0 3px 0 rgba(255,255,255,.6); }

/* ---------- 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(6,20,40,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; }
.screen.modal.soft { background: linear-gradient(180deg, rgba(6,20,40,.1), rgba(6,20,40,.5)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card { width: min(420px, 100%); background: var(--panel); color: var(--ink); border-radius: 26px; padding: 20px 20px 18px; box-shadow: 0 8px 0 var(--panel2), 0 24px 60px rgba(0,0,0,.3); text-align: center; animation: rise .38s cubic-bezier(.2,1.4,.4,1); }
.card.wide { width: min(560px, 100%); }
.card h2 { margin: 0 0 6px; font-size: 1.8rem; line-height: 1.1; }
.sub { margin: 0 0 14px; 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; }

/* Portada */
.title-screen { justify-content: flex-start; background: linear-gradient(180deg, rgba(6,20,40,.35), transparent 40%, transparent 60%, rgba(6,20,40,.45)); }
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { text-align: center; display: flex; flex-direction: column; align-items: center; margin-top: 2vh; }
.logo h1 { margin: 0; line-height: .86; font-weight: 700; display: flex; flex-direction: column; align-items: center; transform: rotate(-3deg); }
.logo .l1 { font-size: clamp(2.6rem, 9vw, 5rem); color: #fff; letter-spacing: .02em; filter: drop-shadow(2.5px 0 0 #e2502f) drop-shadow(-2.5px 0 0 #e2502f) drop-shadow(0 2.5px 0 #e2502f) drop-shadow(0 -2.5px 0 #e2502f) drop-shadow(0 5px 0 #b8341b) drop-shadow(0 10px 14px rgba(0,0,0,.3)); }
.logo .l2 { font-size: clamp(3.4rem, 12vw, 6.6rem); background: linear-gradient(180deg, #e9fbff 10%, #6fdcff 50%, #1c9fd6); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(2.5px 0 0 #08507a) drop-shadow(-2.5px 0 0 #08507a) drop-shadow(0 2.5px 0 #08507a) drop-shadow(0 -2.5px 0 #08507a) drop-shadow(0 6px 0 #063d5e) drop-shadow(0 12px 22px rgba(0,0,0,.3)); animation: wave 3s ease-in-out infinite; padding: 0 .06em; }
@keyframes wave { 50% { transform: translateY(-4px) rotate(1.5deg); } }
.logo p { margin: 12px 0 0; color: var(--ink); font-weight: 700; font-size: clamp(.95rem, 3vw, 1.15rem); background: rgba(255,250,240,.92); padding: .3em 1em; border-radius: 999px; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.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: 1.05rem; font-weight: 600; background: rgba(255,250,240,.92); padding: .25em .9em; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.best-line svg { width: 20px; height: 20px; color: var(--sea2); }
.menu-row { display: flex; gap: 10px; }
.menu-btn { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 16px; font-weight: 600; font-size: .95rem; color: var(--ink); background: rgba(255,250,240,.92); box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.menu-btn svg { width: 22px; height: 22px; color: var(--sea2); }
.menu-btn:active { transform: translateY(2px); }

/* Elegir turista */
.char-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.char-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 12px; border-radius: 20px; background: linear-gradient(180deg, #bfefff, #fff3d6); box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #d9cfbb; color: var(--ink); transition: transform .12s; }
.char-card:hover { transform: translateY(-3px); }
.char-card.on { box-shadow: inset 0 0 0 3px var(--accent), 0 4px 0 #b86a00; }
.char-card b { font-size: 1.4rem; }
.char-card span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.portrait { width: 100%; aspect-ratio: 4 / 5; max-height: 34vh; background: center bottom / contain no-repeat; }
.portrait.fallback { background: radial-gradient(circle at 50% 30%, #ffd9b0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, var(--sea) 45%, transparent 46%); }

/* Mapa */
.map-screen { background: radial-gradient(ellipse at 50% 40%, rgba(6,30,60,.55), rgba(4,16,34,.82)); }
.map-head { width: min(1000px, 100%); display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; }
.map-title { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.map-title h2 { margin: 0; font-size: 1.6rem; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.map-prog { position: relative; width: min(260px, 70%); height: 20px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.map-prog i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #2fcf8f, #8affc1); }
.map-prog span { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; height: 100%; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.map-prog svg { width: 14px; height: 14px; }
.map-body { flex: 1; min-height: 0; width: min(1000px, 100%); display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 8px; }
.map-wrap { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.map { display: block; max-width: 100%; max-height: 100%; width: auto; height: 100%; filter: drop-shadow(0 10px 22px rgba(0,0,0,.4)); }
.map .frame { fill: none; stroke: #fff; stroke-width: 1.6; opacity: .9; }
.map .waves { animation: drift 9s linear infinite; }
@keyframes drift { to { transform: translateX(26px); } }
.map .shallow path { fill: #a8f3ff; stroke: #a8f3ff; stroke-width: 7; opacity: .75; }
.map .isl { fill: url(#land); stroke: #fffaf0; stroke-width: 1.3; stroke-linejoin: round; }
.map .tr { fill: #4f9e4c; } .map .tr-s { fill: rgba(30,70,30,.25); }
.map .isl-tag rect { fill: rgba(8,40,70,.62); }
.map .isl-tag text { font: 700 5.2px var(--font); fill: #fff; letter-spacing: .06em; text-transform: uppercase; }
.map .isl-tag .cnt { fill: #ffd166; text-anchor: end; letter-spacing: 0; }
.map .sea-name { font: italic 600 5px var(--font); fill: rgba(255,255,255,.45); text-anchor: middle; letter-spacing: .3em; text-transform: uppercase; }
.map .boat { opacity: .95; animation: bobBoat 3.2s ease-in-out infinite; transform-box: fill-box; }
.map .boat .wake { fill: none; stroke: #fff; stroke-width: .6; opacity: .6; stroke-linecap: round; }
@keyframes bobBoat { 50% { translate: 0 -1px; rotate: -3deg; } }
.map .compass circle { fill: rgba(255,255,255,.18); stroke: rgba(255,255,255,.55); stroke-width: .6; }
.map .compass .cn { fill: #ff6b6b; } .map .compass .cn2 { fill: #d64545; } .map .compass .cs { fill: rgba(255,255,255,.75); }
.map .compass text { font: 700 4.6px var(--font); fill: #fff; text-anchor: middle; }
.map .rt-done { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; opacity: .95; }
.map .rt-done.ferry { stroke-dasharray: 2.4 2.2; }
.map .rt-todo { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1; stroke-dasharray: 1.4 2; stroke-linecap: round; }
.map .node { cursor: pointer; }
.map .node .hit { fill: transparent; }
.map .node .dot { fill: var(--accent); stroke: #fff; stroke-width: 1.5; transition: transform .15s; }
.map .node text { font: 700 5.4px var(--font); fill: var(--accent-text); text-anchor: middle; pointer-events: none; }
.map .node.done .dot { fill: #2fcf8f; } .map .node.done text { fill: #053b26; }
.map .node.locked .dot { fill: #9fb2c6; stroke: rgba(255,255,255,.75); } .map .node.locked { cursor: default; }
.map .node .nl { fill: #f2f6fa; }
.map .node .nb circle { fill: #ffd166; stroke: #fff; stroke-width: .7; } .map .node .nb path { fill: #8a5a00; }
.map .node .pulse { fill: none; stroke: var(--accent); stroke-width: 1.4; animation: pulseRing 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulseRing { from { transform: scale(1); opacity: .9; } to { transform: scale(2); opacity: 0; } }
.map .node.sel .dot { transform: scale(1.22); stroke: var(--accent2); stroke-width: 1.8; }
.map .me { pointer-events: none; }
.map .me-pin .bob { animation: pinBob 1.1s ease-in-out infinite alternate; }
@keyframes pinBob { to { transform: translateY(-2px); } }
.map .pin-b, .map .pin-c { fill: var(--accent2); stroke: #fff; stroke-width: 1; }
.map .pin-c { fill: #ffe9c4; }
.map-info { flex: 0 0 300px; width: 300px; max-height: 100%; text-align: left; padding: 0 0 14px; overflow: hidden auto; }
.map-info > :not(.mi-band) { margin-left: 16px; margin-right: 16px; }
.mi-band { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: linear-gradient(90deg, var(--hc), color-mix(in srgb, var(--hc) 70%, #fff)); color: #fff; }
.mi-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; background: #fff; color: var(--hc); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.mi-isl { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.mi-nav { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 6px; margin-top: 10px; }
.mi-nav h3 { margin: 0; font-size: 1.25rem; line-height: 1.1; text-align: center; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 10px; font-size: 1.4rem; font-weight: 700; line-height: 1; background: var(--panel2); box-shadow: 0 2px 0 #d9cfbb; }
.icon-btn.small[disabled] { opacity: .3; pointer-events: none; }
.mi-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 8px; }
.mi-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--panel2); font-weight: 600; font-size: .85rem; }
.mi-tags svg { width: 16px; height: 16px; } .mi-tags .best { background: #fff1c2; color: #8a5a00; }
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; color: #b5ad9c; text-align: center; line-height: 1.1; }
.medal i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ece4d3; color: #c7bea9; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.medal i svg { width: 20px; height: 20px; }
.medal.on { color: var(--ink); } .medal.on i { background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc531 60%, #e09a00); color: #6a4300; box-shadow: 0 2px 0 #b07400, 0 0 12px rgba(255,197,49,.55); }
.mi-lives { display: flex; justify-content: center; gap: 2px; margin-bottom: 10px; }
.mi-lives svg { width: 20px; height: 20px; }
.map-info .btn { width: calc(100% - 32px); }

/* Fin de hotel */
.end-card .cause { font-weight: 700; color: var(--danger); font-size: 1.1rem; }
.end-card .cause.win { color: var(--sea2); font-size: 1.3rem; }
.big-lives { display: flex; justify-content: center; gap: 4px; margin: 8px 0 16px; }
.big-lives svg { width: 40px; height: 40px; animation: rise .4s cubic-bezier(.2,1.6,.4,1) both; }
.big-lives b { font-size: 1.6rem; align-self: center; }
.big-lives.off svg { filter: grayscale(1) opacity(.35); }
.final { font-size: clamp(2.8rem, 12vw, 3.8rem); font-weight: 700; 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(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.stats div { padding: 8px 4px; border-radius: 14px; background: var(--panel2); }
.stats b { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 1.25rem; }
.stats b svg { width: 22px; height: 22px; }
.stats span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.revive-slot:not(:empty), .double-slot:not(:empty) { margin: 6px 0 12px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.revive-slot .hint { font-size: .85rem; color: var(--muted); }

/* Paneles */
.panel-screen { background: var(--bg2); }
.panel-head { width: min(620px, 100%); display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; text-align: center; font-size: 1.6rem; }
.panel-body { width: min(620px, 100%); flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: 10px; }
.settings { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; 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(--accent); color: var(--accent-text); }
.links { text-align: center; font-size: .85rem; color: var(--muted); margin: 0; }
.settings .b-reset { align-self: center; }
.howto { background: var(--panel); color: var(--ink); border-radius: 22px; padding: 6px 20px 14px; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.howto h1 { font-size: 1.3rem; } .howto h2 { font-size: 1.1rem; color: var(--sea2); margin-bottom: 4px; }
.howto ul { padding-left: 1.2em; margin-top: 4px; }

/* Volver al portal FizzPlays */
.home-link { text-decoration: none; width: auto; display: inline-flex; align-items: center; padding: 0 10px 0 4px; }
.home-link .chev { width: 20px; height: 20px; }
.home-link .fizz-logo { width: 30px; height: 30px; }
.home-btn .fizz-logo { width: 26px; height: 26px; }
.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 y aviso de girar el móvil */
#loader { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, #5fb7ff, #ffe9c4); z-index: 20; transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-ball { width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(#ff6b6b 0 25%, #fff 0 50%, #19b3d6 0 75%, #fff 0); box-shadow: 0 8px 0 rgba(0,0,0,.12); animation: bounce .6s ease-in-out infinite alternate; }
@keyframes bounce { from { transform: translateY(-18px) rotate(0); } to { transform: translateY(10px) rotate(180deg); } }
#rotate { position: absolute; inset: 0; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: linear-gradient(180deg, #0b7fb3, #0f2a4a); font-weight: 700; font-size: 1.3rem; }
#rotate svg { width: 84px; height: 84px; animation: tilt 1.8s ease-in-out infinite; }
@keyframes tilt { 40%, 70% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 820px) { body.touch.playing #rotate { display: flex; } }
.noscript { padding: 20px; text-align: center; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* Pantallas bajas (móvil en horizontal) */
@media (max-height: 520px) {
  .btn.big { min-height: 50px; font-size: 1.2rem; }
  .card { padding: 12px 16px; }
  .card h2 { font-size: 1.4rem; }
  .logo { margin-top: 0; }
  .logo .l1 { font-size: 2.4rem; } .logo .l2 { font-size: 3.2rem; }
  .logo p { margin-top: 8px; }
  .icon-btn { width: 42px; height: 42px; }
  .hud-time, .hud-ice { height: 36px; font-size: 1.15rem; }
  .stick { width: 112px; height: 112px; left: calc(18px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); }
  .jump-btn { width: 96px; height: 96px; right: calc(22px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); }
  .portrait { max-height: 36vh; }
  .char-row { margin: 6px 0 8px; }
  .end-card { width: min(640px, 100%); display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: center; }
  .end-card .final { font-size: 2.6rem; margin: 2px 0 4px; }
  .end-card h2 { font-size: 1.25rem; }
  .end-card .stats { margin: 4px 0 0; gap: 6px; } .stats div { padding: 5px 2px; } .stats b { font-size: 1.05rem; } .stats b svg { width: 18px; height: 18px; } .stats span { font-size: .72rem; }
  .end-card .col { gap: 8px; } .end-card .btn.big { min-height: 48px; font-size: 1.15rem; padding: .35em 1em; }
  .revive-slot:not(:empty), .double-slot:not(:empty) { margin: 0 0 8px; }
  .big-lives { margin: 4px 0 0; } .big-lives svg { width: 32px; height: 32px; }
  .revive-slot .hint { display: none; }
  .map-info { flex-basis: 250px; width: 250px; padding-bottom: 10px; }
  .map-body { margin-top: 4px; } .map-prog { width: min(200px, 70%); }
  .mi-tags span { padding: 2px 7px; font-size: .78rem; } .medal { font-size: .62rem; }
  .map-info .btn.big { min-height: 44px; font-size: 1.1rem; }
  .mi-band { padding: 6px 12px; } .mi-num { width: 28px; height: 28px; font-size: 1rem; }
  .mi-nav { margin-top: 6px; } .mi-nav h3 { font-size: 1.05rem; } .mi-tags { margin: 6px 0; } .medals { margin-bottom: 6px; } .medal i { width: 28px; height: 28px; } .medal i svg { width: 17px; height: 17px; } .mi-lives { display: none; }
  .map-title h2 { font-size: 1.25rem; } .map-prog { height: 17px; }
  .level-card .lc-name { font-size: 2rem; }
}
/* Mapa en vertical: la ficha del hotel debajo */
@media (max-aspect-ratio: 1/1) { .map-body { flex-direction: column; overflow-y: auto; justify-content: flex-start; } .map-wrap { flex: none; height: auto; width: 100%; } .map { width: 100%; height: auto; } .map-info { flex: none; width: 100%; } .char-row { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .logo .l2, .map .node.sel, .hud-time.low { animation: none; } }

/* Telegram a pantalla completa: márgenes del sistema + zona de los botones flotantes de Telegram. */
body.tg-full {
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px));
  --safe-l: calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px));
  --safe-r: calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px));
}

/* Captura de la imagen de compartir */
.og-shot { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 6%; background: linear-gradient(90deg, rgba(6,20,40,.72), rgba(6,20,40,.35) 45%, transparent 75%); }
.og-shot .logo { align-items: flex-start; margin: 0; }
.og-shot .logo .l1 { font-size: 6.4rem; } .og-shot .logo .l2 { font-size: 8.4rem; }
.og-shot .logo p { font-size: 1.6rem; margin-top: 22px; }
.og-shot b { position: absolute; right: 30px; bottom: 24px; font-size: 1.6rem; padding: .2em .8em; border-radius: 99px; background: rgba(255,250,240,.92); color: var(--ink); }
