* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; background: #0b0f0c; font-family: 'Segoe UI', system-ui, sans-serif; }

canvas { display: block; }

#loading {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1d2b1f 0%, #0b0f0c 100%);
  color: #e8f0e4;
}
#loading .box { text-align: center; }
#loading h1 { font-size: 3rem; letter-spacing: 0.4em; margin-bottom: 1rem; }
#loading p { color: #9db89a; font-size: 1rem; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

#stats {
  position: absolute; top: 16px; left: 16px;
  background: rgba(10, 14, 10, 0.65); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px;
  padding: 12px 18px; color: #f0f4ec; min-width: 150px;
}
#speed { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.unit { font-size: 0.85rem; color: #9db89a; margin-left: 6px; }
#lap { font-size: 1rem; margin-top: 2px; color: #ffd166; }
#time { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
#best { font-size: 0.8rem; color: #9db89a; min-height: 1em; }

#right { position: absolute; top: 16px; right: 16px; text-align: center; }
#minimap {
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 14, 10, 0.65);
}
#backend { margin-top: 6px; font-size: 0.75rem; color: #cfe3ef; text-shadow: 0 1px 2px #000; }

#help {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: rgba(240, 244, 236, 0.85); font-size: 0.85rem;
  background: rgba(10, 14, 10, 0.5); padding: 6px 14px; border-radius: 8px;
}

#toast {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  font-size: 2rem; font-weight: 700; color: #ffd166;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.25s;
}
#toast.show { opacity: 1; }

#countdown {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
  font-size: 7rem; font-weight: 800; color: #ffd166;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
