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

:root {
  --mint: #7dffce;
  --amber: #ffd166;
  --danger: #ff5470;
  --bg: #050818;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #e8f4ff;
  -webkit-user-select: none;
  user-select: none;
}

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

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

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

.hud-row { display: flex; gap: 12px; align-items: baseline; }
.hud-end { justify-content: flex-end; }

.hud-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #5f7ba8;
}

.hud-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--mint);
  text-shadow: 0 0 10px rgba(125,255,206,.45);
  font-variant-numeric: tabular-nums;
}

#deaths { color: var(--danger); text-shadow: 0 0 10px rgba(255,84,112,.5); }

.hud-center { text-align: center; }

.sector-name {
  font-size: 13px;
  letter-spacing: 5px;
  color: #9fc3e8;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(159,195,232,.35);
}

#hintbar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 2px;
  color: #48608a;
  pointer-events: none;
  white-space: nowrap;
}

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

.hidden { display: none !important; }

.game-title {
  font-size: clamp(46px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: 14px;
  line-height: 1;
  color: #f2faff;
  margin-left: 14px;
}

.game-title span {
  color: var(--mint);
  text-shadow: 0 0 28px var(--mint), 0 0 70px rgba(125,255,206,.4);
}

.tagline {
  font-size: clamp(14px, 2.2vw, 19px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255,209,102,.5);
}

.rules p {
  margin: 5px 0;
  color: #a9c1dd;
  font-size: clamp(13px, 1.7vw, 15.5px);
}

.rules strong { color: var(--mint); }
.rules p:nth-child(5) strong { color: var(--danger); }

.btn {
  margin-top: 6px;
  padding: 15px 44px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--mint);
  background: transparent;
  border: 2px solid var(--mint);
  border-radius: 40px;
  cursor: pointer;
  transition: all .18s;
  box-shadow: 0 0 18px rgba(125,255,206,.22), inset 0 0 14px rgba(125,255,206,.07);
}

.btn:hover {
  background: rgba(125,255,206,.13);
  box-shadow: 0 0 32px rgba(125,255,206,.55), inset 0 0 22px rgba(125,255,206,.16);
  transform: translateY(-2px);
}

.best {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255,209,102,.4);
}

.dim   { color: #6d84a6; }
.small { font-size: 12px; letter-spacing: 1px; }

h2 {
  font-size: clamp(28px, 5.5vw, 48px);
  letter-spacing: 7px;
  color: #f2faff;
}

.clear-title {
  color: var(--mint);
  text-shadow: 0 0 26px var(--mint);
}

.final-title {
  color: var(--amber);
  text-shadow: 0 0 26px var(--amber), 0 0 70px rgba(255,209,102,.35);
}

.bonus {
  font-size: clamp(16px, 2.6vw, 22px);
  color: var(--mint);
  text-shadow: 0 0 14px rgba(125,255,206,.45);
  white-space: pre-line;
  line-height: 1.7;
}

.final-wrap { display: flex; flex-direction: column; gap: 6px; }

.final-label {
  font-size: 11px;
  letter-spacing: 4px;
  color: #5f7ba8;
}

.final-score {
  font-size: clamp(44px, 8.5vw, 78px);
  font-weight: 800;
  color: var(--amber);
  text-shadow: 0 0 30px var(--amber);
  font-variant-numeric: tabular-nums;
}
