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

body {
  font-family: 'Press Start 2P', cursive;
  background: linear-gradient(135deg, #0a0015 0%, #1a0a2e 50%, #0d0518 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
#header {
  text-align: center;
  padding: 15px 0;
  position: relative;
}

#title {
  font-size: clamp(16px, 5vw, 28px);
  background: linear-gradient(180deg, #ff1493 0%, #ff6600 25%, #ffff00 50%, #39ff14 75%, #00ffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 20, 147, 0.5);
  animation: titleGlow 2s ease-in-out infinite;
  letter-spacing: 2px;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 10px #ff1493); }
  50% { filter: drop-shadow(0 0 20px #00ffff); }
}

#insert-coin {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #ffff00;
  margin-top: 10px;
  animation: blink 1s step-end infinite;
  cursor: pointer;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* CRT Frame */
#crt-frame {
  position: relative;
  background: #000;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 
    0 0 0 4px #333,
    0 0 0 8px #1a1a1a,
    0 0 30px rgba(138, 43, 226, 0.3),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  flex: 1;
  min-height: 350px;
  max-height: 500px;
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}

#scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  border-radius: 12px;
}

#crt-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  border-radius: 12px;
  z-index: 1;
}

/* Stats Bar */
#stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px 5px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  margin-top: 10px;
}

#stats-bar > div {
  text-align: center;
}

#stats-bar .label {
  display: block;
  font-size: 8px;
  color: #888;
  margin-bottom: 4px;
}

#score, #high-score {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #39ff14;
  text-shadow: 0 0 10px #39ff14;
}

#combo {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #ff1493;
  text-shadow: 0 0 10px #ff1493;
}

/* Power Bar */
#power-bar-container {
  height: 20px;
  background: #111;
  border-radius: 10px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  border: 2px solid #333;
}

#power-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff1493, #ff6600, #ffff00);
  border-radius: 8px;
  transition: width 0.1s;
  box-shadow: 0 0 15px rgba(255, 20, 147, 0.5);
}

#power-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

/* Controls */
#controls {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#instrument-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.instrument-btn {
  font-family: 'Press Start 2P', cursive;
  background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2a 100%);
  border: 2px solid #444;
  border-radius: 8px;
  padding: 10px 12px;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.instrument-btn span {
  display: block;
  font-size: 7px;
  margin-top: 5px;
}

.instrument-btn:hover {
  border-color: #666;
  transform: translateY(-2px);
}

.instrument-btn.active {
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

#tempo-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

#tempo-control label {
  font-size: 10px;
  color: #888;
}

#bpm-slider {
  width: 150px;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #222;
  border-radius: 4px;
  outline: none;
}

#bpm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(180deg, #ff6600 0%, #ff1493 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

#bpm-display {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #ff6600;
  text-shadow: 0 0 10px #ff6600;
  min-width: 50px;
  text-align: center;
}

#mode-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.mode-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2a 100%);
  border: 3px solid #444;
  border-radius: 8px;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  border-color: #666;
}

.mode-btn.active {
  border-color: #39ff14;
  color: #39ff14;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

#audio-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#mute-btn {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

#volume-slider {
  width: 100px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

/* Hit Feedback */
#hit-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
}

#hit-feedback.perfect {
  color: #39ff14;
  text-shadow: 0 0 20px #39ff14;
}

#hit-feedback.good {
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
}

#hit-feedback.ok {
  color: #ffff00;
  text-shadow: 0 0 20px #ffff00;
}

#hit-feedback.miss {
  color: #ff1493;
  text-shadow: 0 0 20px #ff1493;
}

#hit-feedback.power {
  color: #ff6600;
  text-shadow: 0 0 30px #ff6600;
}

@keyframes hitPop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* Footer */
#footer {
  text-align: center;
  padding: 15px;
  margin-top: auto;
}

#footer a {
  color: #ff6b9d;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s;
}

#footer a:hover {
  color: #ff1493;
}

.strawberry {
  display: inline-block;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.tagline {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #game-container {
    padding: 5px;
  }
  
  #crt-frame {
    min-height: 300px;
    border-radius: 15px;
  }
  
  .instrument-btn {
    padding: 8px 10px;
    font-size: 16px;
  }
  
  .instrument-btn span {
    font-size: 6px;
  }
  
  .mode-btn {
    font-size: 8px;
    padding: 10px 12px;
  }
  
  #bpm-slider {
    width: 100px;
  }
}