/* TOOLS COMMON */
.tool-hero-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.tool-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.tool-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ========================================================
   1. TEXTBOOKS SECTION
   ======================================================== */
.textbook-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.filter-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.grade-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.grade-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.grade-pill:hover, .grade-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-select, .search-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.filter-select:focus, .search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.textbooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  height: 100%;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.book-cover {
  width: 100%;
  height: 220px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-grade-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.book-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-series {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.book-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.book-publisher {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Detail page */
.book-detail-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
}

/* ========================================================
   2. MATH TOOL
   ======================================================== */
.math-container {
  max-width: 800px;
  margin: 0 auto;
}

.math-grade-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.math-grade-tab {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.math-grade-tab.active, .math-grade-tab:hover {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.math-topic-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.math-topic-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.math-topic-btn.active, .math-topic-btn:hover {
  border-color: var(--accent-green);
  background: var(--accent-green-light);
}

.math-topic-btn i {
  font-size: 1.25rem;
  color: var(--accent-green);
}

.math-game-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.math-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.math-progress-outer {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
  overflow: hidden;
}

.math-progress-inner {
  height: 100%;
  background: var(--accent-green);
  width: 0%;
  transition: width 0.3s ease;
}

.math-question-display {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.5rem 0 2rem;
  letter-spacing: 0.05em;
}

.math-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.math-opt-btn {
  padding: 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  border: 2px solid var(--border-color);
  background: var(--bg-page);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.math-opt-btn:hover {
  border-color: var(--accent-green);
  background: var(--accent-green-light);
  transform: translateY(-2px);
}

.math-opt-btn.correct {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.math-opt-btn.wrong {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.math-feedback {
  min-height: 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.math-feedback.correct-text { color: var(--accent-green); }
.math-feedback.wrong-text { color: var(--accent-red); }

/* ========================================================
   3. TYPING TOOL
   ======================================================== */
.typing-container {
  max-width: 900px;
  margin: 0 auto;
}

.typing-stats-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.typing-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.typing-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.typing-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.typing-box {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  position: relative;
}

.typing-box:focus-within {
  border-color: var(--primary);
}

.typing-text-display {
  font-size: 1.35rem;
  line-height: 2.2;
  font-family: inherit;
  color: var(--text-muted);
  user-select: none;
  min-height: 140px;
  margin-bottom: 1.5rem;
}

.char-correct {
  color: var(--accent-green);
}

.char-error {
  color: #fff;
  background-color: var(--accent-red);
  border-radius: 2px;
}

.char-current {
  background-color: #bfdbfe;
  color: var(--text-main);
  border-bottom: 2px solid var(--primary);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.7; }
}

.typing-input-field {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--bg-page);
  color: var(--text-main);
}

.typing-input-field:focus {
  background-color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ========================================================
   4. VOCABULARY TOOL
   ======================================================== */
.vocab-container {
  max-width: 860px;
  margin: 0 auto;
}

.vocab-topic-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.vocab-topic-pill {
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.vocab-topic-pill.active, .vocab-topic-pill:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.flashcard-wrapper {
  perspective: 1000px;
  max-width: 520px;
  height: 320px;
  margin: 0 auto 2rem;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-wrapper.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.flashcard-front {
  background: var(--bg-surface);
}

.flashcard-back {
  background: #fdf2f8;
  border-color: #fbcfe8;
  transform: rotateY(180deg);
}

.card-word {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.card-phonetic {
  font-size: 1.2rem;
  color: var(--accent-red);
  font-family: serif;
  margin-bottom: 1rem;
}

.card-meaning {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 0.75rem;
}

.card-example {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 400px;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Book Detail Responsive Grid */
.book-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
  width: 100%;
}

.book-detail-cover-col {
  width: 100%;
}

.book-detail-info-col {
  width: 100%;
  min-width: 0;
}

@media (max-width: 768px) {
  .book-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .book-detail-cover-col {
    max-width: 280px;
    margin: 0 auto 1.25rem;
  }
}

/* ========================================================
   5. KAHU PDF READER COMPONENT
   ======================================================== */
.pdf-reader-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 2rem 0;
  transition: all 0.3s ease;
  position: relative;
}

.pdf-reader-toolbar {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}

.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.pdf-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.pdf-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-page-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pdf-page-counter input {
  width: 44px;
  text-align: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  font-weight: 700;
  outline: none;
}

.pdf-viewport {
  background: #e2e8f0;
  min-height: 600px;
  max-height: 800px;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  transition: background 0.3s ease;
}

/* Theme variations for PDF Reader */
.theme-sepia .pdf-viewport {
  background: #f4ecd8;
}
.theme-sepia .book-page-sheet {
  background: #fffdf7 !important;
  color: #45321e !important;
}

.theme-dark .pdf-viewport {
  background: #090d16;
}
.theme-dark .book-page-sheet {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}
.theme-dark .page-content-box,
.theme-dark .page-exercise-box {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

/* Fullscreen Reader */
.pdf-reader-container.is-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.pdf-reader-container.is-fullscreen .pdf-viewport {
  flex-grow: 1;
  max-height: none;
}

.book-page-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  min-height: 850px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.page-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.sheet-page-badge {
  background: #f1f5f9;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.page-lesson-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.page-lesson-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.page-content-box {
  flex-grow: 1;
}

.page-exercise-box {
  margin-top: 2rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}

.exercise-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.page-sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.page-footer-num {
  font-weight: 800;
  font-size: 1rem;
  color: #1e293b;
}

.pdf-reading-bar {
  height: 4px;
  background: #cbd5e1;
  width: 100%;
}

.pdf-reading-progress {
  height: 100%;
  background: var(--primary);
  width: 6%;
  transition: width 0.3s ease;
}

/* ========================================================
   6. GAME CHỮ RƠI (FALLING WORDS / LETTERS)
   ======================================================== */
.typing-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.typing-mode-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.typing-mode-btn:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.typing-mode-btn.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.falling-game-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.fg-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.fg-hud {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.fg-hud-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fg-arena {
  width: 100%;
  height: 440px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.25rem;
  border: 2px solid #334155;
  transition: border-color 0.2s ease;
}

.fg-arena.arena-flash {
  border-color: #ef4444;
  box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.6);
}

.falling-bubble {
  position: absolute;
  padding: 0.5rem 1.15rem;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-weight: 800;
  font-size: 1.15rem;
  border-radius: 24px;
  border: 3px solid #3b82f6;
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.falling-bubble.bubble-pop {
  animation: bubbleExplode 0.4s ease forwards;
}

.falling-bubble.bubble-miss {
  animation: bubbleFadeRed 0.35s ease forwards;
}

@keyframes bubbleExplode {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.8; filter: brightness(1.5); }
  100% { transform: scale(0.2); opacity: 0; }
}

@keyframes bubbleFadeRed {
  0% { transform: scale(1); background: #ef4444; color: #fff; }
  100% { transform: translateY(20px) scale(0.5); opacity: 0; }
}

.fg-score-popup {
  position: absolute;
  color: #fbbf24;
  font-weight: 900;
  font-size: 1.25rem;
  pointer-events: none;
  animation: scoreFloatUp 0.6s ease forwards;
}

@keyframes scoreFloatUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-35px); opacity: 0; }
}

.fg-level-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  animation: bannerPulse 1.5s ease forwards;
}

@keyframes bannerPulse {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.fg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fg-overlay-card {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.fg-input-wrapper {
  display: flex;
  gap: 1rem;
}

.fg-input-box {
  flex-grow: 1;
  padding: 0.85rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--bg-surface);
  color: var(--text-main);
  text-align: center;
  transition: all 0.2s ease;
}

.fg-input-box:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* ========================================================
   7. MATH SPEED CHALLENGE & MULTIPLICATION TABLE
   ======================================================== */
.math-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.math-mode-btn {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.math-mode-btn.active, .math-mode-btn:hover {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.speed-math-timer {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.multiplication-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mult-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.mult-card-title {
  font-weight: 800;
  color: var(--accent-green);
  font-size: 1.15rem;
  border-bottom: 2px solid var(--accent-green-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.mult-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
}

.mult-item:nth-child(even) {
  background: var(--bg-page);
}

/* ========================================================
   8. ENGLISH VOCABULARY QUIZ COMPONENT
   ======================================================== */
.vocab-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.vocab-mode-btn {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.vocab-mode-btn.active, .vocab-mode-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.vocab-quiz-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

.vocab-quiz-question {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1rem 0 1.5rem;
}

.vocab-quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vocab-quiz-opt {
  padding: 1rem;
  background: var(--bg-page);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vocab-quiz-opt:hover {
  border-color: var(--accent-red);
  background: #fff1f2;
}

.vocab-quiz-opt.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
}

.vocab-quiz-opt.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

/* RESPONSIVE TOOLS */
@media (max-width: 768px) {
  .textbook-layout {
    grid-template-columns: 1fr;
  }
  .book-detail-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .typing-stats-panel {
    grid-template-columns: repeat(2, 1fr);
  }
  .math-options-grid,
  .vocab-quiz-grid {
    grid-template-columns: 1fr;
  }
  .book-page-sheet {
    padding: 1.5rem 1rem;
  }
  .fg-arena {
    height: 380px;
  }
}

