/* ─── リスニングクイズ ─────────────────────────────────────────────────────── */

.quiz-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: calc(100vh - 160px);
}

/* ─── モード選択画面 ──────────────────────────────────────────────────────── */
.type-header {
  text-align: center;
  margin-bottom: 28px;
}
.type-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
}
.type-sub {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 4px;
}

.type-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.type-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  color: #fff;
  text-align: left;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: transform .18s, box-shadow .18s;
  animation: fadeUp .35s both;
}
.type-card:hover  { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.type-card:active { transform: translateY(-1px); }

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

.tc-icon  { font-size: 2.4rem; flex-shrink: 0; }
.tc-text  { flex: 1; }
.tc-label { font-size: 1.05rem; font-weight: 900; }
.tc-desc  { font-size: .78rem; opacity: .92; margin-top: 3px; }
.tc-arrow { font-size: 1.6rem; font-weight: 900; opacity: .8; flex-shrink: 0; }

/* ─── 進捗バー ────────────────────────────────────────────────────────────── */
.q-progress-bar {
  width: 100%;
  height: 6px;
  background: #E0D8C8;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
#progressFill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #FFD95A);
  border-radius: 4px;
  transition: width .4s;
  width: 0%;
}

/* ─── クイズヘッダー ─────────────────────────────────────────────────────── */
.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.q-stat-left  { font-size: .85rem; color: var(--muted); font-weight: 700; }
.q-score-badge {
  background: var(--gold);
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 20px;
}

/* ─── プロンプト エリア ───────────────────────────────────────────────────── */
.q-prompt-area {
  text-align: center;
  margin-bottom: 20px;
}
.q-prompt {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.q-word-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 20px;
  background: #FFF8E8;
  border: 2px solid #FFD95A;
  border-radius: 14px;
}
.hint-emoji { font-size: 2rem; }
.hint-ja    { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ─── 再生ボタン ─────────────────────────────────────────────────────────── */
.play-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #1565C0, #5C9DDD);
  color: #fff;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(21,101,192,.35);
  transition: transform .18s, box-shadow .18s;
  margin-bottom: 20px;
}
.play-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(21,101,192,.4); }
.play-btn:active { transform: scale(.97); }
.play-btn.playing { animation: pulse .5s ease-in-out; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.play-btn.was-played { background: linear-gradient(135deg, #2E7D32, #66BB6A); }

.play-icon { font-size: 2.4rem; line-height: 1; }
.play-text { font-size: .82rem; font-weight: 700; }

/* ─── 選択肢グリッド ─────────────────────────────────────────────────────── */
.choice-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.choice-grid.layout-2x2   { grid-template-columns: 1fr 1fr; }
.choice-grid.layout-4col  { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 480px) {
  .choice-grid.layout-4col { grid-template-columns: repeat(2, 1fr); }
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: #fff;
  border: 2.5px solid #E0D8C8;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .14s, border-color .14s, background .14s;
  min-height: 90px;
  position: relative;
}
.choice-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.choice-btn.correct {
  background: #E8F5E9;
  border-color: #2E7D32;
}
.choice-btn.wrong {
  background: #FFEBEE;
  border-color: #C62828;
}

/* 単語カード型（2x2） */
.ch-emoji { font-size: 2rem; line-height: 1; }
.ch-word  { font-size: .78rem; font-weight: 900; color: var(--text); font-family: 'Sarabun', sans-serif; }
.ch-ja    { font-size: .68rem; color: var(--muted); }

/* 文字型（4列） */
.ch-upper {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  font-family: 'Sarabun', sans-serif;
  line-height: 1;
}
.ch-lower {
  font-size: .72rem;
  color: rgba(255,255,255,.9);
  font-weight: 700;
}
.choice-btn.char-btn {
  min-height: 80px;
  border: none;
  border-radius: 12px;
}

/* カタカナ型 */
.ch-kata {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

/* ─── フィードバック ─────────────────────────────────────────────────────── */
.q-feedback {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 12px;
  border-radius: 12px;
  display: none;
}
.q-feedback.ok { background: #E8F5E9; color: #2E7D32; }
.q-feedback.ng { background: #FFEBEE; color: #C62828; }

/* ─── 結果画面 ────────────────────────────────────────────────────────────── */
.result-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 6px 28px rgba(0,0,0,.12);
}
.result-stars { font-size: 2.6rem; margin-bottom: 12px; }
.result-title { font-size: 1.4rem; font-weight: 900; margin-bottom: 16px; }
.result-score { font-size: 2rem; font-weight: 900; color: var(--gold); }
.result-pct   { font-size: 1.2rem; color: var(--muted); margin-top: 4px; margin-bottom: 24px; }

.result-btns  { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-retry {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--red), #EF5350);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s;
}
.btn-retry:hover { transform: translateY(-2px); }
.btn-back {
  padding: 12px 28px;
  background: #F5F0E8;
  color: var(--text);
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s;
}
.btn-back:hover { transform: translateY(-2px); }
