/* ===============================================================
   Hell Parking — styles
   =============================================================== */
:root {
  --bg1: #ff5a3c; --bg2: #5b1236; --panel: #fff; --panel-ink: #1f2933; --accent: #ff4f3a; --accent2: #ffb347; --muted: #6b7280;
  --font-head: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body); color: var(--panel-ink); overflow: hidden;
  background: linear-gradient(160deg, #1d0b2e, #6b1230 50%, #ff6b35) fixed, #1d0b2e;
}
.screen { position: fixed; inset: 0; display: none; overflow: auto; }
.screen.active { display: flex; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
kbd { font: 800 11px var(--font-body); background: rgba(0,0,0,.1); border: 1px solid rgba(0,0,0,.15); border-radius: 5px; padding: 1px 6px; }
code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 4px; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: 800 15px var(--font-body); border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  background: #fff; color: #1f2933; box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 6px 16px rgba(0,0,0,.12);
  transition: transform .12s, filter .12s, box-shadow .12s; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.22); }
.btn:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, #ff8a5c, var(--accent)); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.btn.good { background: linear-gradient(180deg, #4ade80, #16a34a); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.btn.danger { background: linear-gradient(180deg, #ef4444, #b91c1c); color: #fff; }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; border: 1.5px solid currentColor; opacity: .85; }
.btn.big { font-size: 19px; padding: 14px 26px; border-radius: 16px; }
.btn.sm { font-size: 13px; padding: 6px 10px; border-radius: 9px; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.ghost.sm { box-shadow: none; }
input[type=text], input[type=number], select, textarea {
  font: 700 14px var(--font-body); padding: 7px 10px; border-radius: 9px; border: 1.5px solid rgba(0,0,0,.18); background: #fff; color: #1f2933; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1.5px solid rgba(0,0,0,.2); border-radius: 8px; background: #fff; cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 160px; }
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c3c9cf; border-radius: 27px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(21px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent2); outline-offset: 2px; }
.chip { border: 0; padding: 7px 14px; border-radius: 20px; background: rgba(0,0,0,.07); color: inherit; font: 800 14px var(--font-body); cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; padding: 6px 10px; background: rgba(0,0,0,.05); border-radius: 12px; cursor: pointer; }

/* ---------- modals ---------- */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back { position: fixed; inset: 0; background: rgba(25,5,15,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: auto; animation: fadein .2s; }
.modal-back.closing { animation: fadeout .16s forwards; }
.modal { background: var(--panel); color: var(--panel-ink); border-radius: 22px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
.modal.wide { max-width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; padding: 16px 20px 0; gap: 10px; }
.modal-head h2 { flex: 1; margin: 0; font: 600 23px var(--font-head); }
.modal-head .x { border: 0; background: rgba(0,0,0,.06); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.modal-body { padding: 14px 20px; overflow: auto; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.pause-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pause-stats div { background: rgba(0,0,0,.05); border-radius: 12px; padding: 8px 10px; text-align: center; }
.pause-stats b { display: block; font: 600 20px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pause-stats small { color: var(--muted); font-weight: 800; font-size: 11.5px; }
.pause-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- toasts, confetti, loading ---------- */
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; align-items: center; width: max-content; max-width: 92vw; }
.toast { background: rgba(17,12,34,.92); color: #fff; padding: 9px 18px; border-radius: 30px; font-weight: 800; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); border-left: 5px solid var(--tc, var(--accent)); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(-10px); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
#confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
#loading { position: fixed; inset: 0; z-index: 80; background: rgba(20,8,40,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.spinner { font-size: 54px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }

/* ---------- title ---------- */
#screen-title { align-items: center; justify-content: center; color: #fff; text-align: center; padding: 20px; }
#title-cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.title-wrap { position: relative; z-index: 1; background: rgba(40,8,24,.45); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border-radius: 28px; padding: 26px 30px 22px; max-width: 700px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.title-logo { font-size: clamp(40px, 8vw, 64px); line-height: 1; animation: bob 1.6s ease-in-out infinite; display: inline-block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
#title-name {
  font: 700 clamp(44px, 10vw, 86px)/1 var(--font-head); margin: 8px 0 6px;
  background: linear-gradient(90deg, #ffe066, #ffad33 35%, #ff5a3c 65%, #ff2d75); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.35));
}
.title-sub { font-size: clamp(15px, 2.4vw, 20px); font-weight: 800; margin: 0 0 22px; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.title-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.title-foot { margin: 18px 0 0; font-size: 13px; opacity: .8; font-weight: 700; }
.title-stats { position: fixed; z-index: 2; top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; gap: 8px; color: #fff; }
.title-stats span { background: rgba(0,0,0,.45); border-radius: 20px; padding: 6px 12px; font-weight: 900; font-size: 14px; backdrop-filter: blur(4px); }

/* ---------- shared menu layout ---------- */
#screen-levels, #screen-setup { flex-direction: column; color: #fff; }
.setup-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px 10px; flex-wrap: wrap; }
.setup-head h2 { flex: 1; margin: 0; font: 600 28px var(--font-head); white-space: nowrap; }
.setup-head .btn.ghost { color: #fff; }
.tabs { display: flex; gap: 6px; padding: 0 20px; flex-wrap: wrap; }
.tabs button { font: 800 15px var(--font-body); border: 0; padding: 10px 18px; border-radius: 14px 14px 0 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.tabs button:hover { background: rgba(255,255,255,.24); }
.tabs button.active { background: var(--panel); color: var(--panel-ink); }
.tab-body { flex: 1 0 auto; margin: 0 20px 20px; background: var(--panel); color: var(--panel-ink); border-radius: 0 18px 18px 18px; padding: 22px 26px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.form { column-width: 420px; column-gap: 48px; }
.fsec { font: 600 19px var(--font-head); margin: 18px 0 4px; break-after: avoid; color: var(--accent); }
.fsec:first-child { margin-top: 0; }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(127,127,127,.18); break-inside: avoid; }
.frow > label { font-weight: 800; }
.frow > label small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.fin { display: flex; align-items: center; gap: 8px; flex: none; }
.fin output { min-width: 48px; text-align: right; font-weight: 800; font-size: 13px; }
.fin select { max-width: 260px; }
.ff { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 800; color: var(--muted); }
.lv-car { display: flex; align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 14px; padding: 3px 12px 3px 4px; cursor: pointer; font: 800 15px var(--font-body); text-align: left; }
.lv-car:hover { background: rgba(255,255,255,.22); }
.lv-car canvas { width: 76px; height: 40px; }
.lv-car small { display: block; font-size: 11px; opacity: .75; }

/* ---------- car park map ---------- */
.lv-sum { margin: 0 0 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.world { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.14); border: 1px solid rgba(0,0,0,.06); display: flex; flex-direction: column; }
.w-art { display: flex; gap: 12px; align-items: center; padding: 14px 16px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.w-art h3 { margin: 0; font: 600 22px var(--font-head); }
.w-art p { margin: 2px 0 0; font-weight: 700; font-size: 13px; opacity: .95; }
.w-icon { font-size: 42px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.w-store .w-art { background: linear-gradient(135deg, #43aa8b, #277da1); }
.w-street .w-art { background: linear-gradient(135deg, #f8961e, #c75146); }
.w-pit .w-art { background: linear-gradient(135deg, #3d405b, #14141f); }
.w-tower .w-art { background: linear-gradient(135deg, #577590, #2b2d42); }
.w-roof .w-art { background: linear-gradient(135deg, #8ecae6, #3a6ea5); }
.w-air .w-art { background: linear-gradient(135deg, #4cc9f0, #4361ee); }
.w-round .w-art { background: linear-gradient(135deg, #90be6d, #43aa8b 50%, #f9c74f); }
.w-helix .w-art { background: conic-gradient(from 30deg at 30% 50%, #4361ee, #4cc9f0, #3a0ca3, #4361ee); }
.w-columns .w-art { background: repeating-linear-gradient(90deg, #4a4e57 0 34px, #6c7079 34px 44px); }
.w-lift .w-art { background: linear-gradient(180deg, #b08968 0 45%, #2b2d42 45%); }
.chal { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff4e5; border: 2px solid #ffb347; border-radius: 12px; padding: 4px 6px 4px 12px; }
.pill.hot { background: #e8431f; }
.w-hell .w-art { background: radial-gradient(circle at 30% 120%, #ffb703, #e85d04 30%, #9d0208 60%, #370617); }
.w-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px; }
.lvl { border: 0; border-radius: 12px; background: #f3f4f6; cursor: pointer; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 800 12px var(--font-body); color: #374151; min-width: 0; transition: transform .12s, background .12s; }
.lvl:hover:not(:disabled) { transform: translateY(-2px); background: #ffe8e0; }
.lvl b { font: 700 22px var(--font-head); color: var(--accent); }
.lvl.done b { color: #16a34a; }
.lvl .lv-n { font-size: 10.5px; line-height: 1.15; text-align: center; min-height: 24px; overflow: hidden; }
.lvl small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.lvl.lk { opacity: .45; cursor: not-allowed; }
.lvl.lk b::after { content: '🔒'; font-size: 13px; margin-left: 2px; }
.world.locked { filter: grayscale(.7); opacity: .75; }
.w-foot { padding: 0 14px 12px; font-weight: 900; font-size: 13px; color: #4b5563; }
.stars { font-size: 14px; letter-spacing: 1px; }
.stars span, .done-stars span { color: #d1d5db; }
.stars span.got, .done-stars span.got { color: #ffc107; text-shadow: 0 0 6px rgba(255,200,0,.6); }
.mode-card { display: flex; gap: 22px; align-items: flex-start; max-width: 760px; }
.mode-card h3 { font: 600 28px var(--font-head); margin: 0 0 8px; color: var(--accent); }
.mode-card p { font-weight: 700; line-height: 1.5; color: #374151; }
.mode-ico { font-size: 72px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.big-stat { font-size: 17px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lv-chips b { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 20px; background: #f1f1f4; color: #374151; }
.rnd { max-width: 780px; }
.rnd > p { margin-top: 0; }
.rrow { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(127,127,127,.15); }
.rrow > b { font-weight: 900; }
.rrow select { max-width: 300px; }
.togs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.seed { display: flex; gap: 8px; align-items: center; }
.seed input { width: 120px; }
.rbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.trophy { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.04); opacity: .5; filter: grayscale(1); }
.trophy.got { opacity: 1; filter: none; background: #fff7d6; }
.trophy > span { font-size: 28px; }
.trophy small { display: block; color: var(--muted); font-weight: 700; }

/* ---------- garage ---------- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.car-card { border-radius: 20px; border: 3px solid transparent; background: rgba(0,0,0,.04); overflow: hidden; display: flex; flex-direction: column; }
.car-card.on { border-color: var(--accent); background: #fff4f1; }
.car-stage { position: relative; height: 150px; background: repeating-linear-gradient(90deg, #5d6472 0 30px, #626977 30px 60px); }
.car-stage canvas { width: 100%; height: 100%; display: block; }
.car-card.locked .car-stage canvas { filter: grayscale(.6) brightness(.85); }
.price { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.6); color: #ffd60a; font-weight: 900; padding: 4px 10px; border-radius: 20px; }
.car-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.car-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.car-top h3 { margin: 0; font: 600 22px var(--font-head); }
.car-bio { margin: 0; font-weight: 700; font-size: 14px; color: #4b5563; }
.stats { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; align-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.sbar { height: 8px; border-radius: 6px; background: #e5e7eb; overflow: hidden; }
.sbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb347, var(--accent)); border-radius: 6px; }
.car-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.car-colors select, .car-colors input[type=text] { width: 100%; }
.horn-row { display: flex; gap: 6px; }
.horn-row select { flex: 1; min-width: 0; }
.char-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.data-tab section { margin-bottom: 22px; }
.data-tab h3 { font: 600 19px var(--font-head); margin: 0 0 6px; color: var(--accent); }
.data-tab .btn { margin: 4px 4px 4px 0; }
.code-box { display: block; width: 100%; min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; padding: 6px 10px; background: rgba(0,0,0,.05); border-radius: 12px; cursor: pointer; }

/* ---------- game ---------- */
#screen-game { background: #111; touch-action: none; user-select: none; -webkit-user-select: none; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; color: #fff; }
.hud-btn { pointer-events: auto; width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; background: rgba(0,0,0,.4); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; position: relative; backdrop-filter: blur(4px); }
.hud-btn:hover { background: rgba(0,0,0,.55); }
.hud-btn small { position: absolute; right: 3px; bottom: 1px; font: 900 12px var(--font-body); }
.hud-mid { flex: 1; min-width: 0; text-align: center; }
.hud-name { font: 600 16px var(--font-head); text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-goal { display: inline-block; font: 800 12.5px var(--font-body); background: rgba(0,0,0,.45); padding: 2px 10px; border-radius: 20px; margin-top: 2px; white-space: nowrap; }
.hud-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hud-row { display: flex; align-items: center; gap: 6px; }
.hud-time { font: 700 22px var(--font-head); text-shadow: 0 2px 4px rgba(0,0,0,.6); min-width: 52px; text-align: right; }
.hud-time.late { color: #ffb4a8; }
.hud-gear, .hud-floor { font: 900 13px var(--font-body); background: rgba(0,0,0,.5); border-radius: 7px; padding: 2px 7px; }
.hud-floor { background: #ffd60a; color: #222; }
.hud-par { font-size: 11px; font-weight: 800; opacity: .85; text-shadow: 0 1px 2px #000; }
.hud-hp { width: 70px; height: 8px; border-radius: 6px; background: rgba(0,0,0,.45); border: 1.5px solid rgba(255,255,255,.8); overflow: hidden; }
.hud-hp i { display: block; height: 100%; width: 100%; background: #4ade80; transition: width .2s; }
.hud-rush { position: absolute; z-index: 2; left: 50%; top: max(66px, calc(env(safe-area-inset-top) + 56px)); transform: translateX(-50%); background: #16a34a; color: #fff; font: 800 15px var(--font-body); padding: 3px 14px; border-radius: 20px; pointer-events: none; }
#minimap { position: absolute; z-index: 2; right: max(12px, env(safe-area-inset-right)); top: max(64px, calc(env(safe-area-inset-top) + 54px)); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); pointer-events: none; opacity: .92; }
.banner { position: absolute; z-index: 3; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(.6); background: rgba(20,6,14,.78); color: #fff; font: 700 24px var(--font-head); padding: 10px 24px; border-radius: 18px; pointer-events: none; opacity: 0; transition: opacity .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1); white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.controls { position: absolute; inset: auto 0 0 0; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); pointer-events: none; }
.steer-area > * { display: none; }
.controls[data-steer=wheel] .wheel { display: block; }
.controls[data-steer=buttons] .steer-btns { display: flex; }
.controls[data-steer=slider] .steer-slide { display: block; }
.wheel { width: clamp(118px, 30vmin, 170px); height: clamp(118px, 30vmin, 170px); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,.08) 60%, rgba(0,0,0,.2)); pointer-events: auto; touch-action: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.45)); }
.wheel svg { width: 100%; height: 100%; display: block; }
.steer-btns { gap: 12px; }
.steer-btns button, .pedal, .horn { pointer-events: auto; touch-action: none; border: 0; color: #fff; font: 900 26px var(--font-head); cursor: pointer; -webkit-user-select: none; user-select: none; }
.steer-btns button { width: 78px; height: 78px; border-radius: 22px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.4); }
.steer-btns button.on { background: rgba(255,90,60,.8); }
.steer-slide { width: clamp(200px, 40vw, 300px); height: 64px; border-radius: 32px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.4); position: relative; pointer-events: auto; touch-action: none; }
.steer-slide i { position: absolute; top: 6px; left: 50%; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.pedals { display: flex; gap: 12px; align-items: flex-end; }
.pedal { width: clamp(70px, 17vmin, 92px); height: clamp(96px, 26vmin, 128px); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 10px 20px rgba(0,0,0,.3); transition: transform .06s; }
.pedal small { font: 800 11px var(--font-body); opacity: .9; text-transform: uppercase; letter-spacing: 1px; }
.pedal.gas { background: linear-gradient(180deg, #4ade80, #15803d); }
.pedal.rev { background: linear-gradient(180deg, #fbbf24, #b45309); height: clamp(80px, 21vmin, 104px); }
.pedal.on { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 rgba(0,0,0,.35); filter: brightness(1.15); }
.horn { position: absolute; right: calc(max(14px, env(safe-area-inset-right)) + clamp(166px, 38vmin, 210px)); bottom: max(18px, env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.45); font-size: 22px; }

/* ---------- finish dialog ---------- */
.done-modal { text-align: center; }
.done-modal .modal-foot { justify-content: center; }
.done-hero { padding: 14px 0 4px; background: radial-gradient(circle, #fff3c4, #ffe0d6 55%, transparent 72%); border-radius: 16px; }
.done-big { font: 700 42px var(--font-head); background: linear-gradient(90deg, #ff9f1c, #ff4f3a, #ff2d75); -webkit-background-clip: text; background-clip: text; color: transparent; }
.done-name { font: 600 20px var(--font-head); margin: 8px 0 !important; }
.done-stars { font-size: 38px; letter-spacing: 8px; }
.done-stars span { display: inline-block; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.done-stars span:nth-child(2) { animation-delay: .22s; }
.done-stars span:nth-child(3) { animation-delay: .44s; }
.acc { display: flex; align-items: center; gap: 8px; margin: 6px auto 10px; max-width: 320px; }
.acc-bar { flex: 1; height: 12px; border-radius: 8px; background: #e5e7eb; overflow: hidden; }
.acc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #facc15, #4ade80); border-radius: 8px; }
.acc b { font: 700 20px var(--font-head); }
.acc small { font-weight: 800; color: var(--muted); }
.goals { display: grid; gap: 4px; text-align: left; max-width: 340px; margin: 0 auto; }
.goal { font-weight: 800; color: #9ca3af; display: flex; gap: 8px; }
.goal.ok { color: #1f2933; }
.done-coins { font: 700 22px var(--font-head); margin: 12px 0 0 !important; }
.pill { display: inline-block; font: 800 12px var(--font-body); background: #16a34a; color: #fff; padding: 3px 10px; border-radius: 20px; vertical-align: middle; }
.howto { display: flex; flex-direction: column; gap: 10px; }
.how-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; line-height: 1.45; }
.how-ico { font-size: 26px; width: 36px; flex: none; text-align: center; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .tab-body { margin: 0 8px 12px; padding: 16px 14px; }
  .tabs { padding: 0 8px; }
  .tabs button { padding: 9px 11px; font-size: 13.5px; }
  .setup-head { padding: 10px 12px 8px; }
  .setup-head h2 { font-size: 22px; }
  .form { column-width: auto; }
  .frow { flex-wrap: wrap; }
  .rrow { grid-template-columns: 1fr; gap: 6px; }
  .title-wrap { padding: 18px 16px; }
  .btn.big { font-size: 17px; padding: 12px 20px; }
  .world-grid, .car-grid { grid-template-columns: 1fr; }
  .mode-card { flex-direction: column; gap: 6px; }
  .mode-ico { font-size: 54px; }
  .hud-name { font-size: 14px; }
  .hud-goal { font-size: 11px; }
  .hud-btn { width: 40px; height: 40px; font-size: 18px; }
  #hud-cam { display: none; }
}
@media (max-height: 520px) {
  .title-logo, .title-foot { display: none; }
  #title-name { font-size: 44px; margin-top: 0; }
  .title-sub { margin-bottom: 12px; }
  .title-wrap { padding: 14px 20px; }
  .btn.big { font-size: 16px; padding: 10px 18px; }
  .hud-goal { display: none; }
  #minimap { transform: scale(.8); transform-origin: top right; }
  .banner { font-size: 20px; top: 30%; }
}
@media (orientation: portrait) and (max-width: 640px) {
  #minimap { transform: scale(.75); transform-origin: top right; }
}
@media (prefers-reduced-motion: reduce) { .title-logo, .spinner { animation: none; } }
