/**
 * 寶可夢小樂園 (Pokémon Kids Playground) - 兒童友善專用樣式
 * 設計原則：大按鈕 (>=48px)、大圖片、生動明亮配色、大字體、圓角柔和、直覺觸控
 */

:root {
  --kid-bg: #f0fdf4;
  --kid-header-bg: #ffffff;
  --kid-primary: #3b82f6;
  --kid-primary-hover: #2563eb;
  --kid-accent-yellow: #fde047;
  --kid-accent-orange: #fb923c;
  --kid-accent-green: #22c55e;
  --kid-accent-purple: #a855f7;
  --kid-text-dark: #1e293b;
  --kid-text-muted: #64748b;
  --kid-card-bg: #ffffff;
  --kid-border: #e2e8f0;
  --kid-radius: 20px;
  --kid-radius-sm: 14px;
  --kid-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --kid-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background-color: var(--kid-bg);
  color: var(--kid-text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 頂部導航列 */
.playground-header {
  background-color: var(--kid-header-bg);
  box-shadow: var(--kid-shadow-sm);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid #e2e8f0;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  min-width: 48px;
  padding: 8px 16px;
  background-color: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
  border-radius: var(--kid-radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.header-back-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.header-back-btn:active {
  transform: scale(0.96);
}

.header-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sfx-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  background: #f0fdf4;
  color: #166534;
  border: 2px solid #86efac;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sfx-toggle-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.sfx-toggle-btn:active {
  transform: scale(0.96);
}

.sfx-toggle-btn.muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.sfx-toggle-btn.muted:hover {
  background: #e2e8f0;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.badge-question {
  background: #eff6ff;
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
}

.badge-score {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: #854d0e;
  border: 2px solid #facc15;
  transition: transform 0.2s ease;
}

.score-bump {
  animation: bumpAnim 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bumpAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* 主容器 */
.playground-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* 首頁英雄區 */
.hero-section {
  text-align: center;
  margin-bottom: 28px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: #475569;
}

/* 遊戲選擇卡片格線 */
.game-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.game-card {
  background: var(--kid-card-bg);
  border-radius: var(--kid-radius);
  border: 3px solid var(--kid-border);
  box-shadow: var(--kid-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.game-card:active {
  transform: scale(0.98);
}

.card-audio { border-color: #93c5fd; background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%); }
.card-silhouette { border-color: #fbcfe8; background: linear-gradient(180deg, #ffffff 0%, #fdf2f8 100%); }
.card-bopomofo { border-color: #fde68a; background: linear-gradient(180deg, #ffffff 0%, #fefce8 100%); }
.card-memory { border-color: #6ee7b7; background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%); }
.card-scramble { border-color: #fdba74; background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%); }
.card-evolution { border-color: #c4b5fd; background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%); }
.card-tone { border-color: #7dd3fc; background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%); }
.card-legendary-hub { 
  border-color: #f59e0b; 
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); 
  color: #ffffff;
  grid-column: 1 / -1; 
  flex-direction: row; 
  text-align: left; 
  padding: 24px 32px;
  gap: 24px;
}
.card-legendary-hub .card-title { color: #ffffff; }
.card-legendary-hub .card-desc { color: #cbd5e1; }
@media (max-width: 640px) {
  .card-legendary-hub {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
}

.card-icon-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.card-audio .card-icon-box { background: #dbeafe; }
.card-silhouette .card-icon-box { background: #fce7f3; }
.card-bopomofo .card-icon-box { background: #fef08a; }
.card-memory .card-icon-box { background: #d1fae5; }
.card-scramble .card-icon-box { background: #ffedd5; }
.card-evolution .card-icon-box { background: #ede9fe; }
.card-tone .card-icon-box { background: #e0f2fe; }
.card-legendary-hub .card-icon-box { background: linear-gradient(135deg, #f59e0b, #eab308); flex-shrink: 0; margin-bottom: 0; }

.card-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #0f172a;
}

.card-desc {
  font-size: 1.05rem;
  color: #475569;
  margin-bottom: 20px;
  flex: 1;
}

.card-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: var(--kid-radius-sm);
  font-size: 1.2rem;
  font-weight: 900;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.card-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.card-audio .card-start-btn { background: #1d4ed8; }
.card-silhouette .card-start-btn { background: #be185d; }
.card-bopomofo .card-start-btn { background: #b45309; }
.card-memory .card-start-btn { background: #166534; }
.card-scramble .card-start-btn { background: #9a3412; }
.card-evolution .card-start-btn { background: #6d28d9; }
.card-tone .card-start-btn { background: #0369a1; }
.card-legendary-hub .card-start-btn { background: #d97706; }

/* ==================== 共用實心高對比按鈕樣式 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--kid-radius-sm);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff !important;
  border-color: #1d4ed8;
}
.btn-primary:hover {
  background-color: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background-color: #ffffff;
  color: #1e293b !important;
  border: 2px solid #cbd5e1;
}
.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.btn-success {
  background-color: #166534;
  color: #ffffff !important;
  border-color: #14532d;
}
.btn-success:hover {
  background-color: #14532d;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* 彈窗樣式 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--kid-radius);
  border: 4px solid #3b82f6;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 1.15rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 480px) {
  .modal-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* 遊戲專用面板容器 */
.game-stage-card {
  background: var(--kid-card-bg);
  border-radius: var(--kid-radius);
  border: 3px solid #cbd5e1;
  box-shadow: var(--kid-shadow);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 音訊播放大型按鈕 */
.big-listen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  min-width: 200px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 3px solid #60a5fa;
  border-radius: 9999px;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 20px;
  touch-action: manipulation;
}

.big-listen-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
}

.big-listen-btn:active {
  transform: scale(0.96);
}

.big-listen-btn.playing {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border-color: #86efac;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.3);
  animation: pulseAnim 1.2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* 遊戲一：4 張圖片選項格線 */
.picture-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
}

.picture-choice-card {
  background: #f8fafc;
  border: 3px solid #cbd5e1;
  border-radius: var(--kid-radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
}

.picture-choice-card:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
  transform: translateY(-2px);
}

.picture-choice-card:active {
  transform: scale(0.96);
}

.picture-choice-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  pointer-events: none;
}

.picture-choice-name {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  display: none; /* 作答前不顯示名稱 */
}

.picture-choice-card.revealed .picture-choice-name {
  display: block;
}

.picture-choice-card.correct {
  border-color: #22c55e !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3) !important;
  animation: correctBounce 0.4s ease;
}

.picture-choice-card.wrong {
  border-color: #fb923c !important;
  background-color: #fff7ed !important;
  animation: shakeAnim 0.3s ease;
}

@keyframes correctBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

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

/* 遊戲二：剪影舞台 */
.silhouette-stage {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 50%;
  border: 4px solid #cbd5e1;
  margin-bottom: 24px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.05);
}

.silhouette-img {
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: brightness(0); /* 純黑剪影 */
  transition: filter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s ease;
}

.silhouette-img.revealed {
  filter: none; /* 答對還原彩色 */
  animation: correctBounce 0.5s ease;
}

/* 文字選項格線 (4 選 1) */
.text-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 20px;
}

.text-choice-btn {
  min-height: 56px;
  padding: 12px 20px;
  background: #ffffff;
  color: #1e293b;
  border: 3px solid #cbd5e1;
  border-radius: var(--kid-radius-sm);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  box-shadow: var(--kid-shadow-sm);
}

.text-choice-btn:hover {
  background-color: #eff6ff;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.text-choice-btn:active {
  transform: scale(0.96);
}

.text-choice-btn.correct {
  background-color: #22c55e !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3) !important;
}

.text-choice-btn.wrong {
  background-color: #fff7ed !important;
  border-color: #fb923c !important;
  color: #9a3412 !important;
  animation: shakeAnim 0.3s ease;
}

/* 遊戲三：注音填空小學堂版面 */
.bopomofo-stage-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 650px;
}

@media (min-width: 768px) {
  .bopomofo-stage-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: center;
  }
}

.pokemon-interactive-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--kid-radius);
  border: 3px dashed #93c5fd;
  transition: all 0.2s ease;
}

.pokemon-interactive-box:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  transform: scale(1.02);
}

.pokemon-interactive-box:active {
  transform: scale(0.97);
}

.pokemon-interactive-img {
  width: 170px;
  height: 170px;
  object-fit: contain;
}

.tap-hint-pill {
  margin-top: 8px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bopomofo-question-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
}

.target-pokemon-name-banner {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.target-char-highlight {
  display: inline-block;
  background: #fef08a;
  color: #854d0e;
  padding: 2px 8px;
  border-radius: 8px;
  border: 2px solid #facc15;
}

.bopomofo-formula-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 24px;
  flex-wrap: wrap;
}

.bopomofo-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 60px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.bopomofo-slot.blank {
  min-width: 64px;
  border: 3px dashed #f59e0b;
  background: #fefce8;
  color: #b45309;
  animation: pulseBlank 1.5s infinite;
}

.bopomofo-slot.blank.filled {
  border: 3px solid #22c55e;
  background: #f0fdf4;
  color: #15803d;
  animation: correctBounce 0.4s ease;
}

@keyframes pulseBlank {
  0%, 100% { border-color: #f59e0b; background-color: #fefce8; }
  50% { border-color: #fbbf24; background-color: #fef9c3; }
}

.bopomofo-slot.tone {
  min-width: 38px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #dc2626;
  font-size: 2rem;
}

/* 注音選項 (4選1) */
.bopomofo-choices-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 20px;
}

.bopomofo-choice-btn {
  min-height: 64px;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-radius: 16px;
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.bopomofo-choice-btn:hover {
  border-color: #f59e0b;
  background-color: #fefce8;
  transform: translateY(-2px);
}

.bopomofo-choice-btn:active {
  transform: scale(0.94);
}

.bopomofo-choice-btn.correct {
  background-color: #22c55e !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
}

.bopomofo-choice-btn.wrong {
  background-color: #fff7ed !important;
  border-color: #fb923c !important;
  color: #9a3412 !important;
  animation: shakeAnim 0.3s ease;
}

/* 回饋橫幅 */
.feedback-banner {
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--kid-radius-sm);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 18px;
  display: none;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
}

.feedback-banner.success {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #86efac;
}

.feedback-banner.retry {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: #c2410c;
  border: 2px solid #fdba74;
}

/* 下一題按鈕 */
.next-question-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  min-width: 200px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  margin-top: 10px;
}

.next-question-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.45);
}

.next-question-btn:active {
  transform: scale(0.96);
}

/* 回合結算彈窗 */
.round-complete-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.round-complete-card {
  background: #ffffff;
  border-radius: var(--kid-radius);
  border: 4px solid #facc15;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  max-width: 480px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  animation: correctBounce 0.4s ease;
}

.round-complete-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

.round-complete-title {
  font-size: 2rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.round-complete-score-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 24px;
}

.round-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .round-modal-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.modal-btn-restart {
  background: #3b82f6;
  color: #ffffff;
  min-height: 50px;
  padding: 10px 24px;
  border-radius: var(--kid-radius-sm);
  font-size: 1.15rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
}

.modal-btn-home {
  background: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
  min-height: 50px;
  padding: 10px 24px;
  border-radius: var(--kid-radius-sm);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 題庫分類篩選按鈕 (Filter Tabs) */
.filter-tabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.filter-tab {
  min-height: 44px;
  padding: 8px 16px;
  background-color: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.filter-tab:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

.filter-tab.active {
  background-color: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.badge-explored {
  background-color: #f0fdf4;
  color: #166534;
  border: 2px solid #bbf7d0;
}

.btn-reset-progress {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
  margin-top: 4px;
  touch-action: manipulation;
}

.btn-reset-progress:hover {
  color: #dc2626;
}

/* ==========================================================================
   兒童自拍頭像相機模組 (AvatarCamera)
   ========================================================================== */
.avatar-camera-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.avatar-camera-dialog {
  background: #ffffff;
  border-radius: 24px;
  border: 4px solid #3b82f6;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.avatar-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #eff6ff;
  border-bottom: 2px solid #bfdbfe;
  border-radius: 20px 20px 0 0;
}

.avatar-dialog-header h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1e3a8a;
  margin: 0;
}

.avatar-close-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.avatar-tab-bar {
  display: flex;
  padding: 8px 16px;
  gap: 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.avatar-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.avatar-tab.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.avatar-tab-content {
  padding: 20px;
  flex: 1;
}

.camera-viewport-box {
  width: 280px;
  height: 280px;
  margin: 0 auto 16px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 4px solid #3b82f6;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
  background: #0f172a;
}

.camera-viewport-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #f1f5f9;
  color: #475569;
  padding: 20px;
}

.camera-icon-huge {
  font-size: 3rem;
  margin-bottom: 8px;
}

.camera-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.camera-preview-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #22c55e;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
  margin-bottom: 12px;
}

.camera-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-hint {
  font-size: 1rem;
  font-weight: 800;
  color: #166534;
  text-align: center;
}

.camera-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.avatar-action-btn {
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  transition: all 0.15s;
}

.avatar-action-btn.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.avatar-action-btn.btn-capture {
  background: #16a34a;
  color: #ffffff;
  font-size: 1.15rem;
  padding: 12px 28px;
}

.avatar-action-btn.btn-retake {
  background: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
}

.avatar-action-btn.btn-confirm {
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.upload-drop-box {
  border: 3px dashed #93c5fd;
  border-radius: 20px;
  background: #f0fdf4;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
}

.upload-icon-huge {
  font-size: 3rem;
  margin-bottom: 8px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

.preset-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.preset-item span {
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
  margin-top: 4px;
}

.preset-item:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}

.preset-item.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   訓練家首頁專用樣式 (Trainer Hub)
   ========================================================================== */
.trainer-hero-card {
  background: #ffffff;
  border-radius: 24px;
  border: 3px solid #e2e8f0;
  box-shadow: var(--kid-shadow);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trainer-profile-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trainer-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #3b82f6;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #f8fafc;
}

.trainer-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trainer-info-box {
  flex: 1;
  min-width: 200px;
}

.trainer-nickname-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trainer-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
}

.trainer-buddy-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #fde68a;
}

.btn-switch-trainer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f1f5f9;
  color: #1e293b;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-switch-trainer:hover {
  background: #e2e8f0;
}

/* 核心當前挑戰卡片 */
.hub-challenge-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 3px solid #86efac;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.challenge-legendary-thumb {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.challenge-details {
  flex: 1;
  min-width: 220px;
}

.challenge-badge-stage {
  display: inline-block;
  background: #166534;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.challenge-target-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #14532d;
  margin-bottom: 4px;
}

.challenge-progress-text {
  font-size: 1rem;
  font-weight: 800;
  color: #15803d;
}

.btn-continue-challenge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: #166534;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(22, 101, 52, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.btn-continue-challenge:hover {
  background: #14532d;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(22, 101, 52, 0.45);
}

.btn-continue-challenge:active {
  transform: scale(0.97);
}

/* 收藏統計小卡 */
.hub-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-pill-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.stat-pill-card .stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1e3a8a;
}

.stat-pill-card .stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

/* 底部導覽列 (手機專用，大按鈕三區) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 2px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  padding: 0 10px;
}

.nav-pill-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  transition: all 0.15s;
}

.nav-pill-item .nav-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 2px;
}

.nav-pill-item.active {
  color: #2563eb;
}

.nav-pill-item:active {
  transform: scale(0.94);
}

/* 確保有底部導覽時頁面底部不被遮擋 */
body.has-bottom-nav {
  padding-bottom: 76px;
}

/* 雲端同步狀態膠囊 */
.sync-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.sync-badge-pill.synced {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.sync-badge-pill.syncing {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  animation: pulse 1.5s infinite;
}

.sync-badge-pill.offline {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde047;
}

.sync-badge-pill.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* 輔助與無障礙 */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 家長管理認證分頁與表單樣式 */
.auth-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 18px;
}

.auth-tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.95rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn:hover {
  color: #1e3a8a;
}

.auth-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-group input {
  width: 100%;
  padding-right: 44px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
}

.recovery-code-card {
  background: #f8fafc;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin: 16px 0;
}

.recovery-code-display {
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  user-select: all;
  word-break: break-all;
}

.auth-notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ==================== 寶可夢聲調小學堂專用樣式 ==================== */
.mode-switch-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 1.1rem;
  font-weight: 800;
  border: 2px solid #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  touch-action: manipulation;
}

.mode-switch-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.35);
}

.tone-stage-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 16px 0 24px;
}

@media (min-width: 640px) {
  .tone-stage-layout {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 36px;
  }
}

.tone-pokemon-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f0f9ff;
  border: 3px solid #bae6fd;
  border-radius: 24px;
  padding: 14px 16px;
  width: 180px;
  min-height: 180px;
  height: auto;
  box-sizing: border-box;
  transition: transform 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
  flex-shrink: 0;
}

.tone-pokemon-box:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.18);
}

.tone-pokemon-box:active {
  transform: scale(0.97);
}

.tone-pokemon-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.tap-hint-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #bae6fd;
  margin-top: 8px;
  white-space: nowrap;
  line-height: 1.2;
}

.tone-question-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  width: 100%;
}

.tone-name-banner {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tone-char-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tone-char-pill {
  font-size: 2rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #334155;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.tone-char-unit.active .tone-char-pill {
  background: linear-gradient(135deg, #fef08a, #fde047);
  border: 3px solid #eab308;
  color: #854d0e;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.35);
}

.tone-target-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #854d0e;
  background: #fef9c3;
  border: 1px solid #fde047;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  min-height: 22px;
  line-height: 1.2;
}

.tone-char-unit:not(.active) .tone-target-badge {
  visibility: hidden;
  opacity: 0;
}

.big-listen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0369a1;
  background: #ffffff;
  border: 2px solid #38bdf8;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  margin: 4px 0 16px;
}

.big-listen-btn:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

.big-listen-btn:active {
  transform: scale(0.96);
}

.tone-bopomofo-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  border: 3px solid #7dd3fc;
  border-radius: 20px;
  padding: 12px 30px;
  margin: 4px 0 18px;
  box-shadow: 0 4px 14px rgba(125, 211, 252, 0.25);
}

.tone-base-symbols {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0369a1;
  letter-spacing: 4px;
}

.tone-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 50px;
  font-size: 2rem;
  font-weight: 900;
  border-radius: 14px;
  border: 2px dashed #0284c7;
  background: #f0f9ff;
  color: #0369a1;
  padding: 4px 8px;
  transition: all 0.2s ease;
}

.tone-slot-badge.filled {
  border-style: solid;
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  transform: scale(1.08);
}

/* 5 個固定大按鈕 */
.tone-choices-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 16px auto;
}

.tone-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 10px 6px;
  border-radius: 16px;
  border: 3px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  touch-action: manipulation;
  user-select: none;
}

.tone-choice-btn:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.2);
}

.tone-choice-btn:active {
  transform: scale(0.95);
}

.tone-choice-name {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.2;
}

.tone-choice-symbol {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  color: #0284c7;
}

.tone-choice-hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 2px;
}

.tone-choice-btn.correct {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  transform: scale(1.05) !important;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35) !important;
}

.tone-choice-btn.correct .tone-choice-symbol {
  color: #166534 !important;
}

.tone-choice-btn.wrong {
  animation: wiggle 0.4s ease;
  border-color: #ef4444 !important;
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

/* 學習模式專用指引卡片（支援點擊標題收合/展開） */
.tone-learning-guide {
  background: #f8fafc;
  border: 2px solid #bae6fd;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 14px auto;
  max-width: 680px;
  width: 100%;
  text-align: left;
}

.tone-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  touch-action: manipulation;
}

.tone-guide-header:hover .tone-guide-title {
  color: #0284c7;
}

.tone-guide-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tone-guide-toggle-icon {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #bae6fd;
}

.tone-guide-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.tone-guide-grid.collapsed {
  display: none !important;
}

.tone-guide-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}

.tone-guide-item.highlighted {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
}

.tone-guide-item-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.tone-guide-item-desc {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 2px;
}

.tone-guide-item-example {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0284c7;
  margin-top: 4px;
}

/* 手機與窄螢幕響應式（自然捲動、不壓縮排版） */
@media (max-width: 640px) {
  .playground-header {
    padding: 8px 12px;
  }
  .header-inner {
    gap: 8px;
    flex-wrap: wrap;
  }
  .header-back-btn {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 0.92rem;
  }
  .sfx-toggle-btn {
    min-height: 38px;
    padding: 4px 10px;
    font-size: 0.88rem;
  }
  .badge-pill {
    padding: 4px 10px;
    font-size: 0.88rem;
  }

  .game-stage-card {
    padding: 16px 12px;
  }

  .hero-title {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
  }

  .mode-switch-btn {
    padding: 8px 12px;
    font-size: 0.92rem;
  }

  .tone-learning-guide {
    padding: 10px 12px;
    margin: 10px auto;
  }
  .tone-guide-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
  .tone-guide-item {
    padding: 6px 2px;
    border-radius: 8px;
  }
  .tone-guide-item-title {
    font-size: 0.82rem;
  }
  .tone-guide-item-desc {
    font-size: 0.65rem;
  }
  .tone-guide-item-example {
    font-size: 0.65rem;
  }

  .tone-stage-layout {
    gap: 12px;
    margin: 10px 0 16px;
  }

  .tone-pokemon-box {
    width: 130px;
    min-height: 130px;
    height: auto;
    padding: 10px 8px;
    border-radius: 18px;
    margin: 0 auto;
  }
  .tone-pokemon-img {
    width: 84px;
    height: 84px;
  }
  .tap-hint-pill {
    font-size: 0.74rem;
    padding: 3px 8px;
    margin-top: 6px;
  }

  .tone-name-banner {
    margin-bottom: 12px;
    gap: 6px;
  }
  .tone-char-pill {
    font-size: 1.55rem;
    padding: 4px 10px;
    border-radius: 10px;
  }
  .tone-target-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
    min-height: 18px;
  }

  .big-listen-btn {
    min-height: 44px !important;
    padding: 8px 18px !important;
    font-size: 1rem !important;
    margin: 2px 0 12px !important;
  }

  .tone-bopomofo-card {
    padding: 8px 18px;
    gap: 10px;
    margin: 2px 0 14px;
  }
  .tone-base-symbols {
    font-size: 1.75rem;
  }
  .tone-slot-badge {
    min-width: 42px;
    min-height: 42px;
    font-size: 1.55rem;
  }

  .tone-choices-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 10px auto;
  }
  .tone-choice-btn {
    min-height: 70px;
    padding: 6px 2px;
    border-radius: 12px;
  }
  .tone-choice-name {
    font-size: 0.92rem;
  }
  .tone-choice-symbol {
    font-size: 1.45rem;
  }
  .tone-choice-hint {
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .playground-header {
    padding: 6px 8px;
  }
  .header-inner {
    gap: 6px;
  }
  .header-status-box {
    gap: 4px;
  }
  .sfx-toggle-btn {
    min-height: 34px;
    padding: 2px 8px;
    font-size: 0.8rem;
  }
  .badge-pill {
    padding: 3px 6px;
    font-size: 0.8rem;
  }
  .header-back-btn {
    min-height: 36px;
    padding: 4px 10px;
    font-size: 0.86rem;
  }
}
