:root{--ink:#253b52;--red:#b84230;--paper:#faf6ee;--blue:#277194}*{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 30% 12%,#f4eee1,#cad8e1);font-family:Trebuchet MS,Segoe UI,sans-serif;color:var(--ink);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 #b84230;outline-offset:3px}button[hidden]{display:none!important}header,main{width:min(1280px,calc(100vw - 40px),calc((100dvh - 118px)*1.47))}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.brand{font-size:clamp(20px,2.5vw,32px);font-weight:900;letter-spacing:.14em}.brand b{color:var(--red)}.brand small{display:block;font-size:9px;letter-spacing:.23em;margin-top:5px;color:#506b7d}.tools{display:flex;gap:7px}.tools button{padding:9px 11px;font-size:12px;font-weight:bold;border:1px solid #728b9a88;border-radius:8px;background:#faf6eea0;color:var(--ink)}#help-button{width:36px;border-radius:50%;background:#fff6}#playfield{width:100%;position:relative;overflow:hidden;border:1px solid #7b929e;border-radius:12px;background:#e7edf0;box-shadow:0 18px 50px #3b55672d}#hud{height:49px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 10px;background:#faf6ee;border-bottom:1px solid #c9d1cf;text-align:center;pointer-events:none}#hud div{display:grid}#hud div+div{border-left:1px solid #cad1d2}#hud small{font-size:9px;font-weight:900;letter-spacing:.13em}#hud strong{font-size:21px;font-variant-numeric:tabular-nums}#hud .low{color:#b84230;text-decoration:underline;text-underline-offset:3px}canvas{display:block;width:100%;height:auto;aspect-ratio:8/5;touch-action:none}#status{height:25px;padding:6px;text-align:center;font-size:11px;background:#faf6ee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.hint{margin:10px 0 0;font-size:10px;letter-spacing:.08em;color:#506b7d}.modal{position:fixed;inset:0;z-index:1000;display:none;place-items:center;padding:14px;overflow:auto;background:#233b51dd}.modal.is-visible{display:grid}.modal-card{width:min(720px,100%);max-height:calc(100dvh - 28px);overflow-y:auto;padding:30px;border:1px solid #f9f4e5;border-radius:16px;background:var(--paper);color:var(--ink);box-shadow:0 25px 80px #0004}.eyebrow{font-size:10px;letter-spacing:.18em;font-weight:900;color:#596f7c;margin:0 0 14px}.modal h1,.modal h2{font:normal clamp(34px,4vw,49px)/1.08 Georgia,serif;margin:0 0 16px}.modal em{color:var(--red);font-style:normal}.modal p{line-height:1.5}.guide{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.guide p{margin:0;padding:12px 0 0;border-top:3px solid #b7cbd2;font-size:12px}.fine{font-size:12px;color:#506572}.primary{border:1px solid #a94331;background:var(--red);color:#fff8ec;border-radius:8px;padding:14px 22px;min-height:46px;font-weight:900;letter-spacing:.08em}.result{text-align:center;width:min(520px,100%)}.result button{display:block;margin:12px auto;min-width:190px}#again{border:1px solid #8c9da4;background:transparent;color:var(--ink);border-radius:8px;padding:10px 18px}#touch-controls,#orientation{display:none}body:has(.modal.is-visible) #touch-controls{visibility:hidden!important}body.touch-device header,body.touch-device .hint{display:none}body.touch-device main{display:flex;width:100%;height:100%;align-items:center;justify-content:center}body.touch-device #playfield{border-radius:7px}body.touch-device #hud{height:37px;padding:3px}body.touch-device #hud small{font-size:8px;letter-spacing:0}body.touch-device #hud strong{font-size:16px}body.touch-device #status{height:22px;padding:5px 3px;font-size:9px}body.touch-device #touch-controls{display:flex;position:fixed;inset:0;pointer-events:none;align-items:center;justify-content:space-between}.touch-actions{display:flex;flex-direction:column;gap:9px;pointer-events:auto}.touch-actions button{min-width:112px;min-height:40px;background:#eef2f1;color:var(--ink);border:1px solid #728d9b;border-radius:10px;font-size:11px;font-weight:900;box-shadow:0 3px 0 #667e8a55;touch-action:none}.touch-actions #brake{min-height:84px;background:#b84230;color:#fff7e8;font-size:16px;letter-spacing:.06em;border-color:#943525}.touch-actions button:active,.touch-actions button[aria-pressed=true]{transform:translateY(2px);background:#244e6e!important;color:#fff8ee}body.touch-device.vibecade-joystick-rails #playfield{width:min(calc(100vw - var(--vibecade-control-rail)*2),calc((100dvh - 67px)*1.6))!important;max-width:min(calc(100vw - var(--vibecade-control-rail)*2),calc((100dvh - 67px)*1.6))!important;height:min(calc((100vw - var(--vibecade-control-rail)*2)*.625 + 59px),calc(100dvh - 8px))!important;max-height:min(calc((100vw - var(--vibecade-control-rail)*2)*.625 + 59px),calc(100dvh - 8px))!important}body.touch-device.vibecade-joystick-rails #playfield canvas{height:calc(100% - 59px)!important;aspect-ratio:8/5}
#result-help{border:0;background:transparent;color:#315c76;text-decoration:underline;padding:7px;font-size:12px}
#hud{grid-template-columns:repeat(5,minmax(0,1fr)) 100px}#map{width:88px;height:31px;aspect-ratio:auto;display:block;margin:auto;border-radius:4px}body.touch-device #hud{grid-template-columns:repeat(5,minmax(0,1fr)) 65px}body.touch-device #map{width:59px;height:23px}.map-cell{overflow:hidden}
body.touch-device.vibecade-joystick-rails #playfield #map{width:59px!important;max-width:59px!important;height:23px!important;max-height:23px!important;aspect-ratio:auto!important}
@media(max-width:900px){.flyout-nav{display:none!important}}@media(max-height:450px){.modal-card{padding:15px 20px}.modal h1{font-size:30px}.modal p{font-size:12px}.guide{margin:10px 0;gap:12px}.guide p{font-size:11px}.eyebrow{margin-bottom:8px}.fine{margin:8px 0}.primary{padding:10px 16px}}@media(orientation:portrait) and (max-width:900px){body.touch-device #orientation{position:fixed;inset:0;z-index:45;display:grid;place-items:center;padding:28px;text-align:center;background:#e7edf0}#orientation span{font-size:70px;color:var(--red)}#orientation p{max-width:32ch;line-height:1.6}body.touch-device #touch-controls{visibility:hidden!important}.guide{grid-template-columns:1fr}.modal h1{font-size:35px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
