/* ============================================================
   CHAKMA LANGUAGE — ENHANCED MODERN FRONTEND SUITE
   - 3D Interactive Flip Flashcards
   - Web Audio Waveform Visualizer
   - Interactive Canvas Handwriting & Tracing Pad
   - Virtual On-Screen Chakma (Ojhapath) Keyboard
   - Interactive Practice Quiz with Confetti Effects
   - Floating Action Dock (Sound, Keyboard, Top)
   ============================================================ */
/* ── 2. Floating Action Dock (Bottom-Right) ── */
.floating-control-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
body.virtual-keyboard-active .floating-control-dock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.dock-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  cursor: pointer;
}
.dock-btn:hover {
  transform: scale(1.1);
  border-color: var(--primary);
  background: var(--primary-tint);
}
.dock-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Dock Tooltips */
.dock-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--primary);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}
.dock-btn:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

@media (hover: none) {
  .dock-btn::before {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .floating-control-dock {
    bottom: 16px;
    right: 16px;
    gap: 8px;
  }
  .dock-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* ── 3. Audio Waveform Visualizer ── */
.audio-waveform-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin-left: 8px;
  vertical-align: middle;
}
.wave-bar {
  width: 3px;
  height: 6px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.15s ease;
}
.playing .wave-bar:nth-child(1) { animation: wavePulse 0.6s infinite ease-in-out; }
.playing .wave-bar:nth-child(2) { animation: wavePulse 0.8s infinite ease-in-out 0.1s; }
.playing .wave-bar:nth-child(3) { animation: wavePulse 0.5s infinite ease-in-out 0.2s; }
.playing .wave-bar:nth-child(4) { animation: wavePulse 0.7s infinite ease-in-out 0.15s; }
.playing .wave-bar:nth-child(5) { animation: wavePulse 0.9s infinite ease-in-out 0.25s; }

@keyframes wavePulse {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

/* ── 4. 3D Flip Flashcard (Lesson Detail) ── */
.lesson-card-3d-wrapper {
  perspective: 1200px;
  margin-bottom: 24px;
}
.flashcard-3d {
  position: relative;
  width: 100%;
  min-height: 440px;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.flashcard-3d.flipped {
  transform: rotateY(180deg);
}
.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.flashcard-face-back {
  transform: rotateY(180deg);
  background: var(--bg-card);
  text-align: left;
}

/* Flip Trigger Button */
.btn-flip-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-tint);
  border: 1px solid var(--border-color);
  cursor: pointer;
  margin: 12px auto 0;
  transition: var(--transition);
}
.btn-flip-card:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Back Face Content */
.back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.back-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}
.back-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.back-info-item {
  background: var(--primary-tint);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.bii-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.bii-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}
.back-memory-tip {
  background: #fefce8;
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-top: auto;
  font-size: 0.88rem;
  color: #713f12;
  line-height: 1.5;
}

/* ── 5. Lesson Tabs: Flashcard | Writing Canvas | Quiz ── */
.lesson-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--primary-tint);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}
.lesson-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
  transition: var(--transition);
}
.lesson-tab-btn:hover {
  color: var(--primary);
}
.lesson-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── 6. Canvas Handwriting & Tracing Pad ── */
.canvas-practice-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.canvas-practice-card.active {
  display: block;
}
.canvas-instructions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.canvas-draw-area {
  position: relative;
  width: 100%;
  height: 280px;
  background: #fafaf9;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
}
.canvas-watermark-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-chakma);
  font-size: 9rem;
  color: rgba(13, 56, 41, 0.12);
  pointer-events: none;
  user-select: none;
}
#handwriting-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.canvas-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.canvas-color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.color-swatch:hover, .color-swatch.active {
  transform: scale(1.2);
  border-color: var(--primary);
}
.canvas-action-btns {
  display: flex;
  gap: 8px;
}
.btn-canvas-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  transition: var(--transition);
}
.btn-canvas-action:hover {
  background: var(--primary-tint);
  border-color: var(--primary);
}

/* ── 7. Interactive Practice Quiz ── */
.quiz-practice-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
}
.quiz-practice-card.active {
  display: block;
}
.quiz-question-box {
  margin-bottom: 24px;
}
.quiz-q-num {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--terracotta);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.quiz-q-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  transition: var(--transition);
}
.quiz-option-btn:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.quiz-option-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
}
.quiz-option-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}
.quiz-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-feedback-box {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.quiz-feedback-box.correct {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e6f7ec;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.quiz-feedback-box.incorrect {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ── 8. Virtual On-Screen Chakma Keyboard (Non-modal, Crystal Clear, No Blur) ── */
.keyboard-drawer-overlay {
  display: none !important;
}

.virtual-keyboard-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(105%);
  width: 100%;
  max-width: 860px;
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 32px rgba(13, 56, 41, 0.22);
  z-index: 1099;
  padding: 14px 18px 20px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.virtual-keyboard-panel.open {
  transform: translateX(-50%) translateY(0);
}

/* Ensure inputs render Chakma characters cleanly and boldly */
.trans-area,
.trans-input-area,
.trans-output-area,
.vk-char,
.drc-script,
.chip-script {
  font-family: 'Noto Sans Chakma', 'Times New Roman', Times, serif !important;
}
.vk-header {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.vk-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.vk-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.vk-category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vk-category-tabs::-webkit-scrollbar {
  display: none;
}
.vk-cat-btn {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.vk-cat-btn.active, .vk-cat-btn:hover {
  background: var(--primary);
  color: #ffffff;
}
.vk-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
}
.vk-close-btn:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

/* Keyboard Keys Grid */
.vk-keys-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}
.vk-key {
  height: 48px;
  background: var(--primary-tint);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 2px 0 var(--border-color);
}
.vk-key:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--border-color);
  background: var(--primary-light);
}
.vk-key:hover {
  border-color: var(--primary);
}
.vk-char {
  font-family: var(--font-chakma);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.vk-subscript {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Key Control Row */
.vk-controls-row {
  display: flex;
  gap: 10px;
}
.vk-control-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-color);
  transition: var(--transition);
  user-select: none;
  touch-action: manipulation;
}
.vk-control-btn:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.vk-control-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}
.vk-space-btn {
  flex: 3;
}

/* Responsive Keyboard */
@media (max-width: 768px) {
  .virtual-keyboard-panel {
    max-height: 58vh;
    padding: 12px 14px 18px;
  }
  .vk-keys-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }
  .vk-key {
    height: 44px;
  }
  .vk-char {
    font-size: 1.2rem;
  }
  .vk-controls-row {
    gap: 6px;
  }
  .vk-control-btn {
    height: 38px;
    font-size: 0.8rem;
  }
}
@media (max-width: 480px) {
  .vk-keys-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
  }
  .vk-title {
    display: none;
  }
  .vk-cat-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

/* Header Theme Toggle Button */

/* ============================================================
   Word detail page (/dictionary/word/<slug>/) + "Did you mean"
   ============================================================ */
.word-page { max-width: 860px; }

.word-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px;
}
.word-breadcrumb a { color: var(--primary); text-decoration: none; }
.word-breadcrumb a:hover { text-decoration: underline; }
.word-breadcrumb i { font-size: 0.65rem; opacity: 0.6; }

.word-hero { padding: 32px; }
.word-hero .drc-words { flex-direction: column; align-items: flex-start; gap: 6px; }
.word-hero-script { font-family: var(--font-chakma); font-size: clamp(2.4rem, 7vw, 3.4rem); line-height: 1.2; }
.word-hero-roman { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0; }
.word-pron { color: var(--text-muted); font-style: italic; }

.word-section-label {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin: 24px 0 8px; font-weight: 600;
}
.word-meaning { font-size: 1.15rem; }

.word-prevnext {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  align-items: center; margin: 24px 0;
}
.word-prevnext > :last-child { justify-self: end; }
.word-related { margin-top: 8px; }

.drc-word-link { color: inherit; text-decoration: none; }
.drc-word-link:hover { color: var(--primary); text-decoration: underline; }
a.drc-copy-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.dict-suggest { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dict-suggest-label { font-weight: 600; color: var(--text-main); }

@media (max-width: 600px) {
  .word-hero { padding: 20px; }
  .word-prevnext { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   MOBILE FIXES (2026-11) — header overflow, page width, touch
   ============================================================ */

/* Safety net: nothing may widen the page beyond the screen.
   `clip` (not `hidden`) keeps the sticky header working. */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, svg, canvas { max-width: 100%; }
img { height: auto; }
pre, code { white-space: pre-wrap; word-break: break-word; }
p, li, h1, h2, h3, h4, td { overflow-wrap: anywhere; }

@media (max-width: 768px) {
  :root { --header-height: 62px; }
  .nav-container { padding: 0 14px; gap: 10px; }
  .nav-logo { flex-shrink: 1; min-width: 0; gap: 9px; }
  .logo-text { min-width: 0; }
  .logo-title, .logo-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-actions { margin-left: auto; gap: 8px; flex-shrink: 0; }
  .hamburger { width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0; }
}

@media (max-width: 480px) {
  .logo-emblem { width: 36px; height: 36px; }
  .logo-title { font-size: 0.98rem; }
  .logo-sub { font-size: 0.58rem; letter-spacing: 0.05em; }
  /* Login becomes an icon button (full "Login" is in the menu drawer) */
  .btn-nav-login { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .btn-nav-login span { display: none; }
  .user-avatar-btn span { display: none; }
  .user-avatar-btn .nav-chevron { display: none; }
  .user-avatar-btn { padding: 0; width: 38px; height: 38px; justify-content: center; }
}

@media (max-width: 360px) {
  .logo-sub { display: none; } /* theme toggle stays available in the floating dock */
}

/* ── Page hero (blog post, profile): was unstyled → white text on white ── */
:root { --green-900: #0c3628; --green-800: #134a37; }
.page-hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  color: #ffffff;
  text-align: center;
  padding: 56px 0;
}
.page-hero h1 { color: #ffffff; line-height: 1.25; }
.page-hero-badge { background: rgba(255,255,255,0.18) !important; color: #ffffff !important; }
.page-hero-meta {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 8px 16px; color: rgba(255,255,255,0.8); font-size: 0.9rem;
}

/* ── Blog share row ── */
.blog-share-row { display: flex; align-items: center; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.share-label { font-weight: 600; color: var(--text-muted); }
.share-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff !important; text-decoration: none; transition: transform .2s ease;
}
.share-btn:hover { transform: translateY(-2px); }
.share-fb { background: #1877f2; }
.share-tw { background: #111; }
.share-wa { background: #25d366; }

/* ── Virtual keyboard: truly hidden when closed (no peeking, not focusable) ── */
.virtual-keyboard-panel { visibility: hidden; transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), visibility 0s linear 0.35s; }
.virtual-keyboard-panel.open { visibility: visible; transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), visibility 0s; }

/* ── Flashcard: front face sets the height, so content never spills out ── */
.flashcard-face-front { position: relative; inset: auto; height: auto; min-height: 440px; }
.flashcard-face-back { overflow-y: auto; }

/* ── Resource size badge never wraps ("2.4 / MB") ── */
.resource-size-badge, .ric-size { white-space: nowrap; }

@media (max-width: 768px) {
  /* Floating dock: fewer, smaller buttons so it does not cover content */
  .floating-control-dock { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .dock-btn { width: 42px; height: 42px; font-size: 1rem; }
  #dock-sound-toggle { display: none; }
  body:not(.has-chakma-input) #dock-keyboard-toggle { display: none; } /* only where you type */
  #dock-top-btn { opacity: 0; pointer-events: none; transform: scale(.8); transition: opacity .2s, transform .2s; }
  body.scrolled-down #dock-top-btn { opacity: 1; pointer-events: auto; transform: none; }

  /* Sections: less empty space on phones */
  .section { padding-top: 48px; padding-bottom: 48px; }
  .page-hero { padding: 40px 0; }
  .page-hero h1 { font-size: 1.7rem; }

  /* Dictionary cards: actions always on their own row (no jagged layout) */
  .drc-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .drc-actions { width: 100%; flex-wrap: wrap; }

  /* Lesson mode tabs: three equal tabs, icon above label, nothing clipped */
  .lesson-mode-tabs { gap: 4px; border-radius: var(--radius-lg); }
  .lesson-tab-btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 4px; padding: 8px 4px;
                    font-size: 0.74rem; line-height: 1.2; text-align: center; border-radius: var(--radius-md); }
  .flashcard-face { padding: 28px 20px; }
  .flashcard-face-front { min-height: 380px; }

  /* Bigger touch targets (min ~40px) */
  .footer-links a { display: inline-block; padding: 7px 0; }
  .footer-social-icons a { width: 42px; height: 42px; }
  .dict-page-num, .dict-page-btn { min-height: 40px; min-width: 40px; }
}

.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; }
.lesson-nav .btn-next-lesson { margin-left: auto; }

/* ── Login errors ── */
.login-error {
  background: #fde8e8;
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ── Header: keep menu words whole; the full menu needs about 1100px ── */
.nav-links, .nav-links li { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-actions { margin-left: auto; }
}
