:root{--ink:#184c70;--snow:#f3fbff;--gold:#ffd05b}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(ellipse at 40% 10%,#467b9a,#173d5a 70%);color:var(--snow);font-family:Trebuchet MS,Segoe UI,sans-serif;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,canvas:focus-visible{outline:3px solid var(--gold);outline-offset:3px}header{width:min(1080px,calc(100vw - 32px),calc((100dvh - 115px)*1.33333));display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.brand{font-size:clamp(20px,2.6vw,32px);font-weight:900;letter-spacing:.12em}.brand b{color:var(--gold)}.brand small{display:block;font-size:8px;letter-spacing:.24em;margin-top:4px;color:#d4e9f2}.tools{display:flex;gap:7px}.tools button{border:1px solid #f3fbff55;background:#122f4980;color:#fff;border-radius:7px;padding:9px;font-size:12px;font-weight:bold}.tools #help-button{width:36px;border-radius:50%;background:#ffffff22}#race{width:min(1080px,calc(100vw - 32px),calc((100dvh - 115px)*1.33333))}#playfield{position:relative;width:100%;aspect-ratio:4/3;border-radius:12px;overflow:hidden;box-shadow:0 16px 48px #08273e88;background:#dceef5}canvas{width:100%;height:100%;display:block;touch-action:none}#hud{position:absolute;top:0;left:0;right:0;display:grid;grid-template-columns:repeat(5,1fr);padding:9px 12px;background:#123d5cee;color:white;text-align:center;border-bottom:3px solid var(--gold);pointer-events:none}#hud div{display:grid;gap:2px}#hud div+div{border-left:1px solid #ffffff40}#hud small{font-size:9px;letter-spacing:.13em;font-weight:900}#hud strong{font-size:22px;font-weight:900;font-variant-numeric:tabular-nums}#hearts{color:#ffdc84}#message{position:absolute;bottom:0;left:0;right:0;text-align:center;background:#123d5ce8;padding:7px 3px;color:#fff;font-size:12px;min-height:28px;pointer-events:none}.hint{margin:9px 0 0;font-size:10px;letter-spacing:.07em;color:#d1e7f1}.modal{position:fixed;inset:0;z-index:1000;display:none;place-items:center;padding:14px;overflow:auto;background:#133a56ef}.modal.is-visible{display:grid}.modal-card{width:min(680px,100%);max-height:calc(100dvh - 28px);overflow-y:auto;padding:28px;border:2px solid #ffd05b;border-radius:16px;background:linear-gradient(130deg,#fff,#dfedf2);color:var(--ink);box-shadow:0 24px 70px #071f3399}.eyebrow{font-size:10px;font-weight:900;letter-spacing:.15em;margin:0 0 10px;color:#975111}.modal h1,.modal h2{font:900 clamp(30px,4vw,46px)/1.05 Georgia,serif;margin:0 0 12px}.modal em{color:#b25c0b;font-style:normal}.modal p{line-height:1.45}.guide{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}.guide p{margin:0;padding:11px;background:#fff9;border-top:3px solid #74a8ba;font-size:12px}.guide b{font-size:11px;letter-spacing:.06em}.primary{width:100%;min-height:46px;margin-top:9px;border:0;border-radius:8px;background:#184c70;color:#fff;font-weight:900;letter-spacing:.1em}.primary:hover{background:#26698c}.result{text-align:center;max-width:440px}#touch-controls{display:none;pointer-events:none}.virtual-joystick{pointer-events:auto}.touch-actions{display:flex;flex-direction:column;gap:10px;pointer-events:none}.touch-actions button{width:116px;min-height:48px;pointer-events:auto;padding:8px;border:2px solid #d7e9f1;border-radius:10px;background:#174767;color:#fff;font-size:12px;font-weight:900;box-shadow:0 4px 0 #0b293f;touch-action:none}.touch-actions #brake{background:#f2bb45;color:#183c59;min-height:64px}.touch-actions button.pressed,.touch-actions button:active{transform:translateY(3px);box-shadow:0 1px 0 #0b293f}body.touch-device header,body.touch-device .hint{display:none}body.touch-device #touch-controls{display:flex;position:fixed;inset:0;align-items:center;justify-content:space-between;padding:8px;z-index:38}body.touch-device #hud{padding:5px 3px;border-bottom-width:2px}body.touch-device #hud small{font-size:8px;letter-spacing:0}body.touch-device #hud strong{font-size:14px}body.touch-device #message{font-size:10px;min-height:22px;padding:5px 2px}body.touch-device #playfield{border-radius:8px}body.touch-device #race{width:auto}
@media(max-width:599px){body.touch-device{justify-content:flex-start;padding-top:64px}body.touch-device #race{width:calc(100vw - 16px)}body.touch-device #touch-controls{inset:auto 8px max(14px,env(safe-area-inset-bottom))!important;height:170px!important}.guide{grid-template-columns:1fr}}
@media(orientation:landscape) and (max-height:500px){.modal-card{padding:14px}.modal h1{font-size:30px;margin-bottom:7px}.modal-card>p{font-size:12px;line-height:1.3;margin:8px 0}.guide{margin:9px 0}.guide p{font-size:11px;padding:8px}.primary{min-height:40px;font-size:12px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:599px){body.touch-device:not(.vibecade-joystick-rails) #touch-controls{inset:auto 8px max(14px,env(safe-area-inset-bottom))!important;height:190px!important}}
#progress{position:absolute;left:0;right:0;bottom:28px;height:3px;background:#184c7066;pointer-events:none}#progress span{display:block;width:100%;height:100%;background:#f3bd47;transform:scaleX(0);transform-origin:left}body.touch-device #progress{bottom:22px}
#pace{position:absolute;top:59px;left:50%;transform:translateX(-50%);padding:5px 12px;border-radius:0 0 7px 7px;white-space:nowrap;background:#123d5ce8;color:#fff5d0;font-size:11px;font-weight:bold;pointer-events:none}#pace.behind{background:#883f35;color:#fff}#hud.time-tight #race-time{color:#ffd05b}.touch-actions #accelerate{background:#f2bb45;color:#183c59;min-height:55px}.touch-actions #brake{background:#507f97;color:#fff;min-height:55px}.touch-actions [aria-pressed=true]{border-color:#ffd05b}.touch-actions{gap:8px}body.touch-device #pace{top:40px;font-size:9px;padding:4px 7px}body.touch-device #touch-pause,body.touch-device #touch-sound{min-height:38px;font-size:10px}
@media(max-width:599px){body.touch-device:not(.vibecade-joystick-rails) #touch-controls{height:220px!important}}
