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

html, body {
  height: 100%;
  background: #05060f;
  overflow: hidden;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: block;
  background: #1030a0;
  cursor: pointer;
}

.hidden { display: none !important; }

/* ---------- overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, rgba(30, 80, 220, 0.55), rgba(4, 8, 40, 0.88)),
              linear-gradient(180deg, #1638b8, #0a1354);
  z-index: 10;
}

.menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  animation: menu-pop 0.35s ease-out;
}

@keyframes menu-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.gd-title {
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 0.06em;
  color: #fff;
  -webkit-text-stroke: 2px #08133f;
  text-shadow:
    0 4px 0 #08133f,
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(120, 200, 255, 0.35);
  transform: perspective(300px) rotateX(8deg);
}

.gd-title.small { font-size: clamp(28px, 4.5vw, 52px); color: #7cff6e; }

.level-card {
  background: rgba(5, 10, 40, 0.75);
  border: 3px solid rgba(140, 190, 255, 0.5);
  border-radius: 14px;
  padding: 18px 42px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 24px rgba(60, 120, 255, 0.18);
}

.level-name {
  font-size: clamp(20px, 3vw, 34px);
  color: #ffe14d;
  letter-spacing: 0.08em;
  text-shadow: 0 3px 0 #4a3200, 0 0 18px rgba(255, 210, 60, 0.45);
}

.level-diff {
  margin-top: 8px;
  color: #9fd0ff;
  font-size: clamp(12px, 1.4vw, 16px);
  letter-spacing: 0.12em;
}

.diff-face { color: #ffd23e; }

.level-stats {
  margin-top: 12px;
  display: flex;
  gap: 28px;
  justify-content: center;
  color: #cfe4ff;
  font-size: clamp(11px, 1.3vw, 15px);
  letter-spacing: 0.06em;
}

/* ---------- play button ---------- */

.play-btn {
  width: clamp(96px, 12vw, 140px);
  height: clamp(96px, 12vw, 140px);
  border-radius: 50%;
  border: 5px solid #0a4d12;
  background: radial-gradient(circle at 35% 30%, #a6ff7a, #37d43c 55%, #14962c);
  box-shadow: 0 8px 0 #0a4d12, 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 44px rgba(90, 255, 110, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: play-pulse 1.6s ease-in-out infinite;
}

.play-btn:hover { transform: scale(1.07); }
.play-btn:active {
  transform: scale(0.97) translateY(4px);
  box-shadow: 0 4px 0 #0a4d12, 0 8px 20px rgba(0, 0, 0, 0.5);
}

@keyframes play-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.play-tri {
  width: 0;
  height: 0;
  margin-left: 10%;
  border-top: clamp(20px, 2.6vw, 30px) solid transparent;
  border-bottom: clamp(20px, 2.6vw, 30px) solid transparent;
  border-left: clamp(32px, 4.2vw, 48px) solid #eafff0;
  filter: drop-shadow(0 3px 0 rgba(6, 60, 14, 0.8));
}

.controls-hint {
  color: rgba(210, 230, 255, 0.85);
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.04em;
}

.credit {
  color: rgba(160, 185, 230, 0.55);
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.text-btn {
  font-family: inherit;
  font-size: clamp(14px, 1.8vw, 20px);
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(180deg, #3fa2ff, #1359c9);
  border: 3px solid #0a2f6e;
  border-radius: 10px;
  padding: 12px 34px;
  cursor: pointer;
  box-shadow: 0 5px 0 #0a2f6e, 0 10px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.text-btn:hover { filter: brightness(1.1); }
.text-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0a2f6e; }

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}

#progress-wrap {
  width: min(46vw, 560px);
  height: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #59ff6a, #b7ff59);
  border-radius: 6px;
  transition: width 0.08s linear;
}

#progress-pct {
  color: #fff;
  font-size: 13px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
}

/* ---------- mute ---------- */

#btn-mute {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 30, 0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: filter 0.1s ease;
}

#btn-mute:hover { filter: brightness(1.3); }
#btn-mute.muted { color: rgba(255, 255, 255, 0.35); text-decoration: line-through; }
