@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
  background: #05050d;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Orbitron', monospace;
}

#game-wrap {
  background: #0a0a0f;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid #00ffcc1a;
  box-shadow: 0 0 60px #00ffcc0a, 0 0 120px #ff00ff08;
}

/* ── HUD ── */
#hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  gap: 10px;
}

.hud-box {
  flex: 1;
  background: #111120;
  border: 1px solid #00ffcc33;
  border-radius: 8px;
  padding: 8px 14px;
  text-align: center;
  transition: border-color 0.3s;
}

.hud-label {
  font-size: 10px;
  color: #00ffcc88;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 20px;
  font-weight: 700;
  color: #00ffcc;
}

.combo-val {
  color: #ff00ff;
  animation: comboPulse 0.4s ease;
}

@keyframes comboPulse {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Power-up bar ── */
#powerup-bar {
  width: 100%;
  max-width: 500px;
  min-height: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#powerup-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
}

#powerup-timer-wrap {
  width: 100%;
  height: 4px;
  background: #ffffff18;
  border-radius: 2px;
  overflow: hidden;
}

#powerup-timer-bar {
  height: 100%;
  width: 100%;
  background: #00ffcc;
  border-radius: 2px;
  transition: width 0.2s linear, background 0.3s;
}

/* ── Canvas Wrapper ── */
#canvas-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 40px #00ffcc22, 0 0 80px #ff00ff11;
}

canvas {
  display: block;
  background: #060610;
}

/* ── Level Flash ── */
#lvl-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 900;
  color: #ff00ff;
  letter-spacing: 4px;
  text-shadow: 0 0 20px #ff00ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
}

/* ── Overlay ── */
#overlay, #scores-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #060610ee;
  gap: 12px;
  border-radius: 10px;
}

#overlay h2, #scores-panel h2 {
  font-size: 26px;
  font-weight: 900;
  color: #00ffcc;
  letter-spacing: 4px;
  text-shadow: 0 0 20px #00ffcc;
}

#overlay .sub {
  font-size: 12px;
  color: #ff00ff99;
  letter-spacing: 3px;
}

.score-final {
  font-size: 14px;
  color: #fff;
  margin-top: 4px;
  letter-spacing: 2px;
  text-align: center;
  line-height: 1.8;
}

/* ── Buttons ── */
#start-btn, #scores-close-btn {
  background: transparent;
  border: 1.5px solid #00ffcc;
  color: #00ffcc;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 12px 32px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s, box-shadow 0.2s;
}

#start-btn:hover, #scores-close-btn:hover {
  background: #00ffcc22;
  box-shadow: 0 0 20px #00ffcc55;
}

#tip {
  font-size: 11px;
  color: #ffffff33;
  letter-spacing: 1px;
}

/* ── High Scores Panel ── */
#scores-list {
  list-style: none;
  width: 280px;
  margin-top: 4px;
}

#scores-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #fff;
  padding: 6px 10px;
  border-bottom: 1px solid #ffffff11;
  letter-spacing: 1px;
}

#scores-list li:first-child {
  color: #ffd700;
}

#scores-list li .rank {
  color: #00ffcc88;
  width: 24px;
}

/* ── Legend ── */
#legend {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: #ffffff55;
  letter-spacing: 1px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-normal  { background: #00ffcc; box-shadow: 0 0 6px #00ffcc; }
.dot-bonus   { background: #ff00ff; box-shadow: 0 0 6px #ff00ff; }
.dot-slow    { background: #00aaff; box-shadow: 0 0 6px #00aaff; }
.dot-double  { background: #ffaa00; box-shadow: 0 0 6px #ffaa00; }

/* ── Bottom bar ── */
#bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
}

#scores-btn {
  background: transparent;
  border: 1px solid #ffffff22;
  color: #ffffff55;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

#scores-btn:hover {
  border-color: #00ffcc55;
  color: #00ffcc;
}

/* ── Mobile Controls ── */
.mobile-btns {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mob-row {
  display: flex;
  gap: 6px;
}

.mob-btn {
  background: #111120;
  border: 1px solid #00ffcc44;
  color: #00ffcc;
  font-size: 18px;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.mob-btn:active {
  background: #00ffcc22;
}

/* ── Pause indicator ── */
#paused-indicator {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #ff00ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .mobile-btns {
    display: flex;
  }

  #tip {
    display: none;
  }

  #game-wrap {
    padding: 14px 10px;
    border-radius: 0;
    min-height: 100vh;
    justify-content: center;
  }

  canvas {
    width: 100%;
    height: auto;
  }

  #legend {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}
