@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Inter:wght@400;600;700;800&display=swap');
:root{font-family:Inter,'Malgun Gothic',sans-serif;color:#eef7f5;background:#080e10;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 0%,#18312e 0,#0b1415 48%,#080d0f 100%);min-height:100vh}.game-shell{max-width:1440px;margin:auto;padding:28px 40px 20px}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}.brand{display:flex;gap:12px;align-items:center}.brand-icon{font-size:15px;font-weight:800;letter-spacing:-2px;color:#091411;background:#a9f5bb;padding:10px 9px;border-radius:4px}.brand-icon span{color:#32745c}.brand strong{display:block;letter-spacing:.13em;font-size:13px}.brand small,.top-label,.eyebrow,.footnote{font:10px 'DM Mono',monospace;letter-spacing:.14em;color:#8aa29a}.brand small{display:block;margin-top:5px;font-size:9px}.top-label{color:#acc3b8}.online-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#a9f5bb;margin-right:7px;box-shadow:0 0 9px #a9f5bb}.game-frame{height:min(65vw,690px);min-height:420px;position:relative;overflow:hidden;background:#101d1d;border:1px solid #334d43;border-radius:5px;box-shadow:0 25px 80px #0008}canvas{width:100%;height:100%;display:block}.game-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#07100e9c,transparent 27%,transparent 65%,#07100ed9)}.hud{position:absolute;left:34px;right:34px;display:flex;justify-content:space-between;pointer-events:none}.hud-top{top:31px}.hud-bottom{bottom:28px;align-items:end}.eyebrow{color:#a1d7b4;font-size:10px;font-weight:500}.hud h1{font-size:27px;margin:8px 0 6px;letter-spacing:-.04em}.hud p{font-size:12px;color:#b4c8be;margin:0}.lap-box{text-align:right}.lap-box strong{display:block;font:500 24px 'DM Mono',monospace;margin:8px 0}.lap-box small{font:10px 'DM Mono',monospace;color:#91a69b}.notice{position:absolute;top:49%;left:50%;transform:translate(-50%,-50%);padding:10px 16px;background:#0b1915ca;border:1px solid #7be6a077;color:#dbffe4;font-size:12px;letter-spacing:.04em;transition:opacity .3s;white-space:nowrap}.notice.hidden{opacity:0}.progress{width:220px;position:relative}.progress-track{height:3px;background:#3c554a;margin-top:13px}.progress-track div{height:100%;width:0;background:#a9f5bb;box-shadow:0 0 10px #a9f5bb}.progress strong{position:absolute;right:0;top:0;font:11px 'DM Mono',monospace;color:#d7ebde}.speed{text-align:right}.speed strong{font:500 44px 'DM Mono',monospace;line-height:1}.speed span{font:10px 'DM Mono',monospace;color:#a1b5aa;margin-left:5px}.speed small{display:block;margin-top:8px;color:#4c685a;font:10px 'DM Mono',monospace;letter-spacing:.2em}.speed small.active{color:#a9f5bb;text-shadow:0 0 12px #a9f5bb}.controls{display:flex;justify-content:space-between;align-items:center;background:#111c1b;border:1px solid #293c35;border-top:0;padding:22px 27px}.controls strong{display:block;margin-top:7px;font-size:13px}.control-list{display:flex;gap:28px;color:#b5c6bd;font-size:11px;align-items:center}.control-list span{white-space:nowrap}kbd{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;border:1px solid #526b5d;border-bottom:2px solid #526b5d;border-radius:3px;color:#e5f6eb;font:11px 'DM Mono',monospace;margin-right:4px}.space{padding:0 9px;font-size:9px}.footnote{display:flex;justify-content:space-between;margin-top:17px;font-size:9px;color:#61766d}@media(max-width:760px){.game-shell{padding:18px 14px}.game-frame{height:65vh;min-height:400px}.hud{left:18px;right:18px}.hud-top{top:20px}.hud h1{font-size:21px}.lap-box strong{font-size:17px}.controls{align-items:flex-start;gap:20px;flex-direction:column}.control-list{gap:10px;flex-wrap:wrap}.progress{width:140px}.top-label{font-size:9px}}
.top-actions{display:flex;align-items:center;gap:10px}.sound-toggle{font:11px Inter,'Malgun Gothic',sans-serif;color:#d8f4e0;background:#152721;border:1px solid #527764;border-radius:4px;padding:8px 10px;cursor:pointer;white-space:nowrap}.sound-toggle:hover,.sound-toggle:focus-visible{border-color:#a9f5bb;outline:none}.sound-toggle[aria-pressed="false"]{color:#90a89a;background:#101a17}@media(max-width:480px){.top-actions{gap:5px}.sound-toggle{padding:8px 6px;font-size:10px}.top-label{display:none}}
.hud p.lap-counter{margin-top:10px;color:#a9f5bb;font:500 12px 'DM Mono',monospace;letter-spacing:.08em}.notice{max-width:90%;white-space:normal;text-align:center;line-height:1.5}
.hud p.checkpoint-counter{margin-top:6px;color:#a5d9cf;font:10px 'DM Mono',monospace;letter-spacing:.08em}
[hidden]{display:none!important}.lobby{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;padding:22px;background:#07110fe8;overflow:auto}.lobby-panel{width:min(100%,520px);padding:28px;background:#101f1b;border:1px solid #426355;border-radius:6px;box-shadow:0 20px 70px #0009}.lobby-panel h2{margin:8px 0;font-size:26px;letter-spacing:-.04em}.lobby-panel>p{margin:0 0 18px;font-size:12px;color:#a7beb1}.lobby-panel fieldset{border:0;padding:0;margin:0 0 18px}.lobby-panel legend{font-size:11px;font-weight:700;color:#c6ded0;margin-bottom:9px}.vehicle-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.choice{position:relative;display:flex;align-items:center;gap:11px;padding:13px;background:#152721;border:1px solid #344e42;border-radius:4px;cursor:pointer}.choice:has(input:checked){border-color:#a9f5bb;background:#1b3529}.choice:focus-within{outline:2px solid #baffca;outline-offset:2px}.choice input{accent-color:#a9f5bb;margin:0}.choice strong,.choice small{display:block}.choice strong{font-size:12px}.choice small{color:#92a99b;font-size:10px;margin-top:4px}.car-swatch{display:block;width:27px;height:19px;border:2px solid #a9f5bb;border-radius:2px}.car-two{border-color:#ffd292}.map-choice{padding:12px}.start-race{width:100%;border:0;border-radius:4px;padding:14px 16px;background:#a9f5bb;color:#10221a;font-weight:700;cursor:pointer;text-align:left}.start-race span{float:right}.start-race:hover{background:#cbffd8}.start-race:focus-visible{outline:2px solid white;outline-offset:3px}.lobby-panel p.lobby-note{font-size:10px;color:#7e9b8b;margin:10px 0 0}.start-signal{position:absolute;left:50%;top:40%;z-index:2;transform:translate(-50%,-50%);display:flex;align-items:center;flex-direction:column;gap:10px;pointer-events:none}.signal-lights{display:flex;gap:9px;padding:10px 15px;border:1px solid #567467;border-radius:8px;background:#0a1612e8}.signal-lights span{width:20px;height:20px;border-radius:50%;background:#4d2424;border:1px solid #895252}.signal-lights span.is-lit{background:#ff695d;box-shadow:0 0 14px #ff695daa}.start-signal.go .signal-lights span{background:#a9f5bb;border-color:#c5ffcf;box-shadow:0 0 14px #a9f5bb}.start-signal strong{color:#fff;font:700 50px 'DM Mono',monospace;text-shadow:0 2px 18px #000}.start-signal small{color:#b2dbbe;font:10px 'DM Mono',monospace;letter-spacing:.15em}@media(max-height:700px){.lobby{align-items:flex-start}.lobby-panel{padding:20px}.lobby-panel fieldset{margin-bottom:12px}}
.vehicle-options .choice:has(input:checked){border-color:var(--vehicle-neon)}.vehicle-options .choice input{accent-color:var(--vehicle-neon)}.vehicle-options .car-swatch{border-color:var(--vehicle-neon)}

.multiplayer{border-top:1px solid #344e42;margin-top:16px;padding-top:14px}.multiplayer-title{font-size:12px;font-weight:700}.multiplayer-title small{font-size:10px;font-weight:400;color:#91aa9b;margin-left:8px}.room-actions{display:flex;gap:8px;margin-top:9px}.room-actions button,.room-actions input{min-width:0;border:1px solid #527764;border-radius:4px;background:#152721;color:#e2f8e8;padding:9px;font:11px Inter,'Malgun Gothic',sans-serif}.room-actions button{cursor:pointer;white-space:nowrap}.room-actions button:disabled{opacity:.45;cursor:default}.room-actions input{flex:1;text-transform:uppercase}.multiplayer p{font-size:11px;color:#a9c9b6;margin:9px 0 0}.multiplayer input:focus-visible,.multiplayer button:focus-visible{outline:2px solid #baffca}

.hud p.opponent-status{margin-top:6px;color:#ffd8a4;font:10px 'DM Mono','Malgun Gothic',monospace}.race-result{position:absolute;inset:0;z-index:2;display:grid;place-items:center;pointer-events:none;background:#06100cb3}.race-result-card{width:min(86%,350px);padding:24px;background:#102019ed;border:1px solid #80c89a;border-radius:6px;box-shadow:0 12px 40px #0009}.race-result-card h2{font-size:24px;margin:9px 0 18px;color:#d4ffdb}.race-result-card p{font:12px 'DM Mono','Malgun Gothic',monospace;color:#d9eee0;margin:11px 0}.race-result-card small{display:block;color:#95b1a0;font-size:10px;margin-top:20px;line-height:1.5}
.lobby-panel{max-height:100%;overflow-y:auto}
.vehicle-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.vehicle-options .choice{padding:9px 6px;gap:5px;justify-content:center;flex-wrap:wrap}
.vehicle-options .choice strong{font-size:11px;white-space:nowrap}
.vehicle-options .car-swatch{width:22px;height:15px}
.vehicle-options .choice.taken{opacity:.42;cursor:not-allowed}
.vehicle-options .choice.taken strong::after{content:' · 사용 중';font-size:9px}
.race-result-card{max-height:80%;overflow:auto;pointer-events:auto}
@media(max-width:520px){.vehicle-options{grid-template-columns:repeat(2,minmax(0,1fr))}}

.symbol-options{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:5px}.symbol-choice{display:flex;align-items:center;justify-content:center;position:relative;min-height:37px;border:1px solid #344e42;border-radius:4px;background:#152721;cursor:pointer}.symbol-choice:has(input:checked){border-color:#a9f5bb;background:#284638}.symbol-choice:focus-within{outline:2px solid #baffca;outline-offset:2px}.symbol-choice input{position:absolute;opacity:0}.symbol-choice svg{width:24px;height:24px;fill:none;stroke:#93c6af;stroke-width:1.8;stroke-linecap:square;stroke-linejoin:miter}.symbol-choice:has(input:checked) svg{stroke:#c7ffdb;filter:drop-shadow(0 0 4px #a9f5bb)}.symbol-choice:has(input:disabled){cursor:default;opacity:.7}.lobby-panel legend small{font-weight:400;color:#92a99b}@media(max-width:520px){.symbol-options{grid-template-columns:repeat(5,minmax(0,1fr))}}

.mobile-controls{display:none}
.invite-actions:has(#invite-room[hidden]):has(#invite-link[hidden]),#invite-feedback:empty{display:none}
.invite-actions input{text-transform:none;font-family:'DM Mono',monospace}
.lobby-scroll-hint{display:none}
@media(max-width:760px){
  .game-shell{padding:10px 10px max(12px,env(safe-area-inset-bottom))}
  .topbar{margin-bottom:9px}.brand{gap:7px}.brand-icon{padding:7px;font-size:12px}.brand strong{font-size:11px}.brand small{display:none}
  .top-actions{gap:4px}.sound-toggle{padding:7px 5px;font-size:10px}.top-label{display:none}
  .game-frame{height:52vh;height:clamp(230px,52dvh,460px);min-height:0;border-radius:8px 8px 2px 2px}
  .hud{left:12px;right:12px}.hud-top{top:12px}.hud-bottom{bottom:10px}.hud h1{font-size:17px;margin:4px 0}.hud p{font-size:10px}.hud-top>div:first-child>p:first-of-type{display:none}
  .hud p.lap-counter{margin-top:5px;font-size:10px}.hud p.checkpoint-counter,.hud p.opponent-status{margin-top:3px;font-size:9px}.lap-box strong{font-size:15px;margin:4px 0}.lap-box small{font-size:9px}.progress{width:100px}.progress-track{margin-top:7px}
  .lobby{padding:10px}.lobby-panel{padding:15px 15px 40px}.lobby-panel h2{font-size:21px}.lobby-panel fieldset{margin-bottom:10px}.lobby-panel>p{margin-bottom:10px}
  .lobby-scroll-hint:not([hidden]){position:absolute;left:10px;right:10px;bottom:10px;z-index:1;display:flex;align-items:end;justify-content:center;gap:8px;min-height:49px;padding:17px 8px 9px;background:linear-gradient(transparent,#101f1b 50%);color:#c9f4d3;font:600 11px Inter,'Malgun Gothic',sans-serif;pointer-events:none;text-align:center}.lobby-scroll-hint span:last-child{font-size:16px;color:#a9f5bb}
  .mobile-controls{display:block;padding:12px 18px 16px;background:linear-gradient(155deg,#253c36,#14241f 55%,#101d1a);border:1px solid #547264;border-top:0;border-radius:2px 2px 24px 24px;box-shadow:inset 0 1px #9bc8ac33,0 14px 30px #0008;user-select:none;-webkit-user-select:none;touch-action:none}
  .handheld-topline{display:flex;justify-content:space-between;color:#85ad98;font:700 9px 'DM Mono',monospace;letter-spacing:.13em}
  .handheld-layout{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
  .steer-group{display:flex;flex-direction:column;align-items:center;gap:9px}.steer-pad{display:flex;filter:drop-shadow(0 4px 3px #0008)}
  .steer-key{width:clamp(42px,12vw,56px);height:58px;display:grid;place-items:center;border:1px solid #29483a;background:#0b1714;color:#92d2ae;padding:0;font:16px sans-serif;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}
  .steer-left{border-radius:9px 2px 2px 9px}.steer-right{border-radius:2px 9px 9px 2px}.steer-key span{pointer-events:none}.steer-caption{font:700 9px 'DM Mono',monospace;letter-spacing:.16em;color:#8fb9a0}
  .steer-key.is-pressed,.steer-key:active{background:#284e3e;color:#c3ffd2;text-shadow:0 0 10px #a9f5bb}.steer-key:focus-visible,.action-key:focus-visible{outline:2px solid #d9ffe2;outline-offset:2px;z-index:1}
  .handheld-actions{--action-size:clamp(41px,11.8vw,51px);display:grid;grid-template-columns:repeat(3,var(--action-size));grid-template-rows:repeat(3,var(--action-size));place-items:center}
  .action-key{width:calc(var(--action-size) - 3px);height:calc(var(--action-size) - 3px);display:grid;place-items:center;padding:0;border-radius:50%;border:2px solid #7ac697;background:radial-gradient(circle at 35% 25%,#3b765b,#193e30 60%,#0e251b);color:#d7ffe2;font:700 21px sans-serif;box-shadow:inset 0 2px 3px #b8ffcc55,0 4px 0 #0a1913,0 6px 7px #0008;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}
  .jump-key{grid-area:1/2;border-color:#83ccd5;background:radial-gradient(circle at 35% 25%,#43828a,#19424b 60%,#10282d);color:#ddfcff}.boost-key{grid-area:2/1;border-color:#d8ad74;background:radial-gradient(circle at 35% 25%,#936a3a,#503721 60%,#271d13);color:#ffe8bf}.accel-key{grid-area:3/2}.brake-key{grid-area:2/3;border-color:#c28d9c;background:radial-gradient(circle at 35% 25%,#7e4a5a,#4a2531 60%,#28141b);color:#ffe0e8}.action-key span{pointer-events:none}
  .action-key.is-pressed,.action-key:active{transform:translateY(4px);box-shadow:inset 0 2px 7px #0008,0 1px 0 #0a1913,0 0 14px #a9f5bb66}
  .control-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:5px 12px;margin-top:8px;color:#abcdb8;font:10px 'DM Mono','Malgun Gothic',sans-serif}.control-legend b{color:#e0ffe9;font-size:12px}
  .controls,.footnote{display:none}
}
@media(max-width:360px){.mobile-controls{padding-left:12px;padding-right:12px}.control-legend{gap:5px 8px;font-size:9px}}
