*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:Arial,Helvetica,sans-serif;color:#fff}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,canvas:focus-visible{outline:3px solid #ffc95d;outline-offset:4px}button:disabled{cursor:wait;opacity:.65}[hidden]{display:none!important}#game{position:relative;width:100%;height:100dvh;min-height:360px;background:#b5ced5}canvas{width:100%;height:100%;display:block;touch-action:none}header{position:absolute;top:max(22px,env(safe-area-inset-top));left:28px;right:28px;display:flex;justify-content:space-between;align-items:center}.brand{font-size:25px;font-weight:900;letter-spacing:-1px;color:#193c39}.brand b{color:#a73243}.brand small{display:block;font-size:10px;letter-spacing:2.8px;margin-top:6px}#pause{width:44px;height:44px;border:1px solid #fff5;border-radius:14px;background:#193c39d9;color:white;font-weight:bold}.hud{position:absolute;top:100px;left:28px;display:flex;gap:28px;background:#193c39e8;padding:16px 22px;border-radius:18px;box-shadow:0 6px 22px #1232}.hud span,#results span{display:block;font-size:11px;letter-spacing:1.5px;font-weight:bold;color:#c9d9d2}.hud strong{display:block;font-size:26px;margin-top:5px}.hud i{font-style:normal}.hud small{font-size:14px;color:#ccd9d4}.radishes strong{color:#f0bdc3}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:linear-gradient(90deg,#16363150,transparent,#16363125);padding:180px 20px 110px}.card{background:#173c38f5;max-width:430px;width:100%;border:1px solid #ffffff26;border-radius:26px;padding:28px;text-align:center;box-shadow:0 20px 65px #10282240}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:bold;color:#eccc88}h1{font-size:38px;line-height:1.06;letter-spacing:-1.5px;margin:16px 0}p{font-size:15px;line-height:1.5;color:#d0ddd6}#play{border:0;background:#f5c467;color:#21372e;font-size:19px;font-weight:900;width:100%;padding:18px;border-radius:13px;margin-top:12px;box-shadow:0 4px 0 #b98a40}#play:active{transform:translateY(2px);box-shadow:0 2px 0 #b98a40}.instructions{font-size:12px;line-height:1.7;margin:20px 0 0}#status{font-size:12px;margin:10px 0 0;color:#edc986}#status:empty{display:none}#results{display:flex;justify-content:space-around;margin:25px 0 10px}#results strong{display:block;font-size:25px;margin-top:7px}.touch{position:absolute;bottom:max(48px,calc(env(safe-area-inset-bottom) + 32px));left:50%;transform:translateX(-50%);display:flex;gap:12px}.touch button{min-width:68px;height:55px;border:1px solid #ffffff80;border-radius:16px;background:#193c39de;color:white;font-size:22px;font-weight:bold;user-select:none}.touch button:nth-child(2){font-size:15px;width:110px}.touch button:active{background:#b44047}footer{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));left:28px;right:28px;display:flex;justify-content:space-between;color:#193c39;font-size:10px;letter-spacing:2px;font-weight:bold}@media(max-width:600px){header{top:max(16px,env(safe-area-inset-top));left:18px;right:18px}.brand{font-size:22px}.hud{top:80px;left:18px;right:18px;justify-content:space-between;gap:10px;padding:13px 17px}.hud strong{font-size:23px}.hud span{font-size:9px}.overlay{padding:150px 18px 110px}.card{padding:23px}h1{font-size:33px}}@media(max-height:660px){.overlay{padding:135px 15px 85px}.card{padding:17px;max-width:470px}h1{font-size:27px;margin:10px 0}.instructions{margin-top:12px}p{margin:8px 0}.hud{top:65px;padding:9px 17px}.hud strong{font-size:20px}#play{padding:13px}.touch{bottom:32px}.touch button{height:43px}.brand small{display:none}}@media(max-height:450px){.hud{left:auto;right:80px;top:12px}.overlay{padding:65px 10px 65px}.card{max-width:490px;padding:12px 22px}h1{font-size:24px}h1 br{display:none}.instructions{font-size:11px;margin-top:7px}#results{margin:10px 0}#results strong{font-size:20px}}

.touch button[data-action="slide"]{font-size:14px;width:94px}.touch button[data-action="jump"]{width:94px}@media(max-width:420px){.touch{gap:8px}.touch button{min-width:52px}.touch button[data-action="slide"],.touch button[data-action="jump"]{width:82px}}

.hud .radishes>span,#results>div:last-child>span{max-width:125px;line-height:1.35}.hud .radishes{min-width:0}

header{z-index:3;pointer-events:none}#pause{pointer-events:auto;width:auto;min-width:100px;height:46px;padding:0 14px;font-size:15px;background:#193c39;box-shadow:0 3px 12px #10282230}.overlay{z-index:2}@media(max-height:450px){.hud{right:140px}}

#pause{position:fixed;right:max(8px,env(safe-area-inset-right));bottom:max(6px,env(safe-area-inset-bottom));min-width:76px;height:38px;padding:0 10px;font-size:13px;border-radius:11px;z-index:5}footer{right:96px}.touch{bottom:max(54px,calc(env(safe-area-inset-bottom) + 48px))}@media(max-height:450px){.hud{right:18px}.touch{bottom:max(48px,calc(env(safe-area-inset-bottom) + 42px))}}

#pause{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:max(76px,calc(env(safe-area-inset-bottom) + 56px));height:44px;z-index:20;pointer-events:auto;background:#193c39;border:2px solid #f5c467;color:#fff;box-shadow:0 3px 14px #10282255}@media(pointer:coarse){.touch{bottom:max(132px,calc(env(safe-area-inset-bottom) + 112px))}}

/* Desktop uses keyboard arrows; touch devices retain optional movement controls. */
@media(hover:hover) and (pointer:fine){.touch{display:none}}
#pause{top:42%;bottom:auto;right:max(12px,env(safe-area-inset-right));height:46px;min-width:88px;font-size:15px}

@media(pointer:coarse),(max-width:600px){#pause{top:auto;bottom:max(124px,calc(env(safe-area-inset-bottom) + 104px));left:50%;right:auto;transform:translateX(-50%);min-width:110px;height:46px}}

#sound{pointer-events:auto;flex-shrink:0;min-width:84px;min-height:44px;margin-left:12px;padding:8px 10px;border:1px solid #ffffff80;border-radius:12px;background:#193c39;color:#fff;font-size:14px;font-weight:bold;touch-action:manipulation}

#chase-status{position:absolute;z-index:1;top:190px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 36px);border:1px solid #f5c467;border-radius:12px;padding:10px 14px;background:#193c39ed;color:#f5dc94;text-align:center;font-size:14px;font-weight:bold;pointer-events:none}@media(max-width:600px){#chase-status{top:175px;font-size:12px}}@media(max-height:450px){#chase-status{top:90px}}

#rewards-hud{position:absolute;top:190px;left:28px;z-index:1;padding:8px 12px;border-radius:12px;background:#193c39ed;color:#fff;pointer-events:none;font-size:14px;max-width:calc(100% - 36px)}
#health-icons{font-size:22px;vertical-align:middle;margin:0 8px}
#power-status{color:#f5dc94;font-size:14px}
#reward-status{color:#ffe18a;font-size:14px;margin-top:4px}
#reward-status:empty{display:none}
#chase-status{top:278px}
@media(max-width:600px){#rewards-hud{top:160px;left:18px}#chase-status{top:248px}}
@media(max-height:660px){#rewards-hud{top:139px}}
@media(max-height:450px){#rewards-hud{top:82px;left:18px}#chase-status{top:82px;left:auto;right:18px;transform:none;max-width:45%}}

/* Compact phone score strip, above branding and clear of the screen cutout. */
@media(max-width:600px){
 .hud{top:calc(env(safe-area-inset-top,0px) + 8px);left:10px;right:10px;display:grid;grid-template-columns:1fr 1.4fr 1fr;gap:8px;padding:8px 12px;border-radius:13px;pointer-events:none}
 .hud span{font-size:10px;letter-spacing:.65px;line-height:1.2}
 .hud strong{font-size:20px;margin-top:3px;line-height:1.1}
 .hud small{font-size:12px}
 .hud .radishes>span{max-width:none}
 .hud .best{text-align:right}
 header{top:calc(env(safe-area-inset-top,0px) + 74px);left:14px;right:14px}
 .brand{font-size:19px}.brand small{display:none}
 #rewards-hud{top:calc(env(safe-area-inset-top,0px) + 126px);left:10px;max-width:calc(100% - 20px)}
 #chase-status{top:calc(env(safe-area-inset-top,0px) + 188px);left:50%;right:auto;transform:translateX(-50%);max-width:calc(100% - 20px)}
}

/* Centered arcade title above the compact score strip. */
header{justify-content:center}
.brand{font-family:"Arial Black","Trebuchet MS",Arial,sans-serif;font-size:32px;font-weight:900;font-style:italic;letter-spacing:-1px;white-space:nowrap;color:#fff0cc;-webkit-text-stroke:1px #193c39;paint-order:stroke fill;text-shadow:0 3px 0 #193c39,1px 4px 0 #193c39;transform:rotate(-2deg)}
.brand b{color:#b44047;font-size:1.12em}
#sound{position:absolute;right:0;top:0}
@media(min-width:601px){.hud{left:50%;right:auto;transform:translateX(-50%)}}
@media(max-width:600px){
 header{top:calc(env(safe-area-inset-top,0px) + 2px);left:10px;right:10px;height:36px}
 .brand{font-size:clamp(22px,6.4vw,30px)}
 .hud{top:calc(env(safe-area-inset-top,0px) + 46px)}
 #sound{top:108px;right:0;min-height:36px;font-size:12px;padding:6px 9px}
 #rewards-hud{top:calc(env(safe-area-inset-top,0px) + 158px)}
 #chase-status{top:calc(env(safe-area-inset-top,0px) + 216px)}
}

/* The in-app viewer already reserves room above the game for its toolbar. */
@media(max-width:600px){
 #game{--hud-top:min(env(safe-area-inset-top,0px),24px)}
 header{top:calc(var(--hud-top) + 2px)}
 .hud{top:calc(var(--hud-top) + 46px)}
 #rewards-hud{top:calc(var(--hud-top) + 158px)}
 #chase-status{top:calc(var(--hud-top) + 216px)}
}
@media(max-width:600px) and (display-mode:standalone){#game{--hud-top:env(safe-area-inset-top,0px)}}

/* Covers phone landscape without changing the desktop layout. */
#rotate-phone{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:#193c39;color:#fff0cc;text-align:center;padding:max(20px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));touch-action:none;overflow:auto}
#rotate-phone .card{max-width:430px;padding:24px;border-color:#f5c46780}
#rotate-title{margin:0 0 12px;font-size:clamp(22px,4vw,30px);line-height:1.15}
#rotate-phone p{font-size:16px;margin:8px 0}

/* Phone players pause by rotating; keep the play area clear for swipes. */
#game.phone-play #pause{display:none}

/* Swipes may start over noninteractive HUD text as well as the road. */
#game{touch-action:none;user-select:none;-webkit-user-select:none}

/* Optional one-use continue stays inside the existing game-over card. */
#revive{width:100%;border:2px solid #f5c467;border-radius:13px;background:#f5c467;color:#21372e;padding:14px 10px;font-size:16px;font-weight:900;touch-action:manipulation}
#revive-note{font-size:12px;margin:8px 0;line-height:1.4}
#revive-offer:not([hidden])~.instructions{display:none}
#revive-offer:not([hidden])~#play{background:transparent;color:#f5c467;border:1px solid #f5c46780;box-shadow:none;padding:12px;font-size:16px}
#revive-countdown{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;color:#fff0cc;text-shadow:0 3px 12px #102822}
#revive-countdown span{font-size:20px;font-weight:900;letter-spacing:2px}
#revive-number{font-size:96px;line-height:1.2}

/* Compact record celebration beside the score area; never captures a swipe. */
#best-toast{position:absolute;top:calc(env(safe-area-inset-top,0px) + 60px);left:50%;transform:translateX(-50%);z-index:3;pointer-events:none;white-space:nowrap;border:1px solid #f5c467;border-radius:20px;background:#193c39ed;color:#f5c467;padding:7px 14px;font-size:16px;font-weight:900;letter-spacing:1px;box-shadow:0 3px 12px #10282230}
@media(max-width:600px){#best-toast{top:calc(var(--hud-top) + 113px);left:12px;transform:none;font-size:14px;padding:7px 10px}}

/* The existing start overlay becomes a light menu over the actual road. */
#menu-details{display:none}
.menu-mode .hud,.menu-mode #sound,.menu-mode footer{display:none}
.menu-mode header{top:clamp(24px,7vh,70px);left:16px;right:16px;height:auto}
.menu-mode .brand{font-size:clamp(28px,8.2vw,78px);letter-spacing:-1.5px;text-shadow:0 4px 0 #193c39,2px 6px 0 #193c39}
.menu-mode #overlay{padding:0 20px max(20px,env(safe-area-inset-bottom));align-items:end;background:linear-gradient(0deg,#102e2bce,transparent 36%);pointer-events:none}
.menu-mode #overlay>.card{pointer-events:auto;width:min(100%,350px);max-width:350px;background:transparent;border:0;border-radius:0;box-shadow:none;padding:0}
.menu-mode #eyebrow,.menu-mode #title,.menu-mode #message,.menu-mode .instructions{display:none}
.menu-mode #play{font-size:23px;letter-spacing:1px;padding:17px 20px;border:2px solid #ffe0a0;border-radius:16px;box-shadow:0 5px 0 #a97933,0 8px 24px #10282260}
.menu-mode #menu-details{display:block}
.menu-best{margin:16px 0 13px;font-size:12px;letter-spacing:2px;font-weight:800;color:#e6d7ba;text-shadow:0 2px 5px #102822}
.menu-best strong{display:block;font-size:23px;letter-spacing:0;color:#fff0cc;margin-top:3px}
.menu-secondary{display:flex;justify-content:center;gap:12px}
.menu-secondary button,#main-menu,#close-help{min-height:44px;padding:10px 16px;border:1px solid #f5c46770;border-radius:12px;background:#193c39e8;color:#fff0cc;font-size:14px;font-weight:800}
#main-menu{margin-top:12px;width:100%}
#help-dialog{width:min(90vw,400px);max-height:85dvh;overflow:auto;border:1px solid #f5c46780;border-radius:24px;padding:26px;background:#193c39;color:#fff0cc;text-align:center;box-shadow:0 18px 60px #0006}
#help-dialog::backdrop{background:#102822b0}
#help-dialog h2{font-size:28px;margin:0 0 18px}
#help-dialog section{text-align:left;margin:0 0 20px}
#help-dialog h3,#help-dialog li{font-family:inherit;font-size:16px;line-height:1.5;color:inherit}
#help-dialog h3{margin:0 0 6px;font-weight:700}
#help-dialog ul{margin:0;padding-left:21px}
#help-dialog li+li{margin-top:6px}
#close-help{width:100%;background:#f5c467;color:#193c39;margin-top:8px}
@media(max-height:650px){.menu-mode header{top:20px}.menu-mode #overlay{padding-bottom:14px}.menu-mode #play{padding:12px;font-size:20px}.menu-best{margin:10px 0;font-size:11px}.menu-best strong{font-size:20px}}
@media(min-width:601px) and (max-height:500px){.menu-mode #overlay{justify-items:end;padding-right:6vw}.menu-mode #overlay>.card{width:270px}.menu-mode header{justify-content:flex-start}.menu-mode .brand{font-size:32px}}

/* Keep the menu clear of the phone viewer's bottom toolbar. */
@media(max-width:600px){
 .menu-mode #overlay{padding:0 18px max(88px,calc(env(safe-area-inset-bottom,0px) + 64px))}
 .menu-mode #play{margin-top:0;padding:13px 16px;font-size:21px}
 .menu-mode .menu-best{margin:12px 0 10px}
 .menu-mode .menu-secondary{gap:10px}
 .menu-mode .menu-secondary button{padding:9px 12px;font-size:13px;min-height:44px}
}
@media(max-width:600px) and (max-height:650px){
 .menu-mode header{top:16px}.menu-mode .brand{font-size:clamp(26px,8.2vw,38px)}
 .menu-mode #overlay{padding-bottom:max(76px,calc(env(safe-area-inset-bottom,0px) + 48px))}
 .menu-mode #play{padding:11px;font-size:20px}
 .menu-mode .menu-best{margin:9px 0}.menu-mode .menu-best strong{font-size:19px}
}

/* The phone app overlays its own toolbar and can report a taller web viewport.
   Reserve a proportional bottom area rather than relying on safe-area alone. */
#game.phone-play.menu-mode #overlay{padding-bottom:max(150px,22svh);padding-left:18px;padding-right:18px}
#game.phone-play.menu-mode #overlay>.card{max-width:350px}
#game.phone-play.menu-mode .menu-best{margin:9px 0}
#game.phone-play.menu-mode .menu-secondary button{min-height:44px}

/* Keep chase messages in the top HUD area of windowed desktop games. */
@media(max-height:800px){
 #game:not(.phone-play):not(.menu-mode) header{top:8px;left:12px;right:12px;height:30px}
 #game:not(.phone-play):not(.menu-mode) .brand{font-size:24px}
 #game:not(.phone-play):not(.menu-mode) #sound{top:0;min-height:28px;padding:4px 8px;font-size:12px}
 #game:not(.phone-play):not(.menu-mode) .hud{top:45px;left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);padding:6px 14px;gap:22px}
 #game:not(.phone-play):not(.menu-mode) .hud span{font-size:10px}
 #game:not(.phone-play):not(.menu-mode) .hud strong{font-size:20px;margin-top:2px}
 #game:not(.phone-play) #chase-status{top:101px;left:50%;right:auto;transform:translateX(-50%);padding:4px 9px;font-size:12px;line-height:1.25;max-width:calc(100% - 24px);border-radius:7px}
 #game:not(.phone-play) #rewards-hud{top:138px;left:12px;padding:4px 8px;font-size:12px;max-width:calc(100% - 24px)}
 #game:not(.phone-play) #reward-status{font-size:12px;margin-top:2px}
}

#bonus-progress{font-size:12px;color:#eccc88;line-height:1.4}#bonus-progress:empty{display:none}

/* Back to the main site, styled to match the menu buttons. */
.menu-secondary .back-site{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 12px;border:1px solid #f5c46770;border-radius:12px;background:#193c39e8;color:#fff0cc;font-size:13px;font-weight:800;text-decoration:none;letter-spacing:.02em}
.menu-secondary .back-site:hover{background:#1f4a45}
