/* ══════════════════════════════════════════
   CSL English — Design System & Styles
   Warm Claude palette · Mobile-first
   ══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg:         #FAF8F5;
  --bg-card:    #FFFFFF;
  --bg-card-hover: #FFF9F0;
  --accent:     #D97706;
  --accent-light: #FEF3C7;
  --accent-dark: #B45309;
  --accent-glow: rgba(217,119,6,0.15);
  --text:       #1F1F1F;
  --text-secondary: #6B7280;
  --text-muted:  #9CA3AF;
  --border:     #E5E1DC;
  --success:    #059669;
  --success-light: #D1FAE5;
  --error:      #DC2626;
  --error-light: #FEE2E2;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --nav-height: 68px;
  --topbar-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, sans-serif;

  /* POS colors */
  --pos-noun:  #3B82F6;
  --pos-verb:  #EF4444;
  --pos-adj:   #EAB308;
  --pos-adv:   #22C55E;
  --pos-prep:  #A855F7;
  --pos-conj:  #F97316;
  --pos-aux:   #FBBF24;
  --pos-art:   #9CA3AF;
  --pos-pron:  #6B7280;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ── Splash ── */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFF7ED 0%, #FAF8F5 50%, #FEF3C7 100%);
  transition: opacity 0.5s, visibility 0.5s;
}
.splash.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; }
.splash-icon {
  font-size: 4rem;
  animation: pulse-bounce 1.2s ease-in-out infinite;
}
.splash-content h1 {
  font-size: 1.8rem; font-weight: 800; color: var(--accent);
  margin: 0.5rem 0 0.25rem;
}
.splash-content p { color: var(--text-secondary); font-size: 0.9rem; }
.splash-loader {
  width: 120px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 1.2rem auto 0; overflow: hidden;
}
.splash-bar {
  width: 40%; height: 100%; background: var(--accent);
  border-radius: 2px; animation: slide-loader 1s ease-in-out infinite;
}

@keyframes pulse-bounce {
  0%,100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(-6px); }
}
@keyframes slide-loader {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── App Shell ── */
.app { min-height: 100dvh; }

/* ── Top Bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(250,248,245,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-level {
  font-size: 0.85rem; font-weight: 700; color: var(--accent);
  background: var(--accent-light); padding: 4px 10px;
  border-radius: 20px;
}
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.topbar-xp {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
}

/* ── Pages ── */
.page {
  display: none;
  padding-top: var(--topbar-height);
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  min-height: 100dvh;
}
.page.active { display: block; animation: page-in 0.3s ease; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-scroll { padding: 16px; max-width: 480px; margin: 0 auto; }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

.back-btn {
  font-size: 0.9rem; font-weight: 600; color: var(--accent);
  padding: 6px 0; margin-bottom: 8px;
  transition: opacity .2s;
}
.back-btn:active { opacity: 0.6; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-btn .nav-icon { font-size: 1.4rem; transition: transform 0.2s; }
.nav-btn .nav-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.nav-btn.active .nav-label { color: var(--accent); }
.nav-btn.active .nav-icon { transform: scale(1.15); }
.nav-btn:active { transform: scale(0.9); }

/* ── Hero Card ── */
.hero-card {
  background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  border-radius: var(--radius-lg); padding: 24px 20px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.hero-greeting {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
}
.hero-level-badge { display: flex; align-items: center; gap: 14px; }
.level-icon { font-size: 2.8rem; }
.level-info { flex: 1; }
.level-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.xp-bar-wrap {
  height: 10px; background: rgba(0,0,0,0.08); border-radius: 5px;
  overflow: hidden; margin-bottom: 4px;
}
.xp-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), #F59E0B);
  border-radius: 5px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.xp-text { font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }

/* ── Streak Card ── */
.streak-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 14px 18px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.streak-fire { font-size: 2rem; }
.streak-count { font-weight: 700; font-size: 1rem; }
.streak-sub { font-size: 0.8rem; color: var(--text-secondary); }

/* ── Module Grid ── */
.section-title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 14px;
  color: var(--text);
}
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.module-card {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 18px 14px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--border);
  transition: all 0.25s; position: relative; overflow: hidden;
}
.module-card::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent-glow); opacity: 0;
  transition: opacity 0.25s;
}
.module-card:active { transform: scale(0.96); }
.module-card:active::after { opacity: 1; }
.module-emoji { font-size: 2rem; margin-bottom: 8px; }
.module-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.module-desc { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 8px; }
.module-progress {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  color: var(--accent); background: var(--accent-light);
  padding: 2px 10px; border-radius: 10px;
}

/* ═══ SCENARIO MODULE ═══ */
.scenario-list { display: flex; flex-direction: column; gap: 10px; }
.scenario-item {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--border);
  transition: all 0.2s; cursor: pointer;
}
.scenario-item:active { transform: scale(0.97); background: var(--bg-card-hover); }
.scenario-item .s-emoji { font-size: 1.8rem; }
.scenario-item .s-title { font-weight: 700; font-size: 0.95rem; }
.scenario-item .s-desc { font-size: 0.8rem; color: var(--text-secondary); }
.scenario-item .s-badge {
  margin-left: auto; font-size: 0.7rem; font-weight: 700;
  color: white; background: var(--accent); padding: 3px 10px;
  border-radius: 12px;
}
.scenario-item.completed .s-badge { background: var(--success); }

/* Scenario play */
.scenario-play { padding-top: 10px; }
.dialogue-bubble {
  max-width: 85%; padding: 14px 16px;
  border-radius: var(--radius-md); margin-bottom: 10px;
  font-size: 0.92rem; line-height: 1.5;
  animation: bubble-in 0.3s ease;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.bubble-them {
  background: var(--bg-card); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; margin-right: auto;
}
.bubble-you {
  background: linear-gradient(135deg, var(--accent), #F59E0B);
  color: white; border-bottom-right-radius: 4px; margin-left: auto;
}
.bubble-speaker {
  font-size: 0.72rem; font-weight: 700; margin-bottom: 4px;
  color: var(--text-secondary);
}
.bubble-you .bubble-speaker { color: rgba(255,255,255,0.8); }
.bubble-zh { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.bubble-you .bubble-zh { color: rgba(255,255,255,0.7); }

.scenario-choices {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px;
}
.choice-btn {
  width: 100%; text-align: left; padding: 14px 16px;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s; line-height: 1.4;
}
.choice-btn:active { transform: scale(0.97); }
.choice-btn.correct {
  border-color: var(--success); background: var(--success-light);
  color: var(--success);
}
.choice-btn.wrong {
  border-color: var(--error); background: var(--error-light);
  color: var(--error);
}

.grammar-reveal {
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: var(--radius-md); padding: 14px 16px;
  margin-top: 12px; animation: bubble-in 0.3s ease;
}
.grammar-reveal h4 { font-size: 0.85rem; color: var(--accent-dark); margin-bottom: 8px; }
.grammar-reveal .pos-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; margin: 2px;
}
.grammar-reveal .eli3 {
  font-size: 0.85rem; color: var(--text-secondary);
  margin-top: 8px; line-height: 1.5;
}

.scenario-next-btn {
  width: 100%; margin-top: 16px; padding: 14px;
  background: var(--accent); color: white; font-weight: 700;
  border-radius: var(--radius-md); font-size: 1rem;
  transition: all 0.2s;
}
.scenario-next-btn:active { transform: scale(0.97); opacity: 0.9; }

/* ═══ VOCABULARY MODULE ═══ */
.vocab-topics { display: flex; flex-direction: column; gap: 10px; }
.vocab-topic-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px; text-align: left;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.vocab-topic-btn:active { transform: scale(0.97); }
.vocab-topic-btn .vt-emoji { font-size: 1.6rem; }
.vocab-topic-btn .vt-name { font-weight: 700; font-size: 0.95rem; }
.vocab-topic-btn .vt-count { font-size: 0.8rem; color: var(--text-secondary); }
.vocab-topic-btn .vt-prog {
  margin-left: auto; font-size: 0.75rem; font-weight: 700;
  color: var(--accent);
}

.vocab-card-area { text-align: center; }
.vocab-counter {
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px;
}
.vocab-card-wrapper {
  perspective: 1000px; margin-bottom: 16px;
}
.vocab-card {
  width: 100%; min-height: 260px; position: relative;
  transform-style: preserve-3d; transition: transform 0.5s;
  cursor: pointer;
}
.vocab-card.flipped { transform: rotateY(180deg); }
.vocab-card-front, .vocab-card-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); border: 1.5px solid var(--border);
}
.vocab-card-front { background: var(--bg-card); }
.vocab-word {
  font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 4px;
}
.vocab-phonetic {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px;
}
.vocab-pos-badge {
  font-size: 0.8rem; font-weight: 700; padding: 4px 14px;
  border-radius: 14px; color: white; margin-bottom: 12px;
}
.vocab-speak-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--accent); color: white; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.vocab-speak-btn:active { transform: scale(0.9); }
.vocab-tap-hint {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 12px;
}
.vocab-card-back {
  background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  transform: rotateY(180deg); text-align: center;
}
.vocab-zh { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.vocab-eli3 {
  font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 12px;
  line-height: 1.5;
}
.vocab-example {
  font-size: 0.85rem; color: var(--text); font-style: italic;
  line-height: 1.5; padding: 10px; background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
}

.vocab-actions {
  display: flex; gap: 12px; justify-content: center;
}
.vocab-action-btn {
  flex: 1; max-width: 160px; padding: 14px;
  border-radius: var(--radius-md); font-weight: 700; font-size: 0.95rem;
  transition: all 0.2s;
}
.vocab-action-btn:active { transform: scale(0.95); }
.vocab-know {
  background: var(--success); color: white;
}
.vocab-dunno {
  background: var(--error); color: white;
}

/* ═══ SENTENCE MODULE ═══ */
.sentence-area {}
.sentence-category-list { display: flex; flex-direction: column; gap: 10px; }
.sentence-cat-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px; text-align: left;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.sentence-cat-btn:active { transform: scale(0.97); }
.sentence-cat-btn .sc-emoji { font-size: 1.5rem; }
.sentence-cat-btn .sc-name { font-weight: 700; font-size: 0.95rem; }
.sentence-cat-btn .sc-count { font-size: 0.8rem; color: var(--text-secondary); }

.sentence-game { }
.sentence-prompt {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.sentence-prompt .sp-zh {
  font-size: 1rem; font-weight: 700; margin-bottom: 6px;
}
.sentence-prompt .sp-hint {
  font-size: 0.82rem; color: var(--text-secondary);
}

.sentence-dropzone {
  min-height: 60px; padding: 12px;
  background: rgba(217,119,6,0.06); border: 2px dashed var(--accent);
  border-radius: var(--radius-md); margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  transition: all 0.2s;
}
.sentence-dropzone.correct { border-color: var(--success); background: var(--success-light); }
.sentence-dropzone.wrong { border-color: var(--error); background: var(--error-light); }

.sentence-pool {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 16px;
}

.word-chip {
  padding: 8px 14px; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; user-select: none;
  -webkit-user-select: none;
}
.word-chip:active { transform: scale(0.92); }
.word-chip.placed { opacity: 0.3; pointer-events: none; }
.word-chip.in-zone {
  background: var(--accent-light); border-color: var(--accent);
  color: var(--accent-dark);
}

.sentence-check-btn {
  width: 100%; padding: 14px; background: var(--accent);
  color: white; font-weight: 700; border-radius: var(--radius-md);
  font-size: 1rem; transition: all 0.2s;
}
.sentence-check-btn:active { transform: scale(0.97); }
.sentence-check-btn:disabled { opacity: 0.5; cursor: default; }

.sentence-result {
  margin-top: 14px; padding: 16px;
  border-radius: var(--radius-md);
  animation: bubble-in 0.3s ease;
}
.sentence-result.correct-result {
  background: var(--success-light); border: 1px solid var(--success);
}
.sentence-result.wrong-result {
  background: var(--error-light); border: 1px solid var(--error);
}
.sentence-result h4 { margin-bottom: 8px; }
.sentence-result .sr-answer {
  font-weight: 600; margin-bottom: 8px;
}
.sentence-result .sr-structure {
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px;
}
.sentence-result .sr-pos {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.sentence-result .sr-eli3 {
  font-size: 0.85rem; color: var(--text-secondary);
  background: rgba(255,255,255,0.6); padding: 8px 10px;
  border-radius: var(--radius-sm); line-height: 1.5;
}

/* ═══ GRAMMAR MODULE ═══ */
.grammar-list { display: flex; flex-direction: column; gap: 10px; }
.grammar-item {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border); cursor: pointer;
  transition: all 0.2s;
}
.grammar-item:active { transform: scale(0.97); }
.grammar-item .gi-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.grammar-item .gi-desc { font-size: 0.8rem; color: var(--text-secondary); }

.grammar-detail { animation: page-in 0.3s ease; }
.grammar-detail .gd-back {
  font-size: 0.9rem; font-weight: 600; color: var(--accent);
  padding: 6px 0; margin-bottom: 12px;
}
.grammar-detail .gd-title {
  font-size: 1.3rem; font-weight: 800; margin-bottom: 16px;
}
.grammar-detail .gd-eli3 {
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: var(--radius-md); padding: 16px;
  margin-bottom: 16px; line-height: 1.7; font-size: 0.95rem;
}
.grammar-detail .gd-eli3 .eli3-icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }
.grammar-detail .gd-examples { margin-bottom: 20px; }
.grammar-detail .gd-examples h3 {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 10px;
}
.gd-example {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px;
  border-left: 3px solid var(--accent); box-shadow: var(--shadow-sm);
}
.gd-example .gde-en {
  font-weight: 600; margin-bottom: 4px; line-height: 1.4;
}
.gd-example .gde-en b { color: var(--accent); }
.gd-example .gde-zh {
  font-size: 0.85rem; color: var(--text-secondary);
}

.grammar-quiz { margin-top: 20px; }
.grammar-quiz h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.gq-question {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-sm);
  margin-bottom: 12px; border: 1px solid var(--border);
}
.gq-question .gq-stem { font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.gq-options { display: flex; flex-direction: column; gap: 6px; }
.gq-opt {
  width: 100%; text-align: left; padding: 10px 14px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9rem;
  transition: all 0.2s;
}
.gq-opt:active { transform: scale(0.97); }
.gq-opt.correct { border-color: var(--success); background: var(--success-light); }
.gq-opt.wrong { border-color: var(--error); background: var(--error-light); }
.gq-opt:disabled { cursor: default; }

/* ═══ LISTENING MODULE ═══ */
.listening-area {}
.listening-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 20px;
}
.listen-big-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #F59E0B);
  color: white; font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 4px 12px rgba(217,119,6,0.3); }
  50% { box-shadow: 0 4px 24px rgba(217,119,6,0.5); }
}
.listen-big-btn:active { transform: scale(0.9); }
.speed-btn {
  padding: 6px 12px; border-radius: 14px;
  font-size: 0.8rem; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--bg-card);
  transition: all 0.2s;
}
.speed-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.listening-options {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.listen-opt {
  width: 100%; text-align: left; padding: 14px 16px;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.92rem;
  transition: all 0.2s; line-height: 1.4;
}
.listen-opt:active { transform: scale(0.97); }
.listen-opt.correct { border-color: var(--success); background: var(--success-light); }
.listen-opt.wrong { border-color: var(--error); background: var(--error-light); }

.listening-result {
  padding: 16px; border-radius: var(--radius-md);
  margin-top: 12px; animation: bubble-in 0.3s ease;
}
.listening-counter {
  text-align: center; font-size: 0.85rem; color: var(--text-secondary);
  margin-bottom: 16px;
}
.listening-score {
  text-align: center; padding: 30px; animation: bubble-in 0.3s ease;
}
.listening-score .ls-icon { font-size: 3rem; margin-bottom: 8px; }
.listening-score .ls-text { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.listening-score .ls-detail { font-size: 0.9rem; color: var(--text-secondary); }
.listening-score .ls-restart {
  margin-top: 16px; padding: 12px 28px;
  background: var(--accent); color: white; font-weight: 700;
  border-radius: var(--radius-md);
}

/* ═══ DAILY MODULE ═══ */
.daily-area {}
.daily-start {
  text-align: center; padding: 40px 20px;
}
.daily-start .ds-icon { font-size: 3.5rem; margin-bottom: 12px; }
.daily-start .ds-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.daily-start .ds-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; }
.daily-start-btn {
  padding: 14px 40px; background: linear-gradient(135deg, var(--accent), #F59E0B);
  color: white; font-weight: 700; font-size: 1rem;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  transition: all 0.2s;
}
.daily-start-btn:active { transform: scale(0.95); }

.daily-progress {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 20px;
}
.daily-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: all 0.3s;
}
.daily-dot.current { background: var(--accent); transform: scale(1.3); }
.daily-dot.done { background: var(--success); }
.daily-dot.wrong-dot { background: var(--error); }

.daily-timer {
  text-align: center; font-size: 1.5rem; font-weight: 800;
  color: var(--accent); margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.daily-question {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); margin-bottom: 16px;
  animation: bubble-in 0.3s ease;
}
.daily-question .dq-type {
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
  background: var(--accent-light); padding: 3px 10px;
  border-radius: 10px; display: inline-block; margin-bottom: 10px;
}
.daily-question .dq-stem {
  font-size: 1rem; font-weight: 600; line-height: 1.5; margin-bottom: 14px;
}
.daily-options { display: flex; flex-direction: column; gap: 8px; }
.daily-opt {
  width: 100%; text-align: left; padding: 12px 16px;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.9rem;
  transition: all 0.2s; line-height: 1.4;
}
.daily-opt:active { transform: scale(0.97); }
.daily-opt.correct { border-color: var(--success); background: var(--success-light); }
.daily-opt.wrong { border-color: var(--error); background: var(--error-light); }

.daily-score {
  text-align: center; padding: 30px; animation: bubble-in 0.3s ease;
}
.daily-score .ds2-icon { font-size: 3.5rem; margin-bottom: 10px; }
.daily-score .ds2-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.daily-score .ds2-detail {
  font-size: 0.95rem; color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ═══ TTS BUTTON ═══ */
.tts-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: 1rem; transition: all 0.2s;
  flex-shrink: 0;
}
.tts-btn:active { transform: scale(0.85); }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600; z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══ XP POP ═══ */
.xp-pop {
  position: fixed; top: 80px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #F59E0B);
  color: white; padding: 8px 20px; border-radius: var(--radius-xl);
  font-size: 1rem; font-weight: 800; z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: xp-fly 1.2s ease forwards;
}
@keyframes xp-fly {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
  40% { transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.9); }
}

/* ═══ SHARED POS TAG ═══ */
.pos-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 2px 7px; border-radius: 5px; margin: 1px; color: white;
}
.pos-noun { background: var(--pos-noun); }
.pos-verb { background: var(--pos-verb); }
.pos-adj  { background: var(--pos-adj); color: #1F1F1F; }
.pos-adv  { background: var(--pos-adv); }
.pos-prep { background: var(--pos-prep); }
.pos-conj { background: var(--pos-conj); }
.pos-aux  { background: var(--pos-aux); color: #1F1F1F; }
.pos-art  { background: var(--pos-art); }
.pos-pron { background: var(--pos-pron); }

/* ═══ RESPONSIVE (tablet/desktop) ═══ */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
