/* =============================================
   SMART INTERCHANGE — styles.css
   Light & Dark mode with full contrast system
   ============================================= */

/* ---- LIGHT THEME (default) ---- */
:root {
  color-scheme: light;

  /* Backgrounds */
  --bg-body:    #F5F3FF;
  --bg-card:    #FFFFFF;
  --bg-input:   #FFFFFF;
  --bg-subtle:  #F0EAFF;
  --bg-muted:   #F3F4F6;
  --bg-overlay: rgba(0,0,0,.04);

  /* Text */
  --text-primary:   #1A1033;
  --text-secondary: #4B4570;
  --text-muted:     #7C6EAA;
  --text-on-purple: #FFFFFF;

  /* Brand / Purple */
  --purple-900: #3B0764;
  --purple-700: #6D28D9;
  --purple-600: #7C3AED;
  --purple-500: #8B5CF6;
  --purple-400: #A78BFA;
  --purple-200: #DDD6FE;
  --purple-100: #EDE9FE;
  --purple-50:  #F5F3FF;

  /* Accent colors */
  --green-600: #16A34A;
  --green-500: #22C55E;
  --green-100: #DCFCE7;
  --red-600:   #DC2626;
  --red-500:   #EF4444;
  --red-100:   #FEE2E2;
  --yellow-500: #EAB308;
  --yellow-100: #FEF9C3;
  --blue-600:  #1D4ED8;
  --blue-100:  #DBEAFE;

  /* Borders */
  --border:        #E5E7EB;
  --border-purple: #C4B5FD;
  --border-focus:  #7C3AED;

  /* Header */
  --header-bg:   #6D28D9;
  --header-text: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 8px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.10);

  /* Transitions */
  --t: .2s ease;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-body:    #0D0820;
  --bg-card:    #160D2E;
  --bg-input:   #1E1240;
  --bg-subtle:  #1A1038;
  --bg-muted:   #231450;
  --bg-overlay: rgba(255,255,255,.04);

  --text-primary:   #EDE9FE;
  --text-secondary: #C4B5FD;
  --text-muted:     #7C6EAA;
  --text-on-purple: #FFFFFF;

  --purple-900: #F5F3FF;
  --purple-700: #C4B5FD;
  --purple-600: #A78BFA;
  --purple-500: #8B5CF6;
  --purple-400: #7C3AED;
  --purple-200: #3D2060;
  --purple-100: #281550;
  --purple-50:  #1A1038;

  --green-600: #4ADE80;
  --green-500: #22C55E;
  --green-100: #052E16;
  --red-600:   #F87171;
  --red-500:   #EF4444;
  --red-100:   #3B0707;
  --yellow-500: #FDE047;
  --yellow-100: #1C1506;
  --blue-600:  #60A5FA;
  --blue-100:  #0C1A3A;

  --border:        #2D1B69;
  --border-purple: #5B3FA0;
  --border-focus:  #A78BFA;

  --header-bg:   #160D2E;
  --header-text: #EDE9FE;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 8px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.6);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.7);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--t), color var(--t);
}
button { cursor: pointer; border: none; font-family: inherit; }
input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
::selection { background: var(--purple-400); color: #fff; }

/* =============================================
   HEADER
   ============================================= */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  transition: background var(--t);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.header-brand .logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.header-brand h1 { font-size: 17px; font-weight: 700; }
.header-brand span { font-weight: 400; opacity: .75; font-size: 13px; }

.header-controls { display: flex; align-items: center; gap: 10px; }

/* Theme Toggle Button */
.theme-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.15);
  color: var(--header-text);
  border: none;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), transform var(--t);
}
.theme-btn:hover { background: rgba(255,255,255,.25); transform: rotate(20deg); }

/* Online/Offline Toggle */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.12);
  border-radius: var(--r-full);
  padding: 4px 12px 4px 4px;
  font-size: 13px;
  font-weight: 600;
}
.mode-toggle .toggle-icon { font-size: 15px; }
.toggle-switch { position: relative; width: 38px; height: 21px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.25);
  border-radius: var(--r-full);
  transition: var(--t);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--t);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(17px); }
.mode-label { font-size: 12px; min-width: 40px; }

/* Connectivity Badge */
.connectivity-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
}
.connectivity-badge.online  { background: rgba(34,197,94,.2); color: #4ADE80; }
.connectivity-badge.offline { background: rgba(239,68,68,.2); color: #F87171; }
.connectivity-dot { width: 6px; height: 6px; border-radius: 50%; }
.connectivity-badge.online  .connectivity-dot { background: #4ADE80; }
.connectivity-badge.offline .connectivity-dot { background: #F87171; }

/* =============================================
   MAIN
   ============================================= */
.app-main { max-width: 960px; margin: 0 auto; padding: 32px 16px 80px; }

/* =============================================
   HOME
   ============================================= */
.home-hero {
  text-align: center;
  padding: 48px 16px 40px;
}
.home-hero .hero-emoji { font-size: 64px; display: block; margin-bottom: 16px; }
.home-hero h2 {
  font-size: 32px; font-weight: 800;
  color: var(--purple-600);
  margin-bottom: 8px;
}
.home-hero p { font-size: 16px; color: var(--text-secondary); max-width: 480px; margin: 0 auto 32px; }

.skills-badges {
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 48px;
}
.skill-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  background: var(--bg-card);
  border: 2px solid var(--border-purple);
  color: var(--purple-600);
  transition: all var(--t);
}
.skill-badge:hover { border-color: var(--purple-500); background: var(--purple-50); }
.skill-badge .badge-icon { font-size: 16px; }

.books-section h3 {
  font-size: 18px; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px; text-align: center;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; max-width: 700px; margin: 0 auto;
}
.book-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  border: 2px solid var(--border);
  position: relative; overflow: hidden;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--purple-500); }
.book-card .book-num {
  font-size: 48px; font-weight: 900;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-900));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; margin-bottom: 8px;
}
.book-card h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.book-card p  { font-size: 12px; color: var(--text-muted); }
.book-card .book-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--green-500); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full);
}

/* =============================================
   MODULE HUB
   ============================================= */
.module-header {
  background: linear-gradient(135deg, var(--purple-700), #3B0764);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  color: #fff;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .module-header {
  background: linear-gradient(135deg, #3D2060, #1A0842);
}
.module-header::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.06); border-radius: 50%;
}
.module-header .unit-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  opacity: .7; margin-bottom: 6px;
}
.module-header h2  { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.module-header p   { font-size: 14px; opacity: .8; }
.module-header .objectives { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.objective-pill {
  background: rgba(255,255,255,.15);
  border-radius: var(--r-full); padding: 4px 14px;
  font-size: 12px; font-weight: 600;
}

/* Skill Tabs */
.skill-tabs {
  display: flex; gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.skill-tabs::-webkit-scrollbar { display: none; }
.skill-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 2px solid var(--border);
  transition: all var(--t);
  white-space: nowrap; flex-shrink: 0;
}
.skill-tab:hover { border-color: var(--purple-400); color: var(--purple-600); }
.skill-tab.active {
  background: var(--purple-600);
  color: #fff; border-color: var(--purple-600);
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
}
.skill-tab .tab-icon { font-size: 15px; display: inline-block; transform-origin: center bottom; }
.skill-tab .tab-count {
  background: rgba(255,255,255,.22);
  border-radius: var(--r-full); padding: 0 7px;
  font-size: 11px; min-width: 20px; text-align: center;
}
.skill-tab:not(.active) .tab-count { background: var(--bg-muted); color: var(--text-muted); }

/* Exercise Cards */
.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.exercise-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--t);
  border: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.exercise-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--purple-400);
}
.exercise-card .card-top { display: flex; align-items: center; gap: 12px; }
.exercise-card .card-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.card-icon.vocabulary { background: #FEF3C7; }
.card-icon.grammar    { background: var(--purple-100); }
.card-icon.listening  { background: var(--blue-100); }
.card-icon.reading    { background: var(--green-100); }
.card-icon.video      { background: #FCE7F3; }

[data-theme="dark"] .card-icon.vocabulary { background: #2D1A00; }
[data-theme="dark"] .card-icon.grammar    { background: #1E1040; }
[data-theme="dark"] .card-icon.listening  { background: #0C1A3A; }
[data-theme="dark"] .card-icon.reading    { background: #052E16; }
[data-theme="dark"] .card-icon.video      { background: #2D0520; }

.exercise-card .card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.exercise-card .card-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.card-tag {
  background: var(--purple-100); color: var(--purple-700);
  font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-full);
}
.card-tag.listening { background: var(--blue-100); color: var(--blue-600); }
.card-tag.reading   { background: var(--green-100); color: var(--green-600); }
.card-tag.video     { background: #FCE7F3; color: #9D174D; }
[data-theme="dark"] .card-tag          { background: var(--purple-100); color: var(--purple-700); }
[data-theme="dark"] .card-tag.listening{ background: var(--blue-100); color: var(--blue-600); }
[data-theme="dark"] .card-tag.reading  { background: var(--green-100); color: var(--green-600); }
[data-theme="dark"] .card-tag.video    { background: #3D0A28; color: #F9A8D4; }

.card-score { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--green-500); }
.card-score.none { color: var(--border); }

.card-start-btn {
  background: var(--purple-50);
  color: var(--purple-700);
  border: 2px solid var(--purple-200);
  border-radius: var(--r-sm);
  padding: 8px; font-size: 13px; font-weight: 700;
  width: 100%; transition: all var(--t);
}
.card-start-btn:hover { background: var(--purple-600); color: #fff; border-color: var(--purple-600); }

/* =============================================
   ACTIVITY TYPE CARDS
   ============================================= */
.activity-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 12px;
  margin: 16px 0 4px;
}
.activity-type-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all var(--t);
  user-select: none;
}
.activity-type-card:hover {
  border-color: var(--purple-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.activity-type-card.active {
  border-color: var(--purple-600);
  background: var(--purple-50);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .activity-type-card.active { background: #1E1240; }
.act-icon  { font-size: 30px; margin-bottom: 8px; display: inline-block; transform-origin: center center; transform-style: preserve-3d; }
.act-label { font-size: 13px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.act-desc  { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* =============================================
   FLASH CARD
   ============================================= */
.flash-card-container { padding: 4px 0 8px; }
.fc-nav-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.fc-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.fc-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: all var(--t);
}
.fc-dot.done   { background: var(--green-500); }
.fc-dot.active { background: var(--purple-600); transform: scale(1.3); }
.fc-counter    { font-size: 12px; font-weight: 700; color: var(--text-muted); }

.flash-card {
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 20px;
  min-height: 200px;
}
.flash-card-inner {
  position: relative;
  min-height: 200px;
  transition: transform .5s ease;
  transform-style: preserve-3d;
}
.flash-card.flipped .flash-card-inner { transform: rotateY(180deg); }

.flash-card-front,
.flash-card-back {
  position: absolute; width: 100%; min-height: 200px;
  border-radius: var(--r-lg); backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 20px; box-sizing: border-box; text-align: center;
}
.flash-card-front {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  color: #fff;
}
.flash-card-back {
  background: var(--bg-subtle);
  border: 2px solid var(--border-purple);
  transform: rotateY(180deg);
}
.fc-word       { font-size: 38px; font-weight: 900; }
.fc-tap-hint   { margin-top: 12px; font-size: 13px; opacity: .75; }
.fc-back-word  { font-size: 20px; font-weight: 800; color: var(--purple-600); margin-bottom: 10px; }
.fc-definition { font-size: 14px; color: var(--text-primary); line-height: 1.55; margin-bottom: 12px; }
.fc-example    { font-size: 13px; color: var(--text-muted); font-style: italic; }

.fc-btn-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.fc-btn {
  padding: 9px 18px; border-radius: var(--r-full);
  border: 2px solid var(--border); background: var(--bg-card);
  color: var(--text-primary); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--t);
}
.fc-btn:disabled { opacity: .35; cursor: not-allowed; }
.fc-btn:not(:disabled):hover { border-color: var(--purple-400); background: var(--bg-subtle); }
.fc-got-it { background: var(--purple-600); color: #fff; border-color: var(--purple-600); }
.fc-got-it:hover { background: var(--purple-700) !important; border-color: var(--purple-700) !important; }

/* =============================================
   INLINE EXERCISE PANEL
   ============================================= */
#inlineExercisePanel {
  margin-top: 28px;
}
.inline-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px;
  border: 2px dashed var(--border-purple);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
}
.inline-hint.offline { border-color: var(--border); }

.inline-ex-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border-purple);
  animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.inline-ex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.inline-ex-title h3 { font-size: 16px; font-weight: 800; color: var(--text-primary); margin: 0 0 2px; }
.inline-ex-title p  { font-size: 12px; color: var(--text-muted); margin: 0; }

.btn-shuffle {
  margin-left: auto;
  background: var(--purple-100);
  color: var(--purple-700);
  border: 2px solid var(--purple-200);
  border-radius: var(--r-full);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
  flex-shrink: 0;
}
.btn-shuffle:hover { background: var(--purple-600); color: #fff; border-color: var(--purple-600); }

/* =============================================
   EXERCISE SCREEN
   ============================================= */
.exercise-screen { max-width: 780px; margin: 0 auto; }

.exercise-top-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: all var(--t);
}
.back-btn:hover { border-color: var(--purple-500); color: var(--purple-600); }

.exercise-progress {
  flex: 1; height: 8px;
  background: var(--bg-muted);
  border-radius: var(--r-full); overflow: hidden;
}
.exercise-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-500), var(--purple-700));
  border-radius: var(--r-full); transition: width .4s ease;
}
.exercise-step-label { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }

/* Exercise Card Wrapper */
.exercise-card-wrapper {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: background var(--t), border-color var(--t);
}

.exercise-title-bar {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 20px; padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.exercise-title-icon {
  width: 48px; height: 48px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.exercise-title-icon.vocabulary { background: #FEF3C7; }
.exercise-title-icon.grammar    { background: var(--purple-100); }
.exercise-title-icon.listening  { background: var(--blue-100); }
.exercise-title-icon.reading    { background: var(--green-100); }
.exercise-title-icon.video      { background: #FCE7F3; }
[data-theme="dark"] .exercise-title-icon.vocabulary { background: #2D1A00; }
[data-theme="dark"] .exercise-title-icon.grammar    { background: #1E1040; }
[data-theme="dark"] .exercise-title-icon.listening  { background: #0C1A3A; }
[data-theme="dark"] .exercise-title-icon.reading    { background: #052E16; }
[data-theme="dark"] .exercise-title-icon.video      { background: #2D0520; }

.exercise-title-bar h3 { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.exercise-title-bar p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Instructions */
.instructions-box {
  background: var(--purple-50);
  border: 2px solid var(--purple-200);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 14px; font-weight: 600;
  color: var(--purple-700);
  margin-bottom: 24px;
  display: flex; align-items: flex-start; gap: 10px;
}
.instructions-box .inst-icon { font-size: 18px; flex-shrink: 0; }

/* Word Bank */
.word-bank {
  background: var(--bg-muted);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border: 1px solid var(--border);
}
.word-bank-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; width: 100%; margin-bottom: 4px;
}
.word-chip {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: grab; transition: all var(--t); user-select: none;
}
.word-chip:hover { border-color: var(--purple-500); color: var(--purple-600); background: var(--purple-50); }
.word-chip.used { opacity: .3; pointer-events: none; }

/* Fill Items */
.fill-items { display: flex; flex-direction: column; gap: 14px; }
.fill-item {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; font-size: 14px; line-height: 1.8;
  color: var(--text-primary);
}
.fill-item .item-num { font-weight: 800; color: var(--purple-600); min-width: 24px; }

/* Inputs */
.fill-input {
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 12px;
  font-size: 14px; font-weight: 600;
  min-width: 120px;
  transition: all var(--t); outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
}
.fill-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.fill-input.correct { border-color: var(--green-500); background: var(--green-100); color: var(--green-600); }
.fill-input.wrong   { border-color: var(--red-500);   background: var(--red-100);   color: var(--red-600); }

.dropdown-input {
  border: 2px solid var(--border-purple);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 14px; font-weight: 600;
  background: var(--bg-input); color: var(--text-primary);
  outline: none; transition: all var(--t);
}
.dropdown-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.dropdown-input.correct { border-color: var(--green-500); background: var(--green-100); color: var(--green-600); }
.dropdown-input.wrong   { border-color: var(--red-500);   background: var(--red-100);   color: var(--red-600); }

/* Dialogue box */
.dialogue-box {
  background: var(--bg-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.dialogue-line { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.dialogue-speaker {
  font-weight: 800; color: var(--purple-600);
  min-width: 52px; flex-shrink: 0; padding-top: 6px;
}
.dialogue-text { flex: 1; color: var(--text-primary); line-height: 1.6; }

/* Multiple Choice */
.mc-options { display: flex; flex-direction: column; gap: 10px; }
.mc-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer; transition: all var(--t);
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
}
.mc-option:hover:not(.disabled) { border-color: var(--purple-400); background: var(--purple-50); color: var(--purple-700); }
.mc-option.selected { border-color: var(--purple-600); background: var(--purple-100); color: var(--purple-700); }
.mc-option.correct  { border-color: var(--green-500); background: var(--green-100); color: var(--green-600); }
.mc-option.wrong    { border-color: var(--red-500);   background: var(--red-100);   color: var(--red-600); }
.mc-option.disabled { pointer-events: none; }

.mc-radio, .mc-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--t);
}
.mc-radio { border-radius: 50%; }
.mc-check { border-radius: 5px; }
.mc-option.selected .mc-radio,
.mc-option.selected .mc-check { border-color: var(--purple-600); background: var(--purple-600); }
.mc-option.correct .mc-radio,
.mc-option.correct .mc-check  { border-color: var(--green-500); background: var(--green-500); }
.mc-option.wrong .mc-radio,
.mc-option.wrong .mc-check    { border-color: var(--red-500); background: var(--red-500); }
.mc-radio::after, .mc-check::after {
  content: '✓'; color: #fff; font-size: 11px; font-weight: 900; display: none;
}
.mc-option.selected .mc-radio::after,
.mc-option.selected .mc-check::after,
.mc-option.correct .mc-radio::after,
.mc-option.correct .mc-check::after { display: block; }
.mc-option.wrong .mc-radio::after,
.mc-option.wrong .mc-check::after  { display: block; content: '✕'; }

/* Drag & Drop */
.word-order-area {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 52px;
  border: 2px dashed var(--border-purple);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--purple-50);
  margin-bottom: 16px; align-items: center;
  transition: all var(--t);
}
.word-order-area.drag-over { border-color: var(--purple-600); background: var(--purple-100); }
.word-order-placeholder { font-size: 13px; color: var(--text-muted); font-style: italic; }

.word-source-area {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px;
  background: var(--bg-muted);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.draggable-word {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  font-size: 13px; font-weight: 700;
  cursor: grab; transition: all var(--t); user-select: none;
  color: var(--text-primary);
}
.draggable-word:hover { border-color: var(--purple-500); color: var(--purple-600); }
.draggable-word.in-answer { border-color: var(--purple-500); background: var(--purple-100); color: var(--purple-700); cursor: grab; }
.draggable-word.in-answer:hover { background: var(--red-100); border-color: var(--red-500); color: var(--red-600); }

/* Opposites */
.opposites-container { display: flex; flex-direction: column; gap: 12px; }
.opposite-row { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.opposite-word { min-width: 90px; color: var(--text-primary); }
.opposite-separator { color: var(--text-muted); }
.opposite-drop {
  min-width: 110px; height: 40px;
  border: 2px dashed var(--border-purple);
  border-radius: var(--r-sm);
  background: var(--purple-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  transition: all var(--t); padding: 0 12px;
  cursor: pointer;
}
.opposite-drop.drag-over { border-color: var(--purple-600); background: var(--purple-100); }
.opposite-drop.filled { color: var(--purple-700); border-style: solid; border-color: var(--purple-500); background: var(--bg-card); }
.opposite-drop.correct { border-color: var(--green-500); background: var(--green-100); color: var(--green-600); }
.opposite-drop.wrong   { border-color: var(--red-500);   background: var(--red-100);   color: var(--red-600); }

/* Sub-navigation dots */
.sub-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sub-dots { display: flex; gap: 6px; }
.sub-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: all var(--t); cursor: pointer;
}
.sub-dot.active { background: var(--purple-600); transform: scale(1.3); }
.sub-dot.done   { background: var(--green-500); }
.sub-nav-label  { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Audio Player */
.audio-player {
  background: var(--blue-100);
  border: 2px solid #93C5FD;
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
[data-theme="dark"] .audio-player { background: var(--blue-100); border-color: #1E3A6E; }
.audio-play-btn {
  width: 52px; height: 52px;
  border-radius: 50%; background: var(--blue-600);
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--t);
}
.audio-play-btn:hover { transform: scale(1.07); opacity: .9; }
.audio-play-btn.playing { background: var(--red-500); }
.audio-info { flex: 1; }
.audio-info .audio-title { font-size: 13px; font-weight: 700; color: var(--blue-600); margin-bottom: 2px; }
.audio-info .audio-hint  { font-size: 12px; color: var(--text-muted); }
.audio-progress-bar {
  width: 100%; height: 4px;
  background: rgba(0,0,0,.1);
  border-radius: var(--r-full); overflow: hidden; margin-top: 6px;
}
.audio-progress-fill { height: 100%; background: var(--blue-600); border-radius: var(--r-full); transition: width .3s; }

/* Reading Article */
.reading-article {
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px; font-size: 14px; line-height: 1.8;
  margin-bottom: 24px;
  max-height: 280px; overflow-y: auto;
  color: var(--text-primary);
}
.reading-article h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.reading-article .decade { font-weight: 800; color: var(--purple-600); }
.reading-article::-webkit-scrollbar { width: 4px; }
.reading-article::-webkit-scrollbar-thumb { background: var(--purple-400); border-radius: 4px; }

/* Video */
.video-container {
  position: relative; padding-bottom: 56.25%;
  border-radius: var(--r-lg); overflow: hidden;
  background: #000; margin-bottom: 20px;
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-offline-msg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-muted);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text-primary);
  text-align: center; padding: 20px;
}
.video-offline-msg .offline-icon { font-size: 48px; }
.video-offline-msg h4 { font-size: 16px; font-weight: 700; }
.video-offline-msg p  { font-size: 13px; color: var(--text-muted); max-width: 280px; }

/* Buttons */
.exercise-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.btn-check {
  background: var(--purple-600); color: #fff;
  border-radius: var(--r-md); padding: 12px 28px;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  transition: all var(--t);
}
.btn-check:hover { background: var(--purple-700); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.35); }
.btn-check:disabled { background: var(--border); cursor: not-allowed; transform: none; }

.btn-reset {
  background: var(--bg-card); color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 12px 20px;
  font-size: 15px; font-weight: 700;
  transition: all var(--t);
}
.btn-reset:hover { border-color: var(--text-muted); }

.btn-next {
  background: var(--green-500); color: #fff;
  border-radius: var(--r-md); padding: 12px 24px;
  font-size: 15px; font-weight: 700;
  display: none; align-items: center; gap: 8px;
  margin-left: auto; transition: all var(--t);
}
.btn-next.visible { display: flex; }
.btn-next:hover { background: var(--green-600); }

/* Result Banner */
.result-banner {
  border-radius: var(--r-md); padding: 14px 18px;
  font-size: 14px; font-weight: 700;
  display: none; align-items: center; gap: 10px;
  margin-top: 16px;
}
.result-banner.show { display: flex; }
.result-banner.all-correct { background: var(--green-100); color: var(--green-600); border: 2px solid var(--green-500); }
.result-banner.partial     { background: var(--yellow-100); color: #854D0E; border: 2px solid var(--yellow-500); }
[data-theme="dark"] .result-banner.partial { color: var(--yellow-500); }
.result-banner.wrong       { background: var(--red-100); color: var(--red-600); border: 2px solid var(--red-500); }
.result-banner .banner-icon { font-size: 20px; }

/* Completion */
.completion-screen { text-align: center; padding: 48px 24px; }
.completion-screen .trophy { font-size: 72px; display: block; margin-bottom: 16px; }
.completion-screen h3 { font-size: 28px; font-weight: 800; color: var(--purple-600); margin-bottom: 8px; }
.completion-screen p  { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; }
.score-display {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--purple-100);
  border: 2px solid var(--purple-500);
  border-radius: var(--r-xl); padding: 12px 28px;
  font-size: 24px; font-weight: 900; color: var(--purple-700);
  margin-bottom: 28px;
}
.completion-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-retry {
  background: var(--bg-card); color: var(--purple-700);
  border: 2px solid var(--purple-500);
  border-radius: var(--r-md); padding: 12px 24px;
  font-size: 15px; font-weight: 700; transition: all var(--t);
}
.btn-retry:hover { background: var(--purple-50); }
.btn-back-hub {
  background: var(--purple-600); color: #fff;
  border: none; border-radius: var(--r-md); padding: 12px 24px;
  font-size: 15px; font-weight: 700; transition: all var(--t);
}
.btn-back-hub:hover { background: var(--purple-700); }

/* Toast */
.offline-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); color: var(--text-primary);
  padding: 12px 20px; border-radius: var(--r-lg);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-xl); z-index: 9999;
  transition: transform .4s ease;
  max-width: calc(100vw - 32px);
  border: 2px solid var(--border);
}
.offline-toast.show { transform: translateX(-50%) translateY(0); }
.offline-toast .toast-icon { font-size: 18px; }

/* Confetti canvas */
#confetti-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 9998;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
  .app-header { padding: 0 14px; }
  .header-brand h1 { font-size: 14px; }
  .header-brand span { display: none; }
  .app-main { padding: 16px 10px 60px; }
  .exercise-card-wrapper { padding: 18px 14px; }
  .home-hero h2 { font-size: 24px; }
  .module-header { padding: 20px 16px; }
  .module-header h2 { font-size: 19px; }
  .exercises-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-label { display: none; }
  .connectivity-badge span { display: none; }
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0%   { transform: scale(.8); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.fade-in { animation: fadeInUp .3s ease both; }
.pop-in  { animation: popIn .4s ease both; }

/* =============================================
   INTERACTIVE ICON ANIMATIONS
   ============================================= */

/* ---------- Skill Tab Icons ---------- */
.tab-icon { display: inline-block; transition: transform .2s ease; }

/* Vocabulary 📚 — bounce */
@keyframes tabBounce {
  0%,100% { transform: translateY(0) scale(1); }
  30%     { transform: translateY(-6px) scale(1.15); }
  60%     { transform: translateY(-2px) scale(1.05); }
}
.skill-tab:hover .tab-icon-vocabulary,
.skill-tab.active .tab-icon-vocabulary {
  animation: tabBounce .55s ease both;
}

/* Grammar ✏️ — wiggle/write */
@keyframes tabWiggle {
  0%,100% { transform: rotate(0deg); }
  20%     { transform: rotate(-18deg) scale(1.1); }
  50%     { transform: rotate(14deg) scale(1.15); }
  75%     { transform: rotate(-8deg) scale(1.1); }
}
.skill-tab:hover .tab-icon-grammar,
.skill-tab.active .tab-icon-grammar {
  animation: tabWiggle .5s ease both;
}

/* Listening 🎧 — pulse/scale */
@keyframes tabPulse {
  0%,100% { transform: scale(1); filter: brightness(1); }
  40%     { transform: scale(1.25); filter: brightness(1.2); }
  70%     { transform: scale(1.08); }
}
.skill-tab:hover .tab-icon-listening,
.skill-tab.active .tab-icon-listening {
  animation: tabPulse .55s ease both;
}

/* Reading 📖 — flip open */
@keyframes tabFlipOpen {
  0%   { transform: rotateY(0deg) scale(1); }
  40%  { transform: rotateY(-40deg) scale(1.2); }
  100% { transform: rotateY(0deg) scale(1); }
}
.skill-tab:hover .tab-icon-reading,
.skill-tab.active .tab-icon-reading {
  animation: tabFlipOpen .55s ease both;
}

/* Video 🎬 — shake */
@keyframes tabShake {
  0%,100% { transform: translateX(0) scale(1); }
  20%     { transform: translateX(-5px) scale(1.12); }
  40%     { transform: translateX(5px) scale(1.12); }
  60%     { transform: translateX(-3px) scale(1.08); }
  80%     { transform: translateX(3px) scale(1.05); }
}
.skill-tab:hover .tab-icon-video,
.skill-tab.active .tab-icon-video {
  animation: tabShake .5s ease both;
}

/* ---------- Activity Type Card Icons ---------- */
.act-icon { display: inline-block; transition: transform .25s ease; }

/* Flash Card 🃏 — idle float + hover 3D flip */
@keyframes fcFloat {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%     { transform: translateY(-6px) rotate(2deg); }
}
@keyframes fcFlipHover {
  0%   { transform: rotateY(0deg) scale(1); }
  40%  { transform: rotateY(-180deg) scale(1.25); }
  80%  { transform: rotateY(-360deg) scale(1.1); }
  100% { transform: rotateY(-360deg) scale(1); }
}
.act-icon-flash-card {
  animation: fcFloat 2.4s ease-in-out infinite;
  transform-style: preserve-3d;
}
.activity-type-card:hover .act-icon-flash-card,
.activity-type-card.active .act-icon-flash-card {
  animation: fcFlipHover .65s ease both;
}

/* Fill the Blank ✏️ — write scribble */
@keyframes actWrite {
  0%,100% { transform: rotate(0deg) scale(1); }
  25%     { transform: rotate(-20deg) scale(1.2) translateY(-4px); }
  50%     { transform: rotate(15deg) scale(1.2) translateY(-2px); }
  75%     { transform: rotate(-10deg) scale(1.15); }
}
.activity-type-card:hover .act-icon-fill-blank,
.activity-type-card.active .act-icon-fill-blank {
  animation: actWrite .55s ease both;
}

/* Match & Choose 🔄 — spin */
@keyframes actSpin {
  0%   { transform: rotate(0deg) scale(1); }
  60%  { transform: rotate(360deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}
.activity-type-card:hover .act-icon-match,
.activity-type-card.active .act-icon-match {
  animation: actSpin .55s ease both;
}

/* Dialogue & Build 💬 — pop bounce */
@keyframes actPopChat {
  0%,100% { transform: scale(1) translateY(0); }
  30%     { transform: scale(1.3) translateY(-6px); }
  55%     { transform: scale(1.15) translateY(-3px); }
  80%     { transform: scale(1.05) translateY(-1px); }
}
.activity-type-card:hover .act-icon-dialogue,
.activity-type-card.active .act-icon-dialogue {
  animation: actPopChat .55s ease both;
}

/* =============================================
   WORD SEARCH
   ============================================= */
.ws-wrap { display: flex; gap: 16px; flex-wrap: wrap; }
.ws-grid { display: flex; flex-direction: column; gap: 2px; }
.ws-row  { display: flex; gap: 2px; }
.ws-cell {
  width: 28px; height: 28px; font-size: 12px; font-weight: 800;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.ws-cell:hover { background: var(--purple-100); border-color: var(--purple-400); }
.ws-cell.ws-selecting { background: var(--purple-200); border-color: var(--purple-600); }
.ws-cell.ws-found { background: var(--green-100); border-color: var(--green-500); color: var(--green-600); }
.ws-word-list { display: flex; flex-direction: column; gap: 6px; min-width: 100px; }
.ws-word { font-size: 13px; font-weight: 700; color: var(--text-primary); padding: 4px 8px; border-radius: 4px; background: var(--bg-muted); border: 1px solid var(--border); }
.ws-word.ws-word-found { text-decoration: line-through; color: var(--green-600); background: var(--green-100); border-color: var(--green-500); }
.ws-feedback { font-size: 13px; font-weight: 700; margin-top: 10px; padding: 8px 12px; border-radius: 6px; display: none; }
.ws-feedback.ws-found-msg { display: block; background: var(--green-100); color: var(--green-600); }
.ws-feedback.ws-complete  { display: block; background: var(--purple-100); color: var(--purple-700); font-size: 15px; }

/* =============================================
   HANGMAN
   ============================================= */
.hm-wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.hm-svg  { width: 120px; height: 150px; color: var(--text-primary); flex-shrink: 0; }
.hm-right { flex: 1; min-width: 200px; }
.hm-definition { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; font-style: italic; line-height: 1.5; }
.hm-blanks { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hm-blank { font-size: 22px; font-weight: 900; width: 30px; text-align: center; border-bottom: 3px solid var(--purple-600); color: var(--text-primary); min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.hm-blank.hm-revealed { color: var(--purple-700); border-color: var(--green-500); }
.hm-keyboard { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; max-width: 320px; }
.hm-key { width: 30px; height: 30px; font-size: 12px; font-weight: 800; border: 1.5px solid var(--border); border-radius: 4px; background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: all .15s; }
.hm-key:not(:disabled):hover { background: var(--purple-100); border-color: var(--purple-500); }
.hm-key.hm-correct { background: var(--green-100); border-color: var(--green-500); color: var(--green-600); }
.hm-key.hm-wrong   { background: var(--red-100); border-color: var(--red-500); color: var(--red-600); }
.hm-key:disabled   { opacity: .7; cursor: default; }
.hm-status { font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.hm-win  { background: var(--green-100); color: var(--green-600); }
.hm-lose { background: var(--red-100); color: var(--red-600); }

/* =============================================
   MEMORY GAME
   ============================================= */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mem-card {
  aspect-ratio: 1; cursor: pointer;
  perspective: 600px; border-radius: var(--r-md);
  transition: opacity .2s;
}
.mem-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .4s ease;
  border-radius: var(--r-md);
}
.mem-card.mem-flipped .mem-card-inner { transform: rotateY(180deg); }
.mem-front, .mem-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; padding: 6px; text-align: center;
  border: 2px solid var(--border);
}
.mem-front { background: var(--purple-600); color: #fff; font-size: 22px; }
.mem-back  { transform: rotateY(180deg); background: var(--bg-card); color: var(--text-primary); }
.mem-back.mem-word { background: var(--purple-50); color: var(--purple-700); border-color: var(--purple-400); font-size: 15px; }
.mem-back.mem-def  { background: var(--blue-100); color: var(--text-primary); font-size: 11px; }
.mem-card.mem-matched .mem-front { background: var(--green-500); }
.mem-card.mem-matched .mem-back  { border-color: var(--green-500); }

/* =============================================
   SPELLING BEE
   ============================================= */
.sb-wrap { max-width: 420px; margin: 0 auto; text-align: center; }
.sb-progress { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
.sb-definition { font-size: 15px; color: var(--text-secondary); font-style: italic; margin-bottom: 14px; line-height: 1.5; background: var(--bg-muted); border-radius: var(--r-md); padding: 12px 16px; }
.sb-speak-btn { background: var(--purple-600); color: #fff; border: none; border-radius: var(--r-md); padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer; margin-bottom: 14px; transition: all var(--t); }
.sb-speak-btn:hover { background: var(--purple-700); }
.sb-input { width: 100%; max-width: 300px; font-size: 18px; font-weight: 700; text-align: center; padding: 10px 16px; border-radius: var(--r-md); border: 2px solid var(--border); background: var(--bg-card); color: var(--text-primary); margin-bottom: 12px; }
.sb-input:focus { border-color: var(--purple-500); outline: none; }
.sb-result { font-size: 14px; font-weight: 700; min-height: 24px; margin-bottom: 10px; }
.sb-correct { color: var(--green-600); }
.sb-wrong   { color: var(--red-600); }
.sb-actions { display: flex; gap: 10px; justify-content: center; align-items: center; }

/* =============================================
   ODD ONE OUT
   ============================================= */
.odd-wrap { max-width: 480px; margin: 0 auto; }
.odd-progress { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.odd-prompt { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.odd-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.odd-btn {
  padding: 14px 10px; font-size: 14px; font-weight: 700;
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; transition: all var(--t);
}
.odd-btn:not(:disabled):hover { border-color: var(--purple-400); background: var(--purple-50); }
.odd-btn.odd-correct-btn { background: var(--green-100); border-color: var(--green-500); color: var(--green-600); }
.odd-btn.odd-wrong-btn   { background: var(--red-100); border-color: var(--red-500); color: var(--red-600); }
.odd-feedback { display: none; font-size: 13px; margin-top: 14px; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-muted); line-height: 1.5; }
.odd-correct { color: var(--green-600); font-weight: 700; margin-right: 6px; }
.odd-wrong   { color: var(--red-600); font-weight: 700; margin-right: 6px; }

/* =============================================
   SPEED ROUND
   ============================================= */
.speed-wrap { max-width: 480px; margin: 0 auto; text-align: center; }
.speed-timer-display { font-size: 28px; font-weight: 900; color: var(--purple-600); margin-bottom: 8px; }
.speed-score { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.speed-question { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; padding: 14px 16px; background: var(--purple-50); border-radius: var(--r-md); border-left: 4px solid var(--purple-500); text-align: left; }
.speed-start-msg { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }
.speed-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.speed-btn {
  padding: 12px 10px; font-size: 14px; font-weight: 700;
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; transition: all var(--t);
}
.speed-btn:hover { border-color: var(--purple-400); background: var(--purple-50); }

/* =============================================
   SORT & CATEGORIZE
   ============================================= */
.sort-words { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 12px; background: var(--bg-muted); border-radius: var(--r-md); min-height: 52px; }
.sort-chip { padding: 6px 14px; font-size: 13px; font-weight: 700; border: 2px solid var(--border); border-radius: var(--r-full); background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: all var(--t); }
.sort-chip:hover { border-color: var(--purple-400); }
.sort-chip.sort-selected { border-color: var(--purple-600); background: var(--purple-100); color: var(--purple-700); }
.sort-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sort-cat { border: 2px dashed var(--border); border-radius: var(--r-md); padding: 12px; min-height: 80px; background: var(--bg-card); transition: all var(--t); cursor: pointer; }
.sort-cat.sort-cat-droppable { border-color: var(--purple-400); background: var(--purple-50); }
.sort-cat:hover { border-color: var(--purple-500); }
.sort-cat-name { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.sort-cat-items { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-placed-word { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); background: var(--purple-100); color: var(--purple-700); border: 1px solid var(--purple-400); cursor: pointer; }
.sort-placed-word:hover { background: var(--red-100); color: var(--red-600); border-color: var(--red-400); }
.sort-placeholder { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* =============================================
   GUESS THE WORD
   ============================================= */
.gw-list { display: flex; flex-direction: column; gap: 14px; }
.gw-item { display: flex; flex-direction: column; gap: 6px; }
.gw-def { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.gw-input { width: 100%; max-width: 280px; padding: 8px 12px; font-size: 14px; font-weight: 700; border: 2px solid var(--border); border-radius: var(--r-md); background: var(--bg-card); color: var(--text-primary); transition: border-color var(--t); }
.gw-input:focus { border-color: var(--purple-500); outline: none; }
.gw-input.correct { border-color: var(--green-500); background: var(--green-100); }
.gw-input.wrong   { border-color: var(--red-500); background: var(--red-100); }
