:root {
  --bg-1: #050816;
  --bg-2: #101a30;
  --panel: rgba(10, 18, 31, 0.96);
  --panel-border: #d7ecff;
  --text: #eef6ff;
  --muted: #c2d1ea;
  --primary: #7dd3fc;
  --accent: #facc15;
  --danger: #fb7185;
  --good: #34d399;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  display: grid;
  place-items: center;
}

button {
  font: inherit;
}

.game-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.panel,
.game-container,
.overlay-card {
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow:
    0 18px 38px var(--shadow),
    inset 0 0 25px rgba(125, 211, 252, 0.08);
}

.panel,
.game-container {
  width: 820px;
  background: var(--panel);
}

.panel {
  min-height: 510px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 18px;
}

.title-wrap {
  margin-bottom: 10px;
}

.title-glow {
  font-size: 4.3rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f8fbff;
  text-shadow:
    0 0 10px rgba(125, 211, 252, 0.9),
    0 0 22px rgba(125, 211, 252, 0.75),
    0 0 42px rgba(125, 211, 252, 0.55);
}

.panel p {
  margin: 0 0 22px;
  font-size: 1.15rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.difficulty-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.difficulty-btn,
.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.difficulty-btn {
  background: #dfeaf9;
  color: #0f172a;
  font-weight: 800;
  padding: 12px 18px;
  min-width: 110px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.difficulty-btn.active {
  background: linear-gradient(180deg, #facc15, #f59e0b);
  box-shadow:
    0 0 0 2px rgba(250, 204, 21, 0.35),
    0 0 18px rgba(250, 204, 21, 0.38);
}

.primary-btn,
.secondary-btn {
  background: linear-gradient(180deg, #f8fbff, #dfeaf9);
  color: #111827;
  font-weight: 800;
  padding: 12px 20px;
}

.primary-btn:hover,
.secondary-btn:hover,
.difficulty-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.game-container {
  padding: 14px 14px 10px;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 8px 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.best-score,
.status {
  font-size: 1rem;
}

.scoreboard {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 2.7rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #f8fbff;
  text-shadow: 0 0 10px rgba(125, 211, 252, 0.45);
}

.score {
  min-width: 78px;
  text-align: center;
}

.divider {
  opacity: 0.8;
}

canvas {
  display: block;
  width: 800px;
  height: 500px;
  border: 4px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bg-1), #0f172a 100%);
  box-shadow:
    inset 0 0 18px rgba(125, 211, 252, 0.1),
    0 12px 24px rgba(0, 0, 0, 0.25);
  margin-top: 12px;
  cursor: none;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 2px;
}

.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 20, 0.7);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.overlay-card {
  width: min(440px, 90vw);
  background: rgba(15, 23, 42, 0.98);
  padding: 30px 22px 22px;
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.06em;
  color: #fdfdfd;
  text-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
