/* Fontes embutidas (OFL) — sem elas o painel caía numa monoespaçada ilegível */
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/orbitron-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/orbitron-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 900; font-display: swap; src: url('/assets/fonts/orbitron-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/rajdhani-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/rajdhani-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/rajdhani-latin-700-normal.woff2') format('woff2'); }

/* ============================================================
   ZENITH AUTO OS — DASHBOARD v2 PREMIUM
   Moldura SVG inline, componentes modulares, animações futuristas
   ============================================================ */

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: 'Orbitron', 'Rajdhani', 'Segoe UI', sans-serif;
}

/* ---- Bezel Stage ---- */
.bezel-stage {
  --S: calc(max(100vw, 100vh) * 1.6); /* painel ampliado */
  position: fixed;
  top: 0; left: 50%;
  /* sem transform: um transform faria o .sim-dock (fixed) ficar relativo ao palco e sair da tela */
  margin-left: calc(var(--S) / -2);
  /* centro do LCD (38,5% da altura do palco) fica em 42% da altura da janela */
  margin-top: calc(42vh - 0.385 * var(--S));
  width: var(--S);
  height: var(--S);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- SVG Bezel (substitui foto CDN) ---- */
.bezel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ---- Cluster screen (painel LCD) ---- */
.cluster-screen {
  position: absolute;
  /* alinhado à janela do LCD da moldura SVG (viewBox 1000x1000: x225-775, y314-455) */
  left: 22.5%;
  top: 31.4%;
  width: 55%;
  height: 14.1%;
  overflow: hidden;
  border-radius: 2px;
  z-index: 15;
  background: #040810;
}

/* ---- Cluster SVG ---- */
.cluster-svg {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1; /* medidores por cima do visor central */
}

/* ---- Center Map Slot ---- */
.center-map-slot {
  position: absolute;
  /* visor central ATRÁS de tudo, com bordas que desaparecem (transparência) */
  /* menor e terminando acima da faixa de luzes de aviso (base do painel ~ 85% da altura) */
  left: 30%;
  top: 3%;
  width: 40%;
  height: 78%;
  z-index: auto; /* sem contexto próprio: 3D (z 0) fica sob os mostradores (z 1) e o HUD (z 10) sobre eles */
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  display: none;
}
.center-map-slot.visible { display: block; }
/* modos não-GPS (Mapas, Música, Auto, Computador, Trip, Speed): painel por cima dos mostradores,
   senão fica atrás do SVG (z 1) e o centro parece não mudar */
.center-map-slot.mode-panel { z-index: 16; box-shadow: 0 0 0 1px rgba(56,189,248,0.25), 0 0 24px rgba(0,0,0,0.6); }

/* center panes */
.center-pane { display: none; width: 100%; height: 100%; }
.center-pane.active { display: flex; flex-direction: column; }

/* ---- Blind Spot Warning — brilho suave por dentro da tela, só com veículo no ponto cego ---- */
.bsw-edge {
  position: absolute;
  top: 14%; bottom: 14%;
  width: 4.5%;
  pointer-events: none;
  z-index: 18;
  opacity: 0;
  transition: opacity .35s ease;
}
.bsw-edge.bsw-left  { left: 0;  background: radial-gradient(ellipse 100% 55% at 0% 50%, rgba(239,68,68,.55) 0%, rgba(239,68,68,.18) 45%, transparent 75%); }
.bsw-edge.bsw-right { right: 0; background: radial-gradient(ellipse 100% 55% at 100% 50%, rgba(239,68,68,.55) 0%, rgba(239,68,68,.18) 45%, transparent 75%); }
.bsw-edge.active { opacity: 1; animation: bsw-pulse .7s ease-in-out infinite alternate; }
@keyframes bsw-pulse { from { opacity: .55; } to { opacity: 1; } }

/* Tela recortada no formato exato da janela da moldura (cantos arredondados, laterais inclinadas) */
.cluster-screen { clip-path: url(#lcdClip); border-radius: 0; }

/* ---- Sim Dock ---- */
.sim-dock {
  width: max-content;
  max-width: 98vw;
  flex-wrap: wrap;
  justify-content: center;
  /* fixa na base da janela, abaixo do painel */
  position: fixed;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: rgba(10,15,25,0.92);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.sim-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 1rem;
  border: 1px solid rgba(99,102,241,0.4);
  background: rgba(30,30,60,0.6);
  color: #c7d2fe;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.sim-btn:hover { background: rgba(99,102,241,0.3); border-color: #818cf8; color: #fff; }
.sim-btn.active { background: rgba(99,102,241,0.5); border-color: #a5b4fc; color: #fff; }
.sim-slider { width: 80px; accent-color: #818cf8; }

/* ---- Template Nav ---- */
.template-nav {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.4rem;
  z-index: 100;
}
.tpl-btn {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(99,102,241,0.5);
  background: rgba(10,15,30,0.8);
  color: #818cf8;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.tpl-btn:hover { background: rgba(99,102,241,0.3); color: #fff; }
#tpl-label {
  display: flex; align-items: center;
  padding: 0 0.8rem;
  border-radius: 1rem;
  background: rgba(10,15,30,0.8);
  color: #818cf8;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 1px solid rgba(99,102,241,0.3);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

/* ============================================================
   SVG ELEMENT STYLES
   ============================================================ */

/* Tell-tales: off state = dim, on state = bright + glow */
.tell-tale { transition: opacity 0.15s, filter 0.15s; }
.tell-tale.is-off { opacity: 0.18; filter: none; }
.tell-tale.is-on  { opacity: 1; }
.tell-tale.is-on.warn-red    { filter: drop-shadow(0 0 6px rgba(239,68,68,0.9)); }
.tell-tale.is-on.warn-amber  { filter: drop-shadow(0 0 6px rgba(245,158,11,0.9)); }
.tell-tale.is-on.warn-blue   { filter: drop-shadow(0 0 6px rgba(59,130,246,0.9)); }
.tell-tale.is-on.warn-green  { filter: drop-shadow(0 0 6px rgba(34,197,94,0.9)); }
.tell-tale.is-on.warn-cyan   { filter: drop-shadow(0 0 6px rgba(6,182,212,0.9)); }
.tell-tale.is-blink           { animation: dash-blink 0.42s step-end infinite; }

@keyframes dash-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.1; }
}

/* Needle motion — smooth via CSS transition on transform */
/* JS já gira em torno do pivô via rotate(deg,cx,cy): origem deve ser 0 0 */
.needle-group { transform-origin: 0 0; transform-box: view-box; }
.needle-line  { transition: none; } /* driven by rAF */

/* Needle trail arc — comet/gradient glow behind needle */
.needle-trail-arc {
  pointer-events: none;
  filter: blur(1.5px);
  transition: opacity 0.25s ease;
}

/* Arc segments, rings, dial backgrounds */
.dial-ring     { pointer-events: none; }
.dial-segment  { transition: d 0.05s linear; } /* smooth arc sweep */

/* Glow arcs */
.arc-glow-red   { filter: drop-shadow(0 0 4px rgba(239,68,68,0.8)); }
.arc-glow-cyan  { filter: drop-shadow(0 0 4px rgba(6,182,212,0.8)); }
.arc-glow-green { filter: drop-shadow(0 0 4px rgba(34,197,94,0.8)); }
.arc-glow-amber { filter: drop-shadow(0 0 4px rgba(245,158,11,0.8)); }

/* Redline zone pulse */
.redline-zone { animation: redzone-pulse 1s ease-in-out infinite alternate; }
@keyframes redzone-pulse {
  from { opacity: 0.6; }
  to   { opacity: 1; filter: drop-shadow(0 0 8px rgba(239,68,68,0.9)); }
}

/* Startup sweep ring */
.sweep-ring {
  animation: sweep-expand 1.6s cubic-bezier(0.22,1,0.36,1) forwards;
  transform-origin: center;
}
@keyframes sweep-expand {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 0; transform: scale(1.4); }
}

/* Speed/RPM digital readout */
.digit-readout { font-variant-numeric: tabular-nums; }

/* Holographic ring pulse */
.holo-ring {
  animation: holo-spin 8s linear infinite;
  transform-origin: 500px 192px;
}
@keyframes holo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Auto-drive pulse */
.auto-pulse-ring {
  animation: auto-pulse-ring 1.4s ease-out infinite;
  transform-origin: center;
}
@keyframes auto-pulse-ring {
  0%   { opacity: 0.9; transform: scale(0.95); }
  100% { opacity: 0;   transform: scale(1.3);  }
}

/* Tick marks appear animation on template switch */
.tick-appear {
  animation: tick-fade-in 0.4s ease-out both;
}
@keyframes tick-fade-in {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}

/* Speed number update flash */
.speed-flash { animation: spd-flash 0.12s ease-out; }
@keyframes spd-flash {
  0%   { fill: #ffffff; }
  100% { fill: inherit; }
}

/* ============================================================
   DASH-TEXT clickable elements
   ============================================================ */
.dash-text-btn {
  cursor: pointer;
  user-select: none;
}
.dash-text-btn:hover { opacity: 0.8; }

/* ============================================================
   CENTER PANELS
   ============================================================ */
.gps-view, .maps-view, .music-view, .auto-view {
  width: 100%; height: 100%;
  position: relative;
  overflow: hidden;
}

/* Music panel */
.music-view {
  background: #05080f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  gap: 0.4rem;
}
.sp-cover {
  width: 3.5rem; height: 3.5rem;
  border-radius: 0.4rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.sp-title  { color: #f8fafc; font-size: 0.75rem; font-weight: 700; text-align: center; }
.sp-artist { color: #94a3b8; font-size: 0.6rem; text-align: center; }
.sp-album  { color: #475569; font-size: 0.55rem; text-align: center; }
.sp-time   { color: #94a3b8; font-size: 0.6rem; display: flex; gap: 0.3rem; }
.sp-bar    { width: 90%; height: 3px; background: #1e293b; border-radius: 2px; }
.sp-bar-fill { height: 100%; background: linear-gradient(to right, #6366f1, #a78bfa); border-radius: 2px; transition: width 0.5s linear; }
.sp-controls { display: flex; gap: 0.6rem; }
.sp-btn { background: none; border: none; color: #818cf8; font-size: 1rem; cursor: pointer; padding: 0.1rem; }
.sp-eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.sp-eq-bar { width: 3px; border-radius: 1px; background: #6366f1; animation: sp-eq 0.6s ease-in-out infinite alternate; }
.sp-eq-bar:nth-child(2) { animation-delay: 0.2s; }
.sp-eq-bar:nth-child(3) { animation-delay: 0.4s; }
@keyframes sp-eq {
  from { height: 4px;  opacity: 0.6; }
  to   { height: 14px; opacity: 1;   }
}

/* Auto mode panel */
.auto-view {
  background: #030810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #22d3ee;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  gap: 0.3rem;
}
.auto-view svg { width: 60%; max-width: 160px; }

/* GTA Minimap */
#center-gps-view #center-gta-minimap {
  position: absolute;
  bottom: 0.4rem; right: 0.4rem;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(56,189,248,0.4);
  opacity: 0.85;
  pointer-events: none;
}

/* ============================================================
   BEZEL SVG INLINE — metallic car cluster frame
   ============================================================ */
/* gradient stops and filter definitions are inline in SVG */

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* cluster-screen segue a moldura SVG em qualquer proporção (stage é quadrado) */

/* ── Computador de Bordo ───────────────────────────────────────────────── */
.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px;
  width: 100%;
  align-content: center;
}
.board-cell {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.board-lbl {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.board-val {
  font-family: 'Orbitron', monospace;
  font-size: 26px;
  font-weight: 800;
  color: #06b6d4;
  line-height: 1;
}
.board-unit {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #475569;
}

/* ── Trip Computer ─────────────────────────────────────────────────────── */
.trip-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px;
  width: 100%;
}
.trip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
}
.trip-lbl {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}
.trip-val {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 800;
  color: #22c55e;
  margin: 0 6px 0 auto;
}
.trip-unit {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: #475569;
  min-width: 32px;
  text-align: right;
}
.trip-reset-btn {
  margin: 8px auto 0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #ef4444;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 20px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s, border-color 0.2s;
}
.trip-reset-btn:hover { background: #1e293b; border-color: #ef4444; }

/* ── Speed Digital View ────────────────────────────────────────────────── */
#center-speed-view { background: #040810; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.speed-digital-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
}
.speed-digital-num {
  font-family: 'Orbitron', monospace;
  font-size: 96px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 32px #06b6d4aa, 0 0 8px #06b6d466;
  min-width: 3ch;
  text-align: center;
  transition: color 0.3s;
}
.speed-digital-unit {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  color: #64748b;
  letter-spacing: 0.15em;
  font-weight: 700;
  margin-top: -8px;
}
.speed-scale-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.spd-scale-btn {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  color: #64748b;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.spd-scale-btn.active { background: #0e4a6a; border-color: #06b6d4; color: #06b6d4; }
.spd-scale-btn:hover:not(.active) { border-color: #475569; color: #94a3b8; }
.speed-bar-wrap { width: 100%; margin-top: 6px; }
.speed-bar-track {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}
.speed-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4, #22d3ee);
  border-radius: 4px;
  transition: width 0.08s linear;
}
.speed-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #334155;
}

/* ── GPS HUD Overlay ───────────────────────────────────────────────────── */
.gps-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* texto da manobra embaixo, para não cobrir a seta 3D no meio da pista */
  /* conteúdo só na coluna livre entre os dois mostradores, abaixo de marcha/hora */
  padding: 23% 34% 3%;
  z-index: 10;
}
.gps-hud-top {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}
.gps-maneuver {
  /* sem caixa: seta grande no topo, translúcida; distância e rua logo abaixo */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
}
.gps-arrow {
  display: none; /* seta agora é 3D na cena */
  font-size: 54px;
  line-height: 1;
  color: rgba(34, 211, 238, 0.78);
  text-shadow: 0 0 14px rgba(6, 182, 212, 0.65), 0 2px 6px rgba(0, 0, 0, 0.7);
  min-width: 0;
  text-align: center;
  transition: color 0.3s, transform 0.3s;
}
.gps-maneuver-info { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.gps-dist {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 800;
  color: rgba(248, 250, 252, 0.92);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}
.gps-street {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  line-height: 1.15;
  color: rgba(203, 213, 225, 0.88);
  font-weight: 600;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.gps-hud-top .gps-signal { position: absolute; top: 28%; left: 50%; transform: translateX(-50%); font-size: 9px; padding: 0; }
.gps-signal {
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(4, 12, 24, 0.75);
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  transition: color 0.3s;
}
.gps-signal.green { color: #22c55e; }
.gps-signal.yellow { color: #f59e0b; }
.gps-signal.red { color: #ef4444; }
.gps-hud-bottom { display: flex; flex-direction: column; gap: 4px; }
.gps-route-bar {
  width: 100%;
  height: 5px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 3px;
  overflow: hidden;
}
.gps-route-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.gps-route-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #475569;
}


/* ---- Dock de controles: tudo na horizontal ---- */
.sim-dock-extras {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.modes-wrap { display: flex; flex-flow: row nowrap; align-items: center; gap: 0.4rem; }
.modes-menu { display: flex; flex-flow: row nowrap; align-items: center; gap: 0.35rem; }
.modes-item {
  padding: 0.3rem 0.7rem;
  border-radius: 1rem;
  border: 1px solid rgba(6,182,212,0.4);
  background: rgba(15,30,50,0.6);
  color: #a5f3fc;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.modes-item:hover { background: rgba(6,182,212,0.25); border-color: #22d3ee; color: #fff; }
.modes-item.active { background: rgba(6,182,212,0.45); border-color: #67e8f9; color: #fff; }
.sim-range-wrap { display: inline-flex; align-items: center; gap: 0.35rem; color: #c7d2fe; font-size: 0.7rem; font-weight: 700; }
.sim-range { width: 90px; accent-color: #818cf8; }
a.sim-btn { text-decoration: none; display: inline-block; }
.sim-dock .sim-btn { white-space: nowrap; }

/* telas estreitas: permite quebrar em mais de uma linha */
@media (max-width: 1300px) {
  .sim-dock-extras, .modes-menu { flex-wrap: wrap; }
}

/* ---- Visor central: painéis de modo e cena 3D ---- */
.center-mode-pane { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.center-mode-pane.active { display: block; }
.center-mode-pane:not(#center-gps-view) { background: #060d1a; border-radius: 4px; overflow: auto; }
#center-maps-view #center-gta-minimap { display: block; width: 100%; height: 100%; object-fit: cover; }
/* cena 3D atrás de tudo, com bordas transparentes; o HUD (.gps-hud) fica por cima, sem máscara
   A borda de baixo sobe até a "linha azul" (~73,4% da tela) — a faixa livre abaixo abriga o
   velocímetro digital de números grandes. */
#center-gps-3d {
  position: absolute; inset: 0 0 9.7% 0; z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 38%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 38%, transparent 100%);
}
#center-gps-3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* ---- Velocímetro digital (números grandes) na faixa sob o mapa 3D ---- */
.map-speedo {
  position: absolute;
  left: 30%;
  width: 40%;
  top: 73%;
  height: 17.8%;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--S) * 0.0015);
  text-align: center;
  pointer-events: none;
}
.map-speedo.on { display: flex; }
.map-speedo-num {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: calc(var(--S) * 0.141 * 0.135);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: #eafcff;
  text-shadow:
    0 0 calc(var(--S) * 0.004) rgba(0, 240, 255, 0.55),
    0 0 calc(var(--S) * 0.012) rgba(56, 189, 248, 0.40);
}
.map-speedo-unit {
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: calc(var(--S) * 0.141 * 0.038);
  line-height: 1;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: #7dd3fc;
}

/* só a seta 3D na cena: sem textos de distância/rua/semáforo no HUD */
.gps-hud { display: none !important; }

/* ---- Dropdown Horário (skyTime) ---- */
.sky-wrap { display: inline-flex; align-items: center; gap: 0; }
.sky-label { cursor: default; border-right: none; border-radius: 6px 0 0 6px; }
.sky-select {
  appearance: none; -webkit-appearance: none;
  background: rgba(30,27,75,0.85);
  color: #c7d2fe; border: 1px solid #4f46e5;
  border-left: none; border-radius: 0 6px 6px 0;
  padding: 0.3rem 0.5rem; font-size: 0.72rem; font-weight: 700;
  cursor: pointer; outline: none; white-space: nowrap;
}
.sky-select:hover { background: rgba(99,102,241,0.3); border-color: #818cf8; color: #fff; }
.sky-select option { background: #0f172a; color: #c7d2fe; }

/* ============================================================
   TOOLTIP (funciona em SVG e HTML) — injetado por JS
   ============================================================ */

/* Estados das luzes de aviso (telltales) */
.tell-tale.is-on .tt-bg { opacity: 1 !important; }
.tell-tale.is-on .tt-icon { opacity: 1 !important; }
.tell-tale.is-blink { animation: tt-blink .55s infinite alternate; }
@keyframes tt-blink { from { opacity: .45; } to { opacity: 1; } }
.tell-tale.warn-low { color: #ef4444; }


/* ===== Painel de Medidores (marrom) — lado direito superior ===== */
.gauges-info-panel {
  position: fixed; right: 18px; top: 18px;
  width: 260px; max-width: 32vw;
  background: #1a120c; border: 1px solid #7c3a12; border-radius: 10px;
  padding: 12px 14px; color: #f8fafc; font-family: Orbitron, monospace; font-size: 11px;
  box-shadow: 0 0 30px rgba(0,0,0,0.9), 0 0 0 1px rgba(124,58,18,0.25);
  z-index: 44; pointer-events: none;
  display: flex; flex-direction: column; gap: 8px;
}
.gauges-title {
  font-size: 9px; letter-spacing: .16em; color: #f59e0b; margin-bottom: 4px;
  text-transform: uppercase; text-align: center; border-bottom: 1px solid #7c3a12; padding-bottom: 4px;
}
.gauge-row {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.gauge-item {
  display: flex; flex-direction: column; gap: 2px;
}
.gauge-label {
  font-size: 8px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em;
}
.gauge-bar {
  height: 5px; background: #0d1b2e; border-radius: 2px; overflow: hidden; border: 1px solid #1e3a52;
}
.gauge-fill {
  height: 100%; border-radius: 2px; transition: width .5s ease;
}
.gauge-val {
  font-size: 10px; font-weight: 800; color: #f8fafc; text-align: right;
}

/* ===== Painel GPS (lado direito, espaço todo vertical) ===== */
.gps-info-panel {
  position: fixed; right: 18px; top: 330px;
  width: 260px; max-width: 32vw;
  background: #070b12; border: 1px solid #1e3a52; border-radius: 10px;
  padding: 12px 14px; color: #c7d2fe; font-family: Orbitron, monospace; font-size: 11px;
  box-shadow: 0 0 30px rgba(0,0,0,0.9), 0 0 0 1px rgba(6,182,212,0.15);
  z-index: 45; pointer-events: none;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  bottom: 18px; /* ocupa espaço todo vertical */
}
.gps-title { font-size: 9px; letter-spacing: .16em; color: #38bdf8; margin-bottom: 4px; text-transform: uppercase; text-align: center; }
.gps-arrow { font-size: 42px; color: #f59e0b; line-height: 1; margin: 2px 0 6px; filter: drop-shadow(0 0 6px rgba(245,158,11,0.4)); }
.gps-street { font-size: 15px; font-weight: 800; color: #f8fafc; margin: 0; text-align: center; }
.gps-action { font-size: 11px; font-weight: 700; color: #22c55e; margin: 2px 0 8px; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.gps-next-list { width: 100%; display: flex; flex-direction: column; gap: 3px; align-items: center; margin-bottom: 6px; }
.gps-next-item { font-size: 9.5px; color: #94a3b8; margin: 0; text-align: center; line-height: 1.3; padding: 2px 6px; border-radius: 4px; background: rgba(15,23,35,0.4); border: 1px solid rgba(6,182,212,0.15); width: 100%; }
.gps-next-item:hover { background: rgba(6,182,212,0.12); border-color: #38bdf8; }
.gps-eta { font-size: 10px; color: #22c55e; font-weight: 800; margin: 2px 0 6px; text-align: center; }
.gps-bar { width: 100%; height: 6px; background: #0d1b2e; border-radius: 3px; overflow: hidden; margin-top: 6px; border: 1px solid #1e3a52; }
.gps-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #06b6d4); border-radius: 3px; transition: width .6s ease; }
.gps-hint { font-size: 8px; color: #475569; margin-top: 6px; text-align: center; cursor: default; }

/* Botão SPORT e controles */
.dash-btn { cursor: pointer; }
.dash-btn:hover { filter: brightness(1.25); }

/* G-meter discreto no conta-giro */
#t1-gmeter { opacity: 0.85; pointer-events: none; }
#t1-g-dot { transition: cx .15s linear, cy .15s linear, fill .2s ease; }

/* Área variável (Spotify / chamada) */
#t1-var-bg { transition: stroke .3s ease; }


/* ============================================================
   CONTROLES DE SIMULAÇÃO — volante (roxo), pedais (azul), atalhos (laranja)
   ============================================================ */
.sim-ctrl { position: fixed; bottom: 70px; z-index: 40; font-family: 'Orbitron', monospace; user-select: none; }
.sim-ctrl-left { left: 7vw; display: flex; align-items: flex-end; gap: 26px; }
.sim-wheel-box, .sim-pedal-box, .sim-pedal-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
#sim-wheel { width: 108px; height: 108px; cursor: grab; touch-action: none; transition: transform .05s linear;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.45)); }
#sim-wheel:active { cursor: grabbing; }
#sim-horn { cursor: pointer; transition: fill .1s; }
#sim-horn.on { fill: #f59e0b; filter: drop-shadow(0 0 8px #f59e0b); }
.sim-legend { font-size: 8.5px; color: #94a3b8; letter-spacing: .05em; text-align: center; white-space: nowrap; line-height: 1.4; }
.sim-legend b { color: #f59e0b; }
.sim-pedals { display: flex; gap: 14px; align-items: flex-end; }
.sim-pedal { position: relative; border-radius: 7px; overflow: hidden; cursor: pointer; touch-action: none;
  background: linear-gradient(#1e293b, #0b1220); border: 1px solid #334155; transform-origin: 50% 100%;
  transition: transform .06s, box-shadow .1s, border-color .1s; }
.sim-pedal::before { content: ""; position: absolute; inset: 6px; border-radius: 3px; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(148,163,184,.28) 0 2px, transparent 2px 7px); }
.sim-pedal .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; opacity: .55; }
.sim-pedal.brk { width: 52px; height: 46px; }
.sim-pedal.brk .fill { background: linear-gradient(to top, #ef4444, #fca5a5); }
.sim-pedal.acc { width: 32px; height: 72px; }
.sim-pedal.acc .fill { background: linear-gradient(to top, #22c55e, #86efac); }
.sim-pedal.pressed { transform: perspective(220px) rotateX(20deg) scaleY(.93); }
.sim-pedal.brk.pressed { border-color: #ef4444; box-shadow: 0 0 14px rgba(239,68,68,.8); }
.sim-pedal.acc.pressed { border-color: #22c55e; box-shadow: 0 0 14px rgba(34,197,94,.8); }
.sim-mode { font-size: 8.5px; font-weight: 700; padding: 3px 8px; border-radius: 5px; color: #38bdf8;
  border: 1px solid rgba(56,189,248,.5); background: rgba(2,8,18,.8); white-space: nowrap; }
.sim-mode.manual { color: #f59e0b; border-color: rgba(245,158,11,.65); }

.sim-keys { right: 2vw; width: 38vw; max-width: 660px; background: rgba(2,8,18,.86); border: 1px solid #1e3a5f;
  border-radius: 10px; padding: 8px 12px 10px; }
.sim-keys-title { display: flex; justify-content: space-between; gap: 10px; color: #38bdf8; font-weight: 700;
  font-size: 9.5px; letter-spacing: .08em; border-bottom: 1px solid #1e3a5f; padding-bottom: 4px; margin-bottom: 6px; }
.sim-keys-title span:last-child { color: #64748b; font-weight: 600; letter-spacing: .03em; }
.sim-keys-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 12px; }
.sim-key { display: flex; align-items: center; gap: 6px; font-size: 8.5px; color: #cbd5e1; white-space: nowrap; overflow: hidden; }
.sim-key kbd { flex: 0 0 auto; min-width: 46px; text-align: center; font-family: inherit; font-size: 8px; font-weight: 700;
  color: #f59e0b; background: #0b1220; border: 1px solid #334155; border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px;
  transition: background .1s, color .1s; }
.sim-key.flash kbd { background: #f59e0b; color: #0b1220; }
/* Só em telas realmente pequenas (celular) os controles encolhem — no resto ficam no lugar original */
@media (max-width: 760px), (max-height: 460px) {
  .sim-ctrl { bottom: 56px; }
  .sim-ctrl-left { left: 1.5vw; transform: scale(.62); transform-origin: left bottom; }
  .sim-keys { right: 1.5vw; transform: scale(.62); transform-origin: right bottom; }
}

/* Chamada recebida: anel pulsando em volta da foto */
#t1-call-ring.ringing { animation: callRing 1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes callRing { 0% { opacity: 1; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }

/* Alertas da simulação (colisão, sinal vermelho, estacionado...) */
.sim-alert { position: fixed; top: 9vh; left: 50%; transform: translate(-50%, -10px); z-index: 60; opacity: 0; pointer-events: none;
  font-family: 'Orbitron', monospace; font-weight: 900; font-size: 13px; letter-spacing: .08em; padding: 8px 18px; border-radius: 8px;
  background: rgba(2,8,18,.9); border: 1px solid #38bdf8; color: #38bdf8; transition: opacity .2s, transform .2s; }
.sim-alert.show { opacity: 1; transform: translate(-50%, 0); }
.sim-alert.crash { color: #fecaca; border-color: #ef4444; background: rgba(69,10,10,.92); box-shadow: 0 0 24px rgba(239,68,68,.6); }
.sim-alert.warn { color: #fde68a; border-color: #f59e0b; }
.sim-alert.ok { color: #bbf7d0; border-color: #22c55e; box-shadow: 0 0 20px rgba(34,197,94,.45); }

/* Câmbio automático (área laranja) */
.sim-shifter-col, .sim-hb-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sim-shifter { display: flex; gap: 6px; padding: 6px 8px; border-radius: 10px; background: linear-gradient(#111827, #05080f);
  border: 1px solid #334155; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.sim-gate { display: flex; flex-direction: column; }
.sim-gate button { width: 22px; height: 21px; border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 900; color: #475569; }
.sim-gate button:hover { color: #cbd5e1; }
.sim-gate button.active[data-gear="P"] { color: #ef4444; text-shadow: 0 0 8px #ef4444; }
.sim-gate button.active[data-gear="R"] { color: #f59e0b; text-shadow: 0 0 8px #f59e0b; }
.sim-gate button.active[data-gear="N"] { color: #e2e8f0; }
.sim-gate button.active[data-gear="D"] { color: #22c55e; text-shadow: 0 0 8px #22c55e; }
.sim-slot { position: relative; width: 26px; height: 84px; border-radius: 13px; background: #020409;
  border: 1px solid #1e293b; box-shadow: inset 0 0 8px rgba(0,0,0,.9); }
.sim-knob { position: absolute; left: -4px; width: 32px; height: 21px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: #0b1220;
  background: linear-gradient(#e2e8f0, #64748b); box-shadow: 0 3px 8px rgba(0,0,0,.7), 0 0 10px rgba(56,189,248,.35);
  transition: top .18s cubic-bezier(.3,1.5,.6,1); }
.sim-knob[data-gear="P"] { box-shadow: 0 3px 8px rgba(0,0,0,.7), 0 0 12px rgba(239,68,68,.8); }
.sim-knob[data-gear="R"] { box-shadow: 0 3px 8px rgba(0,0,0,.7), 0 0 12px rgba(245,158,11,.85); }
.sim-knob[data-gear="D"] { box-shadow: 0 3px 8px rgba(0,0,0,.7), 0 0 12px rgba(34,197,94,.8); }

/* Freio de mão (área rosa) */
.sim-handbrake { position: relative; width: 46px; height: 96px; cursor: pointer; }
.sim-handbrake .hb-base { position: absolute; left: 4px; right: 4px; bottom: 0; height: 16px; border-radius: 6px;
  background: linear-gradient(#1e293b, #0b1220); border: 1px solid #334155; }
.sim-handbrake .hb-lever { position: absolute; left: 50%; bottom: 8px; width: 14px; height: 78px; margin-left: -7px;
  border-radius: 7px; background: linear-gradient(90deg, #334155, #64748b 45%, #1e293b); transform-origin: 50% 100%;
  transform: rotate(38deg); transition: transform .2s cubic-bezier(.3,1.4,.6,1); }
.sim-handbrake .hb-grip { position: absolute; top: 0; left: -3px; width: 20px; height: 34px; border-radius: 9px;
  background: linear-gradient(90deg, #0f172a, #1f2937); border: 1px solid #475569; display: flex; align-items: center; justify-content: center; }
.sim-handbrake .hb-grip span { font-size: 7px; font-weight: 900; color: #475569; writing-mode: vertical-rl; }
.sim-handbrake.on .hb-lever { transform: rotate(4deg); }
.sim-handbrake.on .hb-grip { border-color: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,.75); }
.sim-handbrake.on .hb-grip span { color: #ef4444; }


/* ============================================================
   MODO SPORT — preto carbono, vermelho vivo, conta-giros amarelo
   (inspiração: Porsche Turbo S, Audi TT Sport, clusters de LED vermelho)
   ============================================================ */
html:has(body.sport-theme), body.sport-theme { background: radial-gradient(ellipse at 50% 38%, #17171b 0%, #08080a 55%, #000 100%) !important; }
.sport-theme .cluster-screen { background: #050506; box-shadow: inset 0 0 46px rgba(220,38,38,.22); }
.sport-theme .cluster-screen::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 30; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #dc2626 20%, #ff6a00 50%, #dc2626 80%, transparent 100%);
  box-shadow: 0 0 12px 2px rgba(239,68,68,.75);
}
.sport-theme .cluster-screen { animation: sportIgnite .75s ease-out; }
@keyframes sportIgnite {
  0% { filter: brightness(2.4) saturate(1.8); }
  35% { filter: brightness(.6); }
  100% { filter: none; }
}

/* transições suaves entre Normal e Sport */
.dial-bg, .dial-bg-inner, .ticks-group line, .ticks-group text, .dial-arc-bg, .dial-arc-fill, .redline-arc,
.needle-shaft, .needle-trail, .needle-pivot, #t1-var-bg, #t1-medidores > rect, #t1-gps-panel > rect {
  transition: fill .45s ease, stroke .45s ease, stroke-width .45s ease;
}

/* --- Aro externo dos dois mostradores: anel vermelho brilhante --- */
.sport-theme .dial-bg { stroke: #ef4444; stroke-width: 2.5; filter: url(#fGlowSportRed); }

/* --- CONTA-GIROS: mostrador amarelo (Porsche), números/traços pretos, faixa vermelha cheia --- */
.sport-theme #t1-rpm-bg .dial-bg-inner { fill: url(#gSportYellowFace); stroke: #111113; stroke-width: 9; }
.sport-theme #t1-rpm-ticks line { stroke: #0a0a0a; }
.sport-theme #t1-rpm-ticks text { fill: #0a0a0a; font-weight: 900; }
.sport-theme #t1-rpm-ticks line[stroke="#ef4444"] { stroke: #7f1d1d; }
.sport-theme #t1-rpm-ticks text[fill="#ef4444"] { fill: #991b1b; }
.sport-theme #t1-rpm-redline-arc { stroke: #dc2626; stroke-width: 22; stroke-linecap: butt; opacity: .92; }
.sport-theme #t1-rpm-arc-bg { stroke: rgba(0,0,0,.22); stroke-width: 7; }
.sport-theme #t1-rpm-arc-fill { stroke: url(#gSportRpmArc); stroke-width: 7; filter: none; }
.sport-theme #t1-rpm-unit { fill: #1c1917; font-weight: 900; }
.sport-theme #t1-gmeter line, .sport-theme #t1-gmeter circle:not([id]) { stroke: rgba(0,0,0,.28); }
.sport-theme #t1-g-label { fill: rgba(0,0,0,.35); }
.sport-theme #t1-gval-x, .sport-theme #t1-gval-y { fill: #292524; }
.sport-theme #t1-range-km { fill: #0a0a0a; }
.sport-theme #t1-fuel-center rect:first-child { fill: rgba(0,0,0,.35); }
.sport-theme #t1-fuel-bar-center { fill: #0a0a0a; }

/* --- VELOCÍMETRO: fundo carbono, traços vermelhos acesos, números brancos, arco verde→amarelo→vermelho --- */
.sport-theme #t1-spd-bg .dial-bg-inner { fill: url(#gSportCarbon); stroke: #111113; stroke-width: 9; }
.sport-theme #t1-spd-ticks line { stroke: #ff2d2d; filter: url(#fGlowSportRed); }
.sport-theme #t1-spd-ticks text { fill: #fafafa; font-weight: 900; }
.sport-theme #t1-spd-arc-bg { stroke: #1a0505; stroke-width: 8; }
.sport-theme #t1-spd-arc-fill { stroke: url(#gSportSpeedArc); stroke-width: 8; filter: url(#fGlowSportOrange); }
.sport-theme #t1-odo-bg { stroke: #ef4444; fill: #0a0a0a; }
.sport-theme #t1-spd-unit { fill: #ef4444; }

/* --- Ponteiros vermelhos com brilho, pivô preto com aro vermelho --- */
.sport-theme .needle-shaft { fill: #ff1f1f; filter: url(#fGlowSportRed); }
.sport-theme .needle-trail { stroke: #ff1f1f; }
.sport-theme .needle-pivot { fill: #0a0a0a; stroke: #ef4444; stroke-width: 2.5; }

/* --- Linhas decorativas: luz vermelha correndo --- */
.sport-theme #t1-decor-left path, .sport-theme #t1-decor-right path {
  stroke: #ef4444; stroke-width: 2; stroke-dasharray: 60 520; filter: url(#fGlowSportRed);
  animation: sportChase 2.2s linear infinite;
}
@keyframes sportChase { from { stroke-dashoffset: 580; } to { stroke-dashoffset: 0; } }

/* --- Painéis (música, medidores, GPS): preto com contorno vermelho --- */
.sport-theme #t1-var-bg, .sport-theme #t1-gps-panel > rect:first-child {
  fill: #0a0a0c; stroke: rgba(239,68,68,.65); stroke-width: 1.4;
}
.sport-theme #t1-var-title, .sport-theme #t1-gps-panel > text:first-of-type { fill: #ef4444; }
.sport-theme #t1-gps-panel > line, .sport-theme #t1-left-panel > line { stroke: rgba(239,68,68,.35); }
.sport-theme #t1-spot-prog, .sport-theme #t1-gps-fill { fill: #ef4444; }

/* --- Marcha --- */
.sport-theme #t1-gear rect { filter: url(#fGlowSportRed); stroke-width: 3.5; }

/* --- Ponto cego no sport: vermelho mais intenso --- */

/* --- Controles da simulação no sport --- */
.sport-theme #sim-wheel { filter: drop-shadow(0 0 9px rgba(239,68,68,.6)); }
.sport-theme #sim-wheel circle[stroke="#38bdf8"] { stroke: #ef4444; }
.sport-theme #sim-wheel text { fill: #ef4444; }
.sport-theme .sim-keys { border-color: rgba(239,68,68,.5); }
.sport-theme .sim-keys-title { color: #ef4444; border-color: rgba(239,68,68,.35); }
.sport-theme .sim-key kbd { color: #facc15; }

.sport-theme .needle-trail-arc { stroke: #ff2d2d; }
.sport-theme #t1-spd-ticks text { paint-order: stroke; stroke: #0b0b0d; stroke-width: 3px; }

/* ============================================================
   LEGIBILIDADE — controles e atalhos em Rajdhani (nítida em tamanho pequeno)
   ============================================================ */
.cluster-svg text { text-rendering: geometricPrecision; }
.sim-legend { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 12px; font-weight: 600; color: #a3b1c2; letter-spacing: .03em; }
.sim-legend b { font-weight: 700; }
.sim-mode { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sim-keys-title { font-family: 'Orbitron', sans-serif; font-size: 10.5px; }
.sim-keys-title span:last-child { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 12px; font-weight: 600; text-transform: none; }
.sim-key { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 12.5px; font-weight: 600; color: #d6dee8; gap: 8px; }
.sim-key kbd { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 11.5px; font-weight: 700; min-width: 52px; padding: 1px 5px; }
.sim-keys-grid { gap: 4px 14px; }
.sim-gate button { font-family: 'Orbitron', sans-serif; font-size: 12px; }
.sim-knob { font-family: 'Orbitron', sans-serif; font-size: 12px; }
.sim-alert { font-family: 'Orbitron', sans-serif; }

/* G FORCE e mini mostradores no Sport */
.sport-theme #t1-g-label { fill: #7f1d1d; }
.sport-theme #t1-minigauges .mg-tick { stroke: #ff2d2d; }
.sport-theme #t1-minigauges .mg-needle path { fill: #ff1f1f; filter: url(#fGlowSportRed); }
.sport-theme #t1-minigauges .mg-pivot { stroke: #ef4444; fill: #0a0a0a; }
.sport-theme #t1-minigauges .mg-title { fill: #ef4444; }
.sport-theme #t1-minigauges .mg-band[stroke="#e2e8f0"] { stroke: #3f3f46; }

/* Luz de reserva de combustível: apagada, acesa (âmbar) e piscando após 5 km na reserva */
.mg-reserve { opacity: .28; transition: opacity .25s; }
.mg-reserve path, .mg-reserve line { stroke: #64748b; }
.mg-reserve.on { opacity: 1; filter: drop-shadow(0 0 4px #f59e0b); }
.mg-reserve.on path, .mg-reserve.on line { stroke: #f59e0b; }
.reserve-blink { animation: reserveBlink .9s steps(2, jump-none) infinite; }
@keyframes reserveBlink { 0% { opacity: 1; } 100% { opacity: .12; } }

/* Toque: tudo que é controle tem área de toque e não rola/dá zoom a página */
.sim-ctrl, .sim-ctrl * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#sim-wheel, .sim-pedal, .sim-knob, .sim-slot { touch-action: none; }
.sim-handbrake, .sim-gate button, .sim-key { touch-action: manipulation; }
.sim-key { cursor: pointer; border-radius: 5px; padding: 2px 3px; margin: -2px -3px; transition: background .12s; }
.sim-key:hover { background: rgba(56,189,248,.08); }
.sim-key.pressed { background: rgba(245,158,11,.18); }
.sim-key.pressed kbd { background: #f59e0b; color: #0b1220; }
.sim-knob.dragging { transition: none; cursor: grabbing; transform: scale(1.08); }
@media (pointer: coarse) {
  .sim-key { padding: 4px 4px; margin: -1px -2px; }
  .sim-gate button { width: 26px; height: 21px; }
}

/* Atalhos mais baixos: 4 colunas (o encaixe na tela é feito por fitSimOverlay) */
.sim-keys { width: 46vw; max-width: 760px; padding: 6px 10px 8px; }
.sim-keys-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 2px 12px; }
.sim-key { font-size: 12px; }
.sim-key kbd { min-width: 42px; }
.sim-keys-title { margin-bottom: 4px; padding-bottom: 3px; }

/* Barra de configurações compacta: cabe inteira na janela (sem cortar nas pontas) */
.sim-dock { max-width: calc(100vw - 12px); padding: .3rem .55rem; gap: .3rem; }
.sim-dock-extras { gap: .3rem; }
.sim-dock .sim-btn, .sim-dock .modes-item, .sim-dock .sky-select, .sim-dock .sim-range-wrap {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.sim-dock .sim-btn, .sim-dock .modes-item { padding: .22rem .55rem; }
.sim-dock .sim-range { width: 62px; }
.sim-dock .sim-dock-extras, .sim-dock .modes-menu { flex-wrap: wrap; row-gap: .25rem; }
.sim-dock .sim-btn, .sim-dock .modes-item { padding: .18rem .45rem; font-size: 12.5px; }
.sim-dock { gap: .22rem; }
.sim-dock .sim-dock-extras { gap: .22rem; }

/* Câmbio P R N D 2 L */
.sim-slot { height: 126px; }
.sim-gate button.active[data-gear="2"], .sim-gate button.active[data-gear="L"] { color: #a3e635; text-shadow: 0 0 8px #a3e635; }
.sim-knob[data-gear="2"], .sim-knob[data-gear="L"] { box-shadow: 0 3px 8px rgba(0,0,0,.7), 0 0 12px rgba(163,230,53,.8); }

#t1-mute { cursor: pointer; }
#t1-mute:hover .mute-ring { opacity: 1; }

/* Freio de estacionamento por pedal (Lexus ES300): pedal pequeno com frisos */
.sim-parkpedal { position: relative; width: 40px; height: 74px; cursor: pointer; touch-action: manipulation; }
.sim-parkpedal .pp-arm { position: absolute; left: 50%; top: 0; width: 6px; height: 40px; margin-left: -3px; border-radius: 3px;
  background: linear-gradient(90deg, #1e293b, #475569, #1e293b); }
.sim-parkpedal .pp-pad { position: absolute; left: 3px; right: 3px; top: 36px; height: 30px; overflow: hidden;
  border-radius: 9px 9px 6px 6px / 7px 7px 5px 5px; background: linear-gradient(#262b33, #0d1015);
  border: 1px solid #3f4754; box-shadow: 0 3px 6px rgba(0,0,0,.6);
  transform-origin: 50% 0; transition: transform .12s ease, box-shadow .15s, border-color .15s; }
.sim-parkpedal .pp-ribs-h { position: absolute; left: 4px; right: 4px; top: 3px; height: 9px;
  background: repeating-linear-gradient(180deg, rgba(148,163,184,.45) 0 1.5px, transparent 1.5px 3.2px); border-radius: 2px; }
.sim-parkpedal .pp-ribs-v { position: absolute; left: 4px; right: 4px; top: 14px; bottom: 3px;
  background: repeating-linear-gradient(90deg, rgba(148,163,184,.4) 0 1.5px, transparent 1.5px 3.6px); border-radius: 2px; }
.sim-parkpedal .pp-badge { position: absolute; right: -10px; top: 26px; font-family: 'Orbitron', sans-serif; font-size: 8px; font-weight: 900; color: #475569; }
.sim-parkpedal.on .pp-pad { transform: translateY(6px) perspective(160px) rotateX(24deg); border-color: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,.75); }
.sim-parkpedal.on .pp-ribs-h, .sim-parkpedal.on .pp-ribs-v { filter: sepia(1) saturate(6) hue-rotate(-30deg); }
.sim-parkpedal.on .pp-badge { color: #ef4444; text-shadow: 0 0 6px #ef4444; }
.sport-theme .sim-parkpedal.on .pp-pad { box-shadow: 0 0 16px rgba(239,68,68,.95); }

/* Placa de velocidade: uma piscada ao passar do limite; contorno vermelho enquanto estiver acima */
#t1-speed-sign .ss-glow { transition: opacity .3s; }
#t1-speed-sign.over .ss-glow { opacity: .9; filter: url(#fGlowSportRed); }
#t1-radar .radar-cam { opacity: .9; }

/* Previsão do tempo: animação sutil — um movimento curto a cada 10 s, depois fica parado */
#t1-weather { cursor: pointer; }
#t1-weather .wx-rays { animation: wxSpin 10s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
#t1-weather .wx-moon { animation: wxGlow 10s ease-in-out infinite; }
#t1-weather .wx-cloud > path { animation: wxDrift 10s ease-in-out infinite; }
#t1-weather .wx-cloud-slow > path { animation-delay: .4s; }
#t1-weather .wx-drop { opacity: 0; animation: wxRain 10s linear infinite; }
#t1-weather .wx-bolt { opacity: 0; animation: wxBolt 10s steps(1) infinite; }
#t1-weather .wx-fog { animation: wxFog 10s ease-in-out infinite; }
@keyframes wxSpin { 0% { transform: rotate(0); } 14%, 100% { transform: rotate(45deg); } }
@keyframes wxGlow { 0%, 20%, 100% { opacity: .8; } 10% { opacity: 1; } }
@keyframes wxDrift { 0%, 24%, 100% { transform: translateX(0); } 12% { transform: translateX(3px); } }
@keyframes wxRain { 0% { transform: translateY(-2px); opacity: 0; } 3% { opacity: .9; } 9% { transform: translateY(10px); opacity: 0; }
  9.01% { transform: translateY(-2px); } 12% { opacity: .9; } 18% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }
@keyframes wxBolt { 0%, 100% { opacity: 0; } 4% { opacity: 1; } 6% { opacity: 0; } }
@keyframes wxFog { 0%, 24%, 100% { transform: translateX(0); opacity: .75; } 12% { transform: translateX(3px); opacity: 1; } }


/* Freio de estacionamento: mesmo estilo dos pedais, só que menor */
.sim-pedal.pbk { width: 34px; height: 30px; }
.sim-pedal.pbk .fill { background: linear-gradient(to top, #ef4444, #fca5a5); }
.sim-pedal.pbk.on { transform: perspective(220px) rotateX(20deg) scaleY(.93); border-color: #ef4444; box-shadow: 0 0 14px rgba(239,68,68,.8); }
.sim-pedal.pbk.on .fill { height: 100% !important; }

/* Câmbio: letras com o mesmo passo da manopla (21 px) */
.sim-gate { display: flex; flex-direction: column; height: 126px; }
.sim-gate button { flex: 0 0 21px; height: 21px; min-height: 21px; padding: 0; margin: 0; line-height: 21px; box-sizing: border-box; }
.sim-shifter { align-items: flex-start; padding: 7px 8px; }
.sim-slot { margin-top: 0; }

/* Barra do rodapé ainda mais compacta */
.sim-dock { padding: .18rem .4rem; gap: .16rem; border-radius: 1.4rem; }
.sim-dock .sim-dock-extras { gap: .16rem; }
.sim-dock .sim-btn, .sim-dock .modes-item { padding: .1rem .38rem; font-size: 11.5px; border-radius: .8rem; }
.sim-dock .sky-select, .sim-dock .sim-range-wrap { font-size: 11.5px; }
.sim-dock .sim-range { width: 50px; }

/* ===== Modo Cam: câmera frontal do para-choque (mesma área do Mapa 3D) ===== */
#cam-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; display: none; font-family: 'Rajdhani', 'Segoe UI', sans-serif; }
.center-map-slot.cam-on #cam-overlay { display: block; }
.center-map-slot.cam-on #center-gps-3d { filter: saturate(.8) contrast(1.1) brightness(1.08); }
#cam-overlay::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(0,0,0,.6) 100%); }
#cam-overlay::after { content: ""; position: absolute; inset: 0; opacity: .08;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px); }
.cam-top { position: absolute; top: 5%; left: 24%; right: 24%; display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #e2e8f0; text-shadow: 0 1px 3px #000; letter-spacing: .06em; }
.cam-rec { color: #ef4444; animation: camRec 1s steps(2, jump-none) infinite; }
@keyframes camRec { 0% { opacity: 1; } 100% { opacity: .2; } }
.cam-title { font-size: 10px; color: #cbd5e1; }
.cam-guides { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; }
.cam-guides path { fill: none; stroke-width: .6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.cam-guides .g-red { stroke: #ef4444; stroke-width: 2.2; }
.cam-guides .g-yel { stroke: #facc15; stroke-width: 2; }
.cam-guides .g-grn { stroke: #22c55e; stroke-width: 1.8; }
.cam-guides .g-cross { stroke-dasharray: 3 3; opacity: .85; }
.cam-bottom { position: absolute; bottom: 4%; left: 30%; right: 30%; display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: #f8fafc; text-shadow: 0 1px 3px #000; }
.cam-dist { color: #94a3b8; }

/* Mapas: mesma área e disposição do Mapa 3D, atrás dos mostradores, bordas sumindo em degradê */
#center-maps-view #center-gta-minimap {
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 38%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 38%, transparent 100%);
}
/* Cam: HUD só na parte central visível (entre os mostradores), abaixo do "D" */
.cam-top { top: 15%; left: 31%; right: 31%; font-size: 10.5px; }
.cam-guides { left: 30%; right: 30%; width: 40%; height: 55%; }
.cam-bottom { left: 33%; right: 33%; bottom: 7%; }

/* Possível infração no radar: tela pisca em vermelho e mostra o aviso */
#infraction-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; display: none; }
#infraction-flash.show { display: flex; align-items: center; justify-content: center; }
#infraction-flash::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(220,38,38,.18) 0%, rgba(220,38,38,.55) 75%, rgba(127,29,29,.75) 100%);
  animation: infFlash 1.2s ease-out 1 both; }
@keyframes infFlash { 0% { opacity: 0; } 8% { opacity: 1; } 25% { opacity: .15; } 40% { opacity: .9; } 60% { opacity: .1; } 100% { opacity: 0; } }
#infraction-flash .inf-box { position: relative; text-align: center; padding: 8px 22px; border-radius: 10px;
  background: rgba(20,4,4,.82); border: 1.5px solid #ef4444; box-shadow: 0 0 28px rgba(239,68,68,.6);
  animation: infBox 3.2s ease both; }
@keyframes infBox { 0% { opacity: 0; transform: scale(.9); } 8% { opacity: 1; transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
#infraction-flash .inf-title { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 18px; letter-spacing: .08em; color: #fecaca; text-shadow: 0 0 10px #ef4444; }
#infraction-flash .inf-sub { font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-weight: 700; font-size: 14px; color: #fca5a5; margin-top: 2px; }

/* Abertura (vídeo do logotipo) cobrindo a tela do painel */
#intro-wrap { position: absolute; inset: 0; z-index: 40; background: #000; cursor: pointer; opacity: 1; transition: opacity .6s ease; display: flex; align-items: center; justify-content: center; }
#intro-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; transform: scale(0.82); }
#intro-wrap.out { opacity: 0; }

/* ============================================================
   MODO RÉ (PARK ASSIST) — TELA, MOLDURA E MOSTRADORES
   Inspirado no sistema OEM Lexus Park Assist com guia dinâmico
   ============================================================ */
.reverse-theme .cluster-screen {
  box-shadow: inset 0 0 55px rgba(14, 165, 233, 0.28) !important;
}
.reverse-theme .cluster-screen::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 2px;
  z-index: 30; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #0284c7 20%, #38bdf8 50%, #0284c7 80%, transparent 100%);
  box-shadow: 0 0 16px 2px rgba(56, 189, 248, 0.85);
}
.reverse-theme #t1-gear rect {
  stroke: #38bdf8 !important;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9));
}
.reverse-theme #dash-gear {
  fill: #38bdf8 !important;
  text-shadow: 0 0 10px #38bdf8;
}
.reverse-theme .dial-bg {
  stroke: #0284c7;
  transition: stroke .3s ease;
}

/* Painel central do Park Assist */
#center-reverse-view {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, #071324 0%, #02060f 100%);
  border-radius: 4px;
  overflow: hidden;
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  user-select: none;
}
#center-reverse-view.active {
  display: flex !important;
  flex-direction: column;
}

.rev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px 2px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.85) 0%, transparent 100%);
  z-index: 5;
}
.rev-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-pill {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: .08em;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}
.rev-gear-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #f8fafc;
  background: #0284c7;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.7);
  animation: revPulse 1.4s ease-in-out infinite;
}
@keyframes revPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.rev-steer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
}
.rev-steer-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .05em;
}
.rev-steer-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  min-width: 38px;
  text-align: right;
}

.rev-display-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px 4px;
}
.rev-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* PDC Sensores Arcos */
.pdc-arc {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: stroke .2s ease, opacity .2s ease;
}
.pdc-f-arc {
  stroke: rgba(56, 189, 248, 0.35);
}
.pdc-r-arc {
  stroke: rgba(148, 163, 184, 0.3);
}

/* Guias dinâmicas ativas de manobra */
.rev-guideline {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.85));
  transition: d .05s linear;
}
.rev-crossbar {
  fill: none;
  stroke-linecap: round;
  transition: d .05s linear;
}
.rev-crossbar.bar-red {
  stroke: #ef4444;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9));
}
.rev-crossbar.bar-yel {
  stroke: #facc15;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.85));
}
.rev-crossbar.bar-grn {
  stroke: #22c55e;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.85));
}

.rev-footer {
  padding: 3px 12px 5px;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9) 0%, transparent 100%);
  display: flex;
  justify-content: center;
  z-index: 5;
}
.rev-alert-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 4px;
  padding: 2px 10px;
}
.rev-alert-icon {
  font-size: 11px;
  color: #facc15;
}
.rev-alert-msg {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #e2e8f0;
}
