:root{--bg:#16213e;--panel:#1e2d55;--deep:#0b1530;--ink:#fff;--muted:#a9b4d0;--yellow:#ffd23f;--yellow-dark:#c99a00;--red:#e63946;--teal:#2a9d8f;--radius:18px;color:var(--ink);background:var(--bg);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}html,body{overscroll-behavior:none;height:100%;margin:0}body{background:radial-gradient(circle at 50% -10%, #24508f, var(--bg) 60%) fixed;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:manipulation}#app{min-height:100%}.screen{min-height:100dvh;padding:max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));flex-direction:column;align-items:center;display:flex}.wrap{flex-direction:column;gap:12px;width:100%;max-width:540px;display:flex}.wrap.grow{flex:1}.logo{letter-spacing:-2px;text-align:center;text-shadow:0 5px 0 var(--deep);margin:10px 0 0;font-size:clamp(46px,14vw,72px);font-weight:900;line-height:1}.logo span{color:var(--yellow)}.tagline{text-align:center;color:var(--muted);margin:0 0 6px;font-weight:700}.title{margin:0;font-size:26px;font-weight:900}.topbar{align-items:center;gap:12px;display:flex}.btn{appearance:none;border-radius:var(--radius);font:inherit;color:#1b1b1b;background:var(--yellow);box-shadow:0 5px 0 var(--yellow-dark);cursor:pointer;border:0;justify-content:center;align-items:center;gap:8px;padding:14px 18px;font-size:18px;font-weight:800;transition:transform 60ms;display:inline-flex}.btn:active{box-shadow:0 2px 0 var(--yellow-dark);transform:translateY(3px)}.btn.big{padding:18px;font-size:22px}.btn.secondary{background:#e9eefc;box-shadow:0 5px #8f9cc0}.btn.ghost{color:var(--ink);background:0 0;box-shadow:inset 0 0 0 2px #3a4f7a}.btn.backbtn{padding:8px 14px;font-size:16px}.btn:disabled{opacity:.45;pointer-events:none}.row{gap:10px;display:flex}.row>.btn{flex:1}.section-title{color:var(--muted);text-transform:uppercase;letter-spacing:1px;margin:14px 0 0;font-size:15px;font-weight:900}.card-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;display:grid}.vcard{appearance:none;font:inherit;color:var(--ink);text-align:left;background:var(--panel);cursor:pointer;box-shadow:0 4px 0 var(--deep);border:0;border-radius:16px;flex-direction:column;gap:4px;padding:10px;display:flex;position:relative}.vcard:active{transform:translateY(2px)}.vcard img,.vcard canvas{object-fit:contain;width:100%;height:92px}.vcard .name{text-overflow:ellipsis;white-space:nowrap;font-weight:800;overflow:hidden}.vcard .best{color:var(--yellow);font-size:14px;font-weight:800}.vcard .del{color:#fff;background:#0008;border-radius:50%;place-items:center;width:28px;height:28px;font-size:14px;display:grid;position:absolute;top:6px;right:6px}.note{color:var(--muted);text-align:center;margin:0;font-size:14px}.hint{text-align:center;margin:0;font-weight:800}.stage{background:var(--deep);border-radius:var(--radius);touch-action:none;flex:1;min-height:46vh;position:relative;overflow:hidden}.stage canvas{touch-action:none;width:100%;height:100%;position:absolute;inset:0}.seg{background:var(--deep);border-radius:14px;gap:4px;padding:4px;display:flex}.seg button{appearance:none;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:0;border-radius:10px;flex:1;padding:10px;font-weight:800}.seg button.on{background:var(--yellow);color:#111}.slider,.field{flex-direction:column;gap:6px;font-weight:800;display:flex}.slider input{width:100%;accent-color:var(--yellow)}.field input{font:inherit;background:var(--deep);color:var(--ink);-webkit-user-select:text;user-select:text;border:2px solid #3a4f7a;border-radius:14px;padding:12px 14px;font-size:20px;font-weight:800}.recwrap{place-items:center;padding:8px 0;display:grid}.recbtn{width:170px;height:170px;font:inherit;color:#fff;background:radial-gradient(circle at 35% 30%, #ff6b6b, var(--red));cursor:pointer;border:0;border-radius:50%;padding:16px;font-size:20px;font-weight:900;box-shadow:0 8px #9b1d27}.recbtn.on{animation:.6s ease-in-out infinite alternate pulse}.recbtn:disabled{opacity:.4}@keyframes pulse{to{transform:scale(1.06);box-shadow:0 0 0 14px #e6394633}}.meter{background:var(--deep);border-radius:999px;height:14px;overflow:hidden}.meter>div{background:linear-gradient(90deg, var(--teal), var(--yellow), var(--red));width:0%;height:100%;transition:width 60ms linear}.status{text-align:center;color:var(--yellow);margin:0;font-weight:800}.toast{z-index:50;color:#fff;text-align:center;pointer-events:none;background:#000c;border-radius:16px;padding:10px 18px;font-size:22px;font-weight:900;animation:1.4s forwards toast;position:fixed;top:16%;left:50%;transform:translate(-50%)}@keyframes toast{0%{opacity:0;transform:translate(-50%,12px)scale(.9)}12%,80%{opacity:1;transform:translate(-50%)scale(1)}to{opacity:0;transform:translate(-50%,-10px)}}.drive{touch-action:none;background:#8fd3ff;position:fixed;inset:0;overflow:hidden}.drive canvas.game{width:100%;height:100%;position:absolute;inset:0}.hud{top:max(10px, env(safe-area-inset-top));pointer-events:none;justify-content:center;gap:8px;display:flex;position:absolute;left:0;right:0}.pill{color:#fff;background:#000a;border-radius:999px;padding:6px 14px;font-size:22px;font-weight:900}.pill.dim{color:var(--yellow);align-self:center;font-size:16px}.drive-hint{right:16px;bottom:calc(max(16px, env(safe-area-inset-bottom)) + clamp(104px, 28vw, 160px));color:#fff;pointer-events:none;background:#000a;border-radius:12px;padding:8px 12px;font-weight:900;animation:.8s ease-in-out infinite alternate bob;position:absolute}@keyframes bob{to{transform:translateY(-6px)}}.topbtn{top:max(10px, env(safe-area-inset-top));left:max(10px, env(safe-area-inset-left));color:#fff;cursor:pointer;background:#000a;border:0;border-radius:50%;width:44px;height:44px;font-size:20px;font-weight:900;position:absolute}.pedal{bottom:max(16px, env(safe-area-inset-bottom));width:clamp(96px,26vw,150px);height:clamp(96px,26vw,150px);font:inherit;color:#fff;touch-action:none;-webkit-user-select:none;user-select:none;cursor:pointer;border:0;border-radius:28px;font-size:20px;font-weight:900;position:absolute;box-shadow:inset 0 -8px #0005,0 6px 16px #0004}.pedal.gas{right:max(16px, env(safe-area-inset-right));background:#2a9d8fe6}.pedal.brake{left:max(16px, env(safe-area-inset-left));background:#e63946e6}.pedal.on{filter:brightness(1.25);transform:scale(.93)}.speedometer{bottom:calc(max(16px, env(safe-area-inset-bottom)) + 6px);color:#fff;pointer-events:none;background:#101a24eb;border-radius:12px;grid-template-columns:auto auto;align-items:baseline;gap:4px;padding:8px 10px;display:grid;position:absolute;left:50%;transform:translate(-50%)}.speed-digits{text-align:right;min-width:2ch;color:var(--yellow);font:700 clamp(22px,5vw,30px)/1 ui-monospace,monospace}.speed-unit{font-size:11px;font-weight:700}.speed-scale{background:#ffffff38;grid-column:1/-1;height:4px;-webkit-mask-image:repeating-linear-gradient(90deg,#000 0 8%,#0000 8% 10%);mask-image:repeating-linear-gradient(90deg,#000 0 8%,#0000 8% 10%)}.speed-fill{background:var(--yellow);transform-origin:0;height:100%;display:block;transform:scaleX(0)}.result{z-index:10;padding:max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));background:#0b1530ee;flex-direction:column;justify-content:center;align-items:center;gap:14px;display:flex;position:absolute;inset:0;overflow-y:auto}.clipview{aspect-ratio:9/16;background:#000;border-radius:14px;flex-shrink:0;height:min(50vh,560px);overflow:hidden;box-shadow:0 6px #0006}.clipview canvas,.clipview video{object-fit:cover;width:100%;height:100%;display:block}.result-side{text-align:center;flex-direction:column;gap:10px;width:100%;max-width:420px;display:flex}.result-title{font-size:28px;font-weight:900}.result-dist{color:var(--yellow);font-size:64px;font-weight:900;line-height:1}.result-sub{color:var(--muted);font-weight:800}@media (orientation:landscape) and (height<=600px){.result{flex-direction:row}.clipview{height:88vh}.result-dist{font-size:48px}}.logo.small{text-align:left;margin:0;font-size:clamp(34px,10vw,48px)}.homebar{justify-content:space-between;align-items:center;gap:10px;margin-top:6px;display:flex}.pill.coins{color:var(--yellow);background:var(--deep);white-space:nowrap;font-size:18px}.topbar .pill.coins{margin-left:auto}.vehicle-card{background:var(--panel);border-radius:var(--radius);box-shadow:0 4px 0 var(--deep);align-items:center;gap:12px;padding:12px;display:flex}.vehicle-card canvas{width:46%;max-width:220px;height:auto}.vinfo{flex-direction:column;flex:1;gap:8px;min-width:0;display:flex}.vname{text-overflow:ellipsis;white-space:nowrap;font-size:20px;font-weight:900;overflow:hidden}.btn.small{padding:9px 12px;font-size:15px}.mode-grid{grid-template-columns:1fr 1fr;gap:12px;display:grid}.tile-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;display:grid}.tile{appearance:none;font:inherit;color:var(--ink);text-align:center;background:var(--panel);cursor:pointer;box-shadow:0 5px 0 var(--deep);border:0;border-radius:18px;flex-direction:column;align-items:center;gap:4px;padding:14px 10px;display:flex}.tile:active{box-shadow:0 2px 0 var(--deep);transform:translateY(3px)}.tile:disabled{opacity:.55;cursor:default}.tile-icon{font-size:38px;font-weight:900;line-height:1.1}.tile-title{font-size:17px;font-weight:900}.tile-sub{color:var(--muted);flex-direction:column;align-items:center;font-size:13px;font-weight:700;display:flex}.tile-stars{color:var(--yellow);letter-spacing:2px;font-size:18px}.vcard.selected{box-shadow:0 0 0 3px var(--yellow), 0 4px 0 var(--deep)}.upcard{background:var(--panel);border-radius:var(--radius);box-shadow:0 4px 0 var(--deep);align-items:center;gap:12px;padding:14px;display:flex}.upinfo{flex-direction:column;flex:1;gap:6px;display:flex}.upname{font-size:19px;font-weight:900}.note.left{text-align:left}.upbar{gap:4px;display:flex}.upbar span{background:var(--deep);border-radius:4px;flex:1;height:10px}.upbar span.on{background:var(--yellow)}.upcard .btn{min-width:96px}.btn.poor{opacity:.6}.hud{flex-direction:column;align-items:center;gap:6px}.hud-row{flex-wrap:wrap;justify-content:center;gap:8px;padding:0 56px;display:flex}.pill.coin{color:var(--yellow);align-self:center;font-size:18px}.fuel{background:#000a;border-radius:999px;align-items:center;gap:6px;padding:4px 10px;display:flex}.fuel-track{background:#fff3;border-radius:999px;width:120px;height:10px;overflow:hidden}.fuel-track>div{background:linear-gradient(90deg,#e63946,#ffd23f 30%,#2a9d8f) 0 0/120px 100%;width:100%;height:100%;transition:width .15s linear}.fuel.low{animation:.5s steps(2,end) infinite blink}@keyframes blink{50%{background:#e63946aa}}.result-stars{color:var(--yellow);letter-spacing:6px;font-size:40px;line-height:1}.result-coins{color:var(--yellow);font-size:22px;font-weight:900}.palette{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.palette.dim{opacity:.3;pointer-events:none}.swatch{cursor:pointer;border:3px solid #0b1530;border-radius:50%;width:30px;height:30px;box-shadow:0 0 0 2px #3a4f7a}.swatch.on{box-shadow:0 0 0 3px var(--yellow);transform:scale(1.12)}.seg.tools button{white-space:nowrap;padding:10px 4px}.seg button .dot{vertical-align:middle;background:currentColor;border-radius:50%;display:inline-block}.seg button:disabled{opacity:.5}.wheelpanel{flex-direction:column;gap:10px;display:flex}.wheelchips{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.wheelchip{background:var(--panel);cursor:pointer;border:0;border-radius:14px;width:46px;height:46px;padding:4px;box-shadow:0 0 0 2px #3a4f7a}.wheelchip canvas{width:100%;height:100%;display:block}.wheelchip.on{box-shadow:0 0 0 3px var(--yellow);transform:scale(1.08)}.wheelrow{align-items:center;gap:8px;display:flex}.wheelrow input{min-width:0;accent-color:var(--yellow);flex:1}.sizedot{background:var(--ink);border-radius:50%;flex:none;width:8px;height:8px}.sizedot.big{width:20px;height:20px}.btn.icon{flex:none;width:46px;padding:10px 0}.btn.main{white-space:nowrap}.revs{color:#fff;background:#000a;border-radius:999px;align-items:center;gap:8px;padding:4px 12px;font-size:13px;font-weight:900;display:flex}.rev-label{text-align:right;min-width:74px}.rev-track{background:linear-gradient(90deg,#4a5568 0%,#f6c84c 50%,#2a9d8f 55% 80%,#e63946 80%);border-radius:999px;width:160px;height:14px;position:relative}.rev-needle{background:#fff;border-radius:3px;width:6px;height:22px;margin-left:-3px;position:absolute;top:-4px;box-shadow:0 0 0 2px #000}.revs.spin{animation:.12s infinite spin-shake}.revs.spin .rev-label{color:#ff8a8a}@keyframes spin-shake{50%{transform:translate(3px)}}.stats{background:var(--deep);cursor:pointer;border-radius:12px;justify-content:space-between;gap:8px;padding:6px 10px;display:flex}.stat{flex:1;align-items:center;gap:4px;min-width:0;font-size:14px;display:flex}.statbar{background:#fff2;border-radius:999px;flex:1;height:8px;overflow:hidden}.statbar>div{border-radius:inherit;background:var(--yellow);height:100%;transition:width .25s}.wheelchip{position:relative}.wheelchip.locked canvas{opacity:.25;filter:grayscale()}.wheelchip .lock{color:#fff;justify-content:center;align-items:center;font-size:11px;font-weight:900;display:none;position:absolute;inset:0}.wheelchip.locked .lock{display:flex}.missions{border-radius:var(--radius);background:var(--panel);box-shadow:0 4px 0 var(--deep);flex-direction:column;gap:6px;padding:10px 12px;display:flex}.missions-title{justify-content:space-between;align-items:baseline;font-weight:900;display:flex}.missions-title span{color:var(--yellow);font-size:13px}.mission{justify-content:space-between;gap:8px;font-size:15px;font-weight:700;display:flex}.mission.done{opacity:.55;text-decoration:line-through}.mprog{white-space:nowrap;font-weight:900}.topbtn.pausebtn{left:auto;right:max(10px, env(safe-area-inset-right))}.topbtn.soundbtn{top:max(64px, calc(env(safe-area-inset-top) + 54px));left:auto;right:max(10px, env(safe-area-inset-right))}.pause-overlay{z-index:30;background:#0b1530c9;place-items:center;padding:24px;display:grid;position:absolute;inset:0}.pause-card{background:var(--panel);text-align:center;border-radius:20px;flex-direction:column;gap:16px;width:min(100%,340px);padding:28px;display:flex}.pause-card h2{margin:0}.editor{height:100dvh;min-height:600px;padding:max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom))}.editor .wrap{gap:8px;max-width:900px;min-height:0}.editor .title{font-size:clamp(18px,4.8vw,25px)}.editor .topbar{min-height:44px}.editor .hint{color:#ccd9ef;min-height:34px;font-size:14px;font-weight:600}.editor .stage{border:1px solid #52617b;border-radius:12px;flex:1;min-height:180px}.editor .stage canvas{cursor:crosshair}.editor-dock{background:#101b35;border-radius:16px;flex-direction:column;gap:10px;padding:10px;display:flex}.editor .seg.tools{background:0 0;gap:6px;padding:0}.editor .seg.tools button{min-height:44px;padding:8px 4px;font-size:14px}.tool-options{flex-direction:column;flex:none;justify-content:center;gap:10px;height:200px;display:flex}.editor .palette{flex-wrap:nowrap;justify-content:flex-start;gap:8px;padding:4px;overflow-x:auto}.editor .swatch{flex:0 0 34px;width:34px;height:34px}.editor .brush{align-self:center;width:100%;max-width:240px;padding:0}.editor .brush button{min-height:36px;padding:4px}.editor .wheelpanel{gap:10px}.editor .wheelchips{flex-wrap:nowrap;justify-content:flex-start;gap:10px;padding:4px;overflow-x:auto}.editor .wheelchip{border-radius:10px;flex:0 0 44px;height:44px}.wheel-target{justify-content:space-between;align-items:center;display:flex}.wheel-target button{min-height:34px;padding:6px 10px}.wheel-target button.on{color:#ffd23f;outline:1px solid #ffd23f}.editor .wheelrow{flex-wrap:wrap;gap:8px}.editor .wheelrow label{font-size:14px}.editor .wheelrow input{min-width:100px;min-height:36px}.wheel-actions{gap:8px;width:100%;display:flex}.wheel-actions button{flex:1;min-height:40px;padding:8px;font-size:14px}.editor-footer{align-items:center;gap:8px;display:flex}.editor-footer .history-btn{flex:0 0 44px;height:44px;padding:0;font-size:26px}.editor-footer .main{min-height:44px;margin-left:auto;padding:10px 18px}.editor-more{font-size:14px;position:relative}.editor-more summary{cursor:pointer;justify-content:center;align-items:center;min-width:36px;min-height:44px;font-size:20px;display:flex}.more-panel{z-index:5;background:#25365b;border:1px solid #647ba6;border-radius:12px;flex-direction:column;gap:12px;width:270px;padding:16px;display:flex;position:absolute;bottom:54px;left:-90px;box-shadow:0 12px 32px #0008}.editor button:disabled{opacity:.4;cursor:default}.editor button:focus-visible,.editor summary:focus-visible{outline-offset:3px;outline:3px solid #ffd23f}@media (height<=650px) and (width>=700px){.editor{min-height:360px}.editor .wrap{grid-template-rows:auto auto 1fr;grid-template-columns:1fr 300px;display:grid}.editor .topbar,.editor .hint{grid-column:1}.editor .stage{grid-area:3/1}.editor .editor-dock{grid-area:1/2/4;align-self:center}}.checkpoint-hint{color:#3c4d36;text-align:center;background:#fff8e8ed;border-radius:12px;max-width:min(100% - 112px,390px);padding:6px 12px;font-size:14px;font-weight:650}.checkpoint-hint[hidden]{display:none}.result{justify-content:safe center}.result-goals{text-align:left;align-self:center;line-height:1.5}@media (orientation:portrait){.result .clipview{height:min(30dvh,280px)}.result .result-dist{font-size:clamp(32px,10vw,54px)}}.checkpoint-retry{color:#fff;cursor:pointer;z-index:5;background:#403d35d9;border:0;border-radius:50%;width:44px;height:44px;font:800 28px system-ui;position:absolute;top:115px;right:14px}.checkpoint-retry[hidden]{display:none}.upgrade-comparison{color:#edf1ff;margin:10px 0;font-size:13px;line-height:1.6}.upcard .upinfo{min-width:0}.upcard .upinfo .btn{white-space:normal;margin-top:6px}.dyno{color:#edf1ff;background:#ffffff14;border-radius:14px;align-self:stretch;margin:6px 0 12px;padding:12px 14px;font-size:14px;line-height:1.7}.dyno-row{align-items:baseline;gap:6px;display:flex}.dyno-label{flex:1}.dyno-value{font-variant-numeric:tabular-nums;font-weight:800}.dyno-value.gain{color:#7ee081}.dyno-arrow{opacity:.7}.atelier-tabs{flex-wrap:wrap;justify-content:center;gap:8px;display:flex}.atelier-tabs .btn.active{background:var(--yellow);color:#222}.atelier-level{align-self:center;width:160px}.atelier-race{aspect-ratio:640/184;background:#0003;border-radius:14px;width:100%;max-width:640px}.voice-slot{text-align:left;background:#ffffff0f;border-radius:14px;justify-content:space-between;align-items:center;gap:10px;margin:8px 0;padding:10px 12px;display:flex}.voice-slot-info{flex-direction:column;gap:2px;min-width:0;display:flex}.voice-slot .row{flex-wrap:nowrap;gap:6px}.voice-slot .btn.on{color:#fff;background:#e63946}
