/* Pine Ridge Rally — HUD shell. Pine green + gold timing type on alpine darks. */

:root {
  --ink: #f1efdf;
  --gold: #ffc23e;
  --pine: #6fbf8a;
  --panel: rgba(12, 16, 12, 0.55);
  --line: rgba(190, 230, 200, 0.22);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%; overflow: hidden; background: #0a0d0a;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

#app, #app canvas { position: fixed; inset: 0; display: block; width: 100vw; height: 100vh; }

.hud { position: fixed; inset: 0; pointer-events: none; }
.hud > * { pointer-events: none; }

.hud-tl {
  position: absolute; top: 18px; left: 20px; display: flex; gap: 10px;
}
.plate {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 12px 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 3px; backdrop-filter: blur(6px); box-shadow: var(--shadow);
}
.plate .k, .time .k, .slide .k {
  font-size: 10px; letter-spacing: 0.16em; opacity: 0.66; text-transform: uppercase;
}
.plate .v, .time .v {
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hud-tr { position: absolute; top: 14px; right: 22px; text-align: right; }
.speed { line-height: 0.86; text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8); }
.speed span { font-size: 76px; font-weight: 800; font-variant-numeric: tabular-nums; }
.speed i { font-size: 12px; letter-spacing: 0.22em; opacity: 0.7; font-style: normal; margin-left: 6px; }
.bar { margin-top: 6px; width: 190px; height: 4px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; margin-left: auto; }
.bar div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #ff5f36); }
.slide { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 9px; }
.slidebar { width: 110px; height: 3px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
.slidebar div { height: 100%; width: 0%; background: #d8dbe0; }
.slidebar.air { box-shadow: 0 0 12px var(--gold); }

.hud-bl { position: absolute; bottom: 18px; left: 20px; display: flex; flex-direction: column; gap: 5px; }
.time { display: flex; align-items: baseline; gap: 10px; }
.time .v { font-size: 19px; min-width: 86px; }
.gold { color: var(--gold); }
.hint { margin-top: 10px; font-size: 11px; letter-spacing: 0.07em; opacity: 0.45; }

.hud-br { position: absolute; bottom: 18px; right: 20px; }
#h-map {
  display: block; width: 220px; height: 220px; border-radius: 4px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background: #10130f; image-rendering: pixelated;
}
.maplabel {
  margin-top: 6px; text-align: right; font-size: 10px; letter-spacing: 0.24em; opacity: 0.5;
}

.flash {
  position: absolute; top: 22%; left: 50%; transform: translate(-50%, -14px) scale(0.96);
  text-align: center; opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.flash.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.flash b { display: block; font-size: 40px; letter-spacing: 0.06em; text-shadow: 0 6px 26px #000; }
.flash i { display: block; font-size: 13px; letter-spacing: 0.3em; color: var(--pine); font-style: normal; margin-top: 4px; }

.counts {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.14em; opacity: 0.3;
}

.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #16211a, #0a0d0a 70%);
  transition: opacity 0.5s; z-index: 5;
}
.loading.gone { opacity: 0; pointer-events: none; }
.lcard { width: min(460px, 82vw); text-align: center; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: 0.2em; }
.sub { font-size: 11px; letter-spacing: 0.3em; opacity: 0.6; margin-top: 6px; text-transform: uppercase; }
.lbar { margin: 26px 0 10px; height: 2px; background: rgba(255, 255, 255, 0.14); }
.lbar div { height: 100%; width: 0%; background: var(--pine); transition: width 0.3s; }
.lstage { font-size: 12px; letter-spacing: 0.1em; opacity: 0.75; }
.lnote { margin-top: 22px; font-size: 10px; letter-spacing: 0.16em; opacity: 0.35; }

.result, .fatal {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(6, 8, 6, 0.66); backdrop-filter: blur(4px); z-index: 6;
}
.result.on, .fatal.on { display: flex; }
.rcard, .fcard {
  background: #11150f; border: 1px solid var(--line); padding: 26px 30px; border-radius: 4px;
  min-width: 320px; box-shadow: var(--shadow);
}
.rcard h3, .fcard h3 { margin: 0 0 14px; letter-spacing: 0.18em; font-size: 15px; color: var(--pine); }
.rcard div { font-size: 14px; line-height: 1.85; font-variant-numeric: tabular-nums; }
.rcard button {
  pointer-events: auto; margin-top: 18px; width: 100%; padding: 10px; background: var(--gold);
  color: #17120c; border: 0; border-radius: 3px; font-weight: 700; letter-spacing: 0.16em; cursor: pointer;
}
.fcard p { font-size: 13px; line-height: 1.6; opacity: 0.8; }
