:root {
  --bg-0: #05050d;
  --bg-1: #0a0a1a;
  --neon-cyan: #00ffe1;
  --neon-green: #00ff9c;
  --neon-pink: #ff2d78;
  --text-dim: #8b8bb8;
  --panel: rgba(16, 16, 38, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #eaeaff;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(90, 40, 180, 0.35), transparent 60%),
    radial-gradient(900px 600px at 85% 110%, rgba(0, 200, 180, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  width: min(92vw, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Title */
.title {
  margin: 0;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow:
    0 0 8px var(--neon-cyan),
    0 0 22px rgba(0, 255, 225, 0.6);
}

.title span {
  color: var(--neon-green);
  text-shadow:
    0 0 8px var(--neon-green),
    0 0 22px rgba(0, 255, 156, 0.6);
}

/* HUD */
.hud {
  width: 100%;
  display: flex;
  gap: 12px;
}

.hud-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  background: var(--panel);
  border: 1px solid rgba(0, 255, 225, 0.25);
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(0, 255, 225, 0.08);
}

.hud-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.hud-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

/* Board / canvas */
.board {
  position: relative;
  width: 100%;
  border-radius: 14px;
  padding: 4px;
  background: linear-gradient(160deg, rgba(0, 255, 225, 0.5), rgba(255, 45, 120, 0.4));
  box-shadow:
    0 0 24px rgba(0, 255, 225, 0.25),
    0 0 60px rgba(255, 45, 120, 0.15);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--bg-0);
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  border-radius: 10px;
  background: rgba(4, 4, 14, 0.78);
  backdrop-filter: blur(3px);
  transition: opacity 0.18s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-title {
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow:
    0 0 10px var(--neon-pink),
    0 0 30px rgba(255, 45, 120, 0.7);
}

.overlay-sub {
  margin: 0;
  color: #cfcfff;
  font-size: 15px;
}

.overlay-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(70%, 240px);
}

.overlay-score.hidden {
  display: none;
}

.overlay-score-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(139, 139, 184, 0.25);
}

.overlay-score-row span:last-child {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 8px var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

/* Button */
.btn {
  margin-top: 6px;
  padding: 12px 34px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--neon-green);
  background: transparent;
  border: 2px solid var(--neon-green);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-shadow: 0 0 8px rgba(0, 255, 156, 0.6);
  box-shadow: 0 0 14px rgba(0, 255, 156, 0.2);
}

.btn:hover,
.btn:focus-visible {
  background: var(--neon-green);
  color: #04120b;
  box-shadow: 0 0 26px rgba(0, 255, 156, 0.6);
  outline: none;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
