/* =========================================================
   えいごを はなそう（/speaking）
     一覧: .speaking-hero / .speaking-level / .speaking-privacy
     練習: .speaking（.drill の上にのせる）と .sp-* の部品
   ボタンは 48px 以上（指で押しやすく）。スマホの幅でも1列でおさまる
   ========================================================= */

/* ---------- 一覧 ---------- */
.quiz-hero.speaking-hero { background: linear-gradient(135deg, #0ea5e9, #6366f1 60%, #8b5cf6); box-shadow: 0 8px 24px rgba(99,102,241,.25); }
.speaking-today b { font-size: 1.35rem; white-space: nowrap; }
.speaking-today small { display: block; line-height: 1.45; }
.speaking-today.is-done { background: rgba(255,255,255,.3); }
.speaking-level { margin-bottom: 24px; }
.speaking-level .card-head { margin-bottom: 2px; }
.speaking-privacy { background: var(--surface-2); box-shadow: none; font-size: .88rem; }
.speaking-privacy h3 { font-size: .95rem; }
.speaking-privacy ul { margin: 0; padding-left: 1.2em; }
.speaking-privacy li + li { margin-top: 4px; }

/* ---------- 練習 ---------- */
/* .btn などは display を持つので、hidden 属性をかならず効かせる */
.speaking [hidden] { display: none !important; }
.speaking .btn { min-height: 48px; }

.sp-count-label { font-size: .75rem; font-weight: 800; color: var(--muted); }
.sp-dots { display: flex; gap: 6px; margin-top: 10px; }
.sp-dot { flex: 1 1 0; height: 10px; border-radius: 999px; background: var(--surface-2); transition: background .3s; }
.sp-dot.is-cleared { background: var(--success); }
.sp-dot.is-current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

.sp-card { position: relative; text-align: center; }
.sp-num { font-size: .8rem; font-weight: 800; color: var(--muted); }
.sp-ja { font-size: 1.05rem; font-weight: 700; margin: 6px 0 4px; }
.sp-words { font-size: clamp(1.6rem, 5.2vw, 2.4rem); font-weight: 900; line-height: 1.4; margin: 0 0 10px; font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; overflow-wrap: anywhere; }
.sp-word { display: inline-block; padding: 0 4px; border-radius: 8px; border-bottom: 4px solid transparent; transition: color .2s, background .2s; }
/* 言えた＝緑、まだ＝赤い点線（色だけにたよらない） */
.sp-word.is-ok { color: #047857; background: #d1fae5; }
.sp-word.is-miss { color: #b91c1c; background: #fee2e2; border-bottom: 4px dotted #ef4444; }
.sp-tip { text-align: left; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 8px 12px; font-size: .92rem; margin: 0 0 14px; }

.sp-step { text-align: left; font-size: .8rem; font-weight: 800; color: var(--muted); margin: 0 0 6px; }
.sp-model { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.sp-model .btn { font-size: 1.05rem; min-height: 56px; }
.sp-model .btn.is-playing { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.sp-model .muted { grid-column: 1 / -1; text-align: left; }

.speaking .sp-mic { min-height: 72px; font-size: 1.3rem; border-radius: 20px; white-space: normal; line-height: 1.35; }
.sp-mic.is-listening { background: #ef4444; border-color: #ef4444; font-size: 1.05rem; animation: sp-pulse 1.2s ease-in-out infinite; }
.sp-heard { min-height: 1.7em; margin: 10px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.sp-heard.is-live { color: var(--muted); font-style: italic; }

/* じぶんで チェックする やり方（エラーではなく、もう1つのやり方として見せる） */
.sp-self { text-align: left; background: #eff6ff; border: 2px solid #bfdbfe; border-radius: 16px; padding: 14px; margin-top: 12px; }
.sp-self-title { font-weight: 900; font-size: 1.05rem; color: #1d4ed8; margin-bottom: 4px; }
.sp-self p { margin: 0 0 8px; }
.sp-self .btn-accent { min-height: 64px; font-size: 1.2rem; border-radius: 18px; }
.sp-retry-mic { margin-top: 8px; }

.sp-result { text-align: left; border-radius: 14px; padding: 12px 14px; margin-top: 12px; animation: mq-pop .3s ease; }
.sp-result-title { font-weight: 900; font-size: 1.15rem; }
.sp-result.is-ok { background: #ecfdf5; border: 2px solid #6ee7b7; }
.sp-result.is-ng { background: #fff7ed; border: 2px solid #fdba74; }
.sp-result.is-info { background: #eff6ff; border: 2px solid #bfdbfe; }
.speaking .sp-next { margin-top: 16px; min-height: 56px; font-size: 1.1rem; }

/* クリアの小さなお祝い */
.sp-card.is-cheer::after { content: "🎉"; position: absolute; top: 8px; right: 14px; font-size: 2.4rem; pointer-events: none; animation: sp-cheer 1.4s ease both; }
.sp-card.is-cheer .sp-words { animation: mq-bump .45s ease; }

.sp-reward { background: #fef3c7; border: 2px solid #fcd34d; color: #92400e; border-radius: 14px; padding: 10px 14px; font-weight: 800; text-align: center; margin: 0 0 12px; }
.sp-reward.is-got { animation: mq-pop .4s ease; }

.sp-finish { text-align: center; }
.sp-finish-emoji { font-size: 3.4rem; line-height: 1.2; }
.sp-finish-count { font-size: 1.2rem; font-weight: 800; margin: 6px 0; }
.sp-finish-count b { font-size: 2rem; color: var(--primary-dark); }
.sp-finish-actions { display: grid; gap: 10px; margin-top: 16px; }

@keyframes sp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }
@keyframes sp-cheer { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 25% { transform: scale(1.2) rotate(8deg); opacity: 1; } 70% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: translateY(-16px) scale(1); opacity: 0; } }

@media (max-width: 480px) {
  .sp-model .btn { font-size: .98rem; padding: 10px 8px; }
  .sp-mic { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-mic.is-listening, .sp-result, .sp-reward.is-got, .sp-card.is-cheer .sp-words { animation: none !important; }
  .sp-card.is-cheer::after { animation: none !important; opacity: 0; }
}
