/* Whisker Runner. Mobile first (390x844, down to 360 wide). A neon night shell; the world itself is a three.js canvas. */
:root {
  --font: "Baloo 2", ui-rounded, system-ui, sans-serif;
  --ink: #1f2a44; --ink-soft: #55607a;
  --sky: #0a0918; --sky-2: #1c1240;
  --coin: #ffd23f; --good: #49c46a; --red: #e8453c; --blue: #3b82e0;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { touch-action: manipulation; box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sky); color: var(--ink); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }

/* the shared title screen's colors: a neon city at night (the sheets stay light and easy to read) */
#mm {
  --sg-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'%3E%3Cg fill='%231a1236'%3E%3Crect x='0' y='151' width='28' height='89'/%3E%3Crect x='31' y='164' width='38' height='76'/%3E%3Crect x='69' y='158' width='35' height='82'/%3E%3Crect x='106' y='163' width='36' height='77'/%3E%3Crect x='146' y='166' width='24' height='74'/%3E%3Crect x='170' y='117' width='31' height='123'/%3E%3Crect x='201' y='159' width='25' height='81'/%3E%3Crect x='230' y='163' width='31' height='77'/%3E%3Crect x='265' y='142' width='21' height='98'/%3E%3Crect x='290' y='97' width='19' height='143'/%3E%3Crect x='313' y='164' width='30' height='76'/%3E%3Crect x='344' y='99' width='19' height='141'/%3E%3Crect x='364' y='117' width='27' height='123'/%3E%3Crect x='392' y='155' width='35' height='85'/%3E%3C/g%3E%3Cg fill='%230e0a1e'%3E%3Crect x='-6' y='177' width='49' height='63'/%3E%3Crect x='46' y='153' width='42' height='87'/%3E%3Crect x='91' y='193' width='34' height='47'/%3E%3Crect x='130' y='132' width='61' height='108'/%3E%3Crect x='199' y='141' width='50' height='99'/%3E%3Crect x='258' y='162' width='53' height='78'/%3E%3Crect x='316' y='169' width='41' height='71'/%3E%3Crect x='360' y='133' width='49' height='107'/%3E%3C/g%3E%3Cg fill='%23ffb347' opacity='0.8'%3E%3Crect x='35' y='185' width='4' height='5'/%3E%3Crect x='69' y='227' width='4' height='5'/%3E%3Crect x='105' y='212' width='4' height='5'/%3E%3Crect x='180' y='162' width='4' height='5'/%3E%3Crect x='171' y='173' width='4' height='5'/%3E%3Crect x='162' y='195' width='4' height='5'/%3E%3Crect x='180' y='217' width='4' height='5'/%3E%3Crect x='213' y='193' width='4' height='5'/%3E%3Crect x='222' y='215' width='4' height='5'/%3E%3Crect x='321' y='210' width='4' height='5'/%3E%3Crect x='374' y='141' width='4' height='5'/%3E%3Crect x='383' y='196' width='4' height='5'/%3E%3Crect x='365' y='229' width='4' height='5'/%3E%3C/g%3E%3Cg fill='%23ffd9a0' opacity='0.8'%3E%3Crect x='-1' y='207' width='4' height='5'/%3E%3Crect x='17' y='229' width='4' height='5'/%3E%3Crect x='171' y='162' width='4' height='5'/%3E%3Crect x='213' y='215' width='4' height='5'/%3E%3Crect x='281' y='203' width='4' height='5'/%3E%3Crect x='321' y='232' width='4' height='5'/%3E%3Crect x='365' y='141' width='4' height='5'/%3E%3C/g%3E%3Crect x='333' y='175' width='6' height='26' fill='%23ffb347'/%3E%3C/svg%3E") center bottom / 100% auto no-repeat,
    radial-gradient(ellipse 110% 32% at 50% 82%, rgba(255, 140, 90, 0.3), transparent 72%),
    linear-gradient(180deg, #0a0816 0%, #1a1030 50%, #43203f 78%, #120a1a 100%); /* a sunset behind the skyline */
  --sg-ink: #eef0fa; --sg-ink-soft: #b4b8d0;
  --sg-title: #f4f6ff; --sg-title-shadow: 0 2px 0 #3a3f5a, 0 4px 0 #0a0b16;
  --sg-accent: #ffb347; --sg-accent-ink: #1a1424;
  --sg-card: rgba(22, 24, 40, 0.92); --sg-card-ink: #eef0fa; --sg-line: rgba(160, 168, 210, 0.22);
  --sg-font: var(--font);
}
.sg-sheet {
  --sg-ink: #1f2a44; --sg-ink-soft: #3d4a6a;
  --sg-accent: #d42f74; --sg-accent-ink: #fff;
  --sg-card: rgba(255, 255, 255, 0.95); --sg-card-ink: #1f2a44; --sg-line: rgba(31, 42, 68, 0.18);
  --sg-sheet-bg: #fbf9ff; --sg-sheet-ink: #1f2a44;
  --sg-font: var(--font);
}
#mm .sg-play { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -5px 0 rgba(120, 60, 0, 0.3), 0 5px 0 #a8661e; }
.news { text-align: left; }
.news h3 { margin: 2px 0 8px; font: 800 22px/1.15 var(--font); }
.news p { margin: 0 0 10px; font: 600 16px/1.4 var(--font); }
.news-crew { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 4px 0 8px; }
.news-crew img { width: 100%; aspect-ratio: 1; }
.wd-h { margin: 10px 2px 6px; font: 800 13px/1.3 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: #5b4f86; }
.wd-h:first-child { margin-top: 0; }
/* the title's picture: a framed night scene, the character standing on the roof's edge (main.js titleScene) */
.title-art { position: relative; width: min(100%, 340px); height: 100%; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #0e1124 center bottom / cover no-repeat; box-shadow: 0 0 0 1.5px rgba(200, 208, 240, 0.45), 0 10px 24px -12px rgba(0, 0, 0, 0.8); }
.title-stand { position: absolute; left: 0; right: 0; bottom: 15%; height: 76%; display: flex; justify-content: center; align-items: flex-end; }
.title-cat:not([src]) { visibility: hidden; }
.title-cat { position: relative; z-index: 1; height: 100%; width: auto; aspect-ratio: 1; image-rendering: auto; animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45)); }
.title-sh { position: absolute; bottom: -4%; left: 50%; width: 110px; height: 16px; margin-left: -55px; border-radius: 50%; background: radial-gradient(closest-side, rgba(220, 226, 255, 0.35), rgba(220, 226, 255, 0)); animation: sh 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-12px) scale(0.97, 1.04); } 55% { transform: translateY(-12px) scale(0.97, 1.04); } 95% { transform: translateY(0) scale(1.05, 0.94); } }
@keyframes sh { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.6; } }

/* ---------- a run ---------- */
.play { position: fixed; inset: 0; background: var(--sky); touch-action: none; }
.play[hidden] { display: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
/* the sunset's glow along the top of the screen, where the city runs off toward the horizon (city districts only) */
.sky { position: absolute; inset: 0; pointer-events: none; }
/* soft-light: it warms what the sunset lights and leaves the black of a drop black */
.sky[data-sky="dusk"] { background: linear-gradient(180deg, rgba(255, 150, 90, 0.6) 0%, rgba(255, 96, 140, 0.3) 22%, rgba(150, 80, 200, 0.1) 42%, rgba(0, 0, 0, 0) 58%); mix-blend-mode: soft-light; }
.sky[data-sky="cyber"] { background: linear-gradient(180deg, rgba(60, 255, 130, 0.2) 0%, rgba(0, 0, 0, 0) 36%); mix-blend-mode: soft-light; }
.vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.15s; background: radial-gradient(ellipse at 50% 55%, rgba(120, 0, 20, 0) 40%, rgba(150, 0, 30, 0.55) 100%); }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: var(--sg-corner-top) 10px 0 var(--sg-corner-left); display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.9); display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.14), 0 4px 10px -4px rgba(31, 42, 68, 0.45); }
.hud-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.hud-btn:active { transform: translateY(1px); }
.hud-mid { flex: 1 1 auto; min-width: 0; text-align: center; pointer-events: none; }
.score { display: block; font: 800 54px/1 var(--font); color: #fff; text-shadow: 0 3px 0 rgba(31, 42, 68, 0.55), 0 0 12px rgba(31, 42, 68, 0.3); -webkit-text-stroke: 2px rgba(31, 42, 68, 0.55); paint-order: stroke fill; transform-origin: 50% 70%; }
.score.pop { animation: scorepop 0.18s ease-out; }
@keyframes scorepop { 0% { transform: scale(1.28); } 100% { transform: scale(1); } }
.bestpill { display: inline-block; margin-top: 2px; padding: 1px 10px; border-radius: 999px; background: rgba(31, 42, 68, 0.55); color: #fff; font: 700 13px/1.4 var(--font); }
.bestpill:empty { display: none; }
.coins { flex: none; min-width: 62px; height: 44px; padding: 0 12px 0 8px; display: flex; align-items: center; gap: 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.14), 0 4px 10px -4px rgba(31, 42, 68, 0.45); font: 800 20px/1 var(--font); }
.coins.pop { animation: scorepop 0.2s ease-out; }
.coin { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #fff3a8 0 22%, #ffd23f 24% 62%, #d99a0c 64%); box-shadow: inset 0 -2px 0 rgba(150, 90, 0, 0.5), 0 0 0 2px #b97a08; }
.banner { position: absolute; left: 50%; top: 24%; margin: 0; padding: 6px 18px 8px; border-radius: 999px; transform: translateX(-50%) scale(0.5); opacity: 0; pointer-events: none; background: #14162a; color: #ffb347; font: 800 26px/1.1 var(--font); box-shadow: 0 0 0 1.5px rgba(255, 179, 71, 0.6), 0 4px 0 #07080f; white-space: nowrap; }
.banner.show { animation: banner 1.7s cubic-bezier(.2, 1.4, .4, 1) forwards; }
/* the first time a newer obstacle shows up: one line under the banner on how it works */
.obtip { position: absolute; left: 50%; top: calc(24% + 52px); width: min(88vw, 340px); margin: 0; padding: 8px 14px; border-radius: 14px; transform: translateX(-50%); opacity: 0; pointer-events: none; background: rgba(20, 14, 40, 0.88); color: #fff; font: 700 16px/1.3 var(--font); text-align: center; box-shadow: 0 0 0 1.5px rgba(200, 208, 240, 0.35), 0 8px 18px -8px rgba(0, 0, 0, 0.6); }
.obtip.show { animation: obtip 3.2s ease forwards; }
@keyframes obtip { 0% { opacity: 0; transform: translateX(-50%) translateY(8px); } 10%, 82% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .obtip.show { animation-duration: 3.2s; } }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(0.5); } 14% { opacity: 1; transform: translateX(-50%) scale(1.08); } 22% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(1); } }
.close { position: absolute; left: 50%; top: 20%; margin: 0; transform: translateX(-50%); opacity: 0; pointer-events: none; color: #fff; font: 800 22px/1 var(--font); text-shadow: 0 2px 0 rgba(31, 42, 68, 0.7); }
.close.show { animation: closecall 0.8s ease-out forwards; }
@keyframes closecall { 0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.8); } 20% { opacity: 1; transform: translateX(-50%) scale(1.05); } 100% { opacity: 0; transform: translateX(-50%) translateY(-16px); } }
.warn { position: absolute; left: 50%; top: 17%; margin: 0; padding: 6px 16px 7px; border-radius: 16px; transform: translateX(-50%); opacity: 0; pointer-events: none; background: #d8342e; color: #fff; font: 800 19px/1.1 var(--font); box-shadow: 0 4px 0 #8a1f1b; white-space: nowrap; transition: opacity 0.12s; }
.warn.show { opacity: 1; animation: shake 0.25s linear infinite; }
@keyframes shake { 0%, 100% { transform: translateX(-50%) rotate(-1.2deg); } 50% { transform: translateX(-50%) rotate(1.2deg); } }
/* the first runs' hint: just above the player (who stands 27% up from the bottom), where the eye already is, on a pill that
   reads over any roof or world */
.hint { position: absolute; left: 50%; bottom: calc(27% + 64px); margin: 0; padding: 8px 18px 9px; border-radius: 16px; transform: translateX(-50%); text-align: center; white-space: nowrap; pointer-events: none; opacity: 0; color: #fff; background: rgba(20, 14, 40, 0.84); box-shadow: 0 0 0 1.5px rgba(200, 208, 240, 0.35), 0 8px 18px -8px rgba(0, 0, 0, 0.6); font: 700 20px/1.3 var(--font); transition: opacity 0.15s; }
.hint b { color: #ffd36a; }
.hint.show { opacity: 1; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
.nogl { position: fixed; inset: 0; margin: 0; padding: 40px 24px; background: var(--sky); font: 800 20px/1.3 var(--font); text-align: center; z-index: 90; }

/* ---------- the game over card ---------- */
.over { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 12px 12px calc(var(--safe-b) + 14px); background: linear-gradient(rgba(31, 42, 68, 0), rgba(31, 42, 68, 0.38)); opacity: 0; transition: opacity 0.25s; overflow: hidden; }
.over.show { opacity: 1; }
.over .card { position: relative; width: 100%; max-width: 380px; padding: 16px 16px 14px; border-radius: 26px; background: #fffdf6; text-align: center; box-shadow: 0 8px 0 rgba(31, 42, 68, 0.2), 0 18px 40px rgba(31, 42, 68, 0.35); transform: translateY(30px) scale(0.96); transition: transform 0.35s cubic-bezier(.2, 1.3, .4, 1); }
.over.show .card { transform: none; }
.o-cause { margin: 0; font: 700 17px/1.2 var(--font); color: var(--ink-soft); }
.o-score { font: 800 84px/0.95 var(--font); color: var(--ink); text-shadow: 0 4px 0 #ffd23f; }
.o-best { margin: 2px 0 8px; font: 700 18px/1.2 var(--font); color: var(--ink-soft); }
.o-best b { color: var(--ink); }
.nb { display: inline-block; padding: 1px 14px 3px; border-radius: 999px; background: #ff7a3d; color: #fff; font: 800 20px/1.2 var(--font); box-shadow: 0 3px 0 #b8481a; animation: scorepop 0.4s ease-out; }
.o-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.o-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; border-radius: 999px; background: #f2ecd8; font: 700 15px/1.3 var(--font); }
.o-chip b { font-weight: 800; font-size: 17px; }
.o-new { display: grid; gap: 6px; margin-top: 10px; }
.o-new:empty { display: none; }
.o-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: 16px; background: linear-gradient(90deg, #fff3b8, #ffe08a); text-align: left; animation: itemin 0.5s cubic-bezier(.2, 1.4, .4, 1) both; box-shadow: inset 0 -3px 0 rgba(185, 122, 8, 0.25); }
.o-item img { width: 52px; height: 52px; flex: none; }
.o-item small { display: block; font: 700 12px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: #8a5a00; }
.o-item b { font: 800 20px/1.1 var(--font); }
.o-w { width: 48px; height: 48px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 2px rgba(31, 42, 68, 0.2); }
.o-star { width: 48px; text-align: center; font-size: 30px; color: #e89a0c; flex: none; }
.o-item.ach { background: linear-gradient(90deg, #e9f6ff, #d2ecff); }
.o-item.ach small { color: #2f6fa8; }
@keyframes itemin { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: none; } }
.o-goal { margin-top: 10px; text-align: left; }
.o-goal small { display: block; margin-bottom: 4px; font: 700 14px/1.2 var(--font); color: var(--ink-soft); }
.bar { display: block; height: 9px; border-radius: 999px; background: #e7dfc6; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #49c46a, #8fe36a); min-width: 4px; }
.o-retry { display: block; width: 100%; height: 62px; margin-top: 12px; border: 0; border-radius: 20px; background: #ff7a3d; color: #2a1408; font: 800 28px/1 var(--font); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -5px 0 rgba(120, 40, 10, 0.35), 0 5px 0 #b8481a; }
.o-retry:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -5px 0 rgba(120, 40, 10, 0.35), 0 2px 0 #b8481a; }
.o-actions { display: flex; gap: 8px; margin-top: 10px; }
.o-actions button { flex: 1; min-height: 48px; border: 0; border-radius: 16px; background: #eee6cd; font: 800 18px/1 var(--font); box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.12); }
.o-daily { margin: 6px 0 0; text-align: center; font: 700 15px/1.3 var(--font); color: #1f2a44; }
.o-daily b { color: #c2540f; }
.o-fast { margin: -4px 0 6px; text-align: center; font: 700 15px/1.35 var(--font); color: var(--ink-soft); }
.o-fast b { color: var(--ink); }
.o-fast b.hi { color: #c2540f; }
.o-spin { background: linear-gradient(#ffe36a, #ffc531) !important; animation: spinpulse 1.2s ease-in-out infinite; }
@keyframes spinpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 110vh) rotate(720deg); opacity: 0.9; } }

/* ---------- sheets: characters, prize machine, worlds, goals ---------- */
.cx-count { margin: 0 0 8px; font: 700 15px/1.2 var(--font); color: var(--ink-soft); }
.cx-detail { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 18px; background: #eaf6ff; margin-bottom: 10px; min-height: 108px; }
.cx-detail img { width: 88px; height: 88px; flex: none; }
.cx-detail img.lk { filter: brightness(0) opacity(0.35); }
.cx-detail b { font: 800 22px/1.1 var(--font); }
.cx-detail p { margin: 2px 0 0; font: 600 14px/1.3 var(--font); color: var(--ink-soft); }
/* a character's neon look: wear it, or how far away it is */
.cx-neon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 10px; padding: 8px 12px; border-radius: 16px; background: #1c1630; color: #f4efff; }
.cx-neon:empty { display: none; }
.cx-neon-t { flex: 1 1 140px; min-width: 0; }
.cx-neon-t b { display: block; font: 800 16px/1.2 var(--font); }
.cx-neon-t small { display: block; font: 600 13px/1.3 var(--font); color: #cfc6f0; }
.cx-neon .bar { flex: 1 1 100%; background: #3a3054; }
.cx-neon-b { flex: none; min-height: 44px; padding: 0 16px; border: 2px solid var(--neon, #ff3d8b); border-radius: 999px; background: transparent; color: #fff; font: 800 15px/1 var(--font); box-shadow: 0 0 10px var(--neon, #ff3d8b); }
.cx-neon-b.on { background: var(--neon, #ff3d8b); color: #140c2a; }
.cx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cx-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 4px 8px; border: 0; border-radius: 16px; background: #f4efdc; min-height: 118px; box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.1); }
.cx-card img { width: 72px; height: 72px; }
.cx-card b { font: 800 15px/1.1 var(--font); }
.cx-card small { font: 600 11px/1.15 var(--font); color: var(--ink-soft); padding: 0 2px; }
.cx-card.sel { background: #ffe9a8; box-shadow: inset 0 0 0 3px #ff9a3d; }
.cx-card.locked img { filter: brightness(0) opacity(0.28); }
.cx-card.locked { opacity: 0.9; }
.cx-card img.ld { background: radial-gradient(circle at 50% 60%, rgba(31, 42, 68, 0.12) 0 34%, transparent 36%); } /* still being drawn */
.cx-h { grid-column: 1 / -1; margin: 8px 2px 0; font: 800 16px/1.2 var(--font); color: var(--ink-soft); }
.cx-h:first-child { margin-top: 0; }
/* a secret: a glowing silhouette on the night sky until it's found */
.cx-card.secret.locked { background: #1c1630; color: #f4efff; opacity: 1; box-shadow: inset 0 0 0 2px #3a2f5c; }
.cx-card.secret.locked small { color: #cfc6f0; }
.cx-card.secret.locked img { filter: brightness(0) drop-shadow(0 0 5px #a35cff) drop-shadow(0 0 1px #ff7ae0); }
.cx-detail .bar { margin-top: 6px; }
.cx-detail small { font: 700 12px/1.2 var(--font); color: var(--ink-soft); }
.pz { text-align: center; }
.pz-mach { width: 150px; margin: 0 auto; }
.pz-mach svg { width: 100%; height: auto; display: block; }
.pz-mach.shake { animation: rattle 0.12s linear infinite; }
@keyframes rattle { 0%, 100% { transform: translateX(-3px) rotate(-2deg); } 50% { transform: translateX(3px) rotate(2deg); } }
.pz-reveal { margin: 6px auto 0; padding: 8px 18px 12px; width: fit-content; min-width: 190px; border-radius: 22px; background: #eef7ff; animation: itemin 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
.pz-reveal.r2 { background: #e6dcff; }
.pz-reveal.r3 { background: linear-gradient(#fff0a8, #ffd36a); }
.pz-reveal img { width: 120px; height: 120px; display: block; margin: 0 auto; }
.pz-reveal b { display: block; font: 800 24px/1.1 var(--font); }
.pz-reveal small { font: 700 14px/1.2 var(--font); color: var(--ink-soft); }
.pz-info { margin: 10px 0 6px; font: 700 18px/1.2 var(--font); }
.pz-btn, .pz-use { display: block; width: 100%; min-height: 54px; margin: 6px 0 0; border: 0; border-radius: 18px; font: 800 22px/1 var(--font); }
.pz-btn { background: #ff7a3d; color: #fff; box-shadow: inset 0 -5px 0 rgba(120, 40, 10, 0.35), 0 4px 0 #b8481a; }
.pz-btn:disabled { background: #d9d2bc; color: #7a7462; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08); }
.pz-use { min-height: 48px; font-size: 18px; background: #eee6cd; color: var(--ink); }
.pz-use:disabled { color: #8a8270; font-size: 15px; }
.pz .spin-meter { margin: 8px 0 4px; text-align: left; }
.pz-odds { margin: 10px 0 0; font: 600 13px/1.35 var(--font); color: var(--ink-soft); }
.wd { display: grid; gap: 8px; }
.wd-card { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 12px 8px 8px; border: 0; border-radius: 18px; background: #f4efdc; text-align: left; box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.1); }
.wd-card.sel { background: #ffe9a8; box-shadow: inset 0 0 0 3px #ff9a3d; }
.wd-sw { width: 64px; height: 64px; flex: none; border-radius: 14px; box-shadow: inset 0 0 0 2px rgba(31, 42, 68, 0.2); }
.wd-card.locked .wd-sw { filter: grayscale(1) opacity(0.6); }
.wd-t { flex: 1; min-width: 0; }
.wd-t b { display: block; font: 800 19px/1.1 var(--font); }
.wd-t small { display: block; margin: 2px 0 4px; font: 600 13px/1.25 var(--font); color: var(--ink-soft); }
.gl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.gl-stats div { padding: 6px 4px; border-radius: 14px; background: #eaf6ff; text-align: center; }
.gl-stats b { display: block; font: 800 20px/1.1 var(--font); }
.gl-stats small { font: 600 11px/1.15 var(--font); color: var(--ink-soft); }
.gl-stats.gl-fast { grid-template-columns: repeat(2, 1fr); }
.gl h3 { margin: 12px 0 6px; font: 800 17px/1.1 var(--font); }
.gl-list { display: grid; gap: 6px; }
.gl-note { margin: -2px 2px 8px; font: 600 13px/1.35 var(--font); color: var(--ink-soft); }
.gl-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0 8px; align-items: center; padding: 7px 10px; border-radius: 14px; background: #f4efdc; }
.gl-row.done { background: #e4f6df; }
.gl-k { grid-row: span 2; font: 800 10px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); width: 52px; }
.gl-row b { font: 800 16px/1.1 var(--font); }
.gl-row small { grid-column: 2 / 4; font: 600 12.5px/1.25 var(--font); color: var(--ink-soft); }
.gl-row em { grid-row: 1; grid-column: 3; font: 700 12px/1 var(--font); font-style: normal; color: var(--ink-soft); }
.gl-row .bar { grid-column: 2 / 4; margin-top: 4px; height: 7px; }
.gl-row.ach .gl-k { font-size: 20px; letter-spacing: 0; color: #e89a0c; width: 52px; text-align: center; }

@media (max-height: 600px) { .o-score { font-size: 64px; } .over .card { padding: 12px; } .o-retry { height: 54px; } }
@media (prefers-reduced-motion: reduce) {
  .title-cat, .title-sh, .o-spin, .hint.show, .warn.show { animation: none; }
  .confetti { display: none; }
}

/* ---------- the reveal (reveal.js): the machine spins, lands, and the new character hops on its pedestal ---------- */
.rv { position: fixed; inset: 0; z-index: 1000; overflow: hidden; color: #fff; font-family: var(--font); -webkit-user-select: none; user-select: none;
  background: radial-gradient(circle at 50% 40%, #3a1c5e 0, #170f2e 52%, #07060f 100%); }
.rv.secret { background: radial-gradient(circle at 50% 40%, #2a1650 0, #0f0a26 52%, #040309 100%); }
.rv-rays { position: absolute; left: 50%; top: 40%; width: 940px; height: 940px; margin: -470px 0 0 -470px; border-radius: 50%; opacity: 0; transition: opacity 0.5s;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, 0.16) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 62%); mask: radial-gradient(circle, #000 0, transparent 62%); animation: rv-turn 16s linear infinite; }
.rv.secret .rv-rays { background: repeating-conic-gradient(from 0deg, rgba(196, 140, 255, 0.2) 0 9deg, transparent 9deg 24deg); }
.rv.landed .rv-rays { opacity: 1; }
.rv-flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle at 50% 40%, #fff 0, rgba(255, 255, 255, 0.5) 22%, rgba(255, 255, 255, 0) 60%); }
.rv-banner { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 6%); text-align: center; font: 800 32px/1 var(--font); letter-spacing: 0.01em;
  color: #fff6d8; text-shadow: 0 0 14px #ff3d8b, 0 0 32px rgba(255, 61, 139, 0.6); opacity: 0; transform: scale(0.6); }
.rv.secret .rv-banner { color: #f2e6ff; text-shadow: 0 0 14px #a35cff, 0 0 32px rgba(163, 92, 255, 0.7); }
.rv.landed .rv-banner { animation: rv-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.rv-mach { position: absolute; left: 50%; top: 36%; width: 236px; height: 296px; margin: -148px 0 0 -118px; border-radius: 28px; transition: transform 0.4s cubic-bezier(0.5, 0, 0.8, 0.5), opacity 0.4s;
  background: linear-gradient(180deg, #2f2152, #1a1232 70%, #140e28); box-shadow: 0 0 0 3px #ff3d8b, 0 0 26px rgba(255, 61, 139, 0.55), inset 0 0 0 7px #120c22, 0 22px 40px rgba(0, 0, 0, 0.55);
  animation: rv-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.rv.dropped .rv-mach { transform: translateY(-38%) scale(0.5); opacity: 0; }
.rv-bulbs i { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #ffd34e; box-shadow: 0 0 8px #ffd34e, 0 0 2px #fff inset;
  animation: rv-chase 0.9s linear infinite; animation-delay: calc(var(--i) * -0.11s); }
.rv-bulbs i:nth-child(-n+8) { top: 12px; left: calc(14px + var(--i) * 28.5px); }
.rv-bulbs i:nth-child(n+9) { bottom: 44px; left: calc(14px + (var(--i) - 8) * 28.5px); }
.rv-sign { position: absolute; left: 50%; top: -44px; transform: translateX(-50%); white-space: nowrap; padding: 4px 14px; border-radius: 12px; border: 2px solid #ff3d8b;
  font: 800 17px/1.2 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: #ffd6ea; text-shadow: 0 0 8px #ff3d8b; box-shadow: 0 0 14px rgba(255, 61, 139, 0.55), inset 0 0 10px rgba(255, 61, 139, 0.35); background: #1a1232; }
.rv.landed .rv-bulbs i { animation: rv-blink 0.16s steps(2) 8; }
.rv-win { position: absolute; left: 18px; right: 18px; top: 34px; height: 198px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #33285c, #0d0a1c 80%); box-shadow: inset 0 0 0 3px #0b0817, inset 0 0 24px rgba(0, 0, 0, 0.8); }
.rv-win::before, .rv-win::after { content: ""; position: absolute; top: 50%; margin-top: -9px; z-index: 2; border: 9px solid transparent; }
.rv-win::before { left: 0; border-left-color: #ff3d8b; }
.rv-win::after { right: 0; border-right-color: #ff3d8b; }
.rv-strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.rv-tile { height: 132px; display: flex; align-items: center; justify-content: center; }
.rv-tile img { width: 118px; height: 118px; filter: brightness(0) drop-shadow(0 0 6px #a35cff); transition: filter 0.4s; }
.rv-tile.blank img { display: none; }
.rv-tile.blank::after { content: "?"; font: 800 72px/1 var(--font); color: #a35cff; text-shadow: 0 0 12px #a35cff; }
.rv-tile.lit img { filter: drop-shadow(0 0 10px #fff2a8); animation: rv-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
.rv-glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(9, 7, 20, 0.9), transparent 28%, transparent 72%, rgba(9, 7, 20, 0.9)); }
.rv-slot { position: absolute; left: 50%; bottom: 20px; width: 64px; height: 8px; margin-left: -32px; border-radius: 4px; background: #ff3d8b; box-shadow: 0 0 12px #ff3d8b; }
.rv-stage { position: absolute; left: 50%; top: 44%; width: 240px; height: 240px; margin: -120px 0 0 -120px; perspective: 700px; opacity: 0; transition: opacity 0.2s; }
.rv.dropped .rv-stage { opacity: 1; }
.rv-ped { position: absolute; left: 50%; bottom: 14px; width: 196px; height: 48px; margin-left: -98px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, #4a3a7e, #1c1534 72%); box-shadow: 0 0 0 3px #ff7ae0, 0 0 28px #ff3d8b, 0 14px 30px rgba(0, 0, 0, 0.6); }
.rv.secret .rv-ped { box-shadow: 0 0 0 3px #c49cff, 0 0 30px #a35cff, 0 14px 30px rgba(0, 0, 0, 0.6); }
.rv-actor { position: absolute; left: 50%; bottom: 30px; width: 200px; height: 200px; margin-left: -100px; transform-origin: 50% 92%; }
.rv-actor img { width: 100%; height: 100%; display: block; }
.rv.calm .rv-mach { display: none; }
.rv.calm .rv-stage { opacity: 1; }
.rv.calm .rv-actor img { filter: brightness(0) drop-shadow(0 0 8px #a35cff); transition: filter 0.4s; }
.rv.calm.landed .rv-actor img { filter: none; }
.rv-fx { position: absolute; left: 50%; bottom: 40px; width: 0; height: 0; }
.rv-fx i { position: absolute; width: 9px; height: 9px; margin: -4px; border-radius: 2px; }
.rv-fx i.tr { width: 11px; height: 11px; margin: -5px; border-radius: 3px; box-shadow: 0 0 6px currentColor; }
.rv-text { position: absolute; left: 16px; right: 16px; top: 60%; text-align: center; opacity: 0; transform: translateY(14px); transition: opacity 0.35s, transform 0.35s; }
.rv.texted .rv-text { opacity: 1; transform: none; }
.rv-text small { display: inline-block; padding: 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font: 800 13px/1.6 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #ffd98a; }
.rv.secret .rv-text small { color: #e2ccff; }
.rv-text b { display: block; margin-top: 6px; font: 800 32px/1.05 var(--font); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.rv-text p { max-width: 340px; margin: 6px auto 0; font: 600 16px/1.35 var(--font); color: #dcd2f6; }
.rv-btns { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 26px); display: flex; gap: 10px; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.rv.texted .rv-btns { opacity: 1; pointer-events: auto; }
.rv-btns button { min-height: 56px; border-radius: 999px; font: 800 18px/1.1 var(--font); padding: 0 14px; }
.rv-play { flex: 1.7; border: 0; background: #ff3d8b; color: #fff; box-shadow: 0 0 18px rgba(255, 61, 139, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.rv-later { flex: 1; border: 2px solid #6a5a9a; background: transparent; color: #ece4ff; }
.rv-hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 10px); margin: 0; text-align: center; font: 700 13px/1 var(--font); color: rgba(255, 255, 255, 0.5); transition: opacity 0.3s; }
.rv.texted .rv-hint, .rv.calm .rv-hint { opacity: 0; }
.rv-confetti { position: absolute; left: 50%; top: 36%; width: 0; height: 0; }
.rv-confetti i { position: absolute; border-radius: 2px; }
@media (max-height: 700px) {
  .rv-mach { transform: scale(0.8); }
  .rv.dropped .rv-mach { transform: translateY(-38%) scale(0.4); }
  .rv-stage { transform: scale(0.84); }
  .rv-text b { font-size: 27px; }
  .rv-text p { font-size: 15px; }
  .rv-banner { font-size: 27px; top: calc(env(safe-area-inset-top) + 4%); }
}
@keyframes rv-turn { to { transform: rotate(360deg); } }
@keyframes rv-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes rv-in { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@keyframes rv-chase { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes rv-blink { 0% { opacity: 1; background: #fff; } 100% { opacity: 0.3; } }
/* the machine's meter: Characters, Goals and the prize machine */
.spin-meter { margin: 0 0 10px; padding: 10px 12px; border-radius: 16px; background: #1c1630; color: #f4efff; }
.spin-meter b { display: block; font: 800 17px/1.2 var(--font); }
.spin-meter small { display: block; margin-top: 2px; font: 600 13px/1.3 var(--font); color: #cfc6f0; }
.spin-meter .bar { margin-top: 6px; background: #3a3054; }
.spin-meter .bar > i { background: linear-gradient(90deg, #ff3d8b, #ffb340); }
/* the title screen's painted city shows through: Kento stands in it */
.sg-scened .title-art { background: none !important; box-shadow: none; overflow: visible; }
.sg-scened .title-sh { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); }

/* The title's world carousel (titleArt in main.js): the world's picture with your character in it, arrows, its name and lane. */
.title-art.wc { width: min(100%, 360px); overflow: visible; }
.wc-card { position: absolute; left: 46px; right: 46px; top: 2px; bottom: 50px; border-radius: 16px; overflow: hidden; background: #0e1124 center bottom / cover no-repeat;
  box-shadow: 0 0 0 2px rgba(120, 236, 255, 0.55), 0 0 18px -2px rgba(80, 220, 255, 0.45), 0 10px 24px -12px rgba(0, 0, 0, 0.8); touch-action: pan-y; }
.wc.sel .wc-card { box-shadow: 0 0 0 2px #7cf3ff, 0 0 22px 0 rgba(90, 230, 255, 0.6), 0 10px 24px -12px rgba(0, 0, 0, 0.8); }
.wc-card .title-stand { bottom: 9%; height: 72%; }
.wc-card .title-sh { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); }
.wc-card.locked .title-stand { filter: brightness(0) opacity(0.55); }
.wc-lock { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; text-align: center;
  background: rgba(8, 10, 24, 0.62); color: #f4f6ff; font: 700 13px/1.3 var(--font); }
.wc-card.locked .wc-lock { display: flex; }
.wc-lock svg { width: 30px; height: 30px; fill: none; stroke: #ffd36a; stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 200, 90, 0.7)); }
.wc-lock .bar { display: block; width: 70%; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.wc-lock .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffb84d, #ffe07a); }
.wc-arrow { position: absolute; top: calc(50% - 47px); width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(14, 16, 36, 0.72);
  box-shadow: 0 0 0 1.5px rgba(124, 243, 255, 0.6); display: grid; place-items: center; }
.wc-arrow svg { width: 22px; height: 22px; fill: none; stroke: #bff8ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wc-arrow:active { transform: scale(0.92); }
.wc-prev { left: 0; } .wc-next { right: 0; }
.wc-cap { position: absolute; left: 30px; right: 30px; bottom: 0; height: 44px; padding: 0; border: 0; background: none; color: #f4f6ff; text-align: center; }
.wc-cap b { display: block; font: 800 17px/1.15 var(--font); text-shadow: 0 0 10px rgba(124, 243, 255, 0.55), 0 2px 0 #0a0b16; }
.wc-cap small { display: block; font: 700 12px/1.25 var(--font); color: #9feeff; text-shadow: 0 1px 0 #0a0b16; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-dots { position: absolute; left: 46px; right: 46px; bottom: 58px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.wc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.wc-dots i.lk { background: rgba(255, 255, 255, 0.2); }
.wc-dots i.on { background: #7cf3ff; box-shadow: 0 0 6px #7cf3ff; }
.wc-in-r { animation: wcInR 0.26s ease-out; } .wc-in-l { animation: wcInL 0.26s ease-out; }
@keyframes wcInR { from { opacity: 0.2; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes wcInL { from { opacity: 0.2; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wc-in-r, .wc-in-l { animation: none; } }

/* The results card in the city's neon: dark glass, a cyan rim, the score lit; unlock progress as three slim bars. */
.over { background: linear-gradient(rgba(6, 8, 20, 0), rgba(6, 8, 20, 0.6)); }
.over .card { background: linear-gradient(180deg, rgba(22, 20, 48, 0.96), rgba(12, 12, 30, 0.97)); color: #eef2ff;
  box-shadow: 0 0 0 1.5px rgba(124, 243, 255, 0.65), 0 0 26px -4px rgba(90, 230, 255, 0.55), 0 18px 40px rgba(0, 0, 0, 0.55); }
.over .o-cause { color: #ff8ad8; text-shadow: 0 0 10px rgba(255, 79, 216, 0.55); }
.over .o-score { color: #ffffff; text-shadow: 0 0 6px #7cf3ff, 0 0 20px rgba(124, 243, 255, 0.75), 0 3px 0 #ff4fd8; }
.over .o-best, .over .o-fast { color: #aab4e0; }
.over .o-best b, .over .o-fast b { color: #ffffff; }
.over .o-best .nb { background: #c21f8f; color: #fff; box-shadow: 0 0 14px rgba(255, 79, 216, 0.7), 0 3px 0 #6e0f52; }
.over .o-fast b.hi { color: #ffe36a; text-shadow: 0 0 10px rgba(255, 220, 90, 0.7); }
.over .o-daily { color: #dfe6ff; } .over .o-daily b { color: #ffb86a; }
.over .o-chip { background: rgba(124, 243, 255, 0.1); color: #dff8ff; box-shadow: inset 0 0 0 1px rgba(124, 243, 255, 0.35); }
.over .o-actions button { background: rgba(255, 255, 255, 0.08); color: #eef2ff; box-shadow: inset 0 0 0 1.5px rgba(170, 180, 230, 0.35); }
.over .o-spin { color: #2a1408; }
.over .o-goal { display: grid; gap: 7px; }
.over .o-goal[hidden] { display: none; }
.o-g { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 3px; align-items: center; }
.o-gk { grid-row: span 2; align-self: start; padding: 2px 7px; border-radius: 6px; font: 800 11px/1.35 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: #0c0e22; background: #7cf3ff; }
.o-g small { margin: 0 !important; font: 700 13px/1.25 var(--font) !important; color: #c6cdf0 !important; }
.over .bar { height: 7px; background: rgba(255, 255, 255, 0.12); }
.over .bar > i { background: linear-gradient(90deg, #ff4fd8, #7cf3ff); box-shadow: 0 0 8px rgba(124, 243, 255, 0.7); }
.over .o-item { color: #1a1430; }
