/**
 * クイズゲーム - スタイルシート
 * 統一デザインシステム（convertor.htmlベース）を適用
 */

/* CSS変数（統一デザインシステム） */
:root {
  --color-bg: #262626;
  --color-surface: #404040;
  --color-surface-light: rgba(255, 255, 255, 0.1);
  --color-accent: #6c7dd9;
  --color-accent-hover: #5a6fd8;
  --color-text: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-success: #27ae60;
  --color-error: #e74c3c;
  --color-warning: #f39c12;
  
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.5);
  
  --font-family-japanese: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", sans-serif;
}

/* 基本スタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-japanese);
  line-height: 1.6;
  min-height: 100vh;
}

/* コンテナ */
.quiz-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.quiz-header {
  text-align: center;
  padding: 15px 20px;
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

/* ゲーム中はヘッダーを極小化 */
.quiz-header.compact {
  padding: 3px 8px;
  margin-bottom: 3px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.quiz-header.compact .quiz-title {
  font-size: 0.75rem;
  margin-bottom: 0;
  opacity: 0.5;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.quiz-header.compact .quiz-subtitle {
  display: none;
}

.quiz-header.compact .quiz-nav {
  display: none;
}

.quiz-title {
  font-size: 1.8rem;
  margin-bottom: 5px;
  background: linear-gradient(135deg, var(--color-accent), #5a6fd8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
  font-weight: 700;
}

.quiz-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.quiz-nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.btn-back,
.btn-admin {
  padding: 8px 16px;
  background: var(--color-surface-light);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s;
  font-weight: 600;
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
}

.btn-back:hover,
.btn-admin:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ゲーム中はナビゲーションを完全に非表示 */
.quiz-header.compact .quiz-nav {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* メインコンテンツ */
.quiz-main {
  flex: 1;
}

.screen {
  animation: fadeIn 0.3s ease;
}

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

/* モード選択 */
.mode-selection {
  max-width: 900px;
  margin: 0 auto;
}

.mode-selection h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--color-accent);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.mode-card {
  background: var(--color-surface);
  border: 2px solid transparent;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

.mode-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.mode-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
}

.mode-description {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* 統計パネル */
.stats-panel {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.stats-panel h3 {
  margin-bottom: 20px;
  color: var(--color-accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-accent);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.btn-clear-history {
  padding: 12px 24px;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-clear-history:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* カテゴリー選択 */
.category-selection {
  max-width: 800px;
  margin: 0 auto;
}

.category-selection h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 40px;
  color: var(--color-accent);
}

.selection-group {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.selection-group h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--color-text);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.category-btn {
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-weight: 600;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.category-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.category-icon {
  font-size: 2rem;
}

.category-name {
  font-size: 0.95rem;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.difficulty-btn {
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  color: var(--color-text);
}

.difficulty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.difficulty-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.difficulty-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.difficulty-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

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

.btn-primary,
.btn-secondary {
  padding: 15px 40px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-surface-light);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ゲーム画面 */
.game-info-bar {
  display: flex;
  justify-content: space-around;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 15px;
}

.info-item {
  text-align: center;
  min-width: 100px;
}

.info-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 5px;
}

.info-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-accent);
}

/* 問題カード */
.question-card {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.question-category,
.question-difficulty {
  padding: 8px 15px;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
}

.question-category {
  background: rgba(108, 125, 217, 0.2);
  color: var(--color-accent);
}

.question-difficulty {
  background: rgba(243, 156, 18, 0.2);
  color: var(--color-warning);
}

.question-body {
  margin-bottom: 30px;
}

.question-text {
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--color-text);
}

.question-options {
  display: grid;
  gap: 15px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  color: var(--color-text);
}

.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
  transform: translateX(5px);
}

.option-btn:disabled {
  cursor: not-allowed;
}

.option-btn.correct {
  background: var(--color-success);
  border-color: var(--color-success);
  animation: correctPulse 0.5s ease;
}

.option-btn.incorrect {
  background: var(--color-error);
  border-color: var(--color-error);
  animation: incorrectShake 0.5s ease;
}

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

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

.option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  font-size: 1.1rem;
}

/* 解説パネル */
.explanation-panel {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

.explanation-header {
  text-align: center;
  margin-bottom: 20px;
}

.explanation-result {
  font-size: 2rem;
  font-weight: bold;
}

.explanation-result.correct {
  color: var(--color-success);
}

.explanation-result.incorrect {
  color: var(--color-error);
}

.explanation-body {
  margin-bottom: 20px;
}

.explanation-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.btn-next {
  width: 100%;
  padding: 15px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-next:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

/* 結果画面 */
.result-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.result-title {
  font-size: 2rem;
  margin-bottom: 30px;
  color: var(--color-accent);
}

.result-score {
  margin-bottom: 40px;
}

.score-big {
  font-size: 4rem;
  font-weight: bold;
  background: linear-gradient(135deg, var(--color-accent), #5a6fd8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-label {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  margin-top: 10px;
}

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

.result-stat {
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
}

.result-stat .stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.result-stat .stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-accent);
}

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

/* フッター */
.quiz-footer {
  text-align: center;
  padding: 20px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 40px;
}

/* ローディング */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  font-size: 1.2rem;
  color: var(--color-text);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .quiz-title {
    font-size: 2rem;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .difficulty-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .selection-actions,
  .result-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .quiz-container {
    padding: 10px;
  }

  .quiz-header {
    padding: 20px 15px;
  }

  .question-text {
    font-size: 1.2rem;
  }

  .score-big {
    font-size: 3rem;
  }
}

/* ライトテーマ */
body.light-theme {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #2c3e50;
  --color-text-secondary: #7f8c8d;
  --color-border: #d0d0d0;
  --color-hover: #e8e8e8;
}

body.light-theme .header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.light-theme .mode-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .mode-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ==================== 早押しクイズ ==================== */

.buzzer-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* プレイヤー登録画面 */
.buzzer-setup {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

.buzzer-setup h2 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 2rem;
}

.buzzer-setup .subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 30px;
}

/* 回答モード選択 */
.buzzer-mode-selector {
  margin-bottom: 30px;
}

.buzzer-mode-selector h3 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.mode-btn {
  background: var(--color-surface-light);
  border: 3px solid transparent;
  color: var(--color-text);
  padding: 20px;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mode-btn:hover {
  background: var(--color-surface);
  transform: translateY(-2px);
}

.mode-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent-hover);
  color: white;
}

.mode-btn .mode-icon {
  font-size: 2rem;
}

.mode-btn .mode-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.mode-btn .mode-desc {
  font-size: 0.85rem;
  opacity: 0.8;
}

.player-count-selector {
  margin-bottom: 30px;
}

.player-count-selector label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.count-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.count-btn {
  background: var(--color-surface-light);
  border: 2px solid transparent;
  color: var(--color-text);
  padding: 12px 24px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.count-btn:hover {
  background: var(--color-accent);
  color: white;
}

.count-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent-hover);
}

.player-names {
  margin-bottom: 30px;
}

.player-names h3 {
  margin-bottom: 15px;
  text-align: center;
}

.name-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.name-input-group {
  display: flex;
  flex-direction: column;
}

.name-input-group label {
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.name-input-group input {
  background: var(--color-surface-light);
  border: 2px solid transparent;
  color: var(--color-text);
  padding: 10px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.name-input-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.buzzer-settings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .buzzer-settings {
    grid-template-columns: 1fr;
  }
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.setting-item select {
  width: 100%;
  background: var(--color-surface-light);
  border: 2px solid transparent;
  color: var(--color-text);
  padding: 10px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

  .setting-item select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.buzzer-info {
  text-align: center;
  padding: 15px;
  background: var(--color-surface-light);
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.buzzer-info .info-text {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.keyboard-shortcuts-info {
  margin-top: 15px;
  text-align: left;
}

.keyboard-shortcuts-info summary {
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-accent);
  user-select: none;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: background 0.2s ease;
}

.keyboard-shortcuts-info summary:hover {
  background: rgba(255, 107, 107, 0.1);
}

.shortcuts-list {
  margin-top: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.shortcut-item kbd {
  background: var(--color-bg);
  border: 2px solid var(--color-surface);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 30px;
  text-align: center;
}

.shortcut-item span {
  color: var(--color-text-secondary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

.btn-text:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.buzzer-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}/* ゲーム画面 */
.buzzer-game {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 30px; /* パディングを増加 */
  box-shadow: var(--shadow-md);
  max-height: 100vh;
  overflow-y: auto; /* overflow: hidden → overflow-y: auto に変更 */
  overflow-x: hidden; /* 横スクロールは無効 */
  display: flex;
  flex-direction: column;
  gap: 25px; /* 内部要素の間隔を追加 */
}

.buzzer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0; /* gapで制御 */
  flex-shrink: 0;
  padding: 15px 0; /* 上下パディング追加 */
}

.question-counter {
  font-size: 1.3rem; /* フォントサイズを拡大 */
  font-weight: 600;
  padding: 10px 20px; /* パディング追加 */
  background: var(--color-surface-light);
  border-radius: var(--border-radius);
}

.buzzer-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 最小幅を拡大 */
  gap: 15px; /* 間隔を広げる */
  margin-bottom: 0; /* gapで制御 */
  flex-shrink: 0;
  padding: 10px 0; /* 上下パディング追加 */
}

.player-score {
  background: var(--color-surface-light);
  padding: 20px; /* パディングを増加 */
  border-radius: var(--border-radius-lg);
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  font-size: 1rem; /* フォントサイズを拡大 */
  min-height: 85px; /* 最小高さを追加 */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-score.answering {
  border-color: var(--color-warning);
  box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
  animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--color-warning); }
  50% { border-color: var(--color-accent); }
}

.player-score.correct {
  border-color: var(--color-success);
  background: rgba(39, 174, 96, 0.1);
}

.player-score.incorrect {
  border-color: var(--color-error);
  background: rgba(231, 76, 60, 0.1);
}

.player-score.blocked {
  opacity: 0.5;
  border-color: #95a5a6;
  background: rgba(149, 165, 166, 0.1);
  position: relative;
}

.player-score.blocked::after {
  content: '連答制限中';
  position: absolute;
  top: 5px;
  right: 5px;
  background: #95a5a6;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.player-score-name {
  font-weight: 600;
  margin-bottom: 8px; /* 間隔を広げる */
  font-size: 1.1rem; /* フォントサイズを拡大 */
}

.player-score-points {
  font-size: 1.8rem; /* フォントサイズを拡大 */
  font-weight: 700;
  color: var(--color-accent);
}

.buzzer-question-area {
  background: var(--color-bg);
  border-radius: var(--border-radius-lg);
  padding: 40px 30px; /* より広いパディング */
  margin-bottom: 20px;
  min-height: 300px; /* 最小高さを増加 */
  max-height: none;
  border: 2px solid var(--color-surface-light);
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px; /* 内部要素の間隔 */
}

.buzzer-question-area .question-text {
  font-size: 1.5rem; /* フォントサイズを拡大 */
  line-height: 2; /* 行間を広げる */
  text-align: center;
  min-height: 120px; /* 最小高さを増加 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px; /* パディングを増加 */
  background: var(--color-surface);
  border-radius: var(--border-radius);
  margin-bottom: 0; /* gapで制御 */
  word-break: break-word; /* 長い単語を折り返し */
}

/* 出題者モード：答え確認画面 */
.host-answer-preview {
  text-align: center;
  padding: 30px; /* パディングを調整 */
  background: linear-gradient(135deg, rgba(108, 125, 217, 0.1), rgba(52, 152, 219, 0.1));
  border-radius: var(--border-radius-lg);
  border: 3px solid var(--color-accent);
  margin-bottom: 20px; /* 間隔を調整 */
  min-height: 250px; /* 最小高さを調整 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0; /* 縮小しないように設定 */
}

.preview-instruction {
  margin-bottom: 25px; /* 間隔を調整 */
  flex-shrink: 0; /* 縮小しないように設定 */
}

.preview-instruction h3 {
  font-size: 1.8rem; /* フォントサイズを調整 */
  color: var(--color-accent);
  margin-bottom: 12px; /* 間隔を調整 */
  padding: 8px;
}

.preview-instruction p {
  font-size: 1.1rem; /* フォントサイズを調整 */
  color: var(--color-text-secondary);
  font-weight: 500;
  line-height: 1.6; /* 行間を調整 */
}

.preview-answer-box {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
  border: 4px solid #FFC107;
  border-radius: var(--border-radius-lg);
  padding: 35px; /* パディングを調整 */
  margin: 25px auto; /* 間隔を調整 */
  max-width: 700px; /* 最大幅を拡大 */
  min-height: 120px; /* 最小高さを調整 */
  box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* 縮小しないように設定 */
}

.preview-answer-text {
  font-size: 2.5rem; /* フォントサイズを調整 */
  font-weight: bold;
  color: #F57C00;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 1.4; /* 行間を調整 */
  word-break: break-word;
  text-align: center;
  width: 100%;
}

.buzzer-status {
  text-align: center;
  font-size: 1.2rem; /* フォントサイズを拡大 */
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0; /* gapで制御 */
  padding: 20px; /* パディングを増加 */
  background: var(--color-surface-light);
  border-radius: var(--border-radius);
  animation: pulse 2s infinite;
  flex-shrink: 0;
  min-height: 60px; /* 最小高さを追加 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.buzzer-status.upside-down {
  transform: rotate(180deg);
}

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

/* タイムアウトバー */
.buzzer-timeout-container {
  position: relative;
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  margin: 15px 0;
  overflow: hidden;
  border: 2px solid var(--color-accent);
}

.buzzer-timeout-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, 
    var(--color-success) 0%, 
    #FFC107 50%, 
    var(--color-error) 100%);
  transition: width 0.1s linear;
  width: 100%;
}

.buzzer-timeout-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.buzzer-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 最小幅を拡大 */
  gap: 20px; /* 間隔を広げる */
  margin-top: 0; /* gapで制御 */
  padding: 10px 0; /* 上下にパディング */
}

.buzzer-option {
  background: var(--color-surface-light);
  padding: 25px; /* パディングを増加 */
  border-radius: var(--border-radius);
  text-align: center;
  border: 2px solid transparent;
  font-size: 1.1rem; /* フォントサイズを拡大 */
  line-height: 1.6; /* 行間を広げる */
  min-height: 80px; /* 最小高さを追加 */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buzzer-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.buzzer-option.correct {
  border-color: var(--color-success);
  background: rgba(39, 174, 96, 0.1);
}

.buzzer-option.incorrect {
  border-color: var(--color-error);
  background: rgba(231, 76, 60, 0.1);
}

.buzzer-explanation {
  margin-top: 0; /* gapで制御 */
  padding: 35px; /* パディングを増加 */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: var(--border-radius-lg);
  border-left: 5px solid var(--color-accent);
  font-size: 1.2rem; /* フォントサイズを拡大 */
  line-height: 2; /* 行間を広げる */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  min-height: 100px; /* 最小高さを追加 */
}

.buzzer-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px; /* 間隔をさらに広げる */
  padding: 40px 30px; /* パディングを増加 */
  max-width: 100%;
  margin: 0 auto;
  flex: 0 1 auto; /* flex: 1 → flex: 0 1 auto に変更（必要以上に伸びない） */
  overflow-x: auto;
  overflow-y: auto;
  min-height: 250px; /* 最小高さを増加 */
  background: rgba(255, 255, 255, 0.02); /* 微妙な背景を追加 */
  border-radius: var(--border-radius);
}

.buzzer-btn {
  background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
  color: white;
  border: 5px solid #C92A2A;
  padding: 45px 50px; /* パディングを増加 */
  border-radius: 25px;
  font-size: 2.2rem; /* フォントサイズを拡大 */
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 
              0 5px 12px rgba(255, 107, 107, 0.5),
              inset 0 -5px 10px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 3px; /* 文字間隔を広げる */
  min-height: 140px; /* 最小高さを増加 */
  min-width: 200px; /* 最小幅を増加 */
  max-width: 250px; /* 最大幅を増加 */
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  white-space: nowrap;
}

.buzzer-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.buzzer-btn:hover:not(:disabled)::before {
  width: 450px;
  height: 450px;
}

.buzzer-btn:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 
              0 7px 18px rgba(255, 107, 107, 0.7),
              inset 0 -6px 12px rgba(0, 0, 0, 0.35);
  border-color: #A61E4D;
}

.buzzer-btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4),
              inset 0 5px 12px rgba(0, 0, 0, 0.5);
}

.buzzer-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  border-color: #5a6268;
}

.buzzer-btn.blocked {
  opacity: 0.4;
  cursor: not-allowed;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  border-color: #5a6268;
  position: relative;
}

.buzzer-btn.blocked::after {
  content: '🚫';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2rem;
}

.buzzer-btn.pressed {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-color: #FF8C00;
  transform: scale(1.15);
  animation: buzz-flash 0.6s ease;
  box-shadow: 0 0 45px rgba(255, 215, 0, 1),
              0 0 90px rgba(255, 165, 0, 0.8),
              0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 2.4rem;
}

@keyframes buzz-flash {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1.15);
  }
  50% { 
    opacity: 0.8; 
    transform: scale(1.18);
  }
}

/* 出題者モード：正解表示 */
.buzzer-answer-display {
  margin-top: 0; /* gapで制御 */
  padding: 40px; /* パディングを増加 */
  background: linear-gradient(135deg, rgba(108, 125, 217, 0.15), rgba(90, 111, 216, 0.08));
  border: 3px solid var(--color-accent);
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.answer-label {
  font-size: 1.6rem; /* フォントサイズを拡大 */
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 25px; /* 間隔を広げる */
  letter-spacing: 1px;
}

.answer-text {
  font-size: 2.5rem; /* フォントサイズを拡大 */
  font-weight: 700;
  color: #F57C00;
  padding: 35px; /* パディングを増加 */
  background: rgba(255, 193, 7, 0.12);
  border-radius: var(--border-radius-lg);
  text-align: center;
  min-height: 100px; /* 最小高さを増加 */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 上下逆向き表示（ゲーム中の答え） */
.answer-text.upside-down {
  transform: rotate(180deg);
  display: flex;
}

/* 出題者モード：判定ボタン */
.buzzer-host-controls {
  display: flex;
  gap: 40px; /* ボタン間の間隔を広げる */
  margin-bottom: 30px;
  margin-top: 25px;
  justify-content: center;
  align-items: center;
  padding: 25px;
  flex-wrap: nowrap; /* 横並びを強制 */
}

.buzzer-host-controls.upside-down {
  transform: rotate(180deg);
}

/* 出題者モード：判定時の問題表示エリア */
.buzzer-judgment-info {
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid var(--color-primary); /* ボーダーを太く */
  border-radius: var(--border-radius-lg);
  padding: 35px; /* パディングを増加 */
  margin-bottom: 25px; /* 間隔を広げる */
  text-align: center;
}

.buzzer-judgment-info.upside-down {
  transform: rotate(180deg);
}

.buzzer-judgment-question {
  font-size: 1.5rem; /* フォントサイズを拡大 */
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 25px; /* 間隔を広げる */
  line-height: 1.8; /* 行間を広げる */
  padding: 20px; /* パディングを追加 */
  background: rgba(255, 255, 255, 0.05); /* 背景を追加 */
  border-radius: var(--border-radius);
  min-height: 80px; /* 最小高さを追加 */
}

.buzzer-judgment-answer {
  font-size: 1.8rem; /* フォントサイズを拡大 */
  font-weight: 700;
  color: var(--color-primary);
  padding: 25px; /* パディングを増加 */
  background: rgba(52, 152, 219, 0.15);
  border-radius: var(--border-radius-lg);
  border: 3px solid var(--color-primary); /* ボーダーを太く */
  min-height: 90px; /* 最小高さを追加 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-large {
  padding: 25px 50px;
  font-size: 1.8rem;
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-correct {
  background: linear-gradient(135deg, var(--color-success), #229954);
  color: white;
  border: 3px solid #1e8449;
}

.btn-correct:hover {
  background: linear-gradient(135deg, #229954, #1e8449);
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.btn-incorrect {
  background: linear-gradient(135deg, var(--color-error), #c0392b);
  color: white;
  border: 3px solid #a93226;
}

.btn-incorrect:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.btn-large:active {
  transform: translateY(0);
}

.buzzer-controls {
  text-align: center;
  padding: 25px 0; /* 上下パディング追加 */
  margin-top: 10px;
  flex-shrink: 0; /* 縮小しないように設定 */
  width: 100%; /* 幅を確保 */
}

.buzzer-controls button {
  min-height: 60px; /* ボタンの最小高さを追加 */
  font-size: 1.2rem; /* フォントサイズを拡大 */
  padding: 15px 40px; /* パディングを増加 */
  display: inline-block; /* 確実に表示 */
  visibility: visible !important; /* 強制的に表示 */
}

/* 結果画面 */
.buzzer-result {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: 40px; /* パディングを増加 */
  box-shadow: var(--shadow-md);
  text-align: center;
}

.buzzer-result h2 {
  margin-bottom: 30px;
  font-size: 2rem;
}

.buzzer-ranking {
  max-width: 600px;
  margin: 0 auto 30px;
}

.rank-item {
  background: var(--color-surface-light);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.rank-item.rank-1 {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

.rank-item.rank-2 {
  border-color: #C0C0C0;
  background: rgba(192, 192, 192, 0.1);
}

.rank-item.rank-3 {
  border-color: #CD7F32;
  background: rgba(205, 127, 50, 0.1);
}

.rank-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.rank-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 50px;
}

.rank-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.rank-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.rank-stats {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 5px;
}

.buzzer-result-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-block {
  width: 100%;
}

/* アイコンボタン */
.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s;
  color: white;
}

.btn-icon:hover {
  transform: scale(1.1);
}

.sound-toggle,
.theme-toggle {
  margin-left: 0.5rem;
}

/* レスポンシブ対応：早押しボタン */
@media (max-width: 768px) {
  .buzzer-buttons {
    gap: 15px;
    padding: 15px;
  }
  
  .buzzer-btn {
    min-width: 140px;
    max-width: 180px;
    padding: 30px 25px;
    font-size: 1.6rem;
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .buzzer-buttons {
    flex-direction: column;
    gap: 12px;
    padding: 10px;
  }
  
  .buzzer-btn {
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }
}

/* ========================================
   通知システム（NotificationManager）
   ======================================== */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 16px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  border-left: 4px solid var(--color-accent);
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-message {
  flex: 1;
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

/* 通知タイプ別スタイル */
.notification-success {
  border-left-color: var(--color-success);
}

.notification-success .notification-icon {
  color: var(--color-success);
}

.notification-error {
  border-left-color: var(--color-error);
}

.notification-error .notification-icon {
  color: var(--color-error);
}

.notification-warning {
  border-left-color: var(--color-warning);
}

.notification-warning .notification-icon {
  color: var(--color-warning);
}

.notification-info {
  border-left-color: var(--color-accent);
}

.notification-info .notification-icon {
  color: var(--color-accent);
}

/* ========================================
   ローディングオーバーレイ（LoadingManager）
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}

.loading-overlay.show {
  opacity: 1;
}

.loading-content {
  text-align: center;
  padding: 40px;
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-message {
  color: var(--color-text);
  font-size: 1.1rem;
  margin-top: 16px;
}

/* レスポンシブ対応：通知 */
@media (max-width: 768px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .notification {
    min-width: auto;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .notification {
    padding: 12px;
    font-size: 0.9rem;
  }
  
  .notification-icon {
    font-size: 1.3rem;
  }
}
