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

body {
  background: #0f0f0f;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

/* ── Toggle bar ─────────────────────────────────────────────────────────────── */
.toggle-bar {
  display: flex;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  padding: 8px 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #666;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.toggle-btn:hover {
  color: #ccc;
}

.toggle-btn.active {
  background: #4ade80;
  color: #0f0f0f;
}

/* ── Game sections ──────────────────────────────────────────────────────────── */
.game-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.game-section.hidden {
  display: none;
}

/* ── Score board ────────────────────────────────────────────────────────────── */
.score-board {
  display: flex;
  gap: 32px;
  font-size: 1rem;
  color: #a0a0a0;
}

.score-board span span {
  color: #fff;
  font-weight: 600;
}

/* ── Canvas ─────────────────────────────────────────────────────────────────── */
.canvas-wrapper {
  position: relative;
  line-height: 0;
}

canvas {
  display: block;
  border: 2px solid #2a2a2a;
  border-radius: 4px;
  background: #1a1a1a;
}

/* ── Overlay ────────────────────────────────────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.overlay-content h2 {
  font-size: 1.8rem;
  color: #4ade80;
  letter-spacing: 0.1em;
}

.overlay-content p {
  color: #a0a0a0;
  font-size: 0.9rem;
}

.overlay-content button {
  margin-top: 8px;
  padding: 10px 28px;
  background: #4ade80;
  color: #0f0f0f;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s;
}

.overlay-content button:hover {
  background: #86efac;
}

/* ── Hint ───────────────────────────────────────────────────────────────────── */
.hint {
  font-size: 0.78rem;
  color: #555;
  margin-top: 4px;
}
