:root{font-family:Inter,Segoe UI,system-ui,sans-serif;color:#eaf4fa;background:#091b29;font-size:16px;color-scheme:dark}*{box-sizing:border-box}body{margin:0}main{display:grid;grid-template-columns:minmax(0,1fr) 360px;min-height:100dvh}#scene{position:relative;min-height:650px;overflow:hidden;background:#97bdcd}canvas{display:block;width:100%;height:100%;touch-action:none}.brand{position:absolute;z-index:2;top:28px;left:30px;display:flex;align-items:center;gap:12px;color:#102f40;pointer-events:none}.mark{background:#102f40;color:white;border-radius:7px;padding:8px 13px;font-weight:800;font-size:24px}h1{font-size:22px;letter-spacing:4px;margin:0}.brand p{font-size:12px;letter-spacing:3px;margin:5px 0 0}.view-label{position:absolute;top:35px;right:28px;color:#183d50;font-size:12px;letter-spacing:1px;text-align:right;pointer-events:none}.view-label span{display:block;letter-spacing:0;font-size:14px;margin-top:5px}.scene-help{position:absolute;bottom:26px;left:28px;right:28px;text-align:center;background:#092132e8;color:white;padding:14px;border-radius:8px;font-size:15px;line-height:1.65;pointer-events:none}.scene-help span{font-size:13px;color:#a6c7d6}.wind-tag{position:absolute;left:28px;top:108px;color:#164257;font-size:12px;letter-spacing:1px;font-weight:700;pointer-events:none}#loading{position:absolute;top:48%;width:100%;text-align:center;color:#143847;font-weight:600;z-index:3}aside{padding:30px 26px;background:#091b29;border-left:1px solid #204050;display:flex;flex-direction:column;gap:28px}h2{font-size:30px;letter-spacing:-1px;margin:10px 0}p{line-height:1.55;margin:0;color:#a8bfcd}.eyebrow{color:#48d9df;font-size:12px;letter-spacing:1.5px}header>p:last-child{font-size:15px}.label{display:flex;justify-content:space-between;gap:8px;margin:0 0 12px;font-size:14px}output{color:#4fdbe2;font-variant-numeric:tabular-nums}input[type=range]{width:100%;accent-color:#4bd7df;cursor:pointer;margin:0;height:20px}.scale{display:flex;justify-content:space-between;color:#819aaa;font-size:12px;margin:6px 0 22px}.presets{display:flex;gap:5px;margin:0 0 28px}button{border:1px solid #29495c;border-radius:6px;background:#142c3c;color:#dcecf5;font:inherit;font-size:14px;padding:10px 12px;cursor:pointer;touch-action:none}button:hover{background:#214657}button:focus-visible,input:focus-visible{outline:2px solid #55dbe4;outline-offset:4px}.presets button{font-size:12px;flex:1;padding:8px 4px}.controls>.label:not(:first-child){margin-top:24px}.trim-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.trim-buttons button{padding:13px 8px;font-size:14px}.trim-buttons button.active{background:#1f626d;border-color:#4bd7df}kbd{display:block;font-size:12px;margin-top:6px;color:#6acbd3}.instrument{border-top:1px solid #294251;padding-top:22px}.status{display:flex;align-items:center;justify-content:space-between;font-size:14px}#status{color:#4fdbe2;font-weight:600}#loadOut{color:#a2bccb;font-size:12px}.load-track{height:5px;background:#1e3b4e;border-radius:10px;margin:14px 0 23px;overflow:hidden}#loadBar{height:100%;background:#46d5dd;width:0;transition:width .15s}.readings{display:grid;grid-template-columns:1fr 1fr;gap:20px}.readings span{font-size:13px;color:#92adbe}.readings strong{font-weight:400;display:block;font-size:38px;margin:6px 0 15px;font-variant-numeric:tabular-nums}.instrument p{font-size:14px;min-height:44px}footer{margin-top:auto}footer button{width:100%;background:transparent}footer p{font-size:12px;margin-top:15px;color:#7994a5}@media(max-width:850px){main{grid-template-columns:minmax(0,1fr) 310px}aside{padding:25px 20px}.view-label{display:none}}@media(max-width:740px){main{display:block}#scene{height:65dvh;min-height:440px}aside{border-left:0;padding:24px;gap:24px}.brand{top:20px;left:20px}.wind-tag{left:20px;top:94px}.scene-help{left:12px;right:12px;bottom:12px;font-size:13px}header h2{font-size:26px}.readings strong{font-size:32px}}

.readings strong.compact{font-size:20px;line-height:1.6;white-space:nowrap}

.heading-row{display:flex;justify-content:space-between;margin-bottom:18px;font-size:14px}.tiller{position:absolute;bottom:114px;left:22%;right:22%;font-size:10px;color:#0c3347;display:flex;justify-content:space-between;gap:12px;pointer-events:none}.tiller>span{display:none}.tiller-track{position:relative;height:3px;background:#173f5080;width:100%}.tiller-track:after{content:'';position:absolute;left:50%;height:13px;top:-5px;width:1px;background:#12364b}#tillerMarker{position:absolute;left:50%;width:9px;height:9px;top:-3px;border-radius:50%;background:#ffcc25;transform:translateX(-50%)}#telltaleOut{color:#48d9df;margin-bottom:12px;font-size:13px}.view-label span span{font-size:12px}@media(max-width:740px){.tiller{bottom:94px;left:18%;right:18%}}

.run-state{position:absolute;bottom:145px;left:0;right:0;text-align:center;color:#e7f5fc;font-size:12px;letter-spacing:1px;pointer-events:none;text-shadow:0 1px 4px #12364b}@media(max-width:740px){.run-state{bottom:118px;font-size:11px}}

.wind-dial{position:absolute;top:145px;right:24px;width:130px;text-align:center;pointer-events:none;color:#e2f2fa;text-shadow:0 1px 3px #102f40}.wind-dial svg{width:104px;height:104px;display:block;margin:6px auto}.dial-title{font-size:10px;letter-spacing:1px}#windDialLabel{font-size:12px}.wind-tag{font-size:11px}@media(max-width:740px){.wind-dial{top:112px;right:12px;width:106px}.wind-dial svg{width:86px;height:86px}.dial-title{font-size:9px}}

.mark-dial{left:24px;right:auto}#markDialLabel{font-size:12px}#markDistance{font-size:11px;margin-top:5px;color:#e3f2fa}@media(max-width:740px){.mark-dial{left:12px;right:auto}}

.trim-hint{color:#ffdb6a;font-size:14px;margin-top:12px;min-height:20px}#noGoLabel{font-size:10px;margin-top:5px;color:#ffb6bb}

.racer-tag{position:absolute;transform:translate(-50%,-100%);font-size:12px;background:#0b263ddd;border:1px solid #2879ed;border-radius:4px;color:#fff;padding:3px 8px;pointer-events:none;white-space:nowrap}.fleet-score{display:flex;justify-content:space-between;gap:10px;font-size:12px}.fleet-score span:first-child{color:#72aaff}.fleet-score span:last-child{color:#9cdeff}.impact-status{position:absolute;top:70%;left:0;right:0;text-align:center;color:#ffda60;font-size:18px;font-weight:700;text-shadow:0 1px 4px #0b263d;pointer-events:none}

#tillerPad{pointer-events:auto;cursor:ew-resize;touch-action:none;user-select:none;border:1px solid #6d97af;z-index:5}#tillerPad.active{border-color:#55dbe4;background:#0c3549f5}.fleet-score span:last-child{color:#6ddd91}.run-state{bottom:165px}.tiller{bottom:135px}@media(max-width:740px){.run-state{bottom:145px}.tiller{bottom:122px}}

.shadow-status{font-size:12px;color:#ffe44d;margin-top:10px;min-height:0}.shadow-status:empty{display:none}.impact-status{font-size:14px;padding:0 18px}

.course-map{position:absolute;top:145px;left:50%;transform:translateX(-50%);width:160px;text-align:center;color:#e2f2fa;pointer-events:none}.course-map svg{width:160px;height:160px;display:block;margin:6px auto}.map-key{font-size:12px;line-height:1.5;background:#092132bf;border-radius:4px}.fleet-score{flex-wrap:wrap;font-size:12px}.fleet-score #weekendScore{color:#f4c72d}.fleet-score #noviceScore{color:#65de89}@media(max-width:1050px){.course-map{width:126px}.course-map svg{width:126px;height:126px}.course-map .dial-title{font-size:9px}}@media(max-width:740px){.course-map{top:112px;width:112px}.course-map svg{width:112px;height:112px}.map-key{font-size:10px}}

.course-map{top:350px;left:24px;transform:none;width:130px}.course-map svg{width:130px;height:130px}.course-map .dial-title{font-size:9px}@media(max-width:740px){.course-map{top:270px;left:12px;width:106px}.course-map svg{width:106px;height:106px}.map-key{display:none}}

.landmark-tag{font-size:10px;letter-spacing:.5px;background:#092132a6;border-color:#a8c6c9;color:#d6edf3}

@media(max-width:740px){#scene{min-height:560px}}

.true-wind-speed{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;color:#e2f2fa;line-height:1.25;margin:4px 0}.true-wind-speed.in-puff{color:#55e3eb}@media(max-width:740px){.true-wind-speed{font-size:18px}}

.race-banner{position:absolute;top:76px;left:50%;transform:translateX(-50%);padding:8px 14px;border-radius:6px;background:#092132dd;color:#fff;font-size:14px;text-align:center;pointer-events:none;max-width:70%}.fleet-score{display:grid;grid-template-columns:1fr;gap:10px;font-size:14px}.fleet-score #playerScore{color:#ff7e87}.fleet-score #expertScore{color:#72aaff}@media(max-width:740px){.race-banner{top:58px;left:auto;right:12px;transform:none;max-width:54%;font-size:12px}}

.results-overlay[hidden]{display:none}.results-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:16px;background:#03111bcc;backdrop-filter:blur(7px)}.results-card{width:min(640px,100%);max-height:90vh;overflow:auto;padding:28px;border:1px solid #659cb2;border-radius:18px;background:#092132;box-shadow:0 20px 80px #0008;color:#e5f4fa}.results-card h2{font-size:32px;margin:0 0 20px}.results-card table{width:100%;border-collapse:collapse;font-size:16px;text-align:left}.results-card th,.results-card td{padding:12px 8px;border-bottom:1px solid #365767}.results-card thead{color:#9bbdce;font-size:14px}.results-card td:nth-child(3){font-variant-numeric:tabular-nums;white-space:nowrap;color:#55e3eb}.results-card p{font-size:14px;line-height:1.5;color:#acc8d6}.results-card button{width:100%;padding:14px;font-size:16px;margin-top:12px;background:#28b5c3;color:#031922}.results-card tbody tr:first-child{background:#ffd34c18}@media(max-width:540px){.results-card{padding:16px}.results-card th,.results-card td{padding:10px 4px;font-size:14px}}

/* The game surface fills the available viewport; only the controls panel scrolls. */
html,body{width:100%;height:100%;overflow:hidden}main{height:100dvh;min-height:0;grid-template-rows:minmax(0,1fr)}#scene{height:100%;min-height:0;min-width:0}aside{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain}.settings-toggle,.settings-close{display:none}#scene>.brand{top:18px;left:20px}#scene>.wind-tag{top:86px}#scene>.race-banner{top:72px}#scene>.wind-dial{top:112px}#scene>.course-map{top:320px}#scene>.scene-help{bottom:14px;padding:10px;line-height:1.5}#scene>.tiller{bottom:116px}#scene>.run-state{bottom:140px}
@media(max-width:740px){main{display:grid;grid-template-columns:minmax(0,1fr)}#scene{height:100%;min-height:0}aside{display:none;position:fixed;top:0;right:0;bottom:0;width:min(360px,94vw);z-index:25;box-shadow:-12px 0 40px #0008}aside.is-open{display:flex}.settings-toggle{display:block;position:absolute;top:14px;right:12px;z-index:6;padding:8px 12px}.settings-close{display:block}#scene>.race-banner{top:68px;right:12px;left:auto;max-width:65%}#scene>.wind-tag{display:none}#scene>.course-map{top:290px}#scene>.brand{top:14px;left:12px}}
@media(max-height:650px){#scene>.brand p{display:none}#scene>.brand{top:10px}#scene>.race-banner{top:12px;max-width:52%}#scene>.wind-tag,#scene>.view-label{display:none}#scene>.wind-dial{top:68px;width:106px}#scene>.wind-dial svg{width:78px;height:78px}#scene>.course-map{top:250px;width:106px}#scene>.course-map svg{width:96px;height:96px}#scene>.scene-help{bottom:8px;padding:8px;font-size:14px}#scene>.scene-help span{font-size:12px}#scene>.tiller{bottom:101px}#scene>.run-state{bottom:118px}}
@media(max-height:500px){#scene>.race-banner{top:54px}#scene>.wind-dial{top:90px;width:94px}#scene>.wind-dial svg{width:62px;height:62px}#scene>.course-map{top:auto;bottom:110px;left:12px;width:86px}#scene>.course-map svg{width:86px;height:86px}#scene>.course-map .map-key{display:none}#scene>.mark-dial{left:112px}#scene>.wind-dial:not(.mark-dial){right:12px}#scene>.run-state{bottom:100px}#scene>.tiller{bottom:89px}#scene>.scene-help{font-size:12px}#scene>.scene-help span{display:none}}

#scene>.race-banner.player-finished{background:#fff0af;color:#142c3c;border:2px solid #ffcc25;font-weight:800;box-shadow:0 0 22px #ffce5355;font-size:16px;z-index:6}

#scene>.race-banner.early-start{background:#a32b36;color:#fff;border:2px solid #ff9399;font-weight:800;z-index:6}

.sound-toggle{position:absolute;bottom:168px;right:18px;z-index:6;font-size:12px;padding:6px 9px;background:#092132cc}@media(max-height:650px){.sound-toggle{bottom:140px}}@media(max-height:500px){.sound-toggle{bottom:104px;right:8px}}

#raceSetup{z-index:110}#lapCount{display:block;width:100%;margin:14px 0;padding:14px;font:inherit;font-size:24px;color:#e5f4fa;background:#132f41;border:1px solid #659cb2;border-radius:6px}#raceSetupCancel{background:#142c3c;color:#dcecf5}

.race-banner{display:flex;align-items:center;justify-content:center;gap:10px}#countdownDial{width:44px;height:44px;flex:0 0 44px}#raceStatus{line-height:1.4}@media(max-height:500px){#countdownDial{width:34px;height:34px;flex-basis:34px}.race-banner{padding:4px 8px}}

aside{gap:22px}aside header h2{font-size:26px}.instrument .status{margin-bottom:14px}.trim-guide{padding:14px 16px;background:#123044;border:1px solid #2d5062;border-radius:8px;display:grid;gap:7px;margin:14px 0 22px}.trim-guide-label{font-size:12px;letter-spacing:1px;color:#9ebaca}#trimHint{font-size:18px;color:#eff7fb}#trimHint[data-trim=good]{color:#69dbc3}#trimHint[data-trim=adjust]{color:#ffdb6a}#trimAction{font-size:14px;color:#acc8d6}.instrument #telltaleOut{min-height:0;margin:6px 0 0;font-size:14px}.setup-wind{margin-top:24px}.setup-wind-scale{display:flex;justify-content:space-between;font-size:14px;color:#acc8d6;margin:8px 0 12px}.setup-wind output{font-size:18px}.readings{gap:14px}.readings strong{font-size:30px;margin:4px 0 12px}

.setup-wind-scale{position:relative}.setup-wind-scale span:nth-child(2){position:absolute;left:40%;transform:translateX(-50%)}

#courseType{display:block;width:100%;padding:12px;margin:12px 0 22px;font:inherit;color:#e5f4fa;background:#132f41;border:1px solid #659cb2;border-radius:6px}

#tillerPad{--tiller-wood:repeating-linear-gradient(3deg,transparent 0 7px,#2f1b1433 8px 9px,transparent 10px 17px),repeating-linear-gradient(177deg,#c48b4722 0 2px,transparent 3px 11px),radial-gradient(ellipse at 73% 52%,#301b1722 0 3%,transparent 4% 7%,#29191522 8% 9%,transparent 10% 18%),linear-gradient(90deg,#4b2c1b,#75502e 32%,#52301c 67%,#674123);background:var(--tiller-wood);border:2px solid #a77743;color:#fff4df;box-shadow:inset 0 2px 2px #e4b77366,inset 0 -3px 4px #24170bcc,0 4px 10px #0005;text-shadow:0 1px 2px #21150d}#tillerPad span{color:#f3ddba}#tillerPad.active{background:var(--tiller-wood);border-color:#ffd182;box-shadow:inset 0 2px 2px #edc18d88,inset 0 -3px 4px #24170bcc,0 0 12px #f1b55366}

.history-section{margin:24px 0 18px;padding-top:18px;border-top:1px solid #365767}.history-section h3{font-size:20px;margin:0 0 8px}.history-table th:not(:first-child),.history-table td{text-align:center;font-variant-numeric:tabular-nums}.history-table tbody tr:first-child{background:transparent}.history-table tbody tr:nth-child(1) th{color:#ff7e87}.history-table tbody tr:nth-child(2) th{color:#72aaff}.history-table tbody tr:nth-child(3) th{color:#f4c72d}.history-table tbody tr:nth-child(4) th{color:#65de89}.results-card #resetHistory{background:#142c3c;color:#dcecf5;font-size:14px;padding:10px}.history-section #historySummary{margin-bottom:10px}

/* Touch-only trim pad; desktop controls keep their existing layout. */
.mobile-trim{display:none}
@media(max-width:740px),(pointer:coarse){
 #scene>.course-map{display:none}
 .mobile-trim{position:absolute;display:grid;grid-template-rows:1fr 20px 1fr;left:max(12px,env(safe-area-inset-left));bottom:150px;width:94px;height:152px;z-index:7;background:#092132e8;border:1px solid #6a9caf;border-radius:16px;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
 .mobile-trim button{border:0;border-radius:0;background:transparent;font-size:16px;font-weight:700;padding:10px 6px;touch-action:none}
 .mobile-trim button.active{background:#216576;color:#fff;border:2px solid #5ae1e8}
 .thumb-divider{font-size:10px;letter-spacing:.5px;text-align:center;line-height:20px;color:#adced9;border-top:1px solid #34576a;border-bottom:1px solid #34576a;pointer-events:none}
 #tillerPad{font-size:0;min-height:64px;padding:12px 10px}
 #tillerPad::before{content:'TILLER · Hold and slide left / right';font-size:14px}
 #tillerPad span{display:none}
 #scene>.tiller{bottom:96px}#scene>.run-state{bottom:116px}
}
@media(max-height:500px) and (pointer:coarse){.mobile-trim{bottom:105px;height:120px;width:90px}#scene>.run-state{bottom:90px}#scene>.tiller{bottom:78px}#tillerPad{min-height:54px}}

.help-link{position:absolute;top:14px;right:108px;z-index:6;padding:8px 12px;border:1px solid #29495c;border-radius:6px;background:#142c3c;color:#dcecf5;font-size:14px;text-decoration:none;line-height:1.2}.help-link:hover{background:#214657}.help-link:focus-visible{outline:2px solid #55dbe4;outline-offset:4px}@media(min-width:741px){.help-link{right:28px;top:70px}}@media(max-height:650px) and (min-width:741px){.help-link{top:14px;right:18px}}

@media(max-width:740px){#scene>.brand .mark,#scene>.brand p{display:none}#scene>.brand h1{font-size:16px;letter-spacing:2px}#scene>.brand{top:24px}}

.fleet-score #marqueeScore{color:#c2c8ce}.fleet-score #scopeScore{color:#f3f2e9}.history-table tbody tr:nth-child(5) th{color:#c2c8ce}.history-table tbody tr:nth-child(6) th{color:#f3f2e9}.history-table{font-size:14px}.history-table th,.history-table td{padding:8px 5px}@media(max-width:480px){.history-table{font-size:12px}.history-table th,.history-table td{padding:7px 3px}.history-table th:first-child{max-width:96px}}
