@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#edf2e8;background:#163b47;font-size:14px}*{box-sizing:border-box}body{margin:0;overflow:hidden}#sea{display:block;width:100vw;height:100vh;outline:none}button,select,input{font:inherit}button,a{touch-action:manipulation}button{border:1px solid #a5beb448;background:#153944d9;color:inherit;padding:12px 18px;cursor:pointer;border-radius:3px}button:hover,button:focus-visible{border-color:#f3c783;background:#29515a}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #f1cd8c;outline-offset:4px}a{color:inherit;text-decoration:none}.primary{background:#edc58c;color:#183842;font-weight:700;border:0;padding:17px 28px}.primary:hover{background:#ffe0ae}header{position:fixed;top:26px;left:32px;right:32px;display:flex;align-items:center;justify-content:space-between;z-index:4}header a{font-size:13px;font-weight:700;letter-spacing:.18em}header span{display:block;font-size:9px;margin-top:7px;color:#c3d7ce;letter-spacing:.2em}header button{padding:8px 14px}#menu{position:fixed;inset:0;background:linear-gradient(90deg,#102e3df5,#143745c9 42%,#12343b22);overflow:auto}.intro{padding:120px 5vw 35px;width:min(660px,100%)}.eyebrow{font-size:10px;letter-spacing:.18em;color:#e7c38c;font-weight:700}h1{font-family:'Libre Caslon Display',Georgia,serif;font-size:clamp(58px,6vw,92px);line-height:.95;font-weight:400;letter-spacing:-.025em;margin:24px 0}h1 i{font-weight:400;color:#eacb9a}p{line-height:1.7;color:#c5d3cf;font-size:14px}.modebuttons{display:flex;gap:8px;margin:25px 0 20px}.modebuttons button{flex:1;text-align:left;font-size:12px;padding:12px}.modebuttons span{display:block;font-size:9px;opacity:.6;margin-top:5px}.selected{border-color:#efca8e;background:#52707355}#riders{display:grid;grid-template-columns:1fr 1fr;gap:8px}#riders button{text-align:left;padding:12px;border-left:3px solid var(--rider)}#riders span{display:block;font-size:10px;color:#b6c9c5;margin-top:5px}.settings{display:flex;gap:18px;margin:22px 0}.settings label{width:33%;font-size:11px}.settings input{display:block;width:100%;accent-color:#edc58c;margin:9px 0}.settings span{display:block;font-size:9px;opacity:.6}.options{display:flex;gap:20px;font-size:11px;align-items:center;margin-bottom:23px}select{background:#163944;color:#e9eee6;border:1px solid #94b5ae55;padding:5px}.salvage{display:inline-block;font-size:11px;opacity:.65;margin-left:18px}.position{position:fixed;top:130px;left:35px}.position small,.timing small,.telemetry small{display:block;font-size:10px;letter-spacing:.16em;opacity:.8}.position b{font-size:74px;font-weight:500}.position em{font-size:22px;opacity:.55;font-style:normal}.timing{position:fixed;top:130px;right:35px;text-align:right}.timing b{display:block;font-size:32px;font-weight:500;margin:8px 0}.timing span{font-size:10px;opacity:.7}.telemetry{position:fixed;bottom:80px;left:35px;display:flex;gap:45px;align-items:center}.telemetry>b{font-size:42px;font-weight:500}.telemetry>b small{font-size:9px}#power{display:flex;gap:4px;margin:10px 0}#power i{display:block;width:25px;height:5px;background:#71939955}#power i.on{background:#efc080}#misses{font-size:10px;color:#ecba9b}#chart{position:fixed;right:24px;bottom:62px;width:160px;height:190px;background:#12313b8c;border-radius:12px}footer{position:fixed;bottom:24px;width:100%;text-align:center;font-size:10px;color:#d6e6dfaa}#notice{position:fixed;top:95px;left:25%;width:50%;text-align:center;font-size:14px;color:#ffe0a8;text-shadow:0 1px 5px #14303b}#next{position:fixed;top:51%;left:50%;transform:translate(-50%,-50%);font-size:11px;letter-spacing:.07em;text-shadow:0 2px 5px #000;pointer-events:none}#countdown{position:fixed;top:35%;width:100%;text-align:center;font-size:95px;font-weight:700;text-shadow:0 3px 24px #123b4b}#dialog{position:fixed;inset:0;z-index:6;display:grid;place-items:center;background:#102d3bbf;backdrop-filter:blur(8px)}#dialog>div{width:min(520px,92vw);padding:35px;background:#173845ed;border:1px solid #c9d8c633;border-radius:5px}h2{font-family:'Libre Caslon Display',Georgia,serif;font-size:55px;font-weight:400;margin:15px 0}#dialog button{margin:8px 5px 0 0}#results{padding-left:20px;line-height:2.2}#results span{float:right;font-variant-numeric:tabular-nums}#error{color:#ffac99}[hidden]{display:none!important}@media(max-height:800px){.intro{padding-top:105px}h1{font-size:60px;margin:15px 0}.intro p{font-size:12px}.modebuttons{margin:15px 0}.settings{margin:15px 0}#riders button{padding:9px}}@media(max-width:650px){.intro{padding:110px 22px 30px;background:#15374499}.modebuttons{gap:4px}.modebuttons button{padding:8px}header{left:22px;right:22px}.settings{gap:8px}footer{padding:0 10px;font-size:8px}.position{left:22px}.timing{right:22px}.salvage{display:block;margin:15px 0}}

#recordForm{border-top:1px solid #abc3b833;padding-top:12px;margin:12px 0}#initials{width:70px;padding:8px;margin-left:10px;background:#234652;color:#f1e3c1;border:1px solid #b6c7b655;text-transform:uppercase}#recordStatus{font-size:11px}

header:before{content:"";position:fixed;inset:0 0 auto;height:250px;background:linear-gradient(#102e3b80,transparent);pointer-events:none;z-index:-1}.position,.timing,#notice,footer{text-shadow:0 2px 6px #102d3b,0 1px 2px #102d3b}.timing{background:#15354266;padding:12px 16px;border-radius:4px}

.course-options{display:flex;gap:20px;align-items:center;margin:10px 0}.course-options label{font-size:11px}.course-options select{max-width:260px}#courseNote{font-size:11px;line-height:1.5;margin:10px 0 16px}.modebuttons{flex-wrap:wrap}.modebuttons button{min-width:100px}.intro{padding-top:105px}.intro h1{font-size:64px}.intro>p{font-size:12px}

.options{flex-wrap:wrap;gap:12px}.course-options{flex-wrap:wrap}

/* Free riding foregrounds hull contact and speed. */
.freewater .timing,.freewater .telemetry small,.freewater #power{display:none}
.freewater #speed small{display:block}

.freewater #chart{display:none}

#playerTwoOptions{border:1px solid #94b5ae55;margin:18px 0;padding:12px;font-size:12px}#playerTwoOptions .settings{margin:10px 0}#playerTwoOptions p{font-size:11px;margin-bottom:0}
#splitHud{position:fixed;inset:0;pointer-events:none}#splitHud article{position:absolute;left:0;right:0;height:50%;padding:75px 24px 16px;text-shadow:0 2px 4px #102d3b}#playerHud0{top:0;border-bottom:2px solid #f0d19a88}#splitHud #playerHud1{top:50%;padding-top:18px}
.split-title{display:flex;justify-content:space-between;font-size:12px;letter-spacing:.04em}.split-title b{font-size:18px}.split-status{margin-top:10px;font-size:11px;color:#ffe0a8}.split-next{position:absolute;top:45%;left:28%;right:28%;text-align:center;font-size:11px}.split-speed{position:absolute;bottom:40px;left:24px;font-size:26px}.split-speed small{font-size:10px}.split-controls{position:absolute;bottom:12px;left:24px;right:24px;font-size:9px;opacity:.8}.split-power{position:absolute;bottom:44px;right:24px;font-size:11px;color:#edc58c}.split-countdown{position:absolute;top:40%;left:45%;font-size:60px}

#optionsPanel{width:min(760px,94vw);max-height:90vh;padding:26px 32px;color:#edf2e8;background:#153643;border:1px solid #adc6b866;border-radius:6px;overflow:auto}#optionsPanel::backdrop{background:#071e2bd9;backdrop-filter:blur(8px)}.options-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.options-heading h2{font-size:38px;margin:0}#optionsPanel h3{font-size:15px;font-weight:500;color:#edc58c;margin:0 0 18px}#optionsPanel section{padding:25px 0;border-bottom:1px solid #a8bca633}#optionsPanel p{font-size:12px}#optionsPanel button{font-size:12px;padding:9px 12px;margin:5px 5px 0 0}#nameFields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}#optionsPanel label{font-size:11px}#nameFields input{display:block;margin-top:6px;width:100%}#optionsPanel input:not([type=checkbox]):not([type=range]),#optionsPanel textarea{padding:9px;background:#0f2b38;color:#e8eee5;border:1px solid #8bacac66;border-radius:3px;font:inherit;font-size:12px}#optionsPanel textarea{resize:vertical;width:100%;display:block;margin:8px 0;line-height:1.5}.sound-options,.record-filters{display:flex;align-items:center;gap:15px;flex-wrap:wrap}.sound-options input[type=range]{vertical-align:middle;width:130px;accent-color:#edc58c}.save-field{display:block;margin-top:15px}.save-field input{display:block;margin-top:6px}#optionsStatus{position:sticky;bottom:-26px;background:#173d4d;border-top:1px solid #a8bca633;padding:12px;margin:0 -32px -26px;color:#ffe0a8;min-height:40px}#audioStatus{font-size:11px;margin-left:8px}#managedRecords{font-size:12px;line-height:2;padding-left:22px}#optionsButton{margin-top:8px}@media(max-width:600px){#optionsPanel{padding:20px}#nameFields{grid-template-columns:1fr}.options-heading h2{font-size:28px}#optionsStatus{bottom:-20px;margin:0 -20px -20px}.record-filters{gap:9px}}

#rivalBehind{display:block;font-size:10px;letter-spacing:.04em;margin-top:8px}#lapDelta{display:block;font-size:12px;margin-top:8px}#colourNote{display:block;margin-top:8px;opacity:.65}#playerTwoOptions>label{margin-right:14px}

#freeStunts{position:fixed;left:28px;top:94px;display:flex;flex-direction:column;gap:9px;max-width:280px;padding:14px 18px;background:#102e3dc4;border-left:2px solid #efc77c;text-shadow:0 1px 3px #0008}
#freeStunts[hidden]{display:none}
#freeStunts small{font-size:10px;line-height:1.6;letter-spacing:.04em;color:#d7e1d8}
#freeStunts strong{font-size:17px;font-weight:500;color:#ffe0a1}
#stuntScore{font-size:12px}
@media(max-width:600px){#freeStunts{left:16px;top:82px;padding:10px 12px;max-width:240px}}

/* Thumb controls reserve the lower screen; menus retain ordinary scrolling. */
#sea{touch-action:none}
.touch-steering #touchStick{position:relative;width:138px;height:104px;border:1px solid #b8dedb99;border-radius:52px;background:radial-gradient(ellipse,#3c738475,#103441cc);pointer-events:auto;touch-action:none;box-shadow:inset 0 2px 18px #05192366}
#touchStick .stick-track{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;padding:0 13px;white-space:nowrap;color:#d9eee38c;font-size:17px}
#touchKnob{position:absolute;left:50%;top:50%;width:54px;height:54px;border:2px solid #e0e9d8cc;border-radius:50%;background:radial-gradient(circle at 35% 25%,#f3dcaed9,#bd955abf);transform:translate(-50%,-50%);box-shadow:0 3px 10px #061d3677;pointer-events:none}
#touchControls .touch-steering{display:flex;flex-direction:column;align-items:center;gap:7px}
#touchAuto[aria-pressed=true]{border-color:#f3d296;color:#ffe2a7;background:#3c665de8}
.touch-choice{display:block;margin:16px 0;font-size:13px}.touch-choice small{display:block;color:#bbd0ca;font-size:11px;line-height:1.5;margin:6px 0}
#touchControls{position:fixed;inset:auto 0 0;z-index:5;padding:8px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));pointer-events:none;user-select:none;-webkit-user-select:none}
#touchControls button{pointer-events:auto;touch-action:none;-webkit-touch-callout:none;min-width:48px;min-height:48px;padding:10px;font-size:12px;font-weight:600;background:#123746cf;border:1px solid #bdd7cd88;border-radius:12px;box-shadow:0 2px 8px #09253044}
#touchControls button.held{background:#edc58c;color:#102f3a;border-color:#fff1d4;transform:scale(.97)}
.touch-tools{display:flex;justify-content:center;gap:6px;margin-bottom:8px}.touch-tricks{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;margin-bottom:8px}
.touch-driving{display:flex;justify-content:space-between;gap:12px;align-items:end}.touch-steering{display:grid;grid-template-columns:repeat(2,64px);gap:6px}.touch-steering button{height:64px;font-size:24px!important}.touch-steering small{grid-column:span 2;text-align:center;font-size:8px;letter-spacing:.1em;color:#e6eee7}.touch-pedals{display:grid;grid-template-columns:58px 76px;gap:6px}.touch-pedals .touch-gas{grid-column:2;grid-row:1 / 3;background:#c4a675df!important;color:#0b303d;font-size:20px!important}.touch-pedals button{min-height:48px}
.touch-driving-active footer,.touch-driving-active #freeStunts>small:last-child{display:none}.touch-driving-active .telemetry{bottom:198px;left:16px;gap:12px}.touch-driving-active #chart{bottom:195px;right:12px;width:82px;height:97px}.touch-driving-active .telemetry>b{font-size:30px}.touch-driving-active #power i{width:12px}
@media(max-width:650px){header{top:max(12px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right))}.position{top:78px;left:14px}.position b{font-size:38px}.timing{top:75px;right:14px;padding:8px}.timing b{font-size:22px;margin:4px 0}#notice{top:145px;left:12px;width:calc(100% - 24px);font-size:12px}#freeStunts{top:76px!important;left:14px!important;max-width:220px}#dialog{overflow:auto;padding:12px}#dialog>div{padding:20px;margin:auto}#dialog h2{font-size:38px}.intro select{max-width:100%}.touch-driving-active #next{top:43%}}
@media(max-height:500px){.touch-tools{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);margin:0}.touch-tricks{position:absolute;bottom:72px;left:155px;right:155px}.touch-tricks button{min-width:44px!important;min-height:44px!important;padding:6px!important;font-size:10px!important}.touch-driving-active .telemetry{bottom:133px;left:14px}.touch-driving-active #chart{bottom:137px;right:14px;width:60px;height:71px}.touch-driving-active .position{top:65px;left:14px}.touch-driving-active .position b{font-size:30px}.touch-driving-active .timing{top:58px;right:14px;padding:6px}.touch-driving-active .timing b{font-size:20px}.touch-driving-active #notice{top:65px;left:27%;width:46%}.touch-driving-active #freeStunts{top:65px!important;padding:8px!important;max-width:210px}.touch-driving-active header{top:10px}.touch-driving-active #countdown{font-size:58px;top:27%}}

@media(min-height:501px){.touch-stunts-open .telemetry,.touch-stunts-open #chart{bottom:310px}}

#demoStart{margin:10px 8px 10px 0;border-color:#e6c58e}
#demoPanel{position:fixed;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:5;width:min(620px,calc(100% - 24px));padding:14px 18px;background:#123440e8;border:1px solid #d0c8a666;border-radius:10px;text-align:center;pointer-events:auto}
#demoPanel small,#demoPanel strong,#demoPanel span{display:block}#demoPanel small{font-size:9px;letter-spacing:.16em;color:#efcc95}#demoPanel strong{font-size:15px;margin:5px 0}#demoPanel span{font-size:11px;color:#bed4cf}.demo-buttons{display:flex;justify-content:center;gap:6px;margin-top:10px}.demo-buttons button{min-height:44px;padding:8px 14px;font-size:12px}#demoTake{background:#e6c58e;color:#153744}.demo-active footer{display:none}.demo-active .telemetry{bottom:185px}.demo-active #chart{bottom:185px}.demo-active #freeStunts>small:last-child{display:none}
@media(max-height:500px){#demoPanel{width:min(490px,calc(100% - 24px));padding:8px 12px;bottom:8px}#demoPanel strong{font-size:12px}.demo-buttons{margin-top:6px}.demo-active .telemetry{bottom:145px;left:14px}.demo-active #chart{bottom:145px;width:65px;height:77px}.demo-active .position{top:65px}.demo-active .position b{font-size:32px}.demo-active .timing{top:65px;padding:6px}.demo-active .timing b{font-size:20px}}

@media(max-width:650px){.demo-active .telemetry{left:14px;gap:12px}.demo-active .telemetry>b{font-size:30px}.demo-active #power i{width:12px}.demo-active #chart{right:14px;width:82px;height:97px}}

/* Phone viewing: the demo defaults to unobstructed water and a single control chip. */
#demoToggle,#demoPause{display:none}
@media(max-width:900px),(pointer:coarse){
 .demo-active #racehud,.demo-active #splitHud,.demo-active header{display:none!important}
 .demo-active #demoPanel{display:none}
 .demo-active.demo-controls-open #demoPanel{display:block;bottom:calc(64px + env(safe-area-inset-bottom));width:min(460px,calc(100% - 24px));padding:10px 12px;background:#123440d9}
 .demo-active #demoToggle{display:block;position:fixed;z-index:5;right:max(12px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));min-height:44px;padding:10px 14px;border-radius:22px;font-size:12px;background:#153944a8;border-color:#d0e4db55}
 #demoPause{display:block}.demo-buttons{flex-wrap:wrap;gap:5px}.demo-buttons button{padding:8px 10px}#demoPanel small,#demoAction{display:none!important}#demoPanel strong{font-size:12px;margin:0 0 6px}
 .mobile-riding:not(.demo-active) header a{font-size:10px;letter-spacing:.08em}.mobile-riding header:before{display:none}.mobile-riding:not(.demo-active) .position,.mobile-riding:not(.demo-active) #chart,.mobile-riding:not(.demo-active) .timing,.mobile-riding:not(.demo-active) .telemetry>div{display:none}
 .mobile-riding:not(.demo-active) .telemetry{left:14px;bottom:185px}.mobile-riding:not(.demo-active) #speed{font-size:24px}.mobile-riding:not(.demo-active) #next{top:29%;font-size:10px}.mobile-riding:not(.demo-active) #notice{top:65px;font-size:11px;left:15%;width:70%}
 .mobile-riding:not(.demo-active) #freeStunts{background:transparent!important;padding:0!important;top:65px!important;left:14px!important}.mobile-riding:not(.demo-active) #freeStunts small,.mobile-riding:not(.demo-active) #stuntScore{display:none!important}.mobile-riding:not(.demo-active) #stuntGuide{font-size:10px}
}
@media(max-height:500px) and (max-width:900px){.mobile-riding:not(.demo-active) .telemetry{bottom:132px}.demo-active.demo-controls-open #demoPanel{left:12px;transform:none;width:min(450px,calc(100% - 170px));bottom:max(10px,env(safe-area-inset-bottom))}}

#demoStart{display:block;background:#edc58c;color:#153744;font-weight:700;font-size:16px;padding:15px 24px;margin:16px 0 20px;border:0;border-radius:5px}@media(max-width:900px),(pointer:coarse){.intro{padding-top:82px}.intro h1{font-size:48px;margin:12px 0}#demoStart{font-size:15px;padding:14px 20px;margin:12px 0}}

#buildVersion{position:fixed;right:10px;bottom:5px;z-index:7;font:9px/1.4 system-ui,sans-serif;letter-spacing:.10em;color:#e5f2edb3;text-shadow:0 1px 3px #001a26;pointer-events:none}button:disabled{cursor:wait;opacity:.65}

/* Launch controls stay above tuning even on a short landscape phone. */
.launch-actions{display:flex;gap:10px;align-items:stretch;flex-wrap:wrap;margin:18px 0}
.launch-actions #start,.launch-actions #demoStart{margin:0;font-size:14px;padding:15px 18px;flex:1;min-width:160px}
.launch-actions #demoStart{color:#e9eadb;background:#153944bb;border:1px solid #d6c7a780}
@media(max-height:500px){.intro{padding-top:72px}.intro h1{font-size:40px;margin:8px 0}.intro>.eyebrow{display:none}.intro>p{margin:8px 0}.launch-actions{margin:12px 0}.launch-actions #start,.launch-actions #demoStart{padding:12px 14px}.touch-choice small{font-size:10px}}
/* Keep the closer demo craft unobstructed; touch retains its tap-to-show tray. */
@media (min-width:1000px) and (min-height:501px) and (pointer:fine){
 #demoPanel{top:16px;bottom:auto;width:min(640px,calc(100% - 420px));padding:9px 12px;gap:14px;align-items:center;text-align:left}
 #demoPanel:not([hidden]){display:flex}
 #demoPanel>div:first-child{flex:1;min-width:0}
 #demoPanel small{display:none}
 #demoPanel strong{font-size:12px;margin:0 0 3px}
 #demoPanel span{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #demoPanel .demo-buttons{margin:0;flex-wrap:nowrap;gap:4px}
 #demoPanel .demo-buttons button{min-height:38px;padding:7px 9px;font-size:11px}
 .demo-active .telemetry{bottom:36px}
 .demo-active #chart{bottom:36px}
}
