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

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  overflow: hidden;
}

/* 遊戲容器 */
.game-container {
  position: relative;
  width: 800px;
  height: 600px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* 主畫布 */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

/* HUD 顯示 */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
}

.hud > * {
  pointer-events: auto;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 32px;
  font-weight: 900;
  color: #22d3ee;
}

.hud-value.combo {
  color: #f472b6;
}

/* 暫停按鈕 */
.pause-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.pause-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.pause-btn .play-icon {
  display: none;
}

.pause-btn.paused .pause-icon {
  display: none;
}

.pause-btn.paused .play-icon {
  display: inline;
}

/* 暫停畫面 */
.pause-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 50;
  transition: opacity 0.3s, visibility 0.3s;
}

.pause-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.pause-content {
  text-align: center;
}

.pause-title {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 16px;
}

.pause-hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
}

.resume-btn {
  padding: 14px 40px;
  font-size: 18px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #0a0a1a;
  background: #22d3ee;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.resume-btn:hover {
  transform: scale(1.05);
  background: #67e8f9;
}

/* 開始畫面 */
.start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: opacity 0.5s, visibility 0.5s;
}

.start-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.title {
  font-size: 48px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: #22d3ee;
  animation: pulse 2s ease-in-out infinite;
}

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

.subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
  text-align: center;
  max-width: 400px;
  line-height: 1.6;
}

/* 音色選擇器 */
.sound-selector {
  margin-bottom: 24px;
  text-align: center;
}

.selector-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.sound-options {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sound-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 70px;
  color: rgba(255, 255, 255, 0.6);
}

.sound-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.sound-option.active {
  background: rgba(34, 211, 238, 0.1);
  border-color: #22d3ee;
  color: #22d3ee;
}

.sound-icon {
  font-size: 20px;
}

.sound-name {
  font-size: 10px;
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-btn {
  padding: 16px 48px;
  font-size: 20px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #0a0a1a;
  background: #22d3ee;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.start-btn:hover {
  transform: scale(1.05);
  background: #67e8f9;
}

.start-btn:active {
  transform: scale(0.98);
}

/* 說明文字 */
.instructions {
  margin-top: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin: 8px 0;
}

.instructions .highlight {
  color: #22d3ee;
  font-weight: 700;
}

/* 頁尾 */
footer {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

footer a {
  color: #22d3ee;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* RWD */
@media (max-width: 850px) {
  .game-container {
    width: 100vw;
    height: 75vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .title {
    font-size: 32px;
  }

  .hud-value {
    font-size: 24px;
  }
}
