:root {
  --bg: #05070d;
  --ink: #eaf0ff;
  --ink-dim: #8b93ad;
  --accent: #ff6b35;     /* raket-vlam oranje */
  --accent2: #4ea8ff;    /* SpaceX blauw */
  --good: #36d97b;
  --bad: #ff4d5e;
  --line: #1b2230;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; touch-action: none; overscroll-behavior: none; }

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

.hidden { display: none !important; }

/* ---------- HUD ---------- */
.hud { position: absolute; top: calc(var(--safe-top) + 10px); left: 0; right: 0; padding: 0 14px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 5; }
.hud-row { display: flex; gap: 8px; justify-content: space-between; }
.gauge { flex: 1; background: rgba(10,14,22,.55); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 10px; backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; min-width: 0; }
.g-label { font-size: .56rem; letter-spacing: .12em; color: var(--ink-dim); font-weight: 700; }
.g-val { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.g-val.warn { color: var(--bad); }
.g-val.ok { color: var(--good); }
.g-unit { font-size: .58rem; color: var(--ink-dim); }
.hud-bottom { align-items: center; }
.bar-wrap { flex: 1; background: rgba(10,14,22,.55); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 12px 8px; backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bar-wrap .g-label { display: flex; justify-content: space-between; }
.bar { height: 9px; background: #0c1119; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; width: 0%; transition: width .08s linear; }
.bar-fill.thr { background: linear-gradient(90deg, #4ea8ff, #9ad0ff); }
.bar-fill.fuel { width: 100%; background: linear-gradient(90deg, var(--accent), #ffd23f); }
.lvl-pill { font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--accent2);
  background: rgba(10,14,22,.55); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; backdrop-filter: blur(6px); }

/* ---------- Controls ---------- */
.controls { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 14px);
  padding: 0 16px; display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; z-index: 6; }
.ctl { pointer-events: auto; border: 1px solid var(--line); background: rgba(20,26,38,.7); color: var(--ink);
  border-radius: 18px; backdrop-filter: blur(8px); font-size: 1.6rem; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .05s, background .1s, border-color .1s; touch-action: none; }
.ctl-side { width: 74px; height: 74px; }
.ctl-thrust { flex: 1; max-width: 200px; height: 86px; color: var(--accent); border-color: rgba(255,107,53,.4); }
.ctl-thrust small { font-size: .6rem; letter-spacing: .14em; color: var(--ink-dim); margin-top: 2px; }
.ctl.active { background: rgba(78,168,255,.28); border-color: var(--accent2); transform: scale(.96); }
.ctl-thrust.active { background: rgba(255,107,53,.32); border-color: var(--accent); }

/* ---------- Overlay ---------- */
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: radial-gradient(120% 80% at 50% 0%, rgba(78,168,255,.10), transparent 60%), rgba(5,7,13,.82);
  backdrop-filter: blur(4px); }
.panel { width: 100%; max-width: 420px; background: linear-gradient(180deg, #0d121d, #0a0e16);
  border: 1px solid var(--line); border-radius: 24px; padding: 30px 26px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.logo { font-size: 3rem; line-height: 1; }
.panel h1 { font-family: "Futura", "Trebuchet MS", system-ui, sans-serif; font-weight: 900; letter-spacing: .12em;
  font-size: 2rem; margin: 10px 0 6px;
  background: linear-gradient(100deg, var(--accent), #ffd23f, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel h1.win { background: linear-gradient(100deg, var(--good), #aaffd0); -webkit-background-clip: text; background-clip: text; }
.panel h1.lose { background: linear-gradient(100deg, var(--bad), #ff9aa3); -webkit-background-clip: text; background-clip: text; }
#subtitle { color: var(--ink-dim); margin: 0 0 18px; line-height: 1.5; font-size: .98rem; }
.howto { display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; text-align: left; }
.how { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--ink-dim); }
.how .key { flex: 0 0 92px; text-align: center; font-weight: 800; color: var(--ink); background: #11161f;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; font-size: .82rem; }
.goal { font-size: .86rem; color: var(--ink-dim); line-height: 1.5; background: #0c111a;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin-top: 4px; }
.goal b { color: var(--ink); }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 20px; }
.rs { background: #0c111a; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.rs .rs-l { font-size: .6rem; letter-spacing: .1em; color: var(--ink-dim); font-weight: 700; }
.rs .rs-v { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rs.full { grid-column: 1 / -1; }
.rs-v.good { color: var(--good); } .rs-v.bad { color: var(--bad); }
.cta { width: 100%; border: none; cursor: pointer; font-weight: 900; letter-spacing: .08em; font-size: 1.05rem;
  color: #0a0e16; background: linear-gradient(100deg, var(--accent), #ffd23f); padding: 16px; border-radius: 14px;
  transition: filter .15s, transform .06s; }
.cta:hover { filter: brightness(1.07); } .cta:active { transform: scale(.98); }
.best { margin-top: 14px; font-size: .8rem; color: var(--ink-dim); }
.best b { color: var(--accent2); }
