/* HEATLINE — UI styling (menu lobby, garage card, HUD, pause, summary, toasts).
   Dark navy/graphite, cyan/amber/magenta accents. System font stacks only — no web font requests. */
:root {
  --bg: #0b0f1a; --bg2: #121a2b; --panel: rgba(14, 20, 36, 0.86); --line: rgba(120, 160, 220, 0.18);
  --text: #e8eefc; --muted: #8fa0c4; --cyan: #2fe3ff; --amber: #ffb52e; --magenta: #ff3fa4; --green: #4ade80; --red: #ff4d4d;
  --gold: #f2c14e; --purple: #b06cff; --blue: #3fa9f5; --grey: #9aa4b2;
  --glass: rgba(8, 12, 22, 0.72); --glass-strong: rgba(6, 9, 18, 0.9);
  --font: "Segoe UI", "Inter", "Roboto", system-ui, sans-serif; --display: "Bahnschrift", "Segoe UI Black", "Impact", "Arial Black", sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- loading (unchanged contract) */
#loading { background: radial-gradient(1200px 600px at 50% 30%, #16213a 0%, var(--bg) 70%); z-index: 50; }
.loading-box { text-align: center; }
.logo { font-family: var(--display); font-size: 48px; letter-spacing: 0.12em; color: var(--text); text-shadow: 0 0 24px rgba(47, 227, 255, 0.35); }
.logo span { color: var(--cyan); }
.bar { width: 360px; height: 6px; margin: 22px auto 10px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
#loading-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--magenta)); transition: width 0.2s; }
#loading-label { color: var(--muted); font-size: 14px; letter-spacing: 0.08em; }
#loading-credits { position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; letter-spacing: 0.06em; line-height: 1.5; }
#loading-credits span { display: block; color: var(--cyan); opacity: 0.85; font-size: 12px; letter-spacing: 0.1em; }
#toasts { position: absolute; top: 16%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 40; }
#debug { position: absolute; left: 8px; bottom: 8px; font: 12px/1.4 monospace; color: #9fb; background: rgba(0,0,0,0.5); padding: 6px 8px; border-radius: 6px; white-space: pre; z-index: 60; }

/* ---------------------------------------------------------------- shared primitives */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 8px;
  padding: 10px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.15s var(--ease), border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.btn:hover, .btn:focus-visible, .btn.focus { background: rgba(47, 227, 255, 0.12); border-color: rgba(47, 227, 255, 0.55); outline: none; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(47, 227, 255, 0.14); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, rgba(47,227,255,0.22), rgba(47,227,255,0.08)); border-color: rgba(47,227,255,0.6); color: #fff; }
.btn.primary:hover, .btn.primary.focus { background: linear-gradient(135deg, rgba(47,227,255,0.38), rgba(47,227,255,0.16)); box-shadow: 0 8px 30px rgba(47,227,255,0.25); }
.btn.danger { border-color: rgba(255,77,77,0.5); }
.btn.danger:hover, .btn.danger.focus { background: rgba(255,77,77,0.14); border-color: var(--red); box-shadow: 0 6px 24px rgba(255,77,77,0.14); }
.btn.ghost { background: transparent; }
.btn.small { font-size: 12px; padding: 6px 12px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; letter-spacing: 0.04em; text-transform: none; }
.btn kbd { margin-left: 2px; }
.lbl { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sbar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sbar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), #7df3ff); transition: width 0.45s var(--ease); }
.sbar.amber > i { background: linear-gradient(90deg, var(--amber), #ffd27a); }
.sbar.magenta > i { background: linear-gradient(90deg, var(--magenta), #ff8ad0); }
.sbar.green > i { background: linear-gradient(90deg, var(--green), #a7f3c4); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.bar-row b { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tier { display: inline-block; font-family: var(--display); letter-spacing: 0.22em; font-size: 12px; padding: 3px 10px; border-radius: 4px; border: 1px solid currentColor; text-transform: uppercase; }
.tier.STANDARD { color: var(--grey); } .tier.SPORT { color: var(--blue); } .tier.ELITE { color: var(--purple); }
.tier.LEGENDARY { color: var(--gold); text-shadow: 0 0 14px rgba(242,193,78,0.6); box-shadow: inset 0 0 18px rgba(242,193,78,0.12), 0 0 18px rgba(242,193,78,0.18); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 5px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); position: relative; cursor: pointer; margin: 0; }
.check input:checked { border-color: var(--cyan); background: rgba(47,227,255,0.2); }
.check input:checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--cyan); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
select, input[type="range"] { font-family: var(--font); color: var(--text); }
select { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); border-radius: 6px; padding: 7px 10px; font-size: 14px; min-width: 180px; }
select option { background: #121a2b; color: var(--text); }
select:focus-visible { outline: none; border-color: var(--cyan); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--cyan); border: 2px solid #0b0f1a; box-shadow: 0 0 10px rgba(47,227,255,0.6); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--cyan); border: 2px solid #0b0f1a; cursor: pointer; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%); }
.scanlines { position: absolute; inset: 0; pointer-events: none; opacity: 0.18; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 3px); mix-blend-mode: overlay; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--cyan); animation: spin 0.9s linear infinite; margin: 0 auto 14px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
table.data th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
table.data tr.rec td { color: var(--gold); }
table.data tr.dim td { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.note b { color: var(--text); }
pre.license { white-space: pre-wrap; font: 12px/1.5 Consolas, "Courier New", monospace; color: var(--muted); background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; max-height: 220px; overflow: auto; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px); } }
@keyframes flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes titleGlow { 0%, 100% { text-shadow: 0 0 28px rgba(47,227,255,0.35), 0 0 2px rgba(255,255,255,0.4); } 50% { text-shadow: 0 0 46px rgba(47,227,255,0.6), 0 0 2px rgba(255,255,255,0.6); } }
@keyframes recordPop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- menu lobby */
#menu { display: block; z-index: 20; }
#menu.no-backdrop { background: radial-gradient(1400px 700px at 30% 40%, #141c30 0%, #070a12 70%); }
.menu-root { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(300px, 34%) 1fr; }
.menu-left { position: relative; z-index: 2; padding: clamp(28px, 6vh, 64px) clamp(24px, 4vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background: linear-gradient(90deg, rgba(5,8,14,0.82) 0%, rgba(5,8,14,0.62) 70%, rgba(5,8,14,0) 100%); animation: fadeIn 0.5s var(--ease); }
.menu-title { font-family: var(--display); line-height: 0.92; letter-spacing: 0.08em; display: flex; flex-direction: column; animation: titleGlow 4s ease-in-out infinite; }
.menu-title .t1 { font-size: clamp(22px, 2.6vw, 34px); color: var(--muted); letter-spacing: 0.42em; }
.menu-title .t2 { font-size: clamp(54px, 7vw, 96px); color: #fff; }
.menu-title .t2 em { font-style: normal; color: var(--cyan); }
.menu-tag { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); margin-top: -8px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.menu-item { position: relative; text-align: left; font-family: var(--display); font-size: clamp(20px, 2.1vw, 28px); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(232,238,252,0.6); background: transparent; border: 0; padding: 9px 18px 9px 26px; cursor: pointer; transition: color 0.15s, padding-left 0.2s var(--ease); }
.menu-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--cyan); opacity: 0; transform: scaleY(0.4); transition: opacity 0.15s, transform 0.2s var(--ease); box-shadow: 0 0 12px var(--cyan); }
.menu-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(47,227,255,0.14), rgba(47,227,255,0)); opacity: 0; transition: opacity 0.15s; border-radius: 4px; }
.menu-item.active { color: #fff; padding-left: 34px; }
.menu-item.active::before { opacity: 1; transform: scaleY(1); }
.menu-item.active::after { opacity: 1; }
.menu-item .sub { display: block; font-family: var(--font); font-size: 11px; letter-spacing: 0.16em; color: var(--muted); margin-top: 1px; }
.menu-footer { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 18px; flex-wrap: wrap; }
.menu-footer .ver { margin-left: auto; opacity: 0.6; }
.menu-right { position: relative; z-index: 2; align-self: center; justify-self: center; width: min(760px, 92%); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06); backdrop-filter: blur(10px); animation: slideInRight 0.35s var(--ease); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: 0.2em; text-transform: uppercase; color: #fff; }
.panel-head h2 span { color: var(--cyan); }
.panel-body { padding: 18px 24px 24px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.panel-body h3 { margin: 6px 0 2px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat-tile { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 12px 14px; }
.stat-tile .lbl { display: block; margin-bottom: 4px; }
.stat-tile b { font-family: var(--display); font-size: 26px; letter-spacing: 0.04em; color: #fff; font-variant-numeric: tabular-nums; }
.stat-tile b small { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 4px; letter-spacing: 0.08em; }
.vcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vcard { background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08); border-left: 3px solid var(--tier, var(--grey)); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.vcard .vname { font-family: var(--display); font-size: 20px; letter-spacing: 0.06em; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vcard .vclass { font-size: 12px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.vcard .vnums { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.vcard .vnums b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.vcard .bar-row { grid-template-columns: 90px 1fr 30px; font-size: 11px; }
.settings-row { display: grid; grid-template-columns: 180px 1fr 56px; align-items: center; gap: 14px; font-size: 14px; }
.settings-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.settings-row.single { grid-template-columns: 180px 1fr; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.controls-grid table.data td:last-child { text-align: right; }
.hist-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.hist-row { display: grid; grid-template-columns: 90px 1fr 70px 80px 80px; gap: 8px; padding: 7px 10px; border-radius: 6px; background: rgba(255,255,255,0.03); color: var(--muted); }
.hist-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.hist-row .reason.ARRESTED { color: var(--red); } .hist-row .reason.WRECKED { color: var(--amber); }

/* ---------------------------------------------------------------- garage */
#garage { display: block; z-index: 20; pointer-events: none; }
#garage > * { pointer-events: none; }
.garage-root { position: absolute; inset: 0; }
.garage-root button, .garage-root label, .garage-root .garage-strip { pointer-events: auto; }
.garage-fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 0.45s ease; pointer-events: none; }
.garage-fade.on { opacity: 1; }
.garage-top { position: absolute; left: clamp(20px, 4vw, 56px); top: clamp(18px, 4vh, 40px); animation: riseIn 0.4s var(--ease); }
.garage-title { font-family: var(--display); font-size: clamp(28px, 3.4vw, 44px); letter-spacing: 0.3em; color: #fff; text-shadow: 0 0 26px rgba(47,227,255,0.35); }
.garage-sub { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); margin-top: 2px; }
.garage-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 64px; height: 110px; border: 1px solid rgba(255,255,255,0.12); background: rgba(8,12,22,0.5); color: #fff; font-size: 54px; line-height: 1; cursor: pointer; border-radius: 10px; backdrop-filter: blur(6px); transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); font-family: var(--font); }
.garage-arrow.left { left: clamp(12px, 2.5vw, 36px); } .garage-arrow.right { right: clamp(12px, 2.5vw, 36px); }
.garage-arrow:hover { background: rgba(47,227,255,0.14); border-color: rgba(47,227,255,0.5); }
.garage-arrow.left:hover { transform: translateY(-50%) translateX(-3px); } .garage-arrow.right:hover { transform: translateY(-50%) translateX(3px); }
.garage-arrow:active { transform: translateY(-50%) scale(0.96); }
.garage-arrow[disabled] { opacity: 0.25; cursor: default; }
.garage-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px clamp(20px, 4vw, 56px) 22px; display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(3,5,10,0.85) 100%); }
.garage-bottom .spacer { flex: 1; }
.garage-index { font-family: var(--display); letter-spacing: 0.2em; color: var(--muted); font-size: 14px; }
.garage-strip { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 6px; max-width: 86vw; flex-wrap: wrap; justify-content: center; }
.garage-strip button { font-family: var(--font); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: rgba(8,12,22,0.55); border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; padding: 4px 10px; cursor: pointer; transition: all 0.15s; }
.garage-strip button:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.garage-strip button.active { color: #fff; border-color: var(--tier, var(--cyan)); box-shadow: 0 0 12px color-mix(in srgb, var(--tier, var(--cyan)) 50%, transparent); }
.garage-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; background: rgba(3,5,10,0.55); backdrop-filter: blur(4px); }
.garage-topright { position: absolute; right: clamp(20px, 4vw, 56px); top: clamp(18px, 4vh, 40px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; animation: riseIn 0.4s var(--ease); }
.garage-hint { display: flex; gap: 12px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.garage-hint .pad { opacity: 0.7; }

/* coin balance ("12 450 Münzen" with the gold glyph) — always visible in the garage header */
.coin-glyph { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; filter: drop-shadow(0 0 6px rgba(242,193,78,0.45)); }
.lock-glyph { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }
.garage-coins { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; background: var(--glass); border: 1px solid rgba(242,193,78,0.35);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06), 0 0 24px rgba(242,193,78,0.12); backdrop-filter: blur(8px); color: #fff; }
.garage-coins .coin-glyph { width: 24px; height: 24px; }
.garage-coins b { font-family: var(--display); font-size: 24px; letter-spacing: 0.06em; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(242,193,78,0.45); white-space: nowrap; }
.garage-coins .unit { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text); opacity: 0.85; }
.garage-coins-sub { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-right: 6px; }

/* locked cars: strip pill, card, bottom-bar buttons */
.garage-strip button.locked { color: rgba(143,160,196,0.7); border-style: dashed; }
.garage-strip button.locked .lock-glyph { margin-right: 5px; color: var(--amber); opacity: 0.8; }
.garage-strip button.locked.active { color: #fff; border-color: var(--amber); box-shadow: 0 0 12px rgba(255,181,46,0.35); }
.btn.unlock { background: linear-gradient(135deg, rgba(255,181,46,0.26), rgba(242,193,78,0.1)); border-color: rgba(255,181,46,0.7); color: #fff; }
.btn.unlock:hover, .btn.unlock.focus { background: linear-gradient(135deg, rgba(255,181,46,0.42), rgba(242,193,78,0.18)); border-color: var(--gold); box-shadow: 0 8px 30px rgba(255,181,46,0.28); }
.btn.unlock .lock-glyph { color: var(--gold); }
.btn.unlock.insufficient { border-style: dashed; }
.btn.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.gcard.locked { pointer-events: auto; cursor: pointer; border-color: rgba(255,255,255,0.16); box-shadow: 0 24px 70px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.05); background: linear-gradient(160deg, rgba(8,10,16,0.84), rgba(4,6,12,0.9)); }
.gcard.locked::after { background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(0,0,0,0)); }
.gcard.locked .gcard-name, .gcard.locked .gcard-nums b { color: rgba(232,238,252,0.55); text-shadow: none; }
.gcard.locked .gcard-sil { filter: grayscale(1) opacity(0.45) drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.gcard.locked .tier { opacity: 0.5; text-shadow: none; box-shadow: none; }
.gcard.locked .gcard-bars .sbar > i, .gcard.locked .gcard-drive svg { filter: grayscale(0.85) opacity(0.6); }
.gcard-lock { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; border: 1px dashed rgba(255,181,46,0.6); background: rgba(255,181,46,0.1);
  font-family: var(--display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #ffd27a; }
.gcard-lock .lock-glyph { width: 16px; height: 16px; color: var(--amber); }
.gcard.flash { animation: tierFlash 1s var(--ease); }
@keyframes tierFlash { 0% { box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 0 color-mix(in srgb, var(--tier, var(--cyan)) 70%, transparent); border-color: #fff; }
  35% { box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 60px 10px color-mix(in srgb, var(--tier, var(--cyan)) 60%, transparent); border-color: #fff; }
  100% { box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 36px color-mix(in srgb, var(--tier, var(--cyan)) 18%, transparent); } }

/* buy confirm (modal over the hall): Enter = buy, Esc = cancel; shakes when the coins do not suffice */
.garage-root .garage-confirm, .garage-root .garage-confirm * { pointer-events: auto; }
.garage-confirm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5; animation: fadeIn 0.18s ease; }
.garage-confirm-backdrop { position: absolute; inset: 0; background: rgba(3,5,10,0.55); backdrop-filter: blur(5px); }
.garage-confirm-box { position: relative; width: min(440px, 92%); background: var(--glass-strong); border: 1px solid rgba(255,181,46,0.45); border-radius: 14px; padding: 24px 26px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 40px rgba(255,181,46,0.12), inset 0 1px 0 rgba(255,255,255,0.06); animation: riseIn 0.22s var(--ease); display: flex; flex-direction: column; gap: 12px; }
.garage-confirm-box.shake { animation: shakeX 0.5s var(--ease); border-color: var(--red); box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 40px rgba(255,77,77,0.28); }
.gc-title { font-family: var(--display); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); }
.gc-name { font-family: var(--display); font-size: 26px; letter-spacing: 0.06em; color: #fff; line-height: 1.05; }
.gc-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.gc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.gc-row b { font-family: var(--display); font-size: 18px; letter-spacing: 0.04em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gc-row.after b { color: var(--green); }
.gc-row.missing { color: #ffb0b0; } .gc-row.missing b { color: var(--red); }
.gc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-10px); } 30% { transform: translateX(9px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-3px); } 90% { transform: translateX(2px); } }

/* vehicle card (floating glass panel anchored above the selected car) */
.gcard { position: absolute; left: 0; top: 0; width: 330px; transform: translate(-50%, -100%); will-change: transform; opacity: 0; transition: opacity 0.3s ease;
  background: linear-gradient(160deg, rgba(10,14,26,0.78), rgba(6,9,18,0.86)); border: 1px solid color-mix(in srgb, var(--tier, var(--cyan)) 55%, transparent); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 36px color-mix(in srgb, var(--tier, var(--cyan)) 18%, transparent), inset 0 1px 0 rgba(255,255,255,0.08); backdrop-filter: blur(10px);
  padding: 14px 16px 14px; color: var(--text); pointer-events: none; }
.gcard.on { opacity: 1; }
.gcard::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 1px; height: 14px; background: linear-gradient(180deg, var(--tier, var(--cyan)), rgba(0,0,0,0)); }
.gcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gcard-name { font-family: var(--display); font-size: 26px; letter-spacing: 0.08em; color: #fff; line-height: 1; }
.gcard-class { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.gcard-sil { display: block; width: 240px; height: 100px; margin: 6px auto 2px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.gcard-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 2px; border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); padding: 10px 0; }
.gcard-nums div { text-align: center; }
.gcard-nums b { display: block; font-family: var(--display); font-size: 32px; line-height: 1; color: #fff; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px color-mix(in srgb, var(--tier, var(--cyan)) 45%, transparent); }
.gcard-nums span { display: block; font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.gcard-drive { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); margin: 10px 0 8px; }
.gcard-drive svg { width: 34px; height: 22px; flex: none; }
.gcard-drive .dname { color: var(--muted); letter-spacing: 0.08em; text-transform: none; font-size: 12px; }
.gcard-bars { display: flex; flex-direction: column; gap: 6px; }
.gcard-bars .bar-row { grid-template-columns: 96px 1fr 28px; font-size: 11px; }
.gcard-bars .sbar > i { background: linear-gradient(90deg, var(--tier, var(--cyan)), color-mix(in srgb, var(--tier, var(--cyan)) 55%, #fff)); }

/* ---------------------------------------------------------------- HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud-layer { position: absolute; inset: 0; pointer-events: none; font-family: var(--font); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 10px rgba(0,0,0,0.5); }
.hud-layer > * { position: absolute; }
.hud-box { background: rgba(6, 9, 18, 0.42); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; }
.hud-tl { left: 22px; top: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hud-tr { right: 22px; top: 20px; }
.hud-tc { left: 50%; top: 18px; transform: translateX(-50%); }
.hud-bl { left: 22px; bottom: 22px; display: flex; gap: 22px; align-items: flex-end; padding: 10px 16px; }
.hud-br { right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hud-center { left: 50%; bottom: 150px; transform: translateX(-50%); }
.pill { font-family: var(--display); font-size: 15px; letter-spacing: 0.26em; padding: 6px 14px 5px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); background: rgba(6,9,18,0.5); backdrop-filter: blur(6px); transition: all 0.25s; }
.pill.CALM { color: var(--muted); }
.pill.PURSUIT { color: #fff; border-color: var(--red); background: rgba(255,77,77,0.22); box-shadow: 0 0 20px rgba(255,77,77,0.35); animation: flash 1.1s ease-in-out infinite; }
.pill.SEARCHING { color: var(--amber); border-color: var(--amber); background: rgba(255,181,46,0.12); }
.pill.ESCAPED { color: var(--green); border-color: var(--green); background: rgba(74,222,128,0.12); box-shadow: 0 0 18px rgba(74,222,128,0.3); }
.heat { display: flex; align-items: center; gap: 10px; padding: 6px 12px; }
.heat-level { font-family: var(--display); font-size: 26px; letter-spacing: 0.06em; color: var(--amber); min-width: 44px; line-height: 1; }
.heat-level.over { color: var(--magenta); text-shadow: 0 0 16px rgba(255,63,164,0.7); animation: pulse 0.9s ease-in-out infinite; }
.stars { display: flex; gap: 4px; }
.star { position: relative; width: 20px; height: 20px; }
.star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.star .bg { fill: rgba(255,255,255,0.12); }
.star .fg { fill: var(--amber); filter: drop-shadow(0 0 4px rgba(255,181,46,0.7)); }
.star.over .fg { fill: var(--magenta); filter: drop-shadow(0 0 5px rgba(255,63,164,0.8)); }
.star .clip { position: absolute; inset: 0; overflow: hidden; }
.hud-map-label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); padding: 4px 10px; }
.minimap { display: block; width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.14); box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,0,0,0.5); background: rgba(6,9,18,0.55); }
.warn-banner { font-family: var(--display); font-size: 22px; letter-spacing: 0.3em; color: #fff; background: rgba(255,77,77,0.3); border: 1px solid var(--red); border-radius: 8px; padding: 10px 26px; text-align: center; box-shadow: 0 0 30px rgba(255,77,77,0.45); animation: flash 0.5s ease-in-out infinite; white-space: nowrap; }
.warn-banner.spikes { background: rgba(255,181,46,0.25); border-color: var(--amber); box-shadow: 0 0 30px rgba(255,181,46,0.45); }
.warn-banner small { display: block; font-family: var(--font); font-size: 12px; letter-spacing: 0.2em; color: rgba(255,255,255,0.8); margin-top: 2px; }
.stat { display: flex; flex-direction: column; gap: 2px; position: relative; }
.stat b { font-family: var(--display); font-size: 28px; letter-spacing: 0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat.score b { color: var(--cyan); font-size: 34px; }
.score-pops { position: absolute; left: 0; bottom: 100%; pointer-events: none; }
.score-pop { position: absolute; left: 0; bottom: 0; font-family: var(--display); font-size: 18px; color: var(--amber); white-space: nowrap; animation: floatUp 1.3s ease-out forwards; }
.score-pop.good { color: var(--green); }
.gauge { display: block; width: 236px; height: 236px; }
.dmg { display: flex; align-items: center; gap: 10px; padding: 6px 12px; width: 236px; }
.dmg-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.dmg-bar i { display: block; height: 100%; width: 100%; border-radius: 4px; background: var(--green); transition: width 0.25s var(--ease), background 0.4s; box-shadow: 0 0 10px currentColor; }
.dmg b { font-family: var(--display); font-size: 15px; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.dmg.stage3 b, .dmg.stage4 b { color: var(--red); }
.dmg.stage4 { animation: flash 0.8s ease-in-out infinite; }
.arrest { display: block; width: 150px; height: 150px; animation: pulse 0.8s ease-in-out infinite; }
.pause-overlay { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,6,12,0.66); backdrop-filter: blur(8px); pointer-events: auto; animation: fadeIn 0.2s ease; }
.pause-box { width: min(420px, 90%); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 14px; padding: 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: riseIn 0.25s var(--ease); display: flex; flex-direction: column; gap: 14px; }
.pause-box h2 { margin: 0 0 8px; font-family: var(--display); font-size: 34px; letter-spacing: 0.3em; color: #fff; text-align: center; }
.pause-box .btn { justify-content: space-between; width: 100%; }
.pause-box .meta { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 6px; }

/* ---------------------------------------------------------------- toasts */
.toast { pointer-events: none; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: #fff; background: rgba(8,12,22,0.86); border: 1px solid rgba(120,160,220,0.3); border-left-width: 4px; border-radius: 8px; padding: 9px 16px; min-width: 240px; max-width: 60vw; text-align: center; backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0,0,0,0.45); animation: toastIn 0.25s var(--ease); }
.toast.info { border-left-color: var(--cyan); } .toast.warn { border-left-color: var(--amber); } .toast.good { border-left-color: var(--green); } .toast.bad { border-left-color: var(--red); background: rgba(60,10,16,0.86); }
.toast.out { animation: toastOut 0.3s ease forwards; }

/* ---------------------------------------------------------------- round summary */
#summary { z-index: 30; background: rgba(3,5,10,0.55); backdrop-filter: blur(6px); animation: fadeIn 0.3s ease; }
.summary-panel { width: min(760px, 94%); max-height: 92vh; overflow: auto; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px 26px; box-shadow: 0 40px 100px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06); animation: riseIn 0.35s var(--ease); }
.sum-reason { font-family: var(--display); font-size: clamp(34px, 5vw, 56px); letter-spacing: 0.22em; line-height: 1; color: #fff; }
.sum-reason.ARRESTED { color: var(--red); text-shadow: 0 0 30px rgba(255,77,77,0.5); }
.sum-reason.WRECKED { color: var(--amber); text-shadow: 0 0 30px rgba(255,181,46,0.5); }
.sum-sub { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin: 8px 0 18px; }
.sum-score { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.sum-score b { font-family: var(--display); font-size: 56px; color: var(--cyan); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(47,227,255,0.45); }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sum-cell { position: relative; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; }
.sum-cell.rec { border-color: rgba(242,193,78,0.6); box-shadow: 0 0 20px rgba(242,193,78,0.18); }
.sum-cell .lbl { display: block; margin-bottom: 3px; }
.sum-cell b { font-family: var(--display); font-size: 24px; color: #fff; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.badge-record { position: absolute; right: 8px; top: -9px; font-family: var(--display); font-size: 9px; letter-spacing: 0.2em; color: #1a1200; background: var(--gold); padding: 3px 7px; border-radius: 4px; box-shadow: 0 0 14px rgba(242,193,78,0.7); animation: recordPop 0.5s var(--ease) both; }
.sum-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; }
/* coins earned this round: "+ 2 025 Münzen" (counts up like the score), itemised breakdown, new balance */
.sum-coins { display: grid; grid-template-columns: minmax(200px, 0.9fr) 1.1fr; gap: 6px 22px; align-items: start; margin: 0 0 18px; padding: 14px 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(242,193,78,0.1), rgba(242,193,78,0.03)); border: 1px solid rgba(242,193,78,0.32); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 30px rgba(242,193,78,0.08); }
.sum-coins-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sum-coins-head .coin-glyph { width: 28px; height: 28px; align-self: center; }
.sum-coins-head b { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(242,193,78,0.45); white-space: nowrap; transition: text-shadow 0.4s; }
.sum-coins-head b.done { text-shadow: 0 0 34px rgba(242,193,78,0.7); }
.sum-coin-rows { display: flex; flex-direction: column; gap: 2px; grid-row: span 2; }
.sum-coin-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sum-coin-row b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-coin-row.neg b { color: #ff8a8a; }
.sum-coins-total { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.sum-coins-total b { font-family: var(--display); font-size: 18px; letter-spacing: 0.04em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* settings: progress reset with inline confirm; vehicles overview: lock/price line */
.settings-reset { display: flex; flex-direction: column; gap: 10px; }
.confirm-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,77,77,0.5); background: rgba(255,77,77,0.08); font-size: 13px; line-height: 1.5; color: var(--text); animation: riseIn 0.2s var(--ease); }
.confirm-row .confirm-actions { display: flex; gap: 8px; }
.vcard .vprice { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.vcard .vprice.locked { color: #ffd27a; } .vcard .vprice.owned { color: var(--green); }
.vcard.locked { border-left-color: rgba(255,255,255,0.18); }
.vcard.locked .vname span:first-child { color: rgba(232,238,252,0.6); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .menu-root { grid-template-columns: 1fr; }
  .menu-right { position: absolute; inset: 12px; width: auto; max-height: none; }
  .gauge { width: 180px; height: 180px; } .dmg { width: 180px; }
  .minimap { width: 150px; height: 150px; }
  .gcard { width: 290px; }
  .controls-grid { grid-template-columns: 1fr; }
  .sum-coins { grid-template-columns: 1fr; }
  .garage-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-title, .pill.PURSUIT, .warn-banner, .arrest, .heat-level.over, .dmg.stage4, .gcard.flash, .garage-confirm-box.shake { animation: none; }
}

/* ---- HEATLINE wordmark ---- */
.logo, .menu-title .t2 { font-style: italic; letter-spacing: 0.02em; }
.logo .heat, .menu-title .heat { font-weight: 900; background: linear-gradient(92deg, #ffd166 0%, #ff8a2e 48%, #ff3b3b 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 120, 40, 0.45)); }
.logo .line, .menu-title .t2 em { color: var(--cyan); font-style: italic; font-weight: 700; text-shadow: 0 0 18px rgba(47, 227, 255, 0.55); }
.menu-title .t2 { position: relative; display: inline-block; line-height: 0.92; }
.menu-title .heat { display: block; }
.logo .heat, .logo .line { display: block; line-height: 0.95; }
.logo { text-align: center; }
.menu-title .t2::after { content: ""; position: absolute; left: 0; right: -8%; bottom: -6px; height: 2px; background: linear-gradient(90deg, rgba(255,138,46,0.95), rgba(47,227,255,0.9) 60%, rgba(47,227,255,0)); border-radius: 2px; }
.menu-title .t1 { letter-spacing: 0.34em; text-transform: uppercase; font-size: 0.42em; color: var(--muted); font-style: normal; }

/* Hosting badge (Netlify "Powered by" iframe, bottom-right, ~366x334 px, max z-index): keep the primary garage action clear of it. */
body:has(#nl-badge-frame) .garage-bottom { padding-right: 230px; }   /* small screens: the badge is a 197x64 pill */
@media (min-width: 1100px) and (min-height: 700px) {                 /* large screens: the badge is a 366x334 card */
  body:has(#nl-badge-frame) .garage-bottom { padding-right: 400px; }
  body:has(#nl-badge-frame) #hud .hud-bottom-right, body:has(#nl-badge-frame) #hud .minimap { transform: translateX(-380px); }
}

/* ---------------------------------------------------------------- crash / diagnostics overlays (src/ui/Diagnostics.js, index.html boot net) */
.hl-fatal { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px 24px; text-align: center;
  background: rgba(6, 9, 18, 0.94); color: var(--text, #e8eefc); font-family: var(--font, system-ui, sans-serif); pointer-events: auto; }
.hl-fatal-title { margin: 0; font-size: 22px; letter-spacing: 0.04em; color: var(--amber, #ffb52e); }
.hl-fatal-msg { margin: 0; max-width: 640px; font-size: 15px; line-height: 1.4; word-break: break-word; }
.hl-fatal-hint { margin: 0; max-width: 640px; font-size: 13px; line-height: 1.4; color: var(--muted, #8fa0c4); }
.hl-fatal-buttons { display: flex; gap: 12px; margin-top: 6px; }
.hl-fatal-btn { font: 600 15px var(--font, system-ui, sans-serif); letter-spacing: 0.05em; color: var(--text, #e8eefc); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.22); border-radius: 8px; padding: 12px 22px; min-height: 44px; cursor: pointer; }
.hl-fatal-btn.primary { background: rgba(47, 227, 255, 0.18); border-color: rgba(47, 227, 255, 0.7); }
.hl-diag { position: fixed; left: max(4px, env(safe-area-inset-left)); top: max(4px, env(safe-area-inset-top)); margin: 0; z-index: 9000; font: 9px/1.25 monospace; color: #9fb; background: rgba(0,0,0,0.55); padding: 2px 5px; border-radius: 4px; white-space: pre; pointer-events: none; max-width: 96vw; }
