* { box-sizing: border-box; user-select: none; }
:root{
  --text:#e8e8e8;
  --accent:#ff2b2b; /* Type R red */
  --cyan:#00f0ff;
  --green:#00ff79;
  --yellow:#f7b731;
  --blue:#3399ff;
  --seatbelt:#ff4757;
}
html,body{ height:100%; margin:0; background:transparent; font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial; color:var(--text); }

/* HUD bottom-right */
.hud{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 360px;
  height: 360px;
  pointer-events: none; /* so it never blocks input */
}

/* circular speedometer sits behind */
#speedo{
  position:absolute;
  right:0;
  bottom:0;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.6));
  background: repeating-linear-gradient(
    45deg,
    #0c0c0f,
    #0c0c0f 2px,
    #121212 2px,
    #121212 4px
  );
}

/* digital readout in center */
.readout{
  position:absolute;
  inset:auto 0 84px 0;
  text-align:center;
  pointer-events:none;
}
.speed-digits{
  font-family: 'Orbitron', sans-serif;
  font-size: 72px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 0 15px rgba(255,255,255,0.2);
}
.unit{
  font-family: 'Orbitron', sans-serif;
  opacity: .85;
  margin-top: 2px;
  letter-spacing: 2px;
}

.typer{ margin-top: 8px; font-family: 'Orbitron', sans-serif; }
.typer .type{ opacity:.9; margin-right:6px; }
.typer .r{ 
    color: var(--accent);           /* bright Type R red */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 43, 43, 0.6); /* subtle glow */
    transition: color 0.2s ease;
}

/* turn indicators */
.turn{
  position:absolute;
  top: 130px;
  font-size: 22px;
  opacity:.2;
  transition: opacity .12s ease, color .12s ease;
}
.turn-left{ left: 36px; }
.turn-right{ right: 36px; }
.turn.blink{ color: var(--green); opacity:1; animation: blink 0.9s steps(1,end) infinite; }
@keyframes blink { 50%{ opacity:.2 } }

/* status row: left bars, right icons */
.status-row{
  position:absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display:flex;
  justify-content: space-between;
  align-items:flex-start; /* top align for stacked bars */
}

/* stacked bars on left */
.bars-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bars-left .bar {
  width: 80px;
}

.bars-left .bar span {
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.8;
  display: block;
  margin-bottom: 3px;
}

.bars-left .track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  overflow: hidden;
}

.bars-left .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f39c12, #f1c40f);
  border-radius: 20px;
  transition: width 0.25s ease;
}

.bars-left .fill.health {
  background: linear-gradient(90deg, #ff4747, #28e07a);
}

/* right icons */
.icons-right {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  top: 25px; /* moves icons down */
}

.icon{ width:26px; height:26px; fill:#9aa0a6; transition: fill .15s ease; }
#headlights-icon.low-beam{ fill: var(--yellow); }
#headlights-icon.high-beam{ fill: var(--blue); }
#seatbelt-icon.active{ fill: var(--seatbelt); }

/* engine icon & glow */
#engine-icon g { stroke: #9aa0a6; transition: stroke 0.2s ease; }
#engine-icon.active g { stroke: #0ff122; }

@keyframes engine-glow {
  0% { stroke: #f1c40f; filter: drop-shadow(0 0 2px #f1c40f); }
  50% { stroke: #ffd75f; filter: drop-shadow(0 0 8px #ffd75f); }
  100% { stroke: #f1c40f; filter: drop-shadow(0 0 2px #f1c40f); }
}

#engine-icon.active.glow g {
  animation: engine-glow 1s infinite;
}

/* gear */
.gear{
  position:absolute;
  left: 10px;
  bottom: 84px;
  text-align:center;
}
.gear-val{
  font-family:'Orbitron', sans-serif;
  font-size:36px; font-weight:700;
}
.gear-label{
  font-size:12px; letter-spacing:1px; opacity:.8;
}

/* keep things crisp on small screens */
@media (max-width:480px){
  .hud{ transform: scale(.85); transform-origin: bottom right; }
}
