@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Barlow:wght@400;500;600;700&display=swap');
:root{--lime:#d5ff5f;--dark:#08151e;--cream:#f5f5e8;--muted:#97aab5}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--dark);color:var(--cream);font-family:Barlow,Arial,sans-serif}button,a,input,select{touch-action:manipulation}button{font:inherit;cursor:pointer;color:inherit;border:0}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid var(--lime);outline-offset:3px}button:hover{filter:brightness(1.12)}.hidden{display:none!important}#game{position:absolute;width:100%;height:100%;outline:0;touch-action:none}.screen{position:absolute;inset:0;background:linear-gradient(90deg,rgba(4,14,24,.85),rgba(4,14,24,.1) 44%,rgba(4,14,24,.8) 62%);overflow-y:auto}header{height:85px;padding:24px 4%;display:flex;justify-content:space-between;align-items:center}.logo{text-decoration:none;color:var(--cream);font:bold italic 35px 'Barlow Condensed',Impact,sans-serif;letter-spacing:2px;line-height:.85}.logo span{display:block;font-size:12px;letter-spacing:3px;color:var(--lime);margin-top:8px}.header-actions{display:flex;align-items:center;gap:8px}.build-tag{font-size:10px;letter-spacing:2px;color:var(--muted);margin-right:14px}.icon{border:1px solid #ffffff28;background:#0c202bc9;border-radius:9px;padding:10px 13px;font-weight:bold;font-size:12px}.menu-body{display:grid;grid-template-columns:1fr 430px;gap:4%;padding:20px 4% 12px;max-width:1700px;margin:auto}.intro{pointer-events:none;padding-top:28px}.eyebrow{font-size:11px;letter-spacing:2.5px;font-weight:700;color:var(--lime)}h1{font:800 clamp(45px,5vw,80px)/.93 'Barlow Condensed',Impact,sans-serif;text-transform:uppercase;margin:20px 0}h1 em{color:var(--lime);font-style:italic}.intro p{color:#b7cbd4;font-size:16px;line-height:1.7}.selected-name{font:800 33px 'Barlow Condensed',Impact,sans-serif;margin-top:150px;letter-spacing:1px}.selected-car{font-size:13px;letter-spacing:2px;color:var(--muted);text-transform:uppercase;margin-top:4px}.garage-note{font-size:11px;color:var(--muted);margin-top:16px}.setup{background:#08151ee8;border:1px solid #ffffff18;border-radius:18px;padding:22px;backdrop-filter:blur(12px)}.section-label{display:flex;justify-content:space-between;font-size:10px;letter-spacing:1.7px;font-weight:700;color:var(--muted);margin:0 0 13px}.section-label:not(:first-child){margin-top:21px}.drivers{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.driver{background:#122a35;border:1px solid #ffffff12;border-radius:10px;padding:0 0 9px;overflow:hidden}.portrait{position:relative;height:65px;overflow:hidden}.portrait img{position:absolute;width:500%;height:100%;object-fit:fill;max-width:none;top:0}.driver b{display:block;font-size:9px;letter-spacing:.1px;margin-top:3px}.driver.chosen{border-color:var(--lime);background:#263b30;box-shadow:0 0 0 1px var(--lime)}.courses{display:grid;grid-template-columns:1fr 1fr;gap:7px}.course{position:relative;text-align:left;border-radius:10px;background:linear-gradient(130deg,var(--c),#12212c);border:1px solid #ffffff14;padding:12px 11px;min-height:64px;overflow:hidden}.course:last-child{grid-column:span 2}.course:after{content:'';position:absolute;right:0;bottom:-20px;width:65px;height:60px;background:#ffffff08;transform:skew(-25deg)}.course.chosen{border-color:var(--lime)}.course b{display:block;font:700 16px 'Barlow Condensed',Arial;text-transform:uppercase;letter-spacing:.4px}.course small{display:block;font-size:10px;color:#c2d1d7;margin-top:4px}.difficulty{display:flex;gap:7px}.difficulty button{flex:1;padding:10px;border-radius:8px;background:#162b36;font-size:12px}.difficulty .chosen{background:var(--lime);color:#0b1b24;font-weight:bold}.options{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:11px;margin:16px 0}.options input{accent-color:var(--lime)}select{background:#142733;border:1px solid #ffffff22;border-radius:5px;color:var(--cream);font-size:11px;padding:4px}.primary{width:100%;background:var(--lime);color:#102128;border-radius:9px;padding:16px 20px;text-align:left;font-weight:800;letter-spacing:1px;display:flex;justify-content:space-between}.help{font-size:10px;line-height:1.6;color:var(--muted);margin:12px 0 0}footer{padding:15px 4%;display:flex;justify-content:space-between;gap:10px;color:#8499a3;font-size:10px;letter-spacing:1px}#loading{position:absolute;inset:0;background:var(--dark);display:flex;justify-content:center;align-items:center;flex-direction:column;gap:18px;z-index:20}#loading b{font:italic 800 70px 'Barlow Condensed',Impact;color:var(--lime)}#loading span{font-size:13px;color:var(--muted)}.cinematic{position:absolute;inset:0;background:linear-gradient(0deg,#06131cf0,transparent 80%);display:flex;flex-direction:column;justify-content:end;padding:8%;pointer-events:none}.cinematic h2{font:800 clamp(55px,10vw,110px) 'Barlow Condensed',Impact;margin:10px 0 0;animation:slide .5s ease-out}.cinematic p{color:#b7c9cf;margin:0 0 25px}.cinematic button{position:absolute;right:5%;top:5%;pointer-events:auto}.hud-top{position:absolute;top:max(20px,env(safe-area-inset-top));left:4%;right:4%;display:flex;justify-content:space-between;align-items:start;gap:10px}.hud-box{background:#071722b5;padding:12px 18px;border-radius:13px}.hud-box small{font-size:9px;letter-spacing:2px;color:var(--lime);display:block}.hud-box strong{font:800 44px 'Barlow Condensed',Impact}.hud-box strong span{font-size:18px;color:var(--muted)}.hud-center{background:#071722b5;border-radius:13px;padding:13px 22px;text-align:center}.hud-center b{display:block;font-size:12px;letter-spacing:1px}.hud-center span{font-size:12px;display:inline-block;margin:6px 8px 0;color:var(--lime)}#standings{position:absolute;top:125px;left:4%;font-size:12px;background:#071722a8;border-radius:10px;padding:10px 14px;min-width:135px}#standings div{padding:4px 0;color:#c5d2d7}#standings .you{color:var(--lime);font-weight:bold}#announcement{position:absolute;top:25%;left:50%;transform:translateX(-50%);font:800 clamp(20px,4vw,40px) 'Barlow Condensed',Impact;text-align:center;text-shadow:0 3px 10px #000;white-space:nowrap;color:var(--lime)}.speed{position:absolute;right:4%;bottom:160px;text-align:right;width:150px;text-shadow:0 2px 5px #000}.speed strong{font:800 64px/.9 'Barlow Condensed',Impact}.speed>span{display:block;font-size:11px;letter-spacing:3px;margin-top:6px}.boost-track{height:6px;background:#ffffff30;margin:14px 0 6px;border-radius:5px;overflow:hidden}.boost-track i{display:block;height:100%;background:var(--lime);width:100%}.speed small{font-size:10px;letter-spacing:1px}#map{position:absolute;bottom:160px;left:4%;width:125px;height:125px;background:#071722a0;border-radius:15px}#countdown{position:absolute;top:35%;left:0;right:0;text-align:center;font:800 120px 'Barlow Condensed',Impact;color:var(--lime);text-shadow:0 8px 20px #000}#touch{position:absolute;bottom:max(75px,calc(env(safe-area-inset-bottom) + 55px));left:4%;right:4%;display:flex;justify-content:space-between;gap:15px;pointer-events:none}#touch button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid #ffffff40;background:#0c263aca;backdrop-filter:blur(6px);border-radius:16px;min-width:62px;height:62px;font-size:12px;font-weight:bold}#touch button.active{background:#56794ddd;transform:scale(.96)}#touch .boost-btn{background:#d5ff5fe3;color:#122129}.steer,.pedals{display:flex;gap:9px}.steer button{font-size:22px!important;width:70px}.modal{position:absolute;inset:0;z-index:15;background:#03101ccc;backdrop-filter:blur(12px);display:flex;align-items:center;justify-content:center;padding:20px}.modal>div{width:100%;max-width:430px;background:#0b202b;border:1px solid #ffffff20;padding:30px;border-radius:20px}.modal h2{font:800 45px 'Barlow Condensed',Impact;margin:10px 0}.modal p{color:var(--muted);font-size:14px}.secondary{width:100%;margin-top:10px;padding:14px;background:#18333f;border-radius:9px;font-size:12px;font-weight:bold;letter-spacing:1px}#resultList{margin:20px 0}#resultList div{display:flex;justify-content:space-between;padding:10px;border-bottom:1px solid #ffffff10;font-size:13px}#resultList .you{color:var(--lime)}@keyframes slide{from{transform:translateY(25px);opacity:0}to{transform:translateY(0);opacity:1}}@media(min-width:1300px){.menu-body{padding-top:40px}.setup{padding:28px}.portrait{height:75px}}@media(max-width:850px){header{height:65px;padding:15px 5%}.build-tag{display:none}.menu-body{grid-template-columns:1fr 365px;padding:8px 4%;gap:2%}h1{font-size:46px}.intro p{font-size:12px}.selected-name{margin-top:130px}.setup{padding:15px}.portrait{height:52px}.course{padding:9px;min-height:53px}.section-label:not(:first-child){margin-top:16px}.speed{bottom:160px}.hud-center{padding:10px}}@media(max-width:600px) and (orientation:portrait){.screen{background:linear-gradient(0deg,#061521 58%,#06152122)}.menu-body{display:block;padding:0 5%}.intro{padding:0;min-height:210px}h1{font-size:43px;margin:12px 0}.intro p,.garage-note{display:none}.selected-name{font-size:23px;margin-top:50px}.selected-car{font-size:10px;margin-bottom:12px}.setup{padding:16px;background:#0c202aee}.portrait{height:60px}footer{font-size:8px;flex-direction:column}.logo{font-size:29px}.hud-center b{font-size:10px}.hud-center{padding:10px 5px}.hud-box{padding:10px}.hud-box strong{font-size:33px}#standings{top:110px;font-size:10px;min-width:105px}#map{width:90px;height:90px;bottom:190px}.speed{bottom:190px;width:110px}.speed strong{font-size:49px}#touch{bottom:max(90px,calc(env(safe-area-inset-bottom) + 70px));gap:8px;left:3%;right:3%}#touch button{min-width:48px;height:55px;border-radius:12px;font-size:9px}.steer,.pedals{gap:5px}.steer button{width:49px}#announcement{white-space:normal;width:90%;top:32%}.cinematic{padding-bottom:30%}}@media(max-height:540px) and (orientation:landscape){header{height:52px}.menu-body{grid-template-columns:1fr 380px;padding-top:0}.intro{padding:0}h1{font-size:38px;margin:10px 0}.intro p{display:none}.selected-name{margin-top:100px;font-size:23px}.selected-car{font-size:10px}.setup{padding:12px}.portrait{height:40px}.section-label{margin-bottom:7px}.section-label:not(:first-child){margin-top:10px}.course{min-height:43px;padding:7px}.course b{font-size:13px}.courses{gap:5px}.difficulty button{padding:7px}.options{margin:10px 0}.primary{padding:12px}.help{font-size:9px}.speed{bottom:110px}.speed strong{font-size:45px}#touch{bottom:48px}#touch button{height:48px;min-width:55px}#map{bottom:110px;width:85px;height:85px}#standings{top:100px;font-size:10px}.hud-top{top:12px}.hud-box{padding:8px 12px}.hud-box strong{font-size:32px}#announcement{top:25%}}

.score-form{margin:18px 0 4px;padding:16px;background:#142e3b;border-radius:12px}.score-form>label{font-size:10px;letter-spacing:1.5px;color:var(--lime);font-weight:bold}.score-entry{display:flex;gap:8px;margin-top:9px}.score-entry input{min-width:0;flex:1;background:#081c27;border:1px solid #ffffff30;border-radius:7px;color:var(--cream);font:inherit;font-size:16px;padding:11px}.score-entry button{background:var(--lime);color:#102128;font-weight:bold;font-size:11px;border-radius:7px;padding:10px}.score-form p{font-size:11px!important;line-height:1.5;margin-bottom:0}button:disabled{opacity:.5;cursor:default}.modal>div{max-height:90dvh;overflow-y:auto}#leaderboard>div{max-width:610px}.board-filters{display:flex;gap:12px}.board-filters label{flex:1;color:var(--muted);font-size:11px}.board-filters select{display:block;width:100%;margin-top:6px;padding:10px;font-size:13px}.board-scroll{overflow-x:auto}.board-table{width:100%;border-collapse:collapse;font-size:13px}.board-table th{text-align:left;font-size:9px;color:var(--muted);letter-spacing:1px;padding:12px 7px}.board-table td{padding:12px 7px;border-bottom:1px solid #ffffff15}.board-table td:first-child{color:var(--lime);font-weight:bold}.board-table td small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.board-table td:nth-child(3){font-weight:bold;white-space:nowrap}.board-table tr.mine{background:#d5ff5f0b}#boardStatus{font-size:12px;min-height:17px}@media(max-width:600px){#leaderboard>div{padding:20px}.board-table{font-size:11px}.score-form{padding:12px}.board-table th{font-size:8px}}

/* Larger multi-touch controls, with a two-row layout when manual gas is enabled. */
button{touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}#touch{align-items:flex-end}#touch button{height:76px;min-width:76px;border-radius:18px;font-size:13px;touch-action:none;-webkit-touch-callout:none}#touch .steer button{width:80px;font-size:28px!important}#touch button.active{box-shadow:inset 0 0 0 2px #d5ff5f;transform:scale(.98)}#touch.manual-gas .pedals{display:grid;grid-template-columns:repeat(2,76px)}body{overscroll-behavior:none}#touch{overscroll-behavior:none}
@media(max-width:600px) and (orientation:portrait){#touch{left:3%;right:3%;gap:8px;bottom:max(90px,calc(env(safe-area-inset-bottom) + 70px))}#touch button{height:70px;min-width:62px;width:62px;font-size:10px;border-radius:16px}.steer,.pedals{gap:6px}#touch .steer button{width:68px;min-width:68px}#touch.manual-gas .pedals{grid-template-columns:repeat(2,62px)}.speed,#map{bottom:205px}#hud:has(#touch.manual-gas) .speed,#hud:has(#touch.manual-gas) #map{bottom:275px}}
@media(max-width:360px) and (orientation:portrait){#touch button{min-width:54px;width:54px;height:66px}#touch .steer button{width:59px;min-width:59px}#touch.manual-gas .pedals{grid-template-columns:repeat(2,54px)}}
@media(max-height:540px) and (orientation:landscape){#touch button{height:64px;min-width:68px;font-size:11px}#touch .steer button{width:74px}#touch.manual-gas .pedals{display:flex}#map,.speed{bottom:130px}#touch{bottom:max(45px,env(safe-area-inset-bottom))}}
/* The game surface must never trigger mobile copy handles or image callouts. */
body,body *{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
input,textarea,[contenteditable="true"],input *,textarea *,[contenteditable="true"] *{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
canvas,img{-webkit-user-drag:none}

.course{padding-right:69px;min-height:76px}.route-preview{position:absolute;right:5px;top:7px;width:60px;height:60px;color:#d0e4e5;opacity:.8}.course:after{display:none}.course small{line-height:1.4}.course.chosen .route-preview{color:var(--lime)}@media(max-height:540px) and (orientation:landscape){.course{min-height:58px;padding-right:57px}.route-preview{width:48px;height:48px;top:3px}}

/* Keep thumbs away from phone edge and home gestures. */
@media(pointer:coarse) and (orientation:portrait){#touch{left:max(30px,env(safe-area-inset-left));right:max(30px,env(safe-area-inset-right));bottom:max(120px,calc(env(safe-area-inset-bottom) + 95px));gap:8px}#touch .pedals{display:grid;grid-template-columns:repeat(2,76px);gap:6px}#touch:not(.manual-gas) .boost-btn{grid-column:span 2;width:auto}.speed,#map{bottom:300px}#hud:has(#touch.manual-gas) .speed,#hud:has(#touch.manual-gas) #map{bottom:300px}}
@media(pointer:coarse) and (max-width:360px) and (orientation:portrait){#touch .pedals,#touch.manual-gas .pedals{grid-template-columns:repeat(2,54px)}}
@media(pointer:coarse) and (orientation:landscape){#touch{left:max(40px,calc(env(safe-area-inset-left) + 12px));right:max(40px,calc(env(safe-area-inset-right) + 12px));bottom:max(75px,calc(env(safe-area-inset-bottom) + 50px))}#map,.speed{bottom:165px}}

@media(pointer:coarse) and (max-width:600px) and (min-width:361px) and (orientation:portrait){#touch .pedals,#touch.manual-gas .pedals{grid-template-columns:repeat(2,62px)}}

#hud{touch-action:none;overscroll-behavior:none}#hud *{overscroll-behavior:none}

.arcade-return{position:fixed;left:20px;bottom:12px;z-index:20;color:#bcc7cd;font:600 12px sans-serif;text-decoration:none}body:has(#hud:not(.hidden)) .arcade-return{display:none}
