:root {
  --hud: #4dff9e;       /* HUD-groen */
  --hud-dim: #2fae6e;
  --warn: #ff5a52;
  --amber: #ffbf47;
  --ink: #eaf2f0;
  --panel: rgba(8, 20, 28, 0.92);
  --line: rgba(120, 200, 170, 0.25);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #0a1722; color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; touch-action: none; }

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

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none;
  font-variant-numeric: tabular-nums; color: var(--hud);
  text-shadow: 0 0 8px rgba(77, 255, 158, 0.4); }
.hud-row { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 10px; }
.gauge { background: rgba(6, 18, 24, 0.5); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; min-width: 78px; text-align: center; display: flex; flex-direction: column; }
.g-label { font-size: 10px; letter-spacing: 0.14em; color: var(--hud-dim); }
.g-val { font-size: 24px; font-weight: 800; line-height: 1.05; }
.g-val.small { font-size: 15px; }
.g-unit { font-size: 10px; color: var(--hud-dim); }

.hud-throttle { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; }
.thr-bar { width: 90px; height: 8px; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: rgba(0,0,0,0.3); }
.thr-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--hud-dim), var(--hud)); }

.lso { position: absolute; left: 50%; top: 28%; transform: translateX(-50%);
  font-size: clamp(20px, 6vw, 30px); font-weight: 800; letter-spacing: 0.06em; text-align: center;
  text-shadow: 0 0 14px currentColor; opacity: 0; transition: opacity 0.2s; white-space: pre-line; }
.lso.show { opacity: 1; }
.lso.warn { color: var(--warn); }
.lso.good { color: var(--hud); }
.lso.amber { color: #ffbf47; }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px;
  overflow-y: auto;
  background: radial-gradient(120% 90% at 50% 0%, rgba(10,30,42,0.5), rgba(6,14,20,0.86)); }
.panel { width: min(440px, 94vw); margin: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px 18px; text-align: center; backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.logo { font-size: clamp(32px, 9vw, 54px); font-weight: 900; letter-spacing: 0.14em;
  color: var(--hud); text-shadow: 0 0 28px rgba(77,255,158,0.45); margin-bottom: 2px; }
.sub { margin: 6px 0 14px; color: var(--ink); font-size: 15px; }
.howto { text-align: left; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ht { font-size: 13px; color: #c7d6d2; line-height: 1.45; background: rgba(255,255,255,0.03);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.ht b { color: var(--hud); font-weight: 700; }
.kbd { display: inline-block; background: rgba(77,255,158,0.12); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; font-size: 12px; color: var(--ink); }

.btn { font: inherit; font-weight: 700; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 24px; background: rgba(255,255,255,0.06); color: var(--ink); cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(120deg, #1f8f5c, #2bbf7a); border-color: transparent;
  color: #07150e; font-size: 17px; box-shadow: 0 8px 24px rgba(43, 191, 122, 0.4); }
.best { margin-top: 16px; color: var(--hud-dim); font-size: 14px; min-height: 1.1em; }
.best b { color: #ffbf47; }

.grade { font-size: clamp(30px, 9vw, 46px); font-weight: 900; letter-spacing: 0.04em; }
.grade.ok { color: var(--hud); text-shadow: 0 0 26px rgba(77,255,158,0.5); }
.grade.bad { color: var(--warn); text-shadow: 0 0 22px rgba(255,90,82,0.45); }
.grade.fair { color: #ffbf47; }
.r-text { margin: 8px 0 16px; color: #c7d6d2; font-size: 16px; line-height: 1.45; }
.r-stats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; text-align: left; }
.r-stats .rs { display: flex; justify-content: space-between; font-size: 14px;
  border-bottom: 1px dashed var(--line); padding: 5px 2px; }
.r-stats .rs b { color: var(--hud); font-variant-numeric: tabular-nums; }
