/* UNDERGROUND — Car Select (NFS Underground 2 style HUD) */

:root {
  --acc: #a8d81c;          /* lime */
  --acc-soft: rgba(168, 216, 28, 0.55);
  --panel: rgba(10, 12, 16, 0.72);
  --panel-line: rgba(255, 255, 255, 0.14);
  --txt: #e8ecef;
  --font: "Arial Black", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #05060a; }
body { font-family: var(--font); color: var(--txt); user-select: none; }
button { font-family: inherit; cursor: pointer; }

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

/* ── top ───────────────────────────────────────────── */
.hud-top { position: fixed; inset: 0 0 auto 0; padding: 18px 26px 0; z-index: 5; pointer-events: none; }
.hud-top button { pointer-events: auto; }

.hud-title {
  position: absolute; top: 14px; left: 26px;
  font-size: 22px; font-style: italic; font-weight: 900; color: #fff;
  text-shadow: 0 0 14px rgba(168, 216, 28, 0.35);
}
.hud-title span { color: var(--acc); }

.hud-allcars {
  position: absolute; top: 14px; right: 26px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-style: italic; font-weight: 700; color: #cfd4da;
}
.hud-round {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55); background: rgba(0, 0, 0, 0.4);
  color: #fff; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.hud-round:hover { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 12px var(--acc-soft); }

.hud-bar {
  margin: 46px auto 0; width: min(860px, 94%);
  display: flex; align-items: center; gap: 18px;
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 10px; padding: 12px 20px;
  backdrop-filter: blur(4px);
}
.hud-arrow {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.6); background: transparent;
  color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.hud-arrow.right { margin-left: auto; }
.hud-arrow:hover { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 14px var(--acc-soft); }

.hud-badge {
  flex-shrink: 0; padding: 8px 16px;
  border: 2px solid var(--acc); border-radius: 8px;
  font-size: 14px; font-weight: 900; font-style: italic; letter-spacing: 0.06em;
  color: var(--acc); background: rgba(168, 216, 28, 0.08);
  box-shadow: 0 0 16px rgba(168, 216, 28, 0.25), inset 0 0 10px rgba(168, 216, 28, 0.1);
  text-transform: uppercase;
}
.hud-name {
  font-size: clamp(26px, 4.6vw, 44px); font-weight: 900; font-style: italic;
  text-transform: uppercase; letter-spacing: 0.01em; line-height: 1;
  color: #fff; text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud-name.swap { animation: nameswap 0.35s ease; }
@keyframes nameswap { 0% { opacity: 0; transform: translateX(26px) skewX(-8deg); } 100% { opacity: 1; transform: none; } }

.hud-line {
  margin: 8px auto 0; width: min(860px, 94%); height: 3px;
  background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden;
}
.hud-line i { display: block; height: 100%; background: var(--acc); box-shadow: 0 0 10px var(--acc-soft); transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ── bottom ────────────────────────────────────────── */
.hud-bottom {
  position: fixed; inset: auto 0 0 0; z-index: 5; padding: 0 26px 18px;
  pointer-events: none;
}
.hud-bottom button { pointer-events: auto; }

.stats {
  width: min(860px, 94%); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 10px; padding: 14px 22px 18px; backdrop-filter: blur(4px);
}
.stat label {
  display: block; font-size: 13px; font-style: italic; font-weight: 900;
  text-transform: uppercase; color: #fff; margin-bottom: 7px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.track {
  position: relative; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #6f9c10, var(--acc) 70%, #d7f57a);
  box-shadow: 0 0 12px var(--acc-soft);
  transition: width 0.7s cubic-bezier(0.25, 0.9, 0.25, 1);
}
.knob {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #dfe6ee; border: 2px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  transition: left 0.7s cubic-bezier(0.25, 0.9, 0.25, 1);
}

.hud-actions {
  width: min(860px, 94%); margin: 14px auto 0;
  display: flex; align-items: center; gap: 14px;
}
.player {
  margin-right: auto; font-size: 15px; font-style: italic; font-weight: 900;
  color: #cfd4da; letter-spacing: 0.04em;
}
.hbtn {
  min-width: 150px; padding: 12px 26px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px;
  color: #fff; font-size: 15px; font-weight: 900; font-style: italic; text-transform: uppercase;
  transition: 0.2s; backdrop-filter: blur(4px);
}
.hbtn:hover { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 16px var(--acc-soft); }
.hbtn.primary { border-color: var(--acc); color: var(--acc); }
.hbtn.primary:hover { background: var(--acc); color: #0b0d10; }

.hint {
  position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-family: Arial, sans-serif; font-size: 11px; color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.08em; z-index: 5;
}

/* overlays */
.flash {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(168, 216, 28, 0.5), rgba(168, 216, 28, 0.12) 55%, transparent 75%);
  opacity: 0;
}
.flash.go { animation: flash 0.55s ease-out; }
@keyframes flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.fade {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  background: #000; opacity: 0; transition: opacity 0.45s ease;
}
.fade.on { opacity: 1; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .hud-name { font-size: 24px; }
  .hbtn { min-width: 0; flex: 1; }
  .hud-title { font-size: 17px; }
  .hud-allcars span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
