/* QUIZ//NEON スタイルシート (Audio & Visual Update) */

:root {
  --neon-primary: #00ff88;
  --neon-secondary: #ff0088;
  --neon-background: #000000;
  --neon-alert: #ff2200; /* ボス戦用の赤 */
}

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

body {
  font-family: 'Orbitron', monospace;
  background: #000;
  color: var(--neon-primary);
  overflow: hidden;
  user-select: none;
  position: relative;
  min-height: 100vh;
  transition: color 0.5s ease;
}

/* 背景演出 */
.city-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.neon-grid {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
      linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridPulse 4s ease-in-out infinite;
  transition: all 0.5s ease;
}

.data-stream {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--neon-primary), transparent);
  left: 10%;
  animation: dataFlow 3s linear infinite;
}

.scanner-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-primary), transparent);
  top: 30%;
  animation: scannerMove 6s ease-in-out infinite;
  box-shadow: 0 0 10px var(--neon-primary);
}

/* ボス戦用のオーバーレイ */
.boss-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 50%, rgba(255, 0, 0, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ボスモード（赤色テーマ） */
body.boss-active {
  color: var(--neon-alert);
}

body.boss-active .neon-grid {
  background-image: 
      linear-gradient(rgba(255, 34, 0, 0.15) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 34, 0, 0.15) 1px, transparent 1px);
}

body.boss-active .screen {
  border-color: var(--neon-alert);
  box-shadow: 
      0 0 30px rgba(255, 34, 0, 0.3),
      inset 0 0 30px rgba(255, 34, 0, 0.1);
}

body.boss-active .choice-btn {
    border-color: #622;
    color: #f88;
}

body.boss-active .choice-btn:hover {
    border-color: var(--neon-alert);
    color: var(--neon-alert);
    box-shadow: 0 0 15px rgba(255, 34, 0, 0.4);
}

body.boss-active .choice-number {
    background: var(--neon-alert);
    color: #fff;
}

body.boss-active .boss-overlay {
    opacity: 1;
    animation: alarmPulse 1s infinite alternate;
}

/* ボス警告テキスト */
.boss-warning {
    color: var(--neon-alert);
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--neon-alert);
    animation: textBlink 0.2s infinite;
    letter-spacing: 5px;
}
.boss-warning.hidden {
    display: none;
}

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

@keyframes alarmPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

@keyframes dataFlow {
  0% { transform: translateY(-100px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(calc(100vh + 100px)); opacity: 0; }
}

@keyframes scannerMove {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(50vh); opacity: 1; }
}

/* 画面シェイク（正解時） */
@keyframes shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-5px, -5px) rotate(-1deg); }
  20% { transform: translate(5px, 5px) rotate(1deg); }
  30% { transform: translate(-5px, 5px) rotate(0deg); }
  40% { transform: translate(5px, -5px) rotate(1deg); }
  50% { transform: translate(-2px, 2px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shake-effect {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* メインコンテナ */
.main-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 800px;
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--neon-primary);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 
      0 0 30px rgba(0, 255, 136, 0.3),
      inset 0 0 30px rgba(0, 255, 136, 0.1);
  position: relative;
  transition: all 0.5s ease;
}

.screen.active {
  display: block;
}

/* スタート画面 */
.logo-container {
  margin-bottom: 40px;
}

.game-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 0 0 20px var(--neon-primary);
  letter-spacing: 3px;
}

.neon-slash {
  color: var(--neon-secondary);
  text-shadow: 0 0 20px var(--neon-secondary);
  animation: slashFlicker 2s ease-in-out infinite;
}

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

.subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: #88ffaa;
  margin-bottom: 20px;
  font-weight: 400;
}

.city-status {
  font-size: 0.9rem;
  color: #666;
}

.status-online {
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-primary);
  animation: statusBlink 1.5s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 入力とボタン */
.start-menu {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

.name-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-label {
  font-size: 0.9rem;
  color: #88ffaa;
}

.neon-input {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--neon-primary);
  color: var(--neon-primary);
  padding: 12px 20px;
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  text-align: center;
  border-radius: 5px;
  outline: none;
  width: 250px;
  transition: all 0.3s ease;
}

.neon-input:focus {
  border-color: var(--neon-secondary);
  box-shadow: 0 0 15px rgba(255, 0, 136, 0.5);
  text-shadow: 0 0 5px var(--neon-primary);
}

.mode-selection {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-btn {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #444;
  color: #888;
  padding: 12px 25px;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mode-btn.active,
.mode-btn:hover {
  border-color: var(--neon-primary);
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-primary);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.start-btn {
  background: linear-gradient(45deg, var(--neon-primary), #88ffaa);
  border: none;
  color: #000;
  padding: 15px 40px;
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4);
}

.btn-effect {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  top: 0;
  left: -100%;
  transition: left 0.6s ease;
}

.start-btn:hover .btn-effect {
  left: 100%;
}

/* ゲーム画面 */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.stats-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

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

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

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-primary);
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.timer-bar {
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #444;
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-primary), #ffaa00, var(--neon-secondary));
  width: 100%;
  transition: width 0.1s linear;
  border-radius: 4px;
}

.timer-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neon-primary);
  min-width: 30px;
  text-align: center;
}

/* 問題とクイズ */
.question-container {
  margin-bottom: 30px;
}

.question-text {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: #fff;
  margin-bottom: 30px;
  line-height: 1.5;
  background: rgba(0, 255, 136, 0.1);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  transition: all 0.3s ease;
}

body.boss-active .question-text {
    background: rgba(255, 34, 0, 0.15);
    border-color: rgba(255, 34, 0, 0.5);
    color: #ffd;
}

.choices-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  max-width: 100%;
}

.choice-btn {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #444;
  color: #ccc;
  padding: 15px 20px;
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.choice-btn:hover {
  border-color: var(--neon-primary);
  color: var(--neon-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.2);
}

.choice-number {
  background: var(--neon-primary);
  color: #000;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.choice-text {
  flex: 1;
  line-height: 1.3;
}

.choice-btn.correct {
  border-color: var(--neon-primary) !important;
  background: rgba(0, 255, 136, 0.2);
  color: var(--neon-primary) !important;
  animation: correctPulse 0.5s ease;
}

.choice-btn.wrong {
  border-color: var(--neon-secondary) !important;
  background: rgba(255, 0, 136, 0.2);
  color: var(--neon-secondary) !important;
  animation: wrongShake 0.5s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* フィードバック */
.feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--neon-primary);
  border-radius: 10px;
  padding: 30px;
  max-width: 90%;
  z-index: 100;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.feedback.hidden {
  display: none;
}

.feedback-result {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.feedback-explanation {
  font-size: 1rem;
  line-height: 1.5;
  color: #ccc;
}

/* リザルト画面 */
.result-container {
  text-align: center;
}

.result-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--neon-primary);
  margin-bottom: 30px;
  text-shadow: 0 0 20px var(--neon-primary);
}

.memory-code {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--neon-primary);
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 30px;
  font-family: monospace;
}

.code-label {
  color: #888;
  font-size: 0.9rem;
}

.code-value {
  color: var(--neon-primary);
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 10px var(--neon-primary);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.result-stat {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  padding: 15px;
}

.result-label {
  display: block;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.result-value {
  color: var(--neon-primary);
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow: 0 0 10px var(--neon-primary);
}

.result-value.rank {
  font-size: 2rem;
}

.memory-fragment {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  font-style: italic;
  color: #ccc;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  background: linear-gradient(45deg, var(--neon-primary), #88ffaa);
  border: none;
  color: #000;
  padding: 12px 30px;
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .main-container {
      padding: 10px;
  }
  
  .screen {
      padding: 20px;
  }
  
  .game-header {
      flex-direction: column;
      gap: 15px;
  }
  
  .stats-bar {
      justify-content: center;
  }
  
  .timer-container {
      width: 100%;
      justify-content: center;
  }
  
  .timer-bar {
      flex: 1;
      max-width: 200px;
  }
  
  .choices-container {
      grid-template-columns: 1fr;
      gap: 12px;
  }
  
  .choice-btn {
      padding: 12px 15px;
      font-size: 0.9rem;
  }
  
  .mode-selection {
      flex-direction: column;
      width: 100%;
      max-width: 200px;
  }
  
  .mode-btn {
      width: 100%;
  }
  
  .result-actions {
      flex-direction: column;
      align-items: center;
  }
  
  .action-btn {
      width: 100%;
      max-width: 200px;
  }
}

@media (max-width: 480px) {
  .neon-input {
      width: 100%;
      max-width: 250px;
  }
  
  .feedback {
      padding: 20px;
      margin: 10px;
  }
}

/* アニメーション効果 */
.screen-transition {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
      opacity: 0;
      transform: translateY(30px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.audio-container {
  display: none;
}
