@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fredoka:wght@500;600;700&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#254c4d;background:#d8f1ec;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #143f52;outline-offset:5px}[hidden]{display:none!important}#game{height:100svh;min-height:530px;position:relative;overflow:hidden;isolation:isolate}canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}header{position:absolute;top:0;left:0;width:100%;display:flex;justify-content:space-between;align-items:center;padding:28px 42px;z-index:5;pointer-events:none}.wordmark{font-family:Fredoka,sans-serif;font-weight:600;font-size:25px;letter-spacing:-.7px;text-decoration:none;color:#244f4f;pointer-events:auto}.wordmark span{display:block;font:700 9px 'DM Sans',sans-serif;letter-spacing:1.7px;margin-top:5px}.icon{border:1px solid #28575a30;background:#fff9;backdrop-filter:blur(8px);border-radius:30px;padding:11px 16px;color:#254c4d;pointer-events:auto;font-size:13px;font-weight:700}.screen{position:absolute;inset:0;background:linear-gradient(90deg,#f9edcfb3 0%,#f9edcf40 45%,transparent 68%),url('intro-lexi.webp') center/cover no-repeat}.intro-copy{position:absolute;left:8%;top:27%;max-width:650px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:2px}h1{font-family:Fredoka,sans-serif;font-size:clamp(70px,8.8vw,142px);font-weight:600;letter-spacing:-6px;line-height:1;margin:18px 0 23px;color:#1a696c;text-shadow:0 3px #fff5}h1 span{color:#ed7757;display:inline-block;transform:rotate(9deg)}.tagline{font-size:clamp(17px,1.7vw,24px);line-height:1.55;margin-bottom:30px}.primary{border:0;border-radius:100px;background:#db6749;color:white;padding:18px 30px;min-width:210px;box-shadow:0 5px 0 #ac4e39,0 10px 25px #914d2822;font-size:19px;font-weight:700;transition:transform .15s,filter .15s}.primary:hover{filter:brightness(1.06);transform:translateY(-2px)}.primary:active{transform:translateY(3px);box-shadow:0 2px 0 #ac4e39}.primary span{margin-left:28px}.best-intro{font-size:11px;letter-spacing:1.3px;margin:24px 0}.best-intro strong{font-size:16px;margin-left:10px}.instructions{position:absolute;bottom:26px;left:5%;right:5%;display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:13px}.instructions b{background:#fff8;border:1px solid #36534b25;border-radius:6px;padding:5px 8px}.instructions i{font-style:normal;padding:0 10px}.stats{position:absolute;left:50%;top:28px;transform:translateX(-50%);display:flex;gap:30px;align-items:center;background:#fffdf0e8;border:1px solid #fff;border-radius:20px;padding:15px 24px;box-shadow:0 6px 22px #256c6d14}.stats small,.results small{display:block;font-size:10px;font-weight:700;letter-spacing:1.5px;margin-bottom:3px}.stats strong{font-family:Fredoka,sans-serif;font-size:27px;font-weight:500}#hearts{white-space:nowrap;color:#db6749;font-size:26px;letter-spacing:3px}.zoom-wrap{position:absolute;bottom:35px;left:50%;width:290px;transform:translateX(-50%)}.zoom-label{display:flex;justify-content:space-between;font-size:10px;letter-spacing:1px;font-weight:800;margin-bottom:9px}.meter{height:12px;border-radius:12px;background:#ffffffa8;padding:3px;box-shadow:0 1px 3px #0001}#zoomFill{height:100%;border-radius:10px;background:#e4784c;width:0;transition:width .12s}.zooming .meter{box-shadow:0 0 25px #ffbb58}.zooming #zoomFill{background:#e75940}.zooming #multiplier{color:#bb4329}#callout{position:absolute;top:150px;left:0;right:0;text-align:center;font-family:Fredoka,sans-serif;font-size:28px;color:#fff;text-shadow:0 2px 5px #236668;pointer-events:none}.run-hint{position:absolute;bottom:13px;left:0;right:0;text-align:center;letter-spacing:2px;font-size:8px;opacity:.6}.lane-controls{position:absolute;bottom:32px;left:7%;right:7%;display:flex;justify-content:space-between;pointer-events:none}.lane-controls button{pointer-events:auto;background:#fff7;border:1px solid #fff9;border-radius:50%;height:55px;width:55px;color:#38615b;font-size:25px;touch-action:manipulation}.modal{position:absolute;inset:0;display:grid;place-items:center;background:#254c4d30;backdrop-filter:blur(4px);z-index:10}.card{text-align:center;background:#fffaeb;border:2px solid #fff;border-radius:28px;padding:40px;box-shadow:0 25px 80px #23454430;max-width:440px;width:90%}.card h2{font-family:Fredoka,sans-serif;font-size:58px;font-weight:500;color:#206c6d;margin:12px 0}.card p{font-size:15px;line-height:1.6}.results{display:flex;justify-content:center;gap:42px;margin:26px 0}.results strong{font-family:Fredoka,sans-serif;font-size:34px;color:#cd6146}.card .small{font-size:11px;margin:24px 0 0}body.playing .wordmark span{display:none}@media(max-width:760px){header{padding:20px}.wordmark{font-size:21px}.wordmark span{font-size:7px}.screen{background-position:62% center;background-image:linear-gradient(0deg,#faeccfe8,transparent 78%),url('intro-lexi.webp')}.intro-copy{left:7%;top:auto;bottom:125px}.eyebrow{font-size:9px;letter-spacing:1.1px}h1{font-size:77px;letter-spacing:-3px;margin:12px 0}.tagline{font-size:17px;line-height:1.45;margin:14px 0 21px}.primary{font-size:17px;padding:16px 26px}.instructions{bottom:23px;flex-direction:column;align-items:flex-start;left:7%;font-size:11px;gap:17px}.best-intro{margin:21px 0 0}.stats{top:78px;padding:10px 15px;gap:21px;white-space:nowrap}.stats strong{font-size:24px}#hearts{font-size:21px;letter-spacing:0}#callout{top:158px;font-size:23px}.zoom-wrap{width:205px;bottom:38px}.lane-controls{left:5%;right:5%}.card{padding:30px 22px}.screen{background-position:65% 35%}.intro-copy{background:radial-gradient(ellipse,#faeccf70,transparent);}}@media(max-height:650px) and (min-width:761px){.intro-copy{top:23%}h1{font-size:85px}.tagline{font-size:18px;margin-bottom:18px}}
/* Keep the illustrated beach readable behind the in-game controls. */
body.playing header .wordmark{color:#fff9ec;text-shadow:0 2px 8px #244d50aa}body.playing #sound{background:#fff6e8df}.primary:disabled{cursor:wait;opacity:.7;font-size:15px}body.playing #callout{top:145px;font-size:clamp(22px,2.5vw,32px);text-shadow:0 2px 8px #234f51,0 0 20px #234f5177}.zoom-label{color:#234746;text-shadow:0 1px 5px #fff}.lane-controls button{background:#fff7e9d9;box-shadow:0 4px 14px #67462924}.zoom-wrap{background:#fff5dfcc;border:1px solid #fff6;padding:12px 16px;border-radius:18px;bottom:28px;width:320px}.run-hint{bottom:8px}@media(max-width:760px){.zoom-wrap{width:215px;padding:10px 12px;bottom:29px}body.playing #callout{top:151px}.zoom-label{font-size:8px}}

/* Intro: one title, one tagline, one action, then useful instructions. */
body:not(.playing) .wordmark { visibility: hidden; }
.intro-copy { top: 29%; max-width: 650px; }
.intro-copy h1 { margin-top: 0; }
.instructions { position: static; display: block; margin: 26px 0 0; font-size: 14px; line-height: 1.6; }
.instructions p { margin: 0 0 8px; }
.instructions b { display: inline-block; padding: 1px 7px; font-size: 14px; }
.touch-controls { display: none; }
.best-intro { font-size: 14px; letter-spacing: 0; margin: 20px 0 0; }
.best-intro strong { font-size: 16px; }
.icon { font-size: 14px; }
.stats small, .results small { font-size: 12px; letter-spacing: .8px; }
.zoom-label { font-size: 14px; letter-spacing: 0; }
.eyebrow { font-size: 13px; letter-spacing: .8px; }
@media (pointer: coarse) { .desktop-controls { display: none; } .touch-controls { display: block; } }
@media (max-width:760px) {
  .intro-copy { top: auto; bottom: 35px; right: 7%; }
  .intro-copy h1 { font-size: clamp(60px, 15vw, 77px); }
  .instructions { font-size: 14px; margin-top: 23px; }
  .zoom-label { font-size: 12px; }
  .eyebrow { font-size: 12px; }
}
@media (max-height:650px) and (min-width:761px) {
  .intro-copy { top: 20%; }
  .instructions { margin-top: 20px; }
}
/* A single, skimmable pre-run guide using the actual game artwork. */
#tutorial{border:1px solid #fff;border-radius:26px;background:#fff9ea;color:#254c4d;width:min(600px,calc(100% - 28px));max-height:calc(100svh - 28px);padding:0;box-shadow:0 24px 90px #173f4b55;overflow:auto}
#tutorial::backdrop{background:#21494c55;backdrop-filter:blur(5px)}
.tutorial-content{padding:24px 28px;text-align:center}
#tutorial h2{font:500 32px Fredoka,sans-serif;margin:0 0 18px}
.guide-group{margin:0 0 15px;text-align:left}
.guide-group h3{font-size:16px;margin:0 0 5px;display:flex;justify-content:space-between;color:#256b57}
.guide-group h3 span{font-size:14px;font-weight:500}.danger h3{color:#aa4938}
.guide-items{display:grid;gap:6px;grid-template-columns:repeat(4,1fr)}
.guide-items figure{margin:0;text-align:center;min-width:0}
.guide-item{position:static;display:block;width:64px;height:64px;margin:auto;touch-action:auto}
.guide-items figcaption{font-size:14px;line-height:1.2}
.bad-items{grid-template-columns:repeat(7,1fr)}.bad-items .guide-item{width:58px;height:58px}
.guide-zoom{padding:13px 16px;background:#f6e7c6;border-radius:14px;text-align:left}
.guide-zoom strong{font-size:16px}.guide-zoom p{font-size:14px;line-height:1.45;margin:7px 0 0}
.guide-meter{height:13px;margin:9px 38px 0 0;background:#fff9;border-radius:10px;position:relative}
.guide-meter span{display:block;width:100%;height:100%;background:linear-gradient(90deg,#efbd57,#db6749);border-radius:10px}
.guide-meter b{position:absolute;right:-34px;top:-3px;color:#aa4938;font-size:16px}
.guide-controls{font-size:14px;margin:17px 0}.tutorial-content .primary{font-size:17px;padding:14px 26px}
@media(max-width:560px){.tutorial-content{padding:21px 18px}#tutorial h2{font-size:28px;margin-bottom:16px}.bad-items{grid-template-columns:repeat(4,1fr);row-gap:8px}.guide-item{width:55px;height:55px}.bad-items .guide-item{width:49px;height:49px}.guide-items figcaption{font-size:13px}.guide-group{margin-bottom:15px}.guide-zoom{padding:12px}.guide-zoom strong{font-size:15px}}
/* Shared header alignment keeps the profile and sound control on one row. */
header{gap:12px}
body:not(.playing) .wordmark{display:none}
body.playing .instagram-profile{display:none}
.instagram-profile{display:inline-flex;align-items:center;gap:9px;height:48px;padding:4px 12px 4px 4px;border-radius:30px;background:#fff9;color:#28585b;text-decoration:none;font-size:14px;pointer-events:auto;transition:background .15s}
.instagram-profile:hover{background:#fffd}
.instagram-profile svg{opacity:.7;flex:none}
.instagram-copy{display:flex;flex-direction:column;gap:1px;line-height:1.15}
.instagram-copy strong{color:#aa4e38;font-size:14px;font-weight:700}
.instagram-copy>span{font-size:14px}
.instagram-avatar{position:relative;display:block;width:36px;height:36px;overflow:hidden;border-radius:50%;flex:none}
.instagram-avatar img{position:absolute;width:128.75%;height:auto;max-width:none;left:-12.92%;top:-5.83%}
#sound{height:48px;white-space:nowrap}
@media(max-width:760px){.instagram-profile{gap:8px;padding-right:10px}}
/* The entire top HUD follows one layout; only buttons receive pointer input. */
.hud-top{position:absolute;top:28px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:7px;width:max-content;max-width:calc(100% - 32px);pointer-events:none}
.hud-top .stats{position:static;transform:none;width:100%;padding:12px 20px;gap:25px}
.hud-top .zoom-wrap{position:static;transform:none;width:100%;bottom:auto;padding:9px 16px;border-radius:13px;pointer-events:none}
.hud-top .zoom-label{margin-bottom:6px;font-size:13px}
.hud-top .meter{height:10px}
.hud-top button{pointer-events:auto}
body.playing #callout{top:184px;pointer-events:none}
@media(max-width:960px){.hud-top{top:84px}body.playing #callout{top:231px}}
@media(max-width:760px){.hud-top .stats{padding:10px 14px;gap:18px}.hud-top .zoom-wrap{padding:8px 14px}.hud-top .zoom-label{font-size:12px}body.playing #callout{top:225px;font-size:21px}}
@media(max-width:370px){.hud-top .stats{gap:11px;padding:10px}.stats strong{font-size:21px}.stats small{font-size:11px}}

#rotate-screen{position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;border:0;padding:20px;background:#eaf1de;color:#28585b;overflow:auto}
#rotate-screen[open]{display:grid;place-items:center}
#rotate-screen::backdrop{background:#eaf1de}
.rotate-content{text-align:center;max-width:430px}
.rotate-content svg{color:#d16a4c}
.rotate-content h2{font:500 34px Fredoka,sans-serif;margin:10px 0}
.rotate-content p{font-size:17px;line-height:1.5;margin:6px 0}
.rotate-content .rotate-note{font-size:14px;color:#50736c}
@media(max-height:350px){.rotate-content svg{height:46px}.rotate-content h2{font-size:28px;margin:6px 0}}

#outfitPortrait{position:static;inset:auto;display:block;width:145px;height:133px;margin:-8px auto -3px;}
#finalLook{margin:0 0 6px;font-weight:600;color:#8a4c7b;font-size:14px;}

#over{overflow:auto;padding:16px 0;}
@media(max-height:700px){#over .card{padding:18px 22px;}#over .card h2{font-size:40px;margin:5px 0;}#over .results{margin:12px 0;}#overReason{margin:5px 0;}}
/* Broad thumb targets, with open space between and above for swipes. */
.lane-controls{left:16px;right:16px;bottom:max(14px,env(safe-area-inset-bottom));}
.lane-controls button{width:clamp(104px,29vw,150px);height:96px;border-radius:26px;font-size:36px;user-select:none;transition:background .1s,transform .1s;}
.lane-controls button:active{background:#fff3d9;transform:scale(.97);}

.header-controls{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0;}
.header-controls .icon{min-height:44px;}
body.playing #pause{background:#fff6e8df;}
@media(max-width:370px){.header-controls{gap:5px}.header-controls .icon{padding:10px;font-size:12px;}}
/* Keep the HUD footprint fixed as score digits and heart counts change. */
.hud-top{width:360px;}
.hud-top .stats{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 94px;gap:12px;width:100%;}
.hud-top .stats>div{min-width:0;}
.stats strong,.results strong{font-variant-numeric:tabular-nums;letter-spacing:0;}
.stats strong{display:block;height:32px;line-height:32px;font-size:24px;white-space:nowrap;}
#hearts{width:94px;font-size:23px;letter-spacing:0;}
@media(max-width:370px){.hud-top .stats{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 78px;gap:8px;}#hearts{width:78px;font-size:20px;}.stats strong{font-size:21px;}}

.leaderboard-link{display:block;margin:16px auto 0;border:0;background:transparent;color:#28595b;font-size:15px;font-weight:700;padding:8px;}
.intro-copy>.leaderboard-link{margin:13px 0 0;padding-left:0;}
.score-form{margin-top:22px;padding-top:16px;border-top:1px solid #28575a22;text-align:left;}
.score-form label{display:block;font-size:14px;font-weight:700;margin-bottom:7px;}
.submit-row{display:flex;gap:8px;}
.submit-row input{width:0;flex:1;min-width:0;border:1px solid #28575a44;border-radius:12px;padding:10px 12px;font:inherit;font-size:16px;background:#fffef9;color:#254c4d;}
.small-button{border:0;border-radius:12px;background:#285d60;color:white;font:600 14px 'DM Sans',sans-serif;padding:12px;min-height:44px;}
.small-button:disabled{opacity:.6;cursor:default;}
#submissionStatus{font-size:14px;margin:8px 0 0;line-height:1.4;}
#over .card{max-height:calc(100svh - 32px);overflow:auto;}
#leaderboardDialog{width:min(460px,calc(100vw - 28px));max-height:calc(100svh - 32px);border:2px solid white;border-radius:25px;padding:24px;background:#fffaeb;color:#254c4d;overflow:auto;}
#leaderboardDialog::backdrop{background:#234d4c66;backdrop-filter:blur(4px);}
.leaderboard-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.leaderboard-heading h2{font:500 34px Fredoka,sans-serif;margin:0;color:#206c6d;}
.leaderboard-intro,#leaderboardStatus,#yourRank{font-size:14px;line-height:1.5;}
#leaderboardList{list-style:none;padding:0;margin:18px 0;}
#leaderboardList li{display:grid;grid-template-columns:35px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 8px;border-bottom:1px solid #28575a19;border-radius:10px;}
#leaderboardList .rank{font-size:18px;}#leaderboardList strong{font-size:16px;overflow-wrap:anywhere;}#leaderboardList small{display:block;font-size:12px;opacity:.7;margin-top:3px;}
#leaderboardList .rank-score{font-size:18px;font-variant-numeric:tabular-nums;}
#leaderboardList .podium{background:#f7d78324;}#leaderboardList .is-me{background:#d2eee8;box-shadow:inset 3px 0 #297e75;}
#yourRank{font-weight:700;}#leaderboardAfter{margin-top:8px;}
/* Zoomies celebration: fixed layout, warm colour, one pop and a flowing shimmer. */
.hud-top .zoom-wrap{position:relative;left:auto;transition:background .3s,border-color .3s,box-shadow .3s;}
#zoomLabel,#multiplier{font-variant-numeric:tabular-nums;white-space:nowrap;}
#zoomFill{position:relative;overflow:hidden;}
body.zooming .hud-top .zoom-wrap{background:linear-gradient(115deg,#fff5cf,#ffe4bd 55%,#ffd4bf);border-color:#ffbe65;box-shadow:0 0 0 2px #ffd17c55,0 0 23px #ffb45370;animation:zoom-glow 1.4s ease-in-out infinite;}
body.zooming #zoomLabel{color:#af431f;text-shadow:0 1px #fff8;animation:zoom-pop .5s cubic-bezier(.2,.8,.3,1);transform-origin:left center;}
body.zooming #multiplier{color:#9c3b1e;text-shadow:0 1px #fff9;}
body.zooming #zoomFill{background:linear-gradient(90deg,#ee8051,#ffd66e,#f3a847,#ee8051);background-size:200% 100%;box-shadow:0 0 9px #ed8c49;animation:zoom-flow 1.1s linear infinite;}
body.zooming #zoomFill::after{content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 35%,#fff9 50%,transparent 65%);transform:translateX(-100%);animation:zoom-shine 1.3s ease-in-out infinite;}
@keyframes zoom-pop{0%{transform:scale(.92)}45%{transform:scale(1.08)}75%{transform:scale(.99)}100%{transform:scale(1)}}
@keyframes zoom-glow{0%,100%{box-shadow:0 0 0 2px #ffd17c55,0 0 16px #ffb45350}50%{box-shadow:0 0 0 2px #ffd17c88,0 0 28px #ffb45385}}
@keyframes zoom-flow{to{background-position:200% 0}}
@keyframes zoom-shine{to{transform:translateX(100%)}}
body.game-paused .zoom-wrap,body.game-paused #zoomLabel,body.game-paused #zoomFill,body.game-paused #zoomFill::after{animation-play-state:paused!important;}
@media(prefers-reduced-motion:reduce){body.zooming .zoom-wrap,body.zooming #zoomLabel,body.zooming #zoomFill,body.zooming #zoomFill::after{animation:none!important;}.hud-top .zoom-wrap{transition:none;}}
/* Persistent 50k celebration, above the scene and HUD without intercepting taps. */
#game::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:20;opacity:0;transition:opacity 1.1s ease-out;background:radial-gradient(ellipse at center,transparent 38%,#ffd57218 66%,#ffca5266 100%),linear-gradient(#ffd76b0b,#ffc8530b);box-shadow:inset 0 0 50px #ffd26a35;}
body.golden-run #game::after{opacity:1;}
@media(prefers-reduced-motion:reduce){#game::after{transition:none;}}
#outfitPortrait{width:190px;height:174px;margin:-5px auto 0;}
#finalLook{margin:2px 0 4px;font-size:16px;color:#206c6d;}
#overReason{margin:3px 0 12px;font-style:italic;color:#705c4b;}
@media(max-height:740px){#outfitPortrait{width:160px;height:147px;}}
