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

html,
body {
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  font-family: "Inter", sans-serif;
}

:root {
  --blue-dark: #001533;
  --blue-mid: #004488;
  --blue-light: #00aaff;
  --white: #ffffff;
  --red: #ff3300;
  --yellow: #ffcc00;
  --text-dim: rgba(255, 255, 255, 0.6);
}

#hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  transform-origin: bottom center;
  width: 860px;
  height: 340px;
  background: radial-gradient(
    ellipse at center 80%,
    var(--blue-dark) 0%,
    #02060d 100%
  );
  border-radius: 24px;
  border: 1px solid rgba(0, 170, 255, 0.15);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.8),
    0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* Warning Lights */
.telltale-icon {
  width: 26px;
  height: 26px;
  opacity: 0.15;
  transition:
    opacity 0.2s,
    filter 0.2s;
}

.telltale-icon.active {
  opacity: 1;
}
.icon-red {
  color: var(--red);
}
.icon-red.active {
  filter: drop-shadow(0 0 8px var(--red));
}
.icon-green {
  color: #00ff00;
}
.icon-green.active {
  filter: drop-shadow(0 0 8px #00ff00);
}
.icon-blue {
  color: var(--blue-light);
}
.icon-blue.active {
  filter: drop-shadow(0 0 8px var(--blue-light));
}
.icon-yellow {
  color: var(--yellow);
}
.icon-yellow.active {
  filter: drop-shadow(0 0 8px var(--yellow));
}

/* Turn Signals */
.turn-signals {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 260px;
  z-index: 10;
  pointer-events: none;
}

.turn-signal {
  width: 32px;
  height: 32px;
  color: #00ff00;
  opacity: 0.1;
  transition: 0.1s;
}
.turn-signal.active {
  opacity: 1;
  filter: drop-shadow(0 0 10px #00ff00);
}

/* Top Area */
.top-bar {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding-top: 15px;
  height: 80px;
  position: relative;
  z-index: 20;
}

.arc-gauge-wrap {
  width: 100px;
  height: 70px;
}
.top-arc-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.top-arc-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
  stroke-linecap: round;
}
.top-arc-fill {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 4;
  stroke-linecap: round;
  transition:
    stroke-dasharray 0.15s ease-out,
    stroke 0.3s;
}
.top-arc-lbl {
  fill: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-anchor: middle;
}

/* Center Content */
.center-content {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.center-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: -5px;
  text-shadow: 0 0 10px var(--blue-light);
  z-index: 20;
}

.truck-3d-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.terrain-grid {
  position: absolute;
  bottom: -15px;
  width: 120%;
  height: 120%;
  z-index: 1;
  opacity: 0.6;
  filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.4));
}

.truck-image-wrapper {
  position: absolute;
  z-index: 5;
  width: 200px;
  height: 130px;
  top: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: float 4s ease-in-out infinite;
}

.custom-truck-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.5));
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Vapid Startup */
#vapid-startup {
  position: absolute;
  inset: 0;
  background: #02060d;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 2.5s ease-in-out,
    visibility 2.5s;
}

.vapid-logo-intro {
  position: absolute;
  width: 350px;
  height: 175px;
  animation: logo-intro-anim 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}
@keyframes logo-intro-anim {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    filter: blur(10px);
  }
  15% {
    opacity: 1;
    transform: scale(1) translateY(0px);
    filter: blur(0px) drop-shadow(0 0 40px rgba(170, 0, 0, 0.6));
  }
  80% {
    opacity: 1;
    transform: scale(1.05) translateY(0px);
    filter: blur(0px) drop-shadow(0 0 40px rgba(170, 0, 0, 0.6));
  }
  100% {
    opacity: 0;
    transform: scale(1.1) translateY(-10px);
    filter: blur(20px);
  }
}

/* Startup Rig with C-Clamp Lights */
.truck-light-rig {
  position: relative;
  width: 400px;
  height: 280px;
  animation: truck-zoom-rig 3.5s cubic-bezier(0.2, 0.8, 0.2, 1) 2.5s both;
}

@keyframes truck-zoom-rig {
  0% {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    transform: scale(1.05) translateY(-5px);
    opacity: 1;
  }
}

.vapid-truck-svg-auto {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--blue-light));
}

.hl-segment {
  position: absolute;
  background: #ffffff;
  opacity: 0;
  z-index: 10;
  animation: headlights-flash 3.5s ease-out 2.5s both;
}

@keyframes headlights-flash {
  0%,
  20% {
    opacity: 0;
  }
  25% {
    opacity: 1;
    box-shadow:
      0 0 30px 10px rgba(255, 255, 255, 1),
      0 0 50px 20px rgba(0, 170, 255, 0.7);
  }
  35% {
    opacity: 0.5;
    box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.5);
  }
  40%,
  100% {
    opacity: 0.9;
    box-shadow:
      0 0 20px 10px rgba(255, 255, 255, 0.8),
      0 0 40px 15px rgba(0, 170, 255, 0.5);
  }
}

.fog-glow {
  position: absolute;
  width: 13px;
  height: 6px;
  background: #ffffff;
  border-radius: 4px;
  opacity: 0;
  z-index: 10;
  animation: fog-flash 3.5s ease-out 2.7s both;
}

@keyframes fog-flash {
  0%,
  25% {
    opacity: 0;
  }
  30% {
    opacity: 1;
    box-shadow: 0 0 25px 12px rgba(255, 255, 255, 0.9);
  }
  40%,
  100% {
    opacity: 0.8;
    box-shadow: 0 0 15px 8px rgba(255, 255, 255, 0.7);
  }
}

.vapid-text {
  font-family: "Inter", sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 12px;
  margin-top: 10px;
  margin-left: 12px;
  opacity: 0;
  animation: text-fade 3.5s cubic-bezier(0.16, 1, 0.3, 1) 2.5s both;
}

@keyframes text-fade {
  0%,
  40% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

/* Gauges */
.gauges-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 40px;
  margin-top: 10px;
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.gauge-box {
  width: 260px;
  height: 260px;
  position: relative;
}
.gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.arc-bg {
  stroke: var(--blue-mid);
  stroke-linecap: round;
}
.arc-notches {
  stroke: #02060d;
}
.arc-fill {
  stroke: var(--blue-light);
  stroke-linecap: round;
  transition: stroke-dasharray 0.15s ease-out;
}
.arc-redzone {
  stroke: var(--red);
  stroke-linecap: round;
}
.tick-maj {
  stroke: var(--white);
  stroke-width: 3;
}
.tick-min {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
}
.tick-lbl {
  fill: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}
.tick-lbl-sm {
  font-size: 12px;
}

.rpm-title {
  fill: var(--white);
  font-size: 14px;
  font-weight: 800;
}
.rpm-sub {
  fill: var(--text-dim);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.gear-val {
  fill: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
}

.speed-val {
  fill: var(--white);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
}
.speed-lbl {
  fill: var(--white);
  font-size: 14px;
  font-weight: 800;
}
.pointer {
  fill: var(--red);
}
.pointer-glow {
  fill: var(--blue-light);
  filter: blur(4px);
  opacity: 0.8;
}

.odometer-gauge {
  fill: var(--text-dim);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

#rpm-pointer-wrap,
#speed-pointer-wrap {
  transition: transform 0.15s ease-out;
}

/* Sci-Fi Bottom Divider */
.bottom-divider {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 5;
  pointer-events: none;
}
.divider-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Bottom Bar - Centered Content Next To Radio */
.bottom-bar {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px; /* Spacing between left cluster, radio, and right cluster */
  z-index: 10;
  pointer-events: none;
}

.telltale-left,
.telltale-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.media-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}

/* Drag Handles */
#mh {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.2);
  cursor: move;
  transition: 0.2s;
  z-index: 50;
}
#hud:hover #mh {
  color: rgba(255, 255, 255, 0.5);
}
.rh {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 4px;
  cursor: nwse-resize;
  z-index: 50;
  color: rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}
#hud:hover .rh {
  color: rgba(255, 255, 255, 0.6);
}
