/* ========== Reset & Base Styles ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Orbitron', monospace;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #16213e 100%);
  color: #00ffff;
  overflow: hidden;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(0, 255, 127, 0.1) 0%, transparent 50%);
  z-index: -1;
}

/* ========== Game Container ========== */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
}

/* ========== Header Styles ========== */
.game-header {
  width: 100%;
  max-width: 800px;
  margin-bottom: 20px;
}

.game-title {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 20px;
  color: #00ffff;
  text-shadow:
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 40px #00ffff;
  animation: titlePulse 2s ease-in-out infinite alternate;
}

@keyframes titlePulse {
  0% {
    text-shadow:
      0 0 10px #00ffff,
      0 0 20px #00ffff,
      0 0 40px #00ffff;
  }
  100% {
    text-shadow:
      0 0 20px #00ffff,
      0 0 30px #00ffff,
      0 0 60px #00ffff;
  }
}

.game-stats {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #00ffff;
  border-radius: 10px;
  padding: 15px;
  box-shadow:
    0 0 20px rgba(0, 255, 255, 0.3),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 0.8rem;
  color: #888;
  font-weight: 400;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

/* ========== Game Area ========== */
.game-area {
  position: relative;
  border: 3px solid #00ffff;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow:
    0 0 30px rgba(0, 255, 255, 0.5),
    inset 0 0 30px rgba(0, 255, 255, 0.1);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  background: rgba(0, 0, 0, 0.2);
}

/* ========== Game Overlay ========== */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  padding: 40px;
  border: 2px solid #00ffff;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.8);
  box-shadow:
    0 0 30px rgba(0, 255, 255, 0.5),
    inset 0 0 30px rgba(0, 255, 255, 0.1);
}

#overlayTitle {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
}

#overlayText {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #aaa;
  white-space: pre-line;
  line-height: 1.6;
}

/* ========== Neon Button ========== */
.neon-button {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 15px 30px;
  margin: 10px;
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.neon-button:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow:
    0 0 20px #00ffff,
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
}

.neon-button:active {
  transform: translateY(0);
  box-shadow:
    0 0 10px #00ffff,
    inset 0 0 10px rgba(0, 255, 255, 0.2);
}

/* ========== Controls Info ========== */
.controls-info {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
  flex-wrap: wrap;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-key {
  background: rgba(0, 255, 255, 0.2);
  border: 1px solid #00ffff;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
  min-width: 40px;
  text-align: center;
}

.control-desc {
  font-size: 0.9rem;
  color: #aaa;
}

/* ========== Particles Container ========== */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #00ffff;
  border-radius: 50%;
  animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* ========== Power-up Effects ========== */
.powerup-effect {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.explosion-effect {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0080 0%, transparent 70%);
  animation: explosion 0.5s ease-out forwards;
}

@keyframes explosion {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ========== Responsive Design ========== */
@media (max-width: 900px) {
  .game-container {
    padding: 10px;
  }

  .game-title {
    font-size: 2rem;
  }

  #gameCanvas {
    width: 100%;
    height: auto;
    max-width: 800px;
  }

  .game-stats {
    flex-wrap: wrap;
    gap: 10px;
  }

  .controls-info {
    gap: 15px;
  }
}

@media (max-width: 600px) {
  .game-title {
    font-size: 1.5rem;
  }

  .overlay-content {
    padding: 20px;
  }

  #overlayTitle {
    font-size: 1.8rem;
  }

  .neon-button {
    font-size: 1rem;
    padding: 12px 25px;
  }
}

/* 🆕 コンボ表示 */
.combo-display {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace;
  font-size: 48px;
  font-weight: 900;
  color: #ffff00;
  text-shadow:
    0 0 10px #ffff00,
    0 0 20px #ffff00,
    0 0 30px #ffff00,
    0 0 40px #ff8000;
  animation: comboAnimation 2s ease-out;
  z-index: 1000;
  pointer-events: none;
}

@keyframes comboAnimation {
  0% {
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
  }
  20% {
    transform: translateX(-50%) scale(1.2);
    opacity: 1;
  }
  80% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
  }
}

/* 🆕 操作方法選択 */
.control-selection {
  margin: 20px 0;
}

.control-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

.control-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  min-width: 140px;
  background: rgba(0, 255, 255, 0.05);
  border: 2px solid #00ffff;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(0, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow:
    0 5px 20px rgba(0, 255, 255, 0.4),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.control-icon {
  font-size: 2rem;
  margin-bottom: 5px;
}

.control-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #00ffff;
}

.control-desc {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
}

/* 🆕 ゲームオーバーボタンコンテナ */
#gameOverButtons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* 🆕 HOMEボタン */
.home-button {
  background: rgba(255, 128, 0, 0.1);
  border-color: #ff8000;
  color: #ff8000;
}

.home-button:hover {
  background: rgba(255, 128, 0, 0.2);
  box-shadow:
    0 0 20px #ff8000,
    inset 0 0 20px rgba(255, 128, 0, 0.1);
  border-color: #ff8000;
}
