:root {
  --cyan: #63f4ff;
  --magenta: #ff4fd8;
  --amber: #ffd166;
  --bg: #05040f;
  --panel: rgba(8, 10, 28, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #eaf6ff;
  font-family: 'Eurostile', 'Bahnschrift', 'DIN Alternate', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: crosshair;
}

#viewport {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hidden {
  display: none !important;
}
.mono {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* ---------------- HUD ---------------- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  text-transform: uppercase;
}

.panel {
  position: absolute;
  bottom: 24px;
  min-width: 210px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid rgba(99, 244, 255, 0.35);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  box-shadow:
    0 0 24px rgba(99, 244, 255, 0.12),
    inset 0 0 18px rgba(99, 244, 255, 0.06);
}

.panel-speed {
  left: 24px;
}
.panel-clocks {
  right: 24px;
  text-align: right;
}

.speed {
  font-size: 58px;
  line-height: 0.9;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(99, 244, 255, 0.7);
  font-variant-numeric: tabular-nums;
}
.speed small {
  font-size: 16px;
  margin-left: 6px;
  opacity: 0.7;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 15px;
  margin-top: 4px;
}
.row.small {
  font-size: 11px;
  opacity: 0.7;
}
.label {
  color: rgba(234, 246, 255, 0.55);
}

.bar {
  margin-top: 10px;
  height: 8px;
  border: 1px solid rgba(255, 79, 216, 0.5);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}
#hud-boost-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--magenta), var(--amber));
  box-shadow: 0 0 12px var(--magenta);
  transition: width 0.08s linear;
}

#hud-message {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 84px;
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 0 30px var(--cyan),
    0 0 80px var(--magenta);
  opacity: 0;
  transition: opacity 0.15s linear;
}
#hud-message.show {
  opacity: 1;
}

#hud-warning {
  position: absolute;
  top: 8%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  color: var(--magenta);
  text-shadow: 0 0 18px var(--magenta);
  animation: blink 0.55s steps(2, end) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.15;
  }
}

#hud-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid rgba(99, 244, 255, 0.25);
  border-radius: 50%;
}

/* ---------------- Overlay / menus ---------------- */

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(20, 10, 45, 0.82), rgba(2, 2, 10, 0.95));
  backdrop-filter: blur(3px);
}
#overlay.hidden {
  display: none;
}

.card {
  width: min(760px, 92vw);
  padding: 28px 34px 30px;
  border: 1px solid rgba(99, 244, 255, 0.35);
  border-radius: 14px;
  background: rgba(6, 8, 22, 0.75);
  box-shadow: 0 0 60px rgba(99, 244, 255, 0.12);
}

.card h1 {
  margin: 0 0 4px;
  font-size: 46px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-shadow: 0 0 26px rgba(99, 244, 255, 0.6);
}
.card h2 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 400;
  color: var(--magenta);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.card p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(234, 246, 255, 0.8);
}
.card .cta {
  margin-top: 18px;
  font-size: 20px;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.6);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 22px;
  margin: 14px 0 6px;
  font-size: 13px;
}
.grid div span {
  color: rgba(234, 246, 255, 0.5);
  margin-right: 8px;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}
table.results th,
table.results td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid rgba(99, 244, 255, 0.15);
}
table.results th:first-child,
table.results td:first-child {
  text-align: left;
}
table.results th {
  color: rgba(234, 246, 255, 0.5);
  font-weight: 400;
}
table.results tr.total td {
  color: var(--cyan);
  border-bottom: none;
}

.note {
  font-size: 12px;
  color: rgba(255, 79, 216, 0.85);
  margin-top: 12px;
}
.error {
  color: #ff7a7a;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 12px;
}
