@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');
:root{color-scheme:dark;--ink:#100e28;--pink:#ff40a9;--yellow:#ffe75e;--cyan:#65f3ff;--muted:#b9b9d5}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#100e28}body{font-family:Inter,system-ui,sans-serif;color:white;background:radial-gradient(ellipse at 15% 0, #412051 0,transparent 42%),radial-gradient(ellipse at 90% 55%,#08354a 0,transparent 45%),#100e28}.arcade{max-width:1120px;margin:auto;padding:20px 28px 12px}.masthead{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px}.brand{display:flex;align-items:center;gap:12px}.brand-mark{height:48px;width:48px;display:grid;place-items:center;background:var(--pink);color:var(--yellow);border-radius:13px;font:900 44px 'Barlow Condensed',sans-serif;transform:rotate(-6deg);box-shadow:0 4px 0 #921350}.brand h1{font:900 32px/.95 'Barlow Condensed',Impact,sans-serif;letter-spacing:.03em;margin:0}.brand h1 em{font-style:normal;color:var(--yellow)}.brand p{font-size:10px;letter-spacing:.26em;margin:6px 0 0;color:var(--muted);font-weight:700}.header-buttons{display:flex;gap:8px}button{font-family:inherit;cursor:pointer;border:0;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible,canvas:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}button:disabled{cursor:default}.icon-button{background:#ffffff0b;border:1px solid #ffffff26;border-radius:10px;min-height:43px;padding:0 16px;font-weight:600;font-size:14px}.icon-button:hover:not(:disabled){background:#ffffff1a}.icon-button:disabled{opacity:.35}.machine{border:1px solid #ffffff30;border-radius:21px;overflow:hidden;box-shadow:0 25px 80px #0006,0 0 0 5px #ffffff04;background:#19162f}.hud{height:68px;padding:10px 24px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(100deg,#24203d,#151b32)}.hud>div{min-width:100px}.hud span{font-size:10px;letter-spacing:.17em;font-weight:800;color:var(--muted);display:block;margin-bottom:2px}.hud strong{font:800 28px/1 'Barlow Condensed',Impact,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.02em}.hud .time-stat{text-align:center}.hud .heart-stat{text-align:right}.heart-stat strong{color:#ff64ba;font-size:22px;letter-spacing:2px}.track-wrap{height:min(64svh,620px);min-height:350px;position:relative;background:#65c9f8;overflow:hidden}canvas{width:100%;height:100%;display:block;outline:none}.overlay{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;padding:24px;background:#0c0a2861;backdrop-filter:blur(4px)}.hidden{display:none!important}.start-card{width:min(750px,100%);display:grid;grid-template-columns:40% 60%;background:#17162bee;border:1px solid #ffffff50;box-shadow:0 20px 70px #0007;border-radius:19px;overflow:hidden}.cover-art{min-height:340px;overflow:hidden;position:relative}.cover-art img{height:100%;width:100%;object-fit:cover;object-position:54% 75%;display:block}.cover-art:after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,#fb24943d,transparent 65%)}.card-content{padding:29px 30px}.eyebrow{font-size:10px;letter-spacing:.17em;font-weight:800;color:var(--cyan);margin:0 0 9px}h2{font:900 43px/.95 'Barlow Condensed',Impact,sans-serif;letter-spacing:.015em;margin:0 0 13px}h2 em{color:var(--yellow);font-style:normal}.intro{font-size:15px;line-height:1.5;color:#e3e3f1;margin:0 0 19px}.howto{margin:0 0 21px}.howto p{margin:8px 0;font-size:13px;color:#e0dfed;line-height:1.45}.lesson-icon{font-size:20px;display:inline-block;vertical-align:middle;width:25px;color:var(--yellow)}.diamond{color:var(--cyan)}.pink{color:var(--pink)}.primary{display:block;width:100%;min-height:52px;background:var(--yellow);color:#201524;border-radius:10px;font-weight:900;font-size:17px;box-shadow:0 4px 0 #b58a18;transition:transform .1s,filter .1s}.primary:hover:not(:disabled){filter:brightness(1.09)}.primary:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #b58a18}.primary:disabled{opacity:.7}.micro{font-size:11px;color:var(--muted);margin:13px 0 0;text-align:center;line-height:1.4}.small-card{width:min(390px,100%);text-align:center;border-radius:19px;border:1px solid #ffffff40;background:#17162bf2;padding:34px}.small-card p:not(.eyebrow){color:var(--muted);font-size:15px;margin:0 0 25px}.secondary{background:none;border:1px solid #ffffff33;border-radius:9px;width:100%;min-height:45px;margin-top:13px;font-size:14px}.race-progress{height:4px;background:#0c0c20}.race-progress div{height:100%;width:0;background:linear-gradient(90deg,var(--pink),var(--yellow));transition:width .2s linear}.controls{padding:13px 20px;display:grid;grid-template-columns:1fr 1.25fr 1fr;gap:12px;background:linear-gradient(#211c3b,#171529)}.steer{min-height:62px;background:#3a3355;border:1px solid #736282;border-radius:12px;display:flex;gap:13px;align-items:center;justify-content:center;box-shadow:0 4px 0 #080915;font-size:16px;font-weight:800}.steer>span:first-child{font-size:25px;color:#ffe75e}.steer:active,.steer.pressed{background:#57476e;transform:translateY(2px);box-shadow:0 2px 0 #080915}.steer kbd{font:12px Inter,sans-serif;color:#bbb0d2;margin-left:6px}.boost{position:relative;overflow:hidden;border-radius:12px;border:1px solid #ff71c0;background:#6a2452;box-shadow:0 4px 0 #250e27;min-height:62px}.boost-fill{position:absolute;left:0;top:0;bottom:0;width:45%;background:linear-gradient(90deg,#c22280,#ff45af);transition:width .12s linear}.boost-label{position:relative;display:flex;flex-direction:column;gap:3px;align-items:center}.boost-label b{font-size:21px;font-weight:900;letter-spacing:.025em}.boost-label small{font-size:10px;font-weight:800;letter-spacing:.1em}.boost:disabled .boost-label{opacity:.65}.boost.active{border-color:#fff099;box-shadow:0 0 25px #ff39b18a}.toast{position:absolute;top:20px;left:50%;transform:translate(-50%,-7px);color:#fff;padding:10px 20px;white-space:nowrap;background:#19172dde;border:1px solid #ffffff54;border-radius:50px;font-weight:800;font-size:18px;opacity:0;transition:opacity .15s,transform .15s;pointer-events:none;text-shadow:0 2px 4px #0005}.toast.visible{opacity:1;transform:translate(-50%,0)}.speed-tag{position:absolute;left:15px;bottom:14px;background:#142c436f;backdrop-filter:blur(5px);padding:7px 12px;border-radius:6px;font-size:10px;font-weight:800;letter-spacing:.12em;color:white;pointer-events:none}.finish-card{display:grid;grid-template-columns:40% 60%;width:min(660px,100%);border:1px solid #ffffff40;border-radius:19px;overflow:hidden;background:#17162bf5;box-shadow:0 20px 70px #0007}.finish-image{width:100%;height:100%;object-fit:cover;object-position:48% 65%}.finish-content{padding:25px;text-align:center}.finish-content h2{margin:8px 0}.finish-content>p:not(.eyebrow):not(.final-score):not(.score-label){font-size:14px;line-height:1.4;color:var(--muted);margin:0}.final-score{font:900 68px/.95 'Barlow Condensed',Impact,sans-serif;color:var(--yellow);margin:18px 0 2px;font-variant-numeric:tabular-nums}.score-label{font-size:10px;letter-spacing:.18em;color:var(--muted);margin:6px 0 22px}.run-stats{display:flex;justify-content:space-around;gap:15px;margin-bottom:24px}.run-stats strong{font:800 25px 'Barlow Condensed',Impact,sans-serif}.run-stats span{display:block;font-size:9px;letter-spacing:.08em;margin-top:3px;color:var(--muted)}footer{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;color:#a7a5bf;font-size:11px;line-height:1.5;margin-top:15px}.play-note{width:100%;text-align:center;color:#86819d;font-size:10px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:650px){.arcade{padding:12px 10px max(10px,env(safe-area-inset-bottom))}.masthead{margin-bottom:12px;gap:8px}.brand{gap:8px}.brand-mark{width:38px;height:38px;font-size:35px;border-radius:9px}.brand h1{font-size:25px}.brand p{font-size:8px;letter-spacing:.2em;margin-top:5px}.header-buttons{gap:5px}.icon-button{font-size:11px;padding:0 10px;min-height:38px}.machine{border-radius:16px}.hud{height:61px;padding:9px 15px}.hud>div{min-width:80px}.hud strong{font-size:27px}.hud span{font-size:9px}.heart-stat strong{font-size:18px}.track-wrap{height:calc(100svh - 240px);min-height:350px;max-height:750px}.overlay{padding:15px}.start-card{max-width:360px;display:block}.cover-art{height:125px;min-height:0}.cover-art img{object-position:50% 60%}.card-content{padding:20px 23px 19px}.eyebrow{font-size:9px;margin-bottom:7px}h2{font-size:38px;margin-bottom:9px}.intro{font-size:14px;margin:0 0 13px}.howto{margin-bottom:16px}.howto p{font-size:12px;margin:6px 0}.primary{min-height:49px;font-size:16px}.micro{font-size:10px;margin-top:11px}.controls{padding:11px 10px 13px;gap:8px;grid-template-columns:1fr 1.25fr 1fr}.steer{gap:6px;flex-direction:column;font-size:10px;min-height:67px;padding:8px 3px}.steer>span:first-child{font-size:22px;line-height:1}.steer kbd{display:none}.boost{min-height:67px}.boost-label b{font-size:18px}.boost-label small{font-size:9px}.toast{top:15px;font-size:15px;padding:9px 14px}.speed-tag{font-size:8px;padding:6px 9px;bottom:12px}.finish-card{display:block;max-width:350px}.finish-image{display:none}.finish-content{padding:25px}.final-score{font-size:62px}.score-label{margin-bottom:18px}.run-stats{margin-bottom:20px}.desktop-tip{display:none}footer{justify-content:center;text-align:center;font-size:9px;margin-top:9px;gap:3px}.play-note{font-size:8px}}@media(max-height:700px) and (max-width:650px){.cover-art{height:84px}.card-content{padding:16px 20px}.intro{display:none}.howto{margin:11px 0 14px}.track-wrap{min-height:325px}.micro{font-size:9px}h2{font-size:34px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Keep controls and instructions comfortably readable on touch screens. */
.howto p{font-size:14px}.micro{font-size:12px}.icon-button{font-size:14px}.hud span{font-size:12px}.boost-label small{font-size:12px}.steer{font-size:16px}.start-card,.finish-card,.small-card{max-height:100%;overflow-y:auto}.overlay{overscroll-behavior:contain}.controls{touch-action:manipulation}@media(max-width:650px){.track-wrap{min-height:420px}.cover-art{height:85px}.card-content{padding:16px 20px}.card-content .intro{display:none}.card-content h2{font-size:36px;margin-bottom:12px}.howto p{font-size:14px;line-height:1.35;margin:7px 0}.icon-button{font-size:12px;padding:0 9px}.hud span{font-size:10px}.steer{font-size:12px}.boost-label small{font-size:10px}.micro{font-size:12px;line-height:1.35}.howto{margin-bottom:17px}.eyebrow{font-size:10px}.speed-tag{font-size:10px}.run-stats span{font-size:11px}.play-note{font-size:10px}footer{font-size:11px}.start-card{max-width:360px}.score-label{font-size:12px}}
.leaderboard-section{margin-top:24px;padding-top:20px;border-top:1px solid #ffffff25;text-align:left}.leaderboard-section h3{font:800 20px 'Barlow Condensed',Impact,sans-serif;letter-spacing:.1em;color:var(--cyan);margin:0 0 13px}.leaderboard-section label{display:block;font-size:14px;margin:0 0 8px}.initials-row{display:flex;gap:9px}.initials-row input{width:78px;min-height:47px;border:1px solid #807496;border-radius:9px;background:#100e28;color:white;font:800 22px Inter,system-ui,sans-serif;letter-spacing:.1em;text-align:center;text-transform:uppercase}.save-score{flex:1;border-radius:9px;background:var(--pink);font-weight:800;font-size:14px;padding:9px 13px}.save-score:disabled{opacity:.65}.score-status{color:var(--muted);font-size:13px!important;line-height:1.45;margin:11px 0!important}.leaderboard-list{padding:0;margin:14px 0 0;list-style:none;max-height:180px;overflow-y:auto}.leaderboard-list li{display:flex;justify-content:space-between;gap:15px;padding:8px 0;border-bottom:1px solid #ffffff10;font-size:15px}.leaderboard-list strong{color:var(--yellow);font-variant-numeric:tabular-nums}.initials-row input:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}.finish-content{overflow-y:auto}

.back-to-shop{display:inline-block;margin:0 0 14px;color:#e3e3f1;font-size:14px;line-height:1.5;text-underline-offset:4px}.back-to-shop:focus-visible{outline:3px solid var(--cyan);outline-offset:4px}

/* The verified shopping moment follows replay; the full leaderboard follows it. */
.treasure-card[hidden]{display:none!important}.treasure-card{margin-top:24px;padding:20px 0 0;border-top:1px solid #ffffff25;text-align:left}.treasure-celebration{margin:0 0 6px;color:var(--yellow);font-size:14px;font-weight:700;line-height:1.5}.treasure-card h3{font:800 26px/1.1 'Barlow Condensed',Impact,sans-serif;margin:0 0 16px;color:#fff}.treasure-product{display:grid;grid-template-columns:100px minmax(0,1fr);gap:15px;align-items:center}.treasure-product img{display:block;width:100%;height:125px;object-fit:contain;background:#fff;border-radius:10px}.treasure-details{min-width:0}.treasure-line{font-size:12px;font-weight:800;letter-spacing:.16em;color:var(--cyan);margin:0 0 6px}.treasure-details h4{font-size:16px;line-height:1.4;margin:0;font-weight:700;overflow-wrap:anywhere}.treasure-option{font-size:14px;line-height:1.4;color:#dedbef;margin:5px 0 0}.treasure-option:empty{display:none}.treasure-price{font-size:19px;font-weight:800;line-height:1.4;margin:8px 0 0;color:var(--yellow)}.treasure-shop{display:flex;align-items:center;justify-content:center;min-height:48px;margin:16px 0 0;padding:10px 14px;border:1px solid #fa70bc;border-radius:10px;color:#fff;background:#682251;font-size:16px;font-weight:800;text-decoration:none;text-align:center}.treasure-shop:hover{background:#8a2b69}.treasure-shop:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}.treasure-note{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0 0}.finish-content{min-width:0}.finish-card{align-items:start}.finish-image{min-height:100%;align-self:stretch}.finish-content{overflow-y:visible}@media(max-width:650px){.treasure-product{grid-template-columns:88px minmax(0,1fr);gap:12px}.treasure-product img{height:110px}.treasure-card h3{font-size:25px}.finish-content{padding:22px}}

/* A dedicated viewport row keeps scores visible without covering game controls. */
body.has-score-strip{height:100dvh;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
body.has-score-strip>.arcade{width:100%;height:100%;min-height:0;margin:0 auto;overflow-y:auto;overscroll-behavior-y:contain;padding-bottom:20px}
.score-strip{display:flex;align-items:center;gap:16px;min-width:0;min-height:58px;padding:9px max(18px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));border-top:2px solid #ff40a9;background:#141126;color:#fff;box-shadow:0 -5px 22px #0005;z-index:8}
.score-strip h2{flex:none;font:800 16px/1.2 Inter,system-ui,sans-serif;letter-spacing:.055em;color:#65f3ff;margin:0}
.score-strip-viewport{min-width:0;flex:1;overflow:hidden;outline-offset:-3px}
.score-strip-viewport:focus-visible{outline:2px solid #65f3ff}
.score-strip [data-score-status]{margin:0;font:500 14px/1.5 Inter,system-ui,sans-serif;color:#d8d4eb;white-space:nowrap}
.score-strip-track{display:flex;align-items:center;width:max-content}
.score-strip ol{display:flex;align-items:center;flex:none;gap:28px;margin:0;padding:5px 28px 5px 0;list-style:none;width:max-content}
.score-strip li{display:flex;align-items:center;gap:10px;white-space:nowrap;font:700 15px/1.4 Inter,system-ui,sans-serif}
.score-strip li span{color:#fff}.score-strip li strong{color:#ffe75e;font-variant-numeric:tabular-nums}
.score-strip button{flex:none;min-height:38px;min-width:54px;padding:7px 10px;border:1px solid #ffffff50;border-radius:8px;background:#ffffff0a;font:600 13px/1.3 Inter,system-ui,sans-serif}
.score-strip button:focus-visible{outline:3px solid #65f3ff;outline-offset:1px}
.score-strip [hidden]{display:none!important}
.score-strip.is-moving .score-strip-track{animation:score-strip-scroll var(--score-duration,32s) linear infinite;will-change:transform}
.score-strip.is-moving:hover .score-strip-track{animation-play-state:paused}
.score-strip.is-static .score-strip-viewport{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
.score-strip.is-static .score-strip-track{animation:none;transform:none}
@keyframes score-strip-scroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media(max-width:650px){.score-strip{gap:9px;min-height:56px;padding-inline:max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right))}.score-strip h2{font-size:11px;max-width:52px}.score-strip li{font-size:14px;gap:8px}.score-strip ol{gap:22px;padding-right:22px}.score-strip button{font-size:12px;min-width:49px;padding-inline:7px}.score-strip [data-score-status]{font-size:13px}}
@media(prefers-reduced-motion:reduce){.score-strip-track{animation:none!important;transform:none!important}.score-strip-viewport{overflow-x:auto!important}.score-strip [data-score-copy]{display:none!important}}

/* A ride owns the full viewport from its first tap through pause/restart. */
body.has-score-strip.race-active{grid-template-rows:minmax(0,1fr)}
body.race-active #scoreStrip{display:none!important}
body.has-score-strip.race-active>.arcade{display:flex;flex-direction:column;padding-bottom:max(12px,env(safe-area-inset-bottom));padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));overflow:hidden}
body.race-active .arcade>.back-to-shop,body.race-active .masthead,body.race-active .hud,body.race-active .controls,body.race-active .race-progress{flex-shrink:0}
body.race-active .arcade>.back-to-shop{align-self:flex-start}
body.race-active .machine{display:flex;flex:1;min-height:0;flex-direction:column}
body.race-active .track-wrap{flex:1;min-height:0;height:auto;max-height:none}
body.race-active .arcade>footer{display:none}
@media(max-height:500px) and (orientation:landscape){body.has-score-strip.race-active>.arcade{padding-top:max(6px,env(safe-area-inset-top));padding-bottom:max(6px,env(safe-area-inset-bottom))}body.race-active .back-to-shop{margin-bottom:4px;font-size:12px}body.race-active .masthead{margin-bottom:6px}body.race-active .brand-mark{height:32px;width:32px;font-size:30px}body.race-active .brand h1{font-size:25px}body.race-active .brand p{display:none}body.race-active .hud{height:44px;padding-block:5px}body.race-active .hud strong{font-size:23px}body.race-active .hud span{font-size:9px}body.race-active .controls{padding:7px 10px;gap:8px}body.race-active .steer,body.race-active .boost{min-height:48px}body.race-active .steer{flex-direction:row}body.race-active .small-card{padding:12px 22px}body.race-active .small-card h2{font-size:27px;margin-bottom:8px}body.race-active .small-card p:not(.eyebrow){display:none}body.race-active .small-card .primary{min-height:42px}body.race-active .small-card .secondary{min-height:38px;margin-top:8px}}

/* Finish uses the available screen, rather than the shorter racing canvas.
   Keep the score, replay and verified piece above the optional score-entry list. */
#endOverlay{position:fixed;z-index:20;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#0c0a28c9}
#endOverlay .finish-card{width:min(720px,100%);max-height:100%;overscroll-behavior:contain;scrollbar-width:thin}
#endOverlay .finish-content{padding:18px}
#endOverlay .finish-content h2{font-size:34px;margin:4px 0 6px}
#endOverlay .final-score{font-size:44px;margin:10px 0 2px}
#endOverlay .score-label{margin:4px 0 10px;font-size:12px}
#endOverlay .run-stats{margin-bottom:12px;gap:8px}
#endOverlay .run-stats strong{font-size:22px}
#endOverlay .run-stats span{font-size:11px}
#endOverlay #again{min-height:46px}
#endOverlay .treasure-card{margin-top:16px;padding-top:14px}
#endOverlay .treasure-celebration{display:none}
#endOverlay .treasure-card h3{font-size:24px;margin-bottom:10px}
#endOverlay .treasure-product{grid-template-columns:100px minmax(0,1fr);gap:12px}
#endOverlay .treasure-product img{height:112px}
#endOverlay .treasure-shop{min-height:46px;margin-top:10px}
#endOverlay .treasure-note{margin-top:8px}
@media(max-width:650px){#endOverlay .finish-card{max-width:420px}#endOverlay .finish-content{padding:16px}#endOverlay .leaderboard-section{margin-top:18px;padding-top:16px}}
@media(max-height:650px){#endOverlay .finish-content{padding:12px 16px}#endOverlay #endEyebrow,#endOverlay #endMessage{display:none}#endOverlay .finish-content h2{font-size:28px;margin:0 0 4px}#endOverlay .final-score{font-size:36px;margin-top:6px}#endOverlay .score-label{margin-bottom:6px}#endOverlay .run-stats{margin-bottom:10px}#endOverlay .run-stats strong{font-size:20px}#endOverlay .treasure-card{margin-top:12px;padding-top:10px}#endOverlay .treasure-card h3{font-size:22px;margin-bottom:8px}#endOverlay .treasure-product img{height:100px}}
