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

:root {
  --violet: #c77bff;
  --cyan: #46f0e0;
  --bg: #0a0d1a;
}

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

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

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

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

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

.hud-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(70,240,224,.5);
  font-variant-numeric: tabular-nums;
}

.small-v { font-size: 16px; }

#hintbar {
  position: fixed;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: #565f92;
  white-space: nowrap;
  pointer-events: none;
}

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

.hidden { display: none !important; }

.game-title {
  font-size: clamp(50px, 10vw, 100px);
  font-weight: 800;
  letter-spacing: 16px;
  line-height: 1;
  color: #f4f6ff;
  margin-left: 16px;
}

.game-title span { color: var(--violet); text-shadow: 0 0 28px var(--violet), 0 0 70px rgba(199,123,255,.45); }

.tagline {
  font-size: clamp(14px, 2.2vw, 19px);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(70,240,224,.5);
}

.rules p { margin: 4px 0; color: #b9bfde; font-size: clamp(13px, 1.7vw, 15.5px); }
.rules strong { color: var(--cyan); }
.rules p:nth-child(5) strong { color: var(--gold, #ffd166); }

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

.btn:hover {
  background: rgba(70,240,224,.13);
  box-shadow: 0 0 30px rgba(70,240,224,.5), inset 0 0 20px rgba(70,240,224,.15);
  transform: translateY(-2px);
}

.best { font-size: 13px; letter-spacing: 2px; color: var(--gold, #ffd166); }

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

.over-title { color: var(--violet); text-shadow: 0 0 26px var(--violet), 0 0 70px rgba(199,123,255,.35); }

.final-wrap { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.final-label { font-size: 11px; letter-spacing: 4px; color: #6b74a3; }

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

.dim { color: #767ea8; }
