/* Drive · Maxime Lab — palette and type from the maximelab.com "Universe" look */
:root {
  --bg: #070D1B; --bg2: #0B1428; --panel: rgba(12, 20, 40, .72); --text: #EEF2F7; --muted: #A9B4C8; --faint: #8592A8;
  --line: rgba(255, 255, 255, .12); --line2: rgba(255, 255, 255, .3);
  --blue: #7BA4FF; --peach: #F3C49B; --amber: #E9A15B; --ok: #3FD07A; --red: #ff5a4f;
  --grad: linear-gradient(90deg, #6E9BFF 0%, #A9B7F0 48%, #F2C79F 100%);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 18px; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--blue); } a:hover { color: var(--peach); }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-weight: 400; line-height: 1.12; margin: 0 0 .6em; }
p { margin: 0 0 .9em; }
kbd { font: inherit; font-size: .75em; border: 1px solid currentColor; border-radius: 6px; padding: 0 .35em; opacity: .7; }
.noscript { position: fixed; inset: 40% 0 auto; text-align: center; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- menu */
.screen { position: fixed; inset: 0; overflow-y: auto; z-index: 2; }
.scene { background:
  radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 38% 9%, #fff6 50%, transparent 51%),
  radial-gradient(1px 1px at 63% 22%, #fff5 50%, transparent 51%), radial-gradient(1.5px 1.5px at 84% 12%, #fff7 50%, transparent 51%),
  radial-gradient(38% 26% at 72% 84%, rgba(255, 214, 168, .55), transparent 70%),
  radial-gradient(70% 48% at 70% 92%, rgba(232, 140, 82, .45), transparent 72%),
  radial-gradient(60% 50% at 25% 15%, rgba(64, 98, 184, .5), transparent 72%),
  linear-gradient(180deg, #081028 0%, #14224A 45%, #3D4A78 75%, #6d5a66 92%, #1A2140 100%); }
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3rem); }
.menu-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .menu-grid { grid-template-columns: 1fr; } }
.eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.display { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 300; letter-spacing: -.015em; }
.display span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: #D6DDEA; max-width: 34rem; }
.h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 300; }
.h3 { font-size: 1.15rem; font-weight: 500; }
.h4 { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 1.1em 0 .35em; font-weight: 600; }
.small { font-size: .8rem; } .muted { color: var(--muted); } .big { font-size: 1.1rem; }
.warn { border-left: 3px solid var(--amber); padding: .4rem .8rem; background: rgba(233, 161, 91, .1); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1rem, 2.5vw, 1.6rem); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); margin-top: 1.4rem; }
.settings { margin-top: 0; }
.row { display: flex; gap: .6rem; align-items: center; margin: .6rem 0; }
.wrap-row { flex-wrap: wrap; }
.row.end { justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }
.col { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: .5rem; margin-left: auto; }
label.check { flex-direction: row; align-items: center; gap: .6rem; margin: .7rem 0 0; color: var(--text); font-size: .88rem; }
input:not([type=checkbox]), select { width: 100%; min-height: 2.6rem; padding: .5rem .8rem; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; }
label.inline select { width: auto; }
select option { background: var(--bg2); }
input[type=checkbox] { accent-color: var(--blue); width: 1.1rem; height: 1.1rem; }
.btn { font: inherit; font-size: .88rem; font-weight: 500; min-height: 2.6rem; padding: .45rem 1.3rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(10, 18, 38, .5); color: var(--text); cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s; }
.btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .55); }
.btn.light { background: #F5F7FB; color: #0B1428; border-color: #F5F7FB; }
.btn.light:hover { background: #fff; }
.btn.ghost { background: transparent; }
.results { list-style: none; margin: .3rem 0; padding: 0; max-height: 14rem; overflow-y: auto; }
.results button { width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line); padding: .55rem .2rem; font: inherit; font-size: .85rem; cursor: pointer; }
.results button:hover, .results button:focus-visible { color: var(--peach); }
.osm { font-size: .72rem; margin: .8rem 0 0; }

/* ---------- modals */
.modal { position: fixed; inset: 0; z-index: 10; display: flex; overflow-y: auto; background: rgba(4, 8, 18, .55); padding: 1rem; }
.card { margin: auto; width: min(42rem, 100%); background: rgba(11, 20, 40, .94); border: 1px solid var(--line2); border-radius: var(--r); padding: clamp(1.2rem, 3vw, 2rem); box-shadow: 0 30px 60px -30px #000; }
.card.narrow { width: min(26rem, 100%); }
.chip { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px; border: 1px solid currentColor; }
.chip.minor { color: var(--amber); } .chip.serious { color: #ff8a4f; } .chip.dangerous { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1rem 0; }
.stats div { padding: .8rem; text-align: center; } .stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-size: 1.6rem; font-weight: 300; } .stats span { font-size: .75rem; color: var(--muted); }
.faults { list-style: none; padding: 0; margin: 0; }
.faults li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.spinner { width: 2.2rem; height: 2.2rem; margin: 1rem auto 0; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--peach); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- HUD */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud-panel { position: absolute; background: rgba(7, 13, 27, .62); border: 1px solid var(--line); border-radius: 16px; padding: .6rem .9rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dash { left: 16px; bottom: 16px; width: 13rem; }
.speed { display: flex; align-items: baseline; gap: .4rem; } .speed b { font-size: 3rem; font-weight: 300; line-height: 1; } .speed span { color: var(--muted); font-size: .8rem; }
.rpm { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); margin: .4rem 0; overflow: hidden; }
#rpmBar { height: 100%; width: 0; background: var(--grad); }
#rpmBar.red { background: var(--red); }
.gear-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: .75rem; }
.gear { font-size: 1.5rem; color: var(--text); font-weight: 500; }
.ind { display: flex; justify-content: space-between; align-items: center; min-height: 1.3rem; }
.arrow { color: rgba(255, 255, 255, .15); font-size: 1.1rem; } .arrow.on { color: #3dff6e; text-shadow: 0 0 8px #3dff6e; }
.engine-off { color: var(--red); font-size: .7rem; font-weight: 700; letter-spacing: .12em; }
.limit-sign { position: absolute; left: calc(16px + 13rem + 12px); bottom: 20px; width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 7px solid #c4161c; display: grid; place-items: center; color: #111; font-weight: 700; font-size: 1.35rem; font-family: Arial, sans-serif; }
.limit-sign.over { animation: pulse .6s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.side { right: 16px; top: 16px; padding: .5rem; text-align: center; }
#minimap { display: block; width: 180px; height: 180px; border-radius: 12px; }
.row-small { font-size: .75rem; color: var(--muted); margin-top: .3rem; } .row-small b { color: var(--text); }
.nav { left: 16px; top: 16px; display: flex; gap: .8rem; align-items: center; max-width: 22rem; }
.nav-arrow { font-size: 2rem; line-height: 1; color: var(--peach); }
.nav b { display: block; } .nav span { font-size: .85rem; color: var(--muted); } .nav small { display: block; color: var(--faint); }
.tip { position: absolute; z-index: 1; left: 50%; top: 22%; transform: translateX(-50%); max-width: min(34rem, 90vw); background: rgba(7, 13, 27, .8); border: 1px solid var(--peach); color: var(--text); border-radius: 999px; padding: .55rem 1.3rem; font-size: .95rem; text-align: center; }
.tip.good { border-color: var(--ok); }
@media (max-width: 640px) {
  #minimap { width: 110px; height: 110px; }
  .tip { top: auto; bottom: 150px; font-size: .85rem; border-radius: 14px; }
  .nav { max-width: 55vw; }
}
.hud-osm { position: absolute; right: 12px; bottom: 6px; margin: 0; font-size: .65rem; color: rgba(255, 255, 255, .6); text-shadow: 0 1px 2px #000; }
