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

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

body {
padding-bottom: 50px;
}

/* 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: 700px;
  margin: 30px auto;
}

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

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

  z-index: 10;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.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;
  text-align: center;
}

.overlay-text strong {
  font-size: 32px;
  color: #feca57;

  text-shadow:
    0 0 10px rgba(254,202,87,0.6),
    0 0 30px rgba(254,202,87,0.4);
}

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

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

  background: linear-gradient(135deg, #ff9f43, #ff4c4c);
  color: #000;

  cursor: pointer;

  box-shadow:
    0 8px 0 #c0392b,
    0 15px 30px rgba(255,80,80,0.4);

  transition: 0.15s;
}

.play-btn:hover {
  transform: translateY(-3px);
}

.play-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #c0392b,
    0 5px 10px rgba(0,0,0,0.4);
}

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

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

  border-radius: 16px;

  box-shadow: 0 0 20px rgba(0,0,0,0.8);

  width: 100%;
  max-width: 650px;
  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;
}

#game::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(circle at 80% 50%, transparent 60px, rgba(255,255,255,0.05) 61px);

  pointer-events: none;
}

.power-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;

  width: 140px;
  height: 10px;

  background: rgba(255,255,255,0.1);
  border-radius: 8px;

  overflow: hidden;

  box-shadow:
    inset 0 0 10px rgba(0,0,0,0.6),
    0 0 10px rgba(0,0,0,0.4);
}

.power-bar-fill {
  height: 100%;
  width: 0%;

  background: linear-gradient(90deg, #1dd1a1, #feca57, #ff4c4c);

  box-shadow:
    0 0 10px rgba(255,255,255,0.3);

  transition: width 0.05s linear;
}



/* 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: #feca57;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(254,202,87,0.5);
}

.final-score-card {
  text-align: center;
  font-family: "Zen Dots", sans-serif;
  animation: finalScorePop 0.35s ease-out both;
}

.final-score-label {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.final-score-value {
  font-size: clamp(56px, 16vw, 92px);
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255,120,0,0.9),
    0 0 28px rgba(255,90,0,0.65);
}

.final-score-sub {
  margin-top: 8px;
  font-size: 13px;
  color: #ff7a00;
  letter-spacing: 2px;
}

#playBtn {
  margin-top: 22px;
  font-family: "Zen Dots", sans-serif;
  font-size: 14px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,120,0,0.8);
  background: linear-gradient(180deg, #ff8a00, #d94b00);
  color: #fff;
  box-shadow:
    0 0 14px rgba(255,120,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

@keyframes finalScorePop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#overlayLoginHint {
  font-size: 12px;
  color: #999;
}

/* 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;
  }
}