:root{--panel-bg:#0a0c129e;--panel-border:#ffffff1f;--accent:#f2c14e;--text:#f4f6fb;--muted:#a7adbb;color:var(--text);font-family:Segoe UI,system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif}*{box-sizing:border-box}html,body{background:#0b0d12;height:100%;margin:0;overflow:hidden}#game{outline:none;width:100%;height:100%;display:block;position:fixed;inset:0}.hidden{display:none!important}.mono{font-variant-numeric:tabular-nums;font-family:SF Mono,JetBrains Mono,Consolas,Liberation Mono,monospace}#hud{pointer-events:none;-webkit-user-select:none;user-select:none;position:fixed;inset:0}.panel{background:var(--panel-bg);border:1px solid var(--panel-border);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);pointer-events:auto;border-radius:10px;padding:10px 14px;position:absolute;box-shadow:0 6px 24px #00000040}.row{justify-content:space-between;align-items:center;gap:16px;padding:2px 0;display:flex}.row .label{color:var(--muted);letter-spacing:.14em;font-size:11px}.row .value{font-size:16px}.row.big .value{font-size:26px;font-weight:600}.value.best{color:var(--accent)}.row.buttons{gap:6px;padding-top:6px}button,select{font:inherit;color:var(--text);cursor:pointer;background:#ffffff14;border:1px solid #ffffff2e;border-radius:6px;padding:5px 9px;font-size:12px}button:hover,select:hover{background:#ffffff29}select option{color:#000}#hud-top-left{min-width:220px;top:16px;left:16px}#hud-top-right{min-width:220px;top:16px;right:16px}#minimap{background:var(--panel-bg);border:1px solid var(--panel-border);border-radius:10px;width:200px;height:200px;padding:8px;position:absolute;bottom:16px;left:16px}#minimap svg{width:100%;height:100%}#minimap-track{fill:none;stroke:#ffffffd9;stroke-width:3px;stroke-linejoin:round}#minimap-car{fill:var(--accent);stroke:#000;stroke-width:1px}.speedo{text-align:right;min-width:260px;bottom:16px;right:16px}.rpm-wrap{background:#ffffff1f;border-radius:4px;height:8px;margin-bottom:8px;overflow:hidden}#rpm-bar{background:linear-gradient(90deg,#3ec97a 0%,#f2c14e 70%,#ff4d3d 100%);width:0%;height:100%;transition:width 50ms linear}.speed-row{justify-content:flex-end;align-items:baseline;gap:10px;display:flex}.speed{font-size:56px;font-weight:700;line-height:1}.unit{color:var(--muted);font-size:14px}.gear{color:var(--accent);min-width:32px;margin-left:10px;font-size:28px;font-weight:700}#controls-help{color:var(--muted);white-space:nowrap;font-size:12px;bottom:16px;left:50%;transform:translate(-50%)}#controls-help b{color:var(--text)}#message{letter-spacing:.12em;color:var(--accent);text-shadow:0 2px 18px #0009;pointer-events:none;font-size:40px;font-weight:800;position:absolute;top:18%;left:50%;transform:translate(-50%)}#message.warn{color:#ff4d3d}#loading{z-index:10;background:radial-gradient(#1a2233 0%,#0b0d12 70%);flex-direction:column;justify-content:center;align-items:center;gap:18px;display:flex;position:fixed;inset:0}#loading .title{letter-spacing:.25em;color:var(--accent);font-size:48px;font-weight:900}#loading .hint{color:var(--muted);font-size:13px}#start-btn{background:var(--accent);color:#111;border:none;padding:12px 32px;font-size:20px;font-weight:700}#start-btn:hover{background:#ffd56b}body{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}#hud{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.touch-only{display:none}body.touch .touch-only{display:block}body.touch .desktop-only,body.touch #controls-help{display:none}#touch-controls{pointer-events:none;touch-action:none;height:190px;position:absolute;bottom:0;left:0;right:0}.touch-cluster{pointer-events:none;touch-action:none;flex-direction:column;align-items:center;gap:8px;display:flex;position:absolute;bottom:14px}.touch-cluster.left{align-items:flex-start}.touch-cluster.right{align-items:flex-end}.touch-row{pointer-events:none}#steer-pad,.pedal,.tbtn{pointer-events:auto}.touch-cluster.left{left:14px}.touch-cluster.right{right:14px}.touch-row{gap:8px;display:flex}.tbtn{letter-spacing:.08em;min-width:64px;height:38px;color:var(--text);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);touch-action:none;background:#0a0c129e;border:1px solid #ffffff38;border-radius:10px;padding:0 12px;font-size:12px;font-weight:700}.tbtn.active,.tbtn:active{color:#111;background:#f2c14ebf}#steer-pad{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);touch-action:none;background:#0a0c128c;border:1px solid #ffffff38;border-radius:48px;width:220px;height:96px;display:flex;position:relative;overflow:hidden}.steer-half{color:#ffffff8c;flex:1;justify-content:center;align-items:center;font-size:28px;transition:background 80ms;display:flex}.steer-half.active{color:#fff;background:#f2c14e59}#steer-knob{pointer-events:none;background:#ffffff2e;border:2px solid #ffffff73;border-radius:50%;width:80px;height:80px;margin-left:-40px;transition:transform 40ms linear;position:absolute;top:8px;left:50%}#pedals{gap:10px;display:flex}.pedal{letter-spacing:.1em;color:#ffffffd9;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);touch-action:none;background:#0a0c128c;border:1px solid #ffffff38;border-radius:14px;justify-content:center;align-items:flex-end;width:96px;height:120px;padding-bottom:12px;font-size:13px;font-weight:800;display:flex}.pedal.gas{background:linear-gradient(#3ec97a40,#0a0c1299)}.pedal.brake{background:linear-gradient(#ff4d3d40,#0a0c1299)}.pedal.active{color:#111;background:#f2c14ebf}@media (max-width:900px),(max-height:520px){.panel{border-radius:8px;padding:6px 10px}.row{gap:10px;padding:1px 0}.row .label{font-size:9px}.row .value{font-size:13px}.row.big .value{font-size:19px}button,select{padding:6px 7px;font-size:11px}#hud-top-left{min-width:150px;top:8px;left:8px}#hud-top-right{min-width:150px;top:8px;right:8px}.speed{font-size:34px}.gear{min-width:22px;margin-left:6px;font-size:20px}.unit{font-size:11px}.speedo{min-width:150px;padding:6px 10px}.rpm-wrap{height:6px;margin-bottom:4px}#message{text-align:center;letter-spacing:.08em;width:90%;font-size:22px;top:22%}#controls-help{display:none}#loading .title{letter-spacing:.15em;text-align:center;font-size:28px}#loading .hint{text-align:center;padding:0 16px;font-size:12px}}@media (max-height:520px) and (orientation:landscape){#touch-controls{height:150px}.touch-cluster{gap:6px;bottom:8px}.touch-cluster.left{left:8px}.touch-cluster.right{right:8px}#steer-pad{width:190px;height:76px}#steer-knob{width:62px;height:62px;margin-left:-31px;top:6px}.pedal{width:80px;height:92px}.tbtn{min-width:56px;height:32px;padding:0 8px;font-size:11px}body.touch .speedo{min-width:120px;bottom:8px;left:50%;right:auto;transform:translate(-50%)}body.touch #minimap{width:84px;height:84px;padding:4px;top:8px;bottom:auto;left:50%;transform:translate(-50%)}#message{top:36%}#hud-top-right .row.buttons button{padding:5px 6px}}@media (max-width:600px) and (orientation:portrait){#touch-controls{height:210px}.touch-cluster{bottom:12px}#steer-pad{width:min(180px,42vw);height:84px}#steer-knob{width:68px;height:68px;margin-left:-34px;top:7px}.pedal{width:min(72px,18vw);height:110px}.touch-cluster.left{left:8px}.touch-cluster.right{right:8px}#pedals{gap:8px}.tbtn{min-width:0;padding:0 8px;font-size:11px}#hud-top-left,#hud-top-right{width:calc(50% - 12px);min-width:0}#hud-top-right .row.buttons button{flex:1;padding:6px 4px}body.touch .speedo{min-width:0;bottom:228px;right:8px}body.touch #minimap{width:110px;height:110px;padding:6px;bottom:228px;left:8px}}body.touch #btn-reset,body.touch #btn-recover,body.touch #btn-camera,body.touch #hud-top-right .row.buttons:empty{display:none}
