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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  background: #0a0a1a;
  color: white;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Canvas Container */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

#score-container, #highscore-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#score-label, #highscore-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ff6b9d;
  margin-bottom: 5px;
}

#score, #highscore {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px #ff6b9d;
}

#magic-meter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
}

#magic-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #00f7ff;
  margin-bottom: 5px;
}

#magic-bar {
  width: 100%;
  height: 20px;
  background: rgba(0, 247, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(0, 247, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.3);
}

#magic-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00f7ff, #00ff88);
  border-radius: 8px;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.8);
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  background: rgba(10, 10, 26, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

.screen h1 {
  font-size: 64px;
  font-weight: bold;
  color: #ff6b9d;
  text-shadow: 0 0 30px #ff6b9d, 0 0 60px #ff6b9d;
  margin-bottom: 10px;
  animation: pulse 2s infinite;
}

.subtitle {
  font-size: 24px;
  color: #00f7ff;
  margin-bottom: 40px;
  text-shadow: 0 0 20px #00f7ff;
}

/* Controls Info */
.controls-info {
  background: rgba(255, 107, 157, 0.1);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  border: 2px solid rgba(255, 107, 157, 0.3);
}

.control-group {
  margin: 15px 0;
  text-align: center;
}

.control-label {
  display: block;
  font-size: 14px;
  color: #ff6b9d;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.control-text {
  font-size: 13px;
  color: #ddd;
}

/* Neon Button */
.neon-button {
  padding: 18px 50px;
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: transparent;
  border: 3px solid #ff6b9d;
  border-radius: 50px;
  color: #ff6b9d;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

.neon-button:hover {
  background: rgba(255, 107, 157, 0.2);
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 107, 157, 0.8);
}

.neon-button:active {
  transform: scale(0.95);
}

.button-icon {
  font-size: 24px;
}

.button-text {
  font-size: 16px;
}

/* Game Tips */
.game-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 30px;
}

.tip {
  font-size: 13px;
  color: #aaa;
  background: rgba(0, 247, 255, 0.1);
  padding: 10px 20px;
  border-radius: 8px;
  border-left: 3px solid #00f7ff;
  text-align: center;
}

/* Final Score */
.final-score, .highscore-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.final-score .label, .highscore-display .label {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 10px;
}

.final-score .value, .highscore-display .value {
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px #ff6b9d;
}

#final-highscore {
  color: #00f7ff;
  text-shadow: 0 0 20px #00f7ff;
}

/* New Record */
.new-record {
  font-size: 20px;
  color: #ffdd00;
  margin-bottom: 30px;
  animation: pulse 0.5s infinite;
}

/* Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Responsive Design */
@media (max-width: 768px) {
  #hud {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }

  #magic-meter-container {
    width: 100%;
    max-width: 300px;
  }

  .screen h1 {
    font-size: 42px;
  }

  .subtitle {
    font-size: 18px;
  }

  .neon-button {
    padding: 15px 40px;
    font-size: 16px;
  }

  .button-text {
    font-size: 12px;
  }

  .controls-info {
    padding: 15px;
  }

  .control-group {
    margin: 10px 0;
  }

  .control-label {
    font-size: 12px;
  }

  .control-text {
    font-size: 11px;
  }
}

/* Mobile Controls */
@media (max-width: 480px) {
  #score, #highscore {
    font-size: 22px;
  }

  .tip {
    font-size: 12px;
    padding: 8px 15px;
  }
}
