:root {
  color-scheme: dark;
  --bg: #10100f;
  --panel: #191918;
  --line: #353534;
  --ink: #e9e8e6;
  --muted: #b1ada6;
  --copper: #b64225;
  --light-copper: #ff9a72;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 50% 1%, #211c18, transparent 67%), var(--bg); font: 16px "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; min-height:100vh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, #stage:focus-visible { outline: 2px solid var(--light-copper); outline-offset: 3px; }
.shell { max-width: 1320px; width: calc(100% - 8vw); margin: auto; }
header { border-bottom: 1px solid var(--line); background: #0a0a09; }
.nav, .nav-right, .brand, .mast, .cab-bar, .controls, .live, .action, .section-head, .board-meta, .profile-title, .profile-key, footer { display: flex; align-items: center; }
.nav, .mast, .cab-bar, .board-meta, .profile-title, footer { justify-content: space-between; }
.nav { height: 63px; }
.brand { gap: 10px; font-size: 15px; font-weight: 850; letter-spacing: 1.1px; }
.brand svg { width: 34px; height: 32px; }
.brand b { color: var(--light-copper); }
.nav-right { gap: 23px; font-size: 13px; color: #c4c1bc; }
.sound, .cab-bar button { font: 12px var(--mono); border-radius: 5px; padding: 7px 10px; border: 1px solid var(--line); background: #1a1917; }
.sound[aria-pressed=true] { border-color: #a8492e; color: var(--light-copper); }
.audio-controls { display:flex; align-items:center; gap:6px; }
.audio-mix { position:relative; }
.audio-mix summary { cursor:pointer; list-style:none; font:12px var(--mono); padding:7px 9px; border:1px solid var(--line); border-radius:5px; background:#1a1917; }
.audio-mix summary::-webkit-details-marker { display:none; }
.audio-mix summary:focus-visible { outline:2px solid var(--light-copper); outline-offset:3px; }
.audio-mix[open] summary { color:var(--light-copper); border-color:#a8492e; }
.mix-panel { position:absolute; z-index:20; top:calc(100% + 12px); right:0; width:240px; padding:18px; border:1px solid #5c4638; border-radius:8px; background:#201c19; box-shadow:0 12px 35px #0008; }
.mix-panel strong { color:var(--ink); font-size:15px; }.mix-panel p { color:var(--muted); font-size:12px; margin:4px 0 18px; }
.mix-panel label { display:flex; justify-content:space-between; margin:12px 0 6px; color:var(--ink); font:12px var(--mono); }
.mix-panel output { color:var(--light-copper); }
.mix-panel input[type=range] { display:block; width:100%; height:24px; margin:0; accent-color:var(--light-copper); cursor:pointer; }
.mix-panel small { display:block; margin-top:12px; font-size:11px; line-height:1.5; color:var(--muted); }
.radio { display:flex; align-items:center; gap:11px; padding:11px 15px; margin:0 14px 12px; border:1px solid #3b3029; border-radius:5px; background:linear-gradient(110deg,#251d17,#191918); }
.radio-mark { color:var(--light-copper); font-size:22px; }.radio>div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.radio-label { font:9px var(--mono); letter-spacing:.16em; color:#b69279; }
#trackName { color:#e2c9b4; font-size:12px; }
.radio button { margin-left:auto; padding:8px 9px; border:1px solid #554236; border-radius:4px; color:#e2c9b4; background:#29211c; font:11px var(--mono); white-space:nowrap; }
.mast { margin: 25px 0 17px; }
h1, h2, p { margin: 0; }
h1 { font-weight: 750; font-size: clamp(32px, 3.5vw, 52px); letter-spacing: -.055em; line-height: 1.06; }
.live { gap: 7px; color: #d9d8c8; padding: 6px 10px; border-radius: 4px; border: 1px solid #45423a; font: 11px var(--mono); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: #dbd8aa; }
.layout { display: grid; grid-template-columns: minmax(0, 2.9fr) minmax(238px, 1fr); gap: 16px; }
.cabinet, .panel, .stats { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.cabinet { overflow: hidden; box-shadow: 0 12px 35px #0004; }
.cab-bar { height: 36px; padding: 0 14px; background: linear-gradient(#282724, #20201e); }
.cab-name, .eyebrow, .stat-label { font: 650 10px var(--mono); letter-spacing: .13em; }
.signal { display: inline-block; margin-right: 6px; color: var(--light-copper); letter-spacing: 0; }
.cab-bar button { padding: 3px 6px; border-color: transparent; background: transparent; }
.cab-bar button:disabled { opacity: .4; cursor: default; }
#stage { position: relative; aspect-ratio: 1.82; overflow: hidden; isolation: isolate; background: #39251f; touch-action: none; user-select: none; outline-offset: -4px!important; }
#scene { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#character { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 5% 6.8%; background: linear-gradient(90deg,#130f0bc2 0%,#190f0970 38%,transparent 70%); pointer-events: none; }
#opening { width: 100%; }
#titleArt { display: block; width: min(56%, 420px); height: auto; image-rendering: pixelated; }
#opening p, #flightResult { margin: 6px 0 17px; font: 600 clamp(12px,1.1vw,16px)/1.5 "Segoe UI",sans-serif; text-shadow: 0 1px 4px #000; color: #f1e3d4; }
.action { pointer-events: auto; gap: 12px; min-height: 42px; padding: 9px 18px; border: 1px solid #ed8159; border-radius: 5px; background: linear-gradient(#bf4d2c, #a63820); color: white; box-shadow: inset 0 1px 0 #f49a7166, 0 3px 0 #4c2117, 0 8px 20px #0006; font-weight: 750; }
.action:hover { background: #c65232; }
.launch-options { display:flex; flex-wrap:wrap; gap:8px; }
#signature { pointer-events:auto; margin:0 0 10px; }
#signature label { color:#ffe0b7; font:650 10px var(--mono); letter-spacing:.12em; }
#signature div { display:flex; gap:7px; align-items:stretch; margin-top:4px; }
#signature input { background:#181410; border:1px solid #d29468; width:70px; text-align:center; font:700 17px var(--mono); letter-spacing:.15em; border-radius:4px; }
#signature button { padding:6px 10px; background:#32251e; color:#ffdbb9; border:1px solid #9f7d65; border-radius:4px; }
#signedNote { display:block; color:#ffe3c3; font-size:12px; }
#flightRanks { color:#ffe3c3; font:600 clamp(11px,1.15vw,14px)/1.5 var(--mono); margin-bottom:8px; }
#flightRanks span { display:block; }
#stage.modal:has(#flightRanks:not([hidden])) { min-height:285px; }
.action.secondary { background:#211c19; border-color:#9b8477; box-shadow:none; }
.action:disabled { cursor:default; background:#383531; border-color:#66615c; color:#d1c8be; box-shadow:none; }
#attempts { font:600 clamp(10px,1vw,13px)/1.4 var(--mono); color:#ffdfc4; margin-top:9px; max-width:90%; text-shadow:0 1px 4px #000; }
.action:active { transform: translateY(1px); }
.triangle { border-block: 5px solid transparent; border-left: 8px solid white; }
#stage.modal .overlay { background: linear-gradient(90deg,#120f0dee 4%,#16100dcd 43%,#17120c3d); }
.eyebrow { color: var(--light-copper); }
#result h2 { margin-top: 5px; font-size: clamp(30px,4.3vw,62px); line-height: 1; letter-spacing: -.055em; }
#counter { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); padding: 0 10px; color: white; text-shadow: 0 2px 3px #000; font: 850 clamp(23px,3vw,40px) var(--mono); }
#callout { position: absolute; left: 50%; top: 24%; transform: translate(-50%,-4px); opacity:0; color:#fff2cf; text-shadow:0 1px 3px #170e08; font: 700 12px var(--mono); letter-spacing:.08em; pointer-events:none; }
#callout.pulse { animation: callout .95s ease-out; }
@keyframes callout { 0%{opacity:0;transform:translate(-50%,4px)} 16%,72%{opacity:1} 100%{opacity:0;transform:translate(-50%,-6px)} }
.controls { gap: 18px; padding: 9px 14px; font-size: 12px; color: var(--muted); }
kbd { display:inline-block; padding: 2px 5px; border: 1px solid #504d47; border-bottom-width: 2px; border-radius: 3px; color: var(--ink); font:11px var(--mono); }
.panel { min-width: 0; padding: clamp(14px,2vw,24px); display: flex; flex-direction: column; }
.section-head { gap: 9px; }
.section-head svg { width: 21px; height: 21px; fill: none; stroke: var(--light-copper); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.section-head h2 { font-size: clamp(19px,2vw,26px); letter-spacing: -.045em; }
.board-meta { margin-top: 14px; padding: 9px 0; border-block: 1px solid var(--line); font: 11px var(--mono); color: var(--muted); }
.board-switch { display:flex; gap:2px; margin:14px 0 0; padding:3px; background:#10100f; border:1px solid var(--line); border-radius:6px; }
.board-switch button { flex:1; padding:6px; background:transparent; border:0; border-radius:3px; font:600 12px var(--mono); color:var(--muted); }
.board-switch button[aria-pressed=true] { background:#3d2c24; color:#ffd3b8; box-shadow:inset 0 0 0 1px #80503a; }
.standings .board-meta { border-top:0; margin-top:0; }
#podium { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; gap:4px; margin:14px 0 8px; }
.award { --bright:#efd087; --shadow:#a3712b; --light:#ffe8ae; min-width:0; display:flex; align-items:center; flex-direction:column; text-align:center; }
.award.gold { grid-column:2; grid-row:1; }
.award.silver { grid-column:1; grid-row:1; --bright:#d6dee8; --shadow:#89939c; --light:#f2f5fa; }
.award.bronze { grid-column:3; grid-row:1; --bright:#e2a87a; --shadow:#a56b4d; --light:#ffcda3; }
.award .metal { color:var(--bright); font:650 9px var(--mono); letter-spacing:.08em; text-transform:uppercase; }
.award img { width:100%; height:clamp(50px,5.2vw,76px); object-fit:contain; }
.award.gold img { height:clamp(59px,6.1vw,88px); }
.award.silver img { filter:grayscale(1) sepia(.1) hue-rotate(160deg) saturate(1.5); }
.award.bronze img { filter:sepia(.32) hue-rotate(337deg) saturate(.94) brightness(.84); }
.plate { width:100%; display:grid; align-items:center; min-height:26px; padding:3px 2px; overflow-wrap:anywhere; font:700 clamp(9px,.8vw,11px)/1.12 var(--mono); color:#241d17; border:1px solid var(--shadow); border-radius:2px; background:linear-gradient(115deg,var(--shadow),var(--bright) 22%,var(--light) 64%,var(--bright)); text-shadow:0 1px 0 #ffffff55; }
.gates { font:10px var(--mono); color:var(--muted); margin-top:5px; }
.panel ol { list-style: none; margin: 0; padding: 0; }
.panel li.vacant, .panel li.vacant strong { color: var(--muted); }
.panel li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.panel li strong { font: 700 14px var(--mono); color: var(--light-copper); }
.panel li span:first-child { font: 12px var(--mono); color: var(--muted); }
#boardNote { margin: 13px 0 16px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.course-profile { border-block: 1px solid var(--line); padding: 13px 0 10px; }
.profile-title { gap: 7px; }
.profile-title strong { font-weight: 650; font-size: 13px; }
.profile-title span, .profile-key { font: 10px var(--mono); color: var(--muted); }
#profile { width: 100%; height: 55px; margin-top: 9px; display: block; background: #121210; border-radius: 3px; }
.profile-key { gap: 6px; margin-top: 5px; }
.profile-key i { width: 14px; border-top: 1px dashed var(--light-copper); }
.stat-label { color: var(--muted); font-size: 10px; }
input { width: 100%; border: 0; background: transparent; font: 13px var(--mono); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 16px 0; padding: 13px 0; }
.stats>div { padding: 0 20px; border-right: 1px solid var(--line); }
.stats>div:last-child { border: 0; }
.stats strong { display: block; margin-top: 3px; font: 700 22px var(--mono); }
.stats small { font: 12px var(--mono); color: var(--muted); }
footer { margin: 18px 0; color: #a19d95; font: 10px var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(100%); }
[hidden] { display: none!important; }
@media(max-width:900px){.shell{width:calc(100% - 36px)}.layout{grid-template-columns:minmax(0,2.2fr) minmax(195px,1fr);gap:12px}#stage{aspect-ratio:1.48}.panel{padding:14px}}
@media(max-width:720px){
  .shell{width:calc(100% - 24px)}.nav{height:50px}.nav-right{gap:12px}.brand{font-size:13px}.brand svg{width:26px}
  .mast{margin:17px 0 12px}.layout{display:flex;flex-direction:column}.panel{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:0 20px}
  .section-head,.standings{grid-column:1}.standings{grid-row:2/4}.course-profile{grid-column:2;grid-row:1/3;border:0;padding:3px 0}
  #stage{aspect-ratio:1.6}.stats{margin:12px 0}.stats>div{padding:0 14px}.nav-right a{display:none}
}
@media(max-width:440px){#stage{aspect-ratio:1.14}#titleArt{width:70%}.panel{gap:0 12px}.section-head{gap:5px}.profile-title{flex-wrap:wrap}.stat-label{font-size:8px}.controls{padding:8px}.live{font-size:10px}}
@media(max-width:510px){.panel{display:flex}.course-profile{border-top:1px solid var(--line);padding:12px 0}.award img{height:63px}.award.gold img{height:75px}}
@media(prefers-reduced-motion:reduce){#callout.pulse{animation:none;opacity:1}}
