/* drive.css — the Lexus run from Club Ice to the apartment. Owned by lead.
 *
 * Same HUD grammar as the masher (skewed bars, centred judgement, thumb pads) so the
 * game reads as one system, but cooled to headlights-and-streetlights instead of the
 * fight's red. The 3D road plays behind, so this layer stays mostly transparent.
 */

.drv {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 207, 138, .10), transparent 54%),
    radial-gradient(100% 74% at 50% 58%, transparent 34%, rgba(4, 3, 8, .72));
  animation: drv-in .4s cubic-bezier(.22, 1, .36, 1) both;
}
.drv-out { animation: drv-outa .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes drv-in   { from { opacity: 0; transform: scale(1.03); } }
@keyframes drv-outa { to   { opacity: 0; transform: scale(.98); } }

/* --- bars ----------------------------------------------------------------- */
.drv-hud {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 18px; padding: 20px 26px 0;
}
.drv-side { display: flex; flex-direction: column; gap: 6px; }
.drv-right { align-items: flex-end; }
.drv-name { font-size: 11px; font-weight: 800; letter-spacing: .28em; color: #cfc6bb; }
.drv-bar {
  height: 13px; width: 100%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .18);
  overflow: hidden; transform: skewX(-22deg);
}
.drv-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #ffcf8a, #ff2d6f);
  transition: width .16s cubic-bezier(.22, 1, .36, 1);
}
.drv-bar-trip i { background: linear-gradient(90deg, #9fe8ff, #dfe9ee); }
.drv-mid {
  min-width: clamp(130px, 20vw, 250px);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; font-size: 10px; letter-spacing: .3em; font-weight: 800;
  color: rgba(255,255,255,.5);
}
.drv-mid b {
  color: #ffcf8a; font-size: 9px; letter-spacing: .22em; font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 176, 32, .45);
  transition: color .35s ease, opacity .2s ease;
}

/* --- centre --------------------------------------------------------------- */
.drv-stage { flex: 1; position: relative; }

.drv-judge {
  position: absolute; top: 18%; left: 0; right: 0; text-align: center;
  font-size: clamp(24px, 4.6vw, 48px); font-weight: 900; letter-spacing: .1em;
  animation: drv-j .3s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
@keyframes drv-j { from { transform: scale(.7); opacity: 0; } }
.drv-perfect { color: #ffd76a; text-shadow: 0 0 26px rgba(255, 176, 32, .85); }
.drv-good    { color: #9fe8ff; text-shadow: 0 0 20px rgba(0, 229, 255, .6); }
.drv-miss    { color: #ff5c74; text-shadow: 0 0 20px rgba(200, 16, 46, .75); }

/* Speed sits bottom-left like a dash readout, not a game score. */
.drv-speed {
  position: absolute; left: 26px; bottom: 8px;
  display: flex; align-items: baseline; gap: 6px;
  color: rgba(255, 255, 255, .78);
}
.drv-speed b { font-size: clamp(26px, 4vw, 44px); font-weight: 800; font-variant-numeric: tabular-nums; }
.drv-speed span { font-size: 10px; letter-spacing: .24em; color: rgba(255,255,255,.45); }

/* --- dialogue ------------------------------------------------------------- */
.drv-sub {
  /* Clear of the HUD bars. At 5% it landed on top of the trip readout and the two texts
     printed over each other. */
  position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
  width: min(680px, 88vw); text-align: center;
  font-size: 15px; line-height: 1.55;
  color: #efe9e2; text-shadow: 0 2px 14px rgba(0, 0, 0, .95);
  pointer-events: none; opacity: 0;
}
.drv-sub b {
  display: block; font-size: 10px; font-weight: 800; letter-spacing: .28em;
  color: #ffcf8a; margin-bottom: 5px;
}
.drv-sub i { color: #c9c1ba; font-style: italic; }
.drv-sub-in { animation: drv-sub 5.4s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes drv-sub {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  10%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  82%  { opacity: 1; }
  100% { opacity: 0; }
}

.drv-help {
  text-align: center; padding: 0 0 10px;
  font-size: 10px; letter-spacing: .22em; font-weight: 700;
  color: rgba(255, 255, 255, .34);
}

.drv-hurt { animation: drv-shake .22s; }
@keyframes drv-shake {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-9px, 2px); }
  70% { transform: translate(9px, -2px); }
}

/* --- pads: two lanes of input, on every device ---------------------------- */
/* Steering is the whole interface here, so the buttons are always on screen — the same
   call the run makes, for the same reason. */
.drv-pads {
  display: flex; gap: 18px; justify-content: center;
  padding: 0 18px 22px;
}
.drv-pad {
  flex: 1 1 0; max-width: 150px;
  aspect-ratio: 1 / .46;
  display: grid; place-items: center; gap: 2px;
  font-size: clamp(34px, 7vw, 54px); font-weight: 900; line-height: 1;
  color: #efe9e2;
  background: rgba(223, 233, 238, .06);
  border: 1px solid rgba(223, 233, 238, .34);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.drv-pad b { display: block; font-size: 1em; line-height: 1; }
.drv-pad span {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .24em;
  color: rgba(255, 255, 255, .5);
}
.drv-pad.is-hit { background: rgba(255, 207, 138, .5); transform: scale(.94); }

/* Story collisions are final. The retry panel appears over the frozen wreck and starts
   a fresh drive without sending the player back through the chapter. */
.drv-game-over {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 48%, rgba(200,16,46,.28), transparent 34%), rgba(3,2,7,.84);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}
.drv-game-over.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.drv-game-over small {
  font-size: 10px; font-weight: 800; letter-spacing: .4em; color: #ffcf8a;
}
.drv-game-over h2 {
  margin: 0; font-size: clamp(38px, 8vw, 84px); line-height: .95;
  letter-spacing: .08em; color: #fff4df; text-shadow: 0 0 32px rgba(200,16,46,.65);
}
.drv-game-over p { margin: 0 0 12px; color: rgba(255,255,255,.7); }
.drv-restart {
  min-width: min(280px, 78vw); padding: 15px 22px;
  border: 1px solid #ffcf8a; border-radius: 4px;
  color: #12070c; background: linear-gradient(90deg, #ffcf8a, #ff8a3d);
  font: 900 12px/1 ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .22em; cursor: pointer;
}
.drv-restart:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

@media (hover: none), (pointer: coarse) {
  .drv-help { display: none; }
  .drv-pad { backdrop-filter: none !important; }
}

@media (max-width: 640px) {
  .drv-hud { gap: 8px; padding: 14px 12px 0; }
  .drv-mid { min-width: 92px; }
  .drv-mid > span { display: none; }
  .drv-mid b { font-size: 8px; letter-spacing: .14em; }
  .drv-name { font-size: 9px; letter-spacing: .18em; }
  .drv-bar { height: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .drv, .drv-out, .drv-judge, .drv-hurt { animation: none; }
}

/* The stat HUD lives in the same corners as the trip readout, so it steps aside for the
   drive — the other sequences keep it, this one has nowhere to put it. */
body.drv-active .mi-hud { opacity: 0; pointer-events: none; }

/* Smoque's lead. Sits under the district label in the middle of the HUD — it is the
   pressure read, so it belongs next to where you are, not in a corner. */
.run-lead {
  font-style: normal;
  font-size: 9px; letter-spacing: .2em; font-weight: 800;
  color: #9fe8ff;
  text-shadow: 0 0 14px rgba(0, 229, 255, .35);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { .run-lead { font-size: 8px; letter-spacing: .1em; } }
