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

:root {
  --sky: #9fd0ff;
  --gold: #ffd166;
  --bad: #ff5470;
  --dim: #63718f;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070f;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #ecf2ff;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 26px;
  pointer-events: none;
  z-index: 3;
}

.hud-left, .hud-right { display: flex; flex-direction: column; gap: 3px; }
.hud-right { text-align: right; }

.hud-label { font-size: 10px; letter-spacing: 3px; color: var(--dim); }

.hud-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--sky);
  text-shadow: 0 0 12px rgba(159,208,255,.45);
  font-variant-numeric: tabular-nums;
}

.small-v { font-size: 16px; }
.wind-v { color: var(--gold); min-height: 20px; }

.bar {
  width: 180px;
  height: 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.45);
  overflow: hidden;
  margin-bottom: 6px;
}

.bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width .1s linear;
}

.bar-fill.fuel {
  background: linear-gradient(90deg, #ffd166, #7cff6b);
  box-shadow: 0 0 10px rgba(255,209,102,.55);
  width: 100%;
}

.lvl-name {
  font-size: clamp(13px, 2vw, 17px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #b3c4e2;
}

.mini-btn {
  margin-top: 5px;
  padding: 4px 13px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: inherit;
  color: #9fb8dd;
  background: rgba(159,208,255,.07);
  border: 1px solid rgba(159,208,255,.4);
  border-radius: 12px;
  cursor: pointer;
  pointer-events: auto;
}

.mini-btn:hover { background: rgba(159,208,255,.18); }

#hintbar {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--dim);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(5,8,16,.88) 0%, rgba(3,5,10,.97) 100%);
  z-index: 10;
  padding: 24px;
}

.hidden { display: none !important; }

.game-title {
  font-size: clamp(46px, 9.5vw, 92px);
  font-weight: 800;
  letter-spacing: 15px;
  line-height: 1;
  color: #f2f7ff;
  margin-left: 15px;
}

.game-title span { color: var(--sky); text-shadow: 0 0 28px var(--sky), 0 0 70px rgba(159,208,255,.35); }

.tagline {
  font-size: clamp(13px, 2.1vw, 18px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
}

.rules p { margin: 4px 0; color: #bcc9de; font-size: clamp(12.5px, 1.7vw, 15px); }
.rules strong { color: var(--sky); }
.rules p:nth-child(3) strong { color: #7cff6b; }
.rules p:nth-child(4) strong { color: var(--gold); }
.rules p:nth-child(6) strong { color: var(--bad); }

.btn {
  margin-top: 6px;
  padding: 15px 40px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: inherit;
  color: var(--sky);
  background: transparent;
  border: 2px solid var(--sky);
  border-radius: 40px;
  cursor: pointer;
  transition: all .18s;
  box-shadow: 0 0 18px rgba(159,208,255,.2), inset 0 0 14px rgba(159,208,255,.06);
}

.btn:hover {
  background: rgba(159,208,255,.12);
  box-shadow: 0 0 30px rgba(159,208,255,.42), inset 0 0 18px rgba(159,208,255,.1);
}

.btn.secondary {
  color: #93a4c8;
  border-color: rgba(150,175,220,.5);
  box-shadow: none;
}

.btn.secondary:hover { background: rgba(150,175,220,.1); box-shadow: none; }

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.win-title {
  font-size: clamp(26px, 5.5vw, 44px);
  letter-spacing: 8px;
  color: var(--bad);
  text-shadow: 0 0 28px rgba(255,84,112,.5);
}

.final-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.final-label { font-size: 11px; letter-spacing: 4px; color: var(--dim); }

.final-score {
  font-size: clamp(40px, 8vw, 66px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 24px rgba(255,255,255,.35);
  font-variant-numeric: tabular-nums;
}

.dim { color: #8593ba; font-size: 13.5px; letter-spacing: 1.5px; }

.best {
  min-height: 20px;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: #ffd97a;
}
