/* RESET */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  background: radial-gradient(circle at top, #0f0f0f, #000);
}

body {
padding-bottom: 50px;
}

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

/* TITLE */
.game h2 {
  font-family: "Zen Dots", sans-serif;
  margin-top: 30px;
  letter-spacing: 0.15em;
  text-align: center;
  color: #ffffff;
}

/* WRAPPER */
.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 30px auto;
}

/* OVERLAY */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;

  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);

  z-index: 10;
  transition: 0.2s;
}

#overlay.hidden {
  pointer-events: none;
  display: none;
}

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

.overlay-text {
  color: #fff;
  font-size: 18px;
  opacity: 0.9;
  line-height: 1.5;
}

.overlay-text strong {
  font-size: 28px;
  color: #4cff9a;
  text-shadow: 0 0 12px rgba(76,255,154,0.6);
}

/* BUTTON */
.play-btn {
  font-family: "Zen Dots", sans-serif;
  font-size: 20px;
  padding: 14px 32px;
  border-radius: 14px;
  border: none;

  background: linear-gradient(135deg, #4cff9a, #2ecc71);
  color: #000;

  cursor: pointer;
  transition: 0.2s;

  box-shadow:
    0 10px 30px rgba(76,255,154,0.4),
    inset 0 0 10px rgba(255,255,255,0.2);
}

.play-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 20px 50px rgba(76,255,154,0.6),
    inset 0 0 12px rgba(255,255,255,0.3);
}

/* CANVAS */
#game {
  display: block;
  margin: 0 auto;

  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent),
    radial-gradient(circle at 50% 20%, #1a1a1a, #000);

  --glow-color: #3a0000

  border-radius: 12px;

  box-shadow:
    0 0 10px var(--glow-color),
    0 0 30px var(--glow-color),
    0 0 60px var(--glow-color),
    0 0 120px var(--glow-color);

  filter: brightness(1.1);

  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;

  border: 1px solid rgba(255,255,255,0.08);

  touch-action: none;
  user-select: none;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: glowPulse 1.5s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from {
    box-shadow:
      0 0 10px var(--glow-color),
      0 0 30px var(--glow-color),
      0 0 60px var(--glow-color);
  }
  to {
    box-shadow:
      0 0 20px var(--glow-color),
      0 0 50px var(--glow-color),
      0 0 100px var(--glow-color);
  }
}

/* HUD */
.hud {
  color: #fff;
  width: 100%;
  max-width: 520px;
  margin: 15px auto 0;
  padding: 0 12px;

  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

/* SCORELINE */
.scoreline {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);

  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;

  border-radius: 12px;
  font-size: 15px;
  padding: 12px 16px;

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 0 20px rgba(0,0,0,0.5),
    inset 0 0 20px rgba(255,255,255,0.03);
}

.scoreline .item {
  white-space: nowrap;
}

.scoreline .sep {
  opacity: 0.3;
}

/* highlight score */
#score {
  color: #4cff9a;
  font-weight: bold;
}

/* LEADERBOARD */
.leaderboard {
  width: 100%;
  max-width: 420px;

  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px;

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 0 25px rgba(0,0,0,0.6),
    inset 0 0 20px rgba(255,255,255,0.03);
}

.leaderboard h3 {
  margin: 0 0 10px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

#leaderboardList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#leaderboardList li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  transition: 0.2s;
}

#leaderboardList li:hover {
  transform: translateX(4px);
  opacity: 1;
}

.music-btn {
  position: absolute;
  top: 12px;
  right: 12px;

  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;

  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;

  backdrop-filter: blur(6px);
  transition: 0.2s;
}

.music-btn:hover {
  transform: scale(1.1);
}

/* RANK */
.rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: bold;
  font-size: 13px;

  background: #2c2c2c;
}

/* TOP 3 */
.rank.gold {
  background: linear-gradient(135deg, #ffd700, #ffb400);
  color: #000;
  box-shadow: 0 0 10px rgba(255,215,0,0.6);
}

.rank.silver {
  background: linear-gradient(135deg, #c0c0c0, #9e9e9e);
  color: #000;
}

.rank.bronze {
  background: linear-gradient(135deg, #cd7f32, #a05a2c);
}

/* SCORE TEXT */
.score {
  opacity: 0.7;
}

/* MOBILE */
@media (max-width: 360px) {
  .scoreline .sep {
    display: none;
  }
}