@font-face{font-family:Overpass;src:url("/assets/fonts/overpass-latin-wght-normal.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
*{box-sizing:border-box}
:root{font-family:Overpass,Arial,Helvetica,sans-serif;color:#f6f5e9;background:#0c4e3c;--sign:#00533f;--cream:#f6f5e9;--yellow:#ffd32a;--edge:var(--sign);--shadow:0 2px 5px #0005}
body{margin:0}button{font:inherit;font-weight:600;cursor:pointer;min-height:44px;padding:10px 16px;border:0;border-radius:10.5px;background:var(--cream);color:#103b2d;touch-action:manipulation}
button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--yellow);outline-offset:4px}a{color:var(--yellow)}[hidden]{display:none!important}
/* White inset border and green outer rim are drawn in CSS at every size. */
.road-sign{background:var(--sign);color:var(--cream);border:2px solid var(--edge);box-shadow:inset 0 0 0 2px var(--cream),var(--shadow);border-radius:18px}
.yellow-button{background:linear-gradient(120deg,#ffdf39,var(--yellow));color:#082b20;border:2px solid var(--edge);box-shadow:inset 0 0 0 1px #ffe778,var(--shadow);border-radius:21px}
button:not(:disabled):hover{filter:brightness(1.08)}button:not(:disabled):active{filter:brightness(.95)}
.arrow{display:inline-block;width:1.5em;height:.75em;flex:none;margin-left:.3em;vertical-align:-.04em}.location-icon{width:26px;height:34px;flex:none}
#landing{position:relative;min-height:100vh;min-height:100svh;isolation:isolate;padding:clamp(24px,4.5vh,64px) 20px 40px;display:flex;flex-direction:column;align-items:center}
#landing::before{content:'';position:fixed;inset:0;z-index:-1;background:#7dc0e5 url('/assets/bkg-desktop.jpg') var(--landing-x,50%) bottom/cover no-repeat}
#game-intro{width:min(61.6vw,814px);padding:20px 28px 28px;text-align:center;border-radius:30px}
#landing h1{margin:0;font-weight:700;line-height:1.05;letter-spacing:-.035em}.title-the{display:block;font-size:clamp(28px,4.7vw,60px);letter-spacing:0}.title-name{display:block;font-size:clamp(44px,8.3vw,112px);white-space:nowrap;width:125%;margin-left:-12.5%;transform:scaleX(.88)}
.landing-route{border-top:2px solid #f6f5e9b3;margin:30px auto 0;padding-top:20px;display:flex;align-items:center;justify-content:center;gap:16px;width:78%;text-align:left}
.landing-route .location-icon{width:66px;height:52px;border:2px solid var(--cream);border-radius:13.5px;padding:6px 18px}.landing-route h2{font-size:clamp(18px,2.4vw,34px);font-weight:600;color:var(--yellow);margin:0 0 3px}.landing-route p{margin:0;font-size:clamp(13px,1.7vw,24px);font-weight:500;white-space:nowrap}
#setup{margin-top:clamp(32px,10vh,96px)}.landing-actions{display:flex;flex-direction:column;align-items:center;gap:8px}.landing-actions button{font-size:clamp(20px,2.7vw,30px)}:is(#connect,#play-friends){display:flex;align-items:center;justify-content:center;gap:10px;white-space:nowrap;width:min(35.5vw,520px);min-width:266px;min-height:clamp(54px,7.1vw,104px);padding:12px 16px;font-size:clamp(22px,3.1vw,44px);font-weight:700}:is(#connect,#play-friends) .arrow{margin-left:0}
#how-to-play{width:min(27.2vw,400px);min-width:206px;min-height:clamp(46px,6.1vw,88px);font-size:clamp(18px,2.3vw,32px);font-weight:600;padding:10px 20px}
#status{max-width:560px;margin:18px 0 0;padding:12px 16px;text-align:center;background:#004732ec;border-radius:12px;font-size:14px;line-height:1.45}
#game-screen{position:fixed;inset:0;height:100vh;height:100dvh;overflow:hidden;background:#101713}body.playing{overflow:hidden}body.playing #landing{display:none}
#stage{position:absolute;inset:0;overflow:hidden;touch-action:none}#photo-wrap{position:absolute;top:0;left:0;transform-origin:top left;line-height:0}#photo{display:block;height:auto;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;pointer-events:none}#overlay{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab}
#hud{position:absolute;inset:0;pointer-events:none;font-weight:600;color:var(--cream)}#hud button{pointer-events:auto}
.target-card{position:absolute;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:108px;padding:10px 6px 9px;text-align:center;font-size:18px;line-height:1.1;border-radius:13.5px}.target-card strong{display:block;font-weight:700;font-size:72px;line-height:.98;color:var(--yellow)}#letter-value{font-size:14px;letter-spacing:-.025em;margin-top:3px;white-space:nowrap;font-weight:700}
#score-card{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));padding:13px 22px;font-size:23px;text-align:center;white-space:nowrap;border-radius:13.5px}
:is(#menu-button,#landing-menu-button){position:absolute;top:max(12px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));display:flex;align-items:center;gap:12px;padding:10px 20px;font-size:20px;min-height:50px;border-radius:13.5px}.menu-icon{font-size:25px;line-height:1}
#controls-info{position:absolute;top:calc(70px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));padding:5px 7px;max-width:calc(50% - 62px);border-radius:4.5px;background:#26342bc4;color:#fff;font-size:12px;font-weight:500;line-height:1.4;pointer-events:none}
.mobile-controls{display:none}
.drive-bar{position:absolute;bottom:calc(16px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:16px;padding:12px 16px;width:max-content;max-width:calc(100% - 32px);border-radius:24px}
.route-card{display:flex;align-items:center;gap:12px;white-space:nowrap;font-size:13px;padding-right:18px;border-right:1px solid #f6f5e980}.route-place{display:block;font-weight:600;font-size:18px;margin-bottom:3px}.route-mobile-label{display:none}.route-unit{font-size:inherit}
.drive{display:flex;align-items:center;gap:8px}.drive button{font-size:16px;min-width:60px;min-height:48px;padding:8px 10px;border-radius:12px}.drive .yellow-button{font-size:21px;min-width:128px;padding:8px 14px}.drive .arrow{margin-left:.2em}
#pass-letter{background:none;padding:0 0 0 14px;border:0;border-left:1px solid #f6f5e980;border-radius:0;box-shadow:none;min-width:70px;height:64px;min-height:44px;color:#15261e}#pass-letter .highway-shield{display:block;width:56px;height:62px;filter:drop-shadow(0 1px 2px #0005)}.highway-shield{position:relative;aspect-ratio:1;flex:none}.highway-shield img{display:block;width:100%;height:100%;object-fit:contain}.shield-label,.shield-letter{position:absolute;left:0;width:100%;text-align:center;font-family:Overpass,Arial,sans-serif;font-weight:700;line-height:1}.shield-label{top:23%;font-size:9px}.shield-letter{top:40%;font-size:27px}
#score-feedback{position:absolute;top:calc(136px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);padding:9px 12px;border-radius:12px;background:#004732ed;color:var(--cream);font-size:15px;font-weight:700;line-height:1.35;pointer-events:none;text-align:center}
#check-hint{position:absolute;transform:translate(-50%,-50%);max-width:calc(100% - 24px);padding:8px 12px;border-radius:12px;background:#280505e8;color:#fff;font-size:clamp(16px,4vw,22px);font-weight:800;text-align:center;line-height:1.25;pointer-events:none;text-shadow:0 1px 2px #000}
#developer-button{position:absolute;right:max(14px,env(safe-area-inset-right));top:calc(76px + env(safe-area-inset-top));padding:5px 8px;min-height:30px;font-size:11px;background:#004732db;color:var(--cream);border:1px solid #f6f5e980}
#game-screen,#stage,#photo-wrap,#photo,#overlay,#hud{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}#stage,#overlay{-webkit-tap-highlight-color:transparent}
/* Shared road-sign dialog treatment; panels keep their existing behavior. */
dialog{width:min(400px,calc(100vw - 24px));max-height:min(650px,calc(100vh - 32px));max-height:min(650px,calc(100dvh - 32px));padding:22px;border:2px solid var(--edge);border-radius:24px;box-shadow:inset 0 0 0 2px var(--cream),0 8px 35px #0007;background:var(--sign);color:var(--cream);overflow:auto;overscroll-behavior:contain}dialog::backdrop{background:#0008}dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #f6f5e96b;padding-bottom:10px}dialog h2{font-size:1.35rem;margin:0}dialog p{line-height:1.5}dialog button{border:1px solid #f6f5e9a0}.popup-body>div>button,.popup-body>section>button{display:block;width:100%;margin:12px 0 0}#close-popup{flex:none;font-size:24px;width:44px;padding:0;background:transparent;color:var(--cream);border:0}#skip-photo,#finish,#replay,#confirm-pass{background:var(--yellow);color:#082b20;border-color:var(--yellow)}table{border-collapse:collapse;width:100%;font-size:.9rem}th,td{text-align:left;padding:6px;border-bottom:1px solid #f6f5e955}summary{padding:10px 0;cursor:pointer}
dialog.how-to-play{font-size:14px;max-height:min(570px,calc(100vh - 32px));max-height:min(570px,calc(100dvh - 32px))}dialog.how-to-play header{padding:8px 0 12px}#how-to-play-panel h3{font-size:14px;color:var(--yellow);margin:16px 0 6px}#how-to-play-panel p{margin:10px 0}#how-to-play-panel ul{padding-left:20px;margin:8px 0;line-height:1.5}#how-to-play-panel li+li{margin-top:6px}.how-controls{line-height:1.6}dialog.developer-menu{max-height:min(280px,calc(100dvh - 32px))}#final-score{font-size:1.8rem;font-weight:850;color:var(--yellow);margin:16px 0 6px}#score-breakdown{font-size:14px;margin:0 0 12px}
@media(max-width:900px){.drive-bar{gap:10px;padding:10px 12px}.drive{gap:6px}.drive button{min-width:44px;padding:8px 7px;font-size:14px}.drive .yellow-button{min-width:96px;font-size:18px}.route-place{font-size:15px}.route-card{gap:8px;padding-right:10px;font-size:11px}.route-card .location-icon{width:22px}#pass-letter{min-width:54px;padding-left:8px;height:52px}#pass-letter .highway-shield{width:44px;height:50px}}
@media(max-width:650px){
 #landing{padding: max(54px,env(safe-area-inset-top)) 20px 36px;--landing-x:46%}
 #game-intro{width:100%;max-width:430px;padding:10px 16px 12px;border-radius:21px}
 .title-the{font-size:30px}.title-name{font-size:clamp(39px,12.8vw,57px);letter-spacing:-.04em;transform:scaleX(.82)}
 .landing-route{margin-top:12px;padding-top:10px;gap:9px;width:88%}.landing-route .location-icon{width:44px;height:36px;padding:4px 10px;border-radius:9px}.landing-route h2{font-size:16px;font-weight:600}.landing-route p{font-size:11px;font-weight:500}
 #setup{margin-top:54px;width:100%}.landing-actions{gap:6px}:is(#connect,#play-friends){width:min(100%,266px);min-width:0;min-height:54px;padding:10px 12px;font-size:23px}#how-to-play{width:206px;min-width:0;max-width:85%;min-height:46px;font-size:18px;padding:10px 14px}
 :is(#menu-button,#landing-menu-button){left:max(8px,env(safe-area-inset-left));top:max(8px,env(safe-area-inset-top));gap:8px;padding:8px 12px;min-height:44px;font-size:16px}.menu-icon{font-size:23px}
 .target-card{top:max(8px,env(safe-area-inset-top));width:94px;padding:8px 4px;font-size:16px}.target-card strong{font-size:56px}#letter-value{font-size:12px}
 #score-card{top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));font-size:18px;padding:12px 10px}
 #controls-info{top:calc(58px + env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));max-width:calc(50% - 58px);font-size:11px;padding:4px 5px}
 .drive-bar{bottom:calc(8px + env(safe-area-inset-bottom));width:calc(100% - 4px);max-width:none;gap:10px;padding:10px 12px;border-radius:16.5px;justify-content:center}
 .route-card{position:absolute;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);gap:7px;font-size:16px;padding:9px 14px;background:var(--sign);border:2px solid var(--edge);box-shadow:inset 0 0 0 2px var(--cream),var(--shadow);border-radius:16.5px}.route-card .location-icon{width:20px;height:27px}.route-place,.route-road{display:none}.route-mobile-label{display:inline}
 .drive{flex:1;min-width:0;gap:6px}.drive button{min-width:0;flex:1;padding:8px 4px;font-size:13px;min-height:44px}.drive .yellow-button{min-width:0;flex:1.6;font-size:18px;padding:8px 6px}.drive .arrow{display:none}
 #pass-letter{flex:none;min-width:48px;width:48px;height:48px;padding-left:8px}#pass-letter .highway-shield{width:100%;height:46px}
 #developer-button{top:calc(62px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right))}
 #score-feedback{top:calc(118px + env(safe-area-inset-top));font-size:13px}
}
@media(max-width:350px){:is(#menu-button,#landing-menu-button){padding:8px;font-size:14px;gap:5px}#score-card{font-size:13px;padding:12px 6px}.target-card{width:80px}#letter-value{font-size:9px}.drive-bar{gap:6px;padding:9px 8px}.drive{gap:4px}.drive button{font-size:11px;padding:8px 2px}.drive .yellow-button{font-size:16px}.landing-route{width:95%}.landing-route h2{font-size:14px}.landing-route p{font-size:10px}#controls-info{max-width:calc(50% - 49px);font-size:10px}}
@media(pointer:coarse),(max-width:650px){.desktop-controls{display:none}.mobile-controls{display:block}}
@media(max-height:440px) and (orientation:landscape){
 #landing{padding:14px 16px 20px}#game-intro{width:370px;padding:10px 18px 14px}.title-the{font-size:22px}.title-name{font-size:43px}.landing-route{margin-top:12px;padding-top:10px;gap:10px}.landing-route .location-icon{width:42px;height:34px;padding:4px 10px}.landing-route h2{font-size:16px;font-weight:600}.landing-route p{font-size:11px;font-weight:500}#setup{margin-top:16px}:is(#connect,#play-friends){padding:9px 18px;font-size:20px;min-width:260px}#how-to-play{font-size:16px;padding:8px 16px;width:220px}
 .target-card{padding:6px 4px;width:86px;font-size:12px;top:max(8px,env(safe-area-inset-top))}.target-card strong{font-size:40px}#letter-value{font-size:9px}
 .drive-bar{bottom:calc(6px + env(safe-area-inset-bottom));padding:8px 12px;gap:10px}.route-card{font-size:11px}.route-place{font-size:14px}.drive button{min-height:44px;font-size:13px}.drive .yellow-button{font-size:18px;min-width:90px}#pass-letter{height:48px;min-width:52px;padding-left:10px}#pass-letter .highway-shield{height:46px;width:42px}
 .route-card{position:absolute;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);border:2px solid var(--edge);padding:7px 12px;border-radius:13.5px;background:var(--sign);box-shadow:inset 0 0 0 2px var(--cream),var(--shadow);font-size:13px}.route-place,.route-road{display:none}.route-mobile-label{display:inline}.drive .arrow{display:none}
 #controls-info{font-size:10px}.mobile-controls{display:block}.desktop-controls{display:none}#score-feedback{top:calc(102px + env(safe-area-inset-top));font-size:12px}
}
@media(min-width:651px) and (min-height:441px) and (max-height:700px){
 #game-intro{padding:14px 24px 18px}.title-the{font-size:clamp(28px,4.2vw,38px)}.title-name{font-size:clamp(44px,8vw,74px)}
 .landing-route{margin-top:18px;padding-top:12px}#setup{margin-top:32px}
 :is(#connect,#play-friends){min-height:clamp(54px,7.1vw,72px)}#how-to-play{min-height:clamp(46px,6.1vw,60px)}
}
/* Desktop rims are twice the mobile thickness; drive buttons have no cast shadow. */
@media(min-width:651px){
 .road-sign{border-width:4px;box-shadow:inset 0 0 0 4px var(--cream),var(--shadow)}
 .yellow-button{border-width:4px}
 .drive .road-sign{box-shadow:inset 0 0 0 4px var(--cream)}
}
.drive .road-sign{box-shadow:inset 0 0 0 2px var(--cream)}
.drive .yellow-button{box-shadow:inset 0 0 0 1px #ffe778}
@media(min-width:651px){.drive .road-sign{box-shadow:inset 0 0 0 4px var(--cream)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Sign typography follows the mockup proportions, using actual Overpass weights. */
@media(min-width:651px) and (min-height:441px){
 .target-card{width:clamp(72px,9.6vw,138px);font-size:clamp(11px,1.45vw,21px);padding:clamp(6px,.8vw,12px) 4px}
 .target-card strong{font-size:clamp(42px,5.6vw,80px)}
 #letter-value{font-size:clamp(9px,1.2vw,17px);font-weight:600}
 :is(#menu-button,#landing-menu-button){font-size:clamp(13px,1.7vw,24px);min-height:clamp(36px,4.6vw,66px);padding:clamp(6px,.8vw,12px) clamp(12px,1.6vw,23px);gap:clamp(8px,1.1vw,16px)}
 .menu-icon{font-size:clamp(20px,2.7vw,38px)}
 #score-card{font-size:clamp(14px,1.9vw,27px);padding:clamp(8px,1vw,15px) clamp(14px,1.9vw,27px)}
 #controls-info{top:calc(clamp(54px,6.5vw,94px) + env(safe-area-inset-top));font-size:clamp(9px,1.1vw,15px)}
 #score-feedback{top:calc(clamp(108px,12vw,174px) + env(safe-area-inset-top))}
 .route-place{font-size:clamp(14px,1.7vw,24px)}
 .route-card{font-size:clamp(11px,1.3vw,18px)}
 .drive button{font-weight:600;font-size:clamp(13px,1.5vw,21px)}
 .drive .yellow-button{font-weight:700;font-size:clamp(20px,2.3vw,32px)}
}
@media(max-width:650px){
 :is(#menu-button,#landing-menu-button){font-weight:600}#score-card{font-weight:700}
 .target-card{font-weight:600;padding:6px 4px;font-size:14px}.target-card strong{font-size:52px;line-height:.9}#letter-value{font-size:11px;font-weight:600;letter-spacing:-.035em}
 .route-card{font-weight:600}.drive button{font-weight:600}.drive .yellow-button{font-weight:700}
}

@media(max-width:350px){#letter-value{font-size:9px}}

/* The fixed header and inset scroll region share the same sign fill. */
dialog{overflow:hidden;padding:20px;background:var(--sign)}
dialog[open]{display:flex;flex-direction:column}
dialog header{flex:none;position:static;background:var(--sign)}
.popup-body{min-height:0;overflow:auto;overscroll-behavior:contain;margin-top:8px;padding:0 8px 4px 0;scrollbar-width:thin;scrollbar-color:#f6f5e980 transparent;-webkit-overflow-scrolling:touch}
.popup-body::-webkit-scrollbar{width:8px;height:8px}
.popup-body::-webkit-scrollbar-track{background:transparent}
.popup-body::-webkit-scrollbar-thumb{background:#f6f5e980;border:2px solid var(--sign);border-radius:12px}
.popup-body::-webkit-scrollbar-button{display:none}
@media(min-width:651px){.drive button{height:clamp(48px,4.2vw,60px);min-height:0;display:flex;align-items:center;justify-content:center;padding-top:0;padding-bottom:0;line-height:1}}
@media(max-width:900px){.shield-label{font-size:7px}.shield-letter{font-size:22px}}

@media(pointer:coarse),(max-width:650px){#controls-info{width:max-content}#controls-info .mobile-controls>div{white-space:nowrap}}

/* Shared green buttons, landing shadows, and balanced target-letter spacing. */
button{background:var(--sign);color:var(--cream);border:2px solid var(--sign);box-shadow:inset 0 0 0 2px var(--cream),var(--shadow);border-radius:18px}
@media(min-width:651px){button{border-width:4px;box-shadow:inset 0 0 0 4px var(--cream),var(--shadow)}}
#close-popup,#pass-letter{box-shadow:none}
#game-intro,:is(#connect,#play-friends),#how-to-play{--shadow:0 4px 9px #0006}
.target-card strong{position:relative;top:.07em}

/* Page-specific corner consistency and the landing Start sign treatment. */
:root{--hud-radius:13.5px;--drive-button-radius:12px}
:is(#connect,#play-friends){color:#000;border-color:var(--yellow);box-shadow:inset 0 0 0 2px #000,var(--shadow)}
:is(#menu-button,#landing-menu-button),#score-card,.target-card,.drive-bar{border-radius:var(--hud-radius)}
:is(#menu-panel,#landing-menu-panel)>button{border-radius:var(--drive-button-radius)}
@media(min-width:651px){:is(#connect,#play-friends){box-shadow:inset 0 0 0 4px #000,var(--shadow)}}
@media(max-width:650px){
 :root{--hud-radius:6.75px;--drive-button-radius:6.75px}
 :is(#connect,#play-friends){border-radius:10.5px}#how-to-play{border-radius:9px}
 #game-screen .route-card,#game-screen .drive button,#controls-info,#score-feedback,#check-hint,#developer-button{border-radius:var(--hud-radius)}
}

/* End-trip and replay actions share the Start sign, without cast shadows. */
#finish,#replay{background:linear-gradient(120deg,#ffdf39,var(--yellow));color:#000;border:2px solid var(--yellow);border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px #000}
#confirm-panel>.back-menu,#return-home,:is(#menu-panel,#landing-menu-panel)>button{border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px var(--cream)}
@media(min-width:651px){
 #finish,#replay{border-width:4px;box-shadow:inset 0 0 0 4px #000}
 #confirm-panel>.back-menu,#return-home,:is(#menu-panel,#landing-menu-panel)>button{box-shadow:inset 0 0 0 4px var(--cream)}
}

.drive .yellow-button{color:#000;border-color:var(--yellow);box-shadow:inset 0 0 0 2px #000}
@media(min-width:651px){.drive .yellow-button{box-shadow:inset 0 0 0 4px #000}}

/* Align NEXT's outer yellow edge with the distance buttons' inset white edge. */
.drive .yellow-button{height:40px;min-height:40px;padding-top:0;padding-bottom:0;display:flex;align-items:center;justify-content:center;line-height:1}
@media(min-width:651px){.drive .yellow-button{height:calc(clamp(48px,4.2vw,60px) - 8px);min-height:0}}

.drive .next-label{position:relative;top:.07em}


/* Route selection keeps the landing sign's existing pointer and proportions. */
#select-route{flex:none;padding:0;min-height:0;border:0;background:none;box-shadow:none;border-radius:13.5px;line-height:0;color:var(--cream)}
#select-route .location-icon{display:block}
.landing-route{display:grid;grid-template-columns:minmax(0,1fr);row-gap:0}
/* A definite row width prevents fitted text from shrinking its own available space. */
.landing-title-line{--route-selector-width:66px;display:flex;align-items:center;justify-content:center;justify-self:center;gap:16px;width:100%;max-width:100%;min-width:0}
/* Balance the selector with equal empty space so only the title is centered. */
.landing-title-line::after{content:'';flex:0 0 var(--route-selector-width)}
#landing-date,#landing-road{grid-column:1/-1;text-align:center;white-space:normal;overflow-wrap:anywhere}
#landing-title{flex:0 1 auto;min-width:0;white-space:nowrap}
#landing-title-text{display:inline-block;white-space:nowrap;font-size:calc(1em * var(--title-scale,1))}
#landing-road{margin-top:3px}
@media(max-width:650px){.landing-title-line{gap:9px;--route-selector-width:44px}}
@media(max-height:440px) and (orientation:landscape){.landing-title-line{gap:10px;--route-selector-width:42px}}
.landing-route .challenge-date{font-size:clamp(11px,1.1vw,16px);margin-bottom:5px;color:var(--cream);font-weight:500}
dialog.route-selection{max-height:min(480px,calc(100dvh - 32px));font-size:14px}
.route-list-intro{margin:4px 0 12px}
#route-list{display:flex;flex-direction:column;gap:10px}
#route-list .route-choice{width:100%;text-align:left;padding:12px 14px;border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px var(--cream)}
.route-choice[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--yellow)!important}
.route-choice span{display:block;overflow-wrap:anywhere}
.route-choice-date{font-size:12px;font-weight:500;margin-bottom:4px}
.route-choice-title{font-size:18px;font-weight:700;color:var(--yellow);line-height:1.2}
.route-choice-details{font-size:13px;font-weight:500;line-height:1.35;margin-top:5px}
@media(max-width:650px){#select-route{border-radius:9px}.landing-route .challenge-date{font-size:10px;margin-bottom:3px}}
/* Editorial location labels may be longer than the first route's labels. */
@media(min-width:651px) and (min-height:441px){.route-card>div{max-width:clamp(140px,23vw,330px)}.route-place,.route-road{white-space:normal;overflow-wrap:anywhere}}

/* Stable progress widths: content changes never resize the drive sign. */
.route-compass{display:block;width:64.4px;height:64.4px;flex:none}
#compass-arrow{transform-box:view-box;transform-origin:32px 32px;transition:transform 240ms ease-out}
@media(max-width:900px){.route-compass{width:50.6px;height:50.6px}}
@media(max-width:650px){.route-compass{width:32.2px;height:32.2px}}
@media(max-height:440px) and (orientation:landscape){.route-compass{width:32.2px;height:32.2px}}
@media(prefers-reduced-motion:reduce){#compass-arrow{transition:none}}
#miles,#route-length{display:inline-block;width:4ch;font-variant-numeric:tabular-nums}
#miles{text-align:right}#route-length{text-align:left}
@media(min-width:651px) and (min-height:441px){
 .drive-bar{width:min(1100px,calc(100% - 32px))}
 .route-card{flex:1;min-width:0}
 .route-card>div{min-width:0;max-width:none}
 .drive,#pass-letter{flex:none}
}

/* Recap points pair earned yellow values with each letter's starting value. */
#score-details .earned-points{color:var(--yellow);font-weight:700}
#score-details td:nth-child(2),#score-details td:nth-child(3){white-space:nowrap;font-variant-numeric:tabular-nums}

/* Hospital-sign blue: white inset outline with a matching blue outer rim. */
#share-score{background:#0647a9;color:var(--cream);border:2px solid #0647a9;border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px var(--cream)}
@media(min-width:651px){#share-score{border-width:4px;box-shadow:inset 0 0 0 4px var(--cream)}}
#share-status{font-size:14px;margin:10px 0 0}
#share-manual{margin-top:12px}
#share-manual label{display:block;margin-bottom:6px;font-size:14px}
#share-text{display:block;width:100%;padding:10px;border:1px solid var(--cream);border-radius:6px;background:var(--sign);color:var(--cream);font:inherit;font-size:14px;line-height:1.5;resize:vertical;user-select:text;-webkit-user-select:text}
#share-text:focus-visible{outline:3px solid var(--yellow);outline-offset:2px}

/* The mode switch sits below the route sign, outside its scroll region. */
.popup-sign{display:contents}
dialog.route-selection{padding:0;background:transparent;border:0;box-shadow:none;overflow:visible;max-height:min(560px,calc(100dvh - 32px))}
dialog.route-selection .popup-sign{display:flex;flex-direction:column;min-height:0;padding:20px;background:var(--sign);border:2px solid var(--edge);border-radius:24px;box-shadow:inset 0 0 0 2px var(--cream),0 8px 35px #0007;overflow:hidden}
#switch-route-mode{flex:none;align-self:center;width:80%;margin-top:12px;min-height:54px;font-size:23px;font-weight:700;color:#000;border-color:var(--yellow);border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px #000,var(--shadow)}
@media(min-width:651px){#switch-route-mode{box-shadow:inset 0 0 0 4px #000,var(--shadow)}}
/* Keep Free Play modes in the fixed header above its divider. */
dialog.route-selection header{display:grid;grid-template-columns:minmax(0,1fr) auto}
dialog:not(.route-selection) #free-play-types{display:none}
#free-play-types{display:flex;grid-column:1/-1;gap:6px;margin:0}
#free-play-types button{flex:1;min-width:0;padding:8px 12px;border-width:2px;border-radius:var(--drive-button-radius);box-shadow:inset 0 0 0 2px var(--cream);font-size:20px}
#free-play-types button[aria-pressed="true"]{color:var(--yellow);box-shadow:inset 0 0 0 2px var(--yellow)}

/* Random's preview follows the target on desktop and sits below SCORE on mobile. */
#next-letter-card{position:absolute;top:max(12px,env(safe-area-inset-top));left:calc(50% + 62px);display:flex;align-items:center;gap:18px;padding:12px 18px;border-radius:var(--hud-radius);font-size:18px;line-height:1.15}
#next-letter-card strong{font-size:32px;line-height:1;font-weight:700;width:1em;text-align:center;flex:none}
@media(min-width:651px) and (min-height:441px){
 #next-letter-card{left:calc(50% + clamp(36px,4.8vw,69px) + 8px);font-size:clamp(12px,1.45vw,21px);padding:clamp(8px,.8vw,12px) clamp(12px,1.1vw,18px);gap:clamp(12px,1.2vw,18px)}
 #next-letter-card strong{font-size:clamp(23px,2.2vw,36px)}
}
@media(max-width:650px){
 #next-letter-card{left:auto;right:max(8px,env(safe-area-inset-right));top:calc(64px + env(safe-area-inset-top));padding:8px 12px;gap:14px;font-size:12px}
 #next-letter-card strong{font-size:24px}
 .random-play #developer-button{top:calc(120px + env(safe-area-inset-top))}
}
@media(max-width:350px){#next-letter-card{font-size:10px;padding:8px;gap:10px}#next-letter-card strong{font-size:22px}}
@media(max-height:440px) and (orientation:landscape){#next-letter-card{top:max(8px,env(safe-area-inset-top));left:calc(50% + 51px);right:auto;padding:8px 10px;gap:10px;font-size:12px}#next-letter-card strong{font-size:24px}}



/* Landing Menu shares gameplay typography, icon, rim and corner treatment. */
#landing-menu-button{position:static;align-self:center;transform:scale(.75);transform-origin:top center;--shadow:0 4px 9px #0006}
#game-copyright{font-size:12px;line-height:1.5;margin-top:20px}

/* Optical title centering and clearer route-selection affordances. */
#game-intro{--title-optical-offset:8px}
#landing h1{transform:translateY(var(--title-optical-offset))}
@media(max-width:650px){#game-intro{--title-optical-offset:3px}}
@media(min-width:651px) and (min-height:441px) and (max-height:700px){#game-intro{--title-optical-offset:5px}}
@media(max-height:440px) and (orientation:landscape){#game-intro{--title-optical-offset:3px}}
#select-route:focus-visible .location-icon{box-shadow:0 0 6px #f6f5e999,0 0 12px #f6f5e940}
@media(hover:hover){
 #select-route:not(:disabled):hover .location-icon{box-shadow:0 0 6px #f6f5e999,0 0 12px #f6f5e940}
}
dialog.route-selection::backdrop{background:rgba(0,0,0,.78)}

/* Align the selector with Overpass capitals rather than the full line box. */
.landing-title-line{font-size:clamp(18px,2.4vw,34px)}
#select-route{position:relative;top:-.12em;font-size:inherit}
@media(max-width:650px){.landing-title-line{font-size:16px}}
@media(max-width:350px){.landing-title-line{font-size:14px}}
@media(max-height:440px) and (orientation:landscape){.landing-title-line{font-size:16px}}

/* Mobile route title gets more emphasis and room; balance the smaller selector. */
@media(max-width:650px){
 .landing-title-line{--route-selector-width:33px;font-size:24px;width:calc(100% + 24px);max-width:calc(100% + 24px)}
 #landing-title{font-size:24px}
 #select-route{border-radius:6.75px}
 #select-route .location-icon{width:33px;height:27px;padding:3px 7.5px;border-width:1.5px;border-radius:6.75px}
}
@media(max-width:350px){
 .landing-title-line,#landing-title{font-size:21px}
}
@media(max-width:650px) and (max-height:440px) and (orientation:landscape){
 .landing-title-line{--route-selector-width:31.5px;font-size:24px}
 #landing-title{font-size:24px}
 #select-route .location-icon{width:31.5px;height:25.5px}
}

#landing-title-text[role="button"]{cursor:pointer}
#landing-title-text:focus-visible{outline:3px solid var(--yellow);outline-offset:3px;border-radius:3px}
@media(hover:hover){#landing-title-text[aria-disabled="false"]:hover{filter:brightness(1.08)}}

/* Phone landscape: compact HUD with route details inside the desktop-style bar.
   The height range includes Safari's reduced viewport and Home Screen web apps. */
@media(orientation:landscape) and (max-height:500px) and (max-width:1000px){
 #game-intro{width:min(560px,calc(100% - 16px))}
 .landing-route{width:96%}
 .landing-title-line{--route-selector-width:33px;font-size:24px;width:100%;max-width:100%;gap:10px}
 #landing-title{font-size:24px}
 #select-route .location-icon{width:33px;height:27px;padding:3px 7.5px;border-width:1.5px;border-radius:6.75px}
 #game-screen{--hud-radius:6.75px;--landscape-edge:8px}
 #hud .road-sign{border-width:2px;box-shadow:inset 0 0 0 2px var(--cream),var(--shadow)}
 #hud .drive .road-sign{box-shadow:inset 0 0 0 2px var(--cream)}
 #menu-button,#score-card,.target-card,#next-letter-card{top:max(var(--landscape-edge),env(safe-area-inset-top))}
 #menu-button{left:max(var(--landscape-edge),env(safe-area-inset-left));height:37.5px;min-height:37.5px;padding:7.5px 15px;font-size:15px;gap:9px;line-height:1}
 #menu-button .menu-icon{font-size:18.75px}
 #score-card{right:max(var(--landscape-edge),env(safe-area-inset-right));height:37.5px;min-height:37.5px;padding:0 12px;font-size:17px;line-height:1;display:flex;align-items:center;gap:5px}
 .target-card{width:86px;padding:6px 4px;font-size:12px}
 .target-card strong{font-size:40px}
 #letter-value{font-size:9px}
 #controls-info{display:none}
 .drive-bar{bottom:max(var(--landscape-edge),env(safe-area-inset-top));width:calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));max-width:1100px;left:max(8px,env(safe-area-inset-left));transform:none;padding:8px 10px;gap:10px}
 .route-card{position:static;transform:none;flex:1;min-width:0;gap:8px;padding:0 10px 0 0;border:0;border-right:1px solid #f6f5e980;background:none;box-shadow:none;border-radius:0;font-size:11px;white-space:normal}
 .route-card>div{min-width:0;max-width:none;overflow-wrap:anywhere}
 .route-compass{width:32.2px;height:32.2px}
 .route-place{display:block;font-size:14px;margin-bottom:2px}
 .route-road{display:inline}
 .route-mobile-label{display:none}
 .drive{flex:none;gap:6px}
 .drive button{flex:none;min-width:44px;height:44px;min-height:44px;padding:0 7px;font-size:13px;line-height:1;display:flex;align-items:center;justify-content:center;border-radius:var(--hud-radius)}
 .drive .yellow-button{flex:none;min-width:90px;height:40px;min-height:40px;padding:0 8px;font-size:18px;border-width:2px;box-shadow:inset 0 0 0 2px #000}
 .drive .arrow{display:inline-block}
 #pass-letter{flex:none;width:48px;min-width:48px;height:48px;padding-left:8px}
 #pass-letter .highway-shield{width:40px;height:46px}
 #next-letter-card{left:calc(50% + 51px);right:auto;padding:8px 10px;gap:10px;font-size:12px}
 #next-letter-card strong{font-size:24px}
 #developer-button,.random-play #developer-button{top:calc(max(8px,env(safe-area-inset-top)) + 44px);right:max(8px,env(safe-area-inset-right))}
 #score-feedback{top:calc(102px + env(safe-area-inset-top));font-size:12px}
}



/* Daily status stays readable alongside route details. */
.route-choice-status{font-size:13px;line-height:1.35;margin-top:6px}
#route-list .route-choice:disabled{opacity:1;background:#3e514b;color:#c3cbc7;box-shadow:inset 0 0 0 2px #a7b3ad}
.route-choice:disabled .route-choice-title{color:#c3cbc7}
#daily-countdown{flex:none;font-size:12px;text-align:center;font-variant-numeric:tabular-nums;line-height:1.4;margin:12px 0 0;padding-top:8px;border-top:1px solid #f6f5e96b}
#landing-dev-button{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:12px;padding:5px 8px;min-height:30px;font-size:11px;border-width:1px;box-shadow:none}
#daily-dev-panel{font-size:13px}
#daily-dev-panel>button{font-size:16px;padding:10px}

@media(orientation:landscape) and (max-height:440px) and (max-width:1000px){
 dialog.route-selection .popup-sign{padding:12px}
 dialog.route-selection #route-list-intro{display:none}
}

/* Completed Daily results share the date row, leaving three lines per route. */
#route-list .completed-choice{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:8px}
.completed-choice .route-choice-result{font-size:12px;font-weight:500;text-align:right;white-space:nowrap;margin-bottom:4px}
.completed-choice .route-choice-title,.completed-choice .route-choice-details{grid-column:1/-1}
@media(max-width:350px){.completed-choice .route-choice-date,.completed-choice .route-choice-result{font-size:10px}}

/* Match the route selector dimming for every landing-page dialog. */
body:not(.playing) dialog::backdrop{background:rgba(0,0,0,.78)}
