/* ==========================================================================
   Design System & Theme CSS Variable Definitions
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  /* Brand Color Palette - Modern Neo Glass Tech Theme */
  --bg-main: #0b0f19;
  --bg-card: rgba(21, 30, 49, 0.75);
  --bg-card-hover: rgba(30, 43, 70, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.8);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.18);
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.18);
  --success-glow: rgba(16, 185, 129, 0.35);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.18);
  --danger-glow: rgba(239, 68, 68, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-active: rgba(99, 102, 241, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);

  --font-primary: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* App Container Layout */
.app-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  background: var(--primary-light);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Category Filter Bar */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 7px 14px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.chip-count {
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 7px;
  border-radius: 10px;
}

.progress-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.stat-item {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

.stat-val {
  font-weight: 800;
  color: var(--text-main);
}

/* Global Visual Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* View Sections Wrapper */
.view-section {
  display: none;
  flex: 1;
  flex-direction: column;
}

.view-section.active {
  display: flex;
}

/* ==========================================================================
   1. Flashcard Mode (3D Perspective Flip Container)
   ========================================================================== */
.card-mode-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 24px;
}

/* 3D Scene Perspective */
.card-scene {
  width: 100%;
  max-width: 580px;
  height: 340px;
  perspective: 1200px;
}

/* 3D Inner Card Switcher */
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

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

/* Card Faces (Front & Back) */
.card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(145deg, rgba(26, 36, 60, 0.9), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-inner:hover .card-face {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 25px rgba(99, 102, 241, 0.2);
}

.card-back {
  transform: rotateY(180deg);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.level-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.level-tag.level2 { background: rgba(6, 182, 212, 0.18); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.level-tag.level3 { background: var(--primary-light); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.level-tag.irregular { background: rgba(168, 85, 247, 0.18); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.3); }

.card-counter-badge {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: 12px;
}

.card-back-title {
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Card Body Content */
.card-main-body, .card-back-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
}

.card-word {
  font-size: 46px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
  margin-bottom: 8px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-phonetic-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-phonetic {
  font-size: 20px;
  color: var(--accent-cyan);
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', monospace;
}

/* Enhanced Soundwave Audio Button */
.btn-audio {
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.audio-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-main);
  transition: transform 0.2s ease;
}

.btn-audio:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-audio:hover .audio-icon {
  stroke: #ffffff;
}

@keyframes soundWave {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.btn-audio.playing {
  animation: soundWave 1.2s infinite;
  background: var(--primary) !important;
}

.btn-audio.playing .audio-icon {
  stroke: #ffffff;
}

.card-hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Back Side Content Typography */
.card-pos {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 8px;
  display: inline-block;
}

.card-translation {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
}

.card-example-box {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-cyan);
  width: 100%;
  text-align: left;
}

.card-example {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

mark.highlight-word {
  background: rgba(6, 182, 212, 0.25);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* Card Shake & Slide Animations */
@keyframes cardShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-12px) rotate(-2deg); }
  40% { transform: translateX(10px) rotate(2deg); }
  60% { transform: translateX(-6px) rotate(-1deg); }
  80% { transform: translateX(4px) rotate(1deg); }
}

.card-inner.shake {
  animation: cardShake 0.4s ease-in-out;
}

@keyframes slideRightOut {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  50% { transform: translateX(50px) scale(0.96) rotate(3deg); opacity: 0.6; }
  100% { transform: translateX(0) scale(1) rotate(0deg); opacity: 1; }
}

.card-inner.slide-right {
  animation: slideRightOut 0.4s ease-out;
}

/* Action Controls Buttons Section */
.card-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 580px;
  align-items: center;
  justify-content: space-between;
}

.action-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.action-btn.know {
  background: var(--success-light);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.action-btn.know:hover {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 20px var(--success-glow);
  transform: translateY(-2px);
}

.action-btn.forget {
  background: var(--danger-light);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.action-btn.forget:hover {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 20px var(--danger-glow);
  transform: translateY(-2px);
}

.card-nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-circle-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.nav-circle-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.08);
}

.kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   2. Quiz & Spelling Mode Styling
   ========================================================================== */
.quiz-wrapper {
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.quiz-score-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}

.quiz-question-card {
  text-align: center;
  margin-bottom: 24px;
}

.quiz-translation-prompt {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.quiz-pos-prompt {
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
}

.spelling-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  outline: none;
}

.quiz-input:focus {
  border-color: var(--primary);
}

.quiz-input.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.quiz-input.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
}

.quiz-btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.quiz-feedback {
  min-height: 40px;
  margin-top: 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

/* ==========================================================================
   3. Dictionary / Search Mode
   ========================================================================== */
.dict-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-bar-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px 14px 44px;
  font-size: 16px;
  color: var(--text-main);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.word-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.word-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-item-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.word-item-trans {
  font-size: 14px;
  color: var(--text-muted);
}

.word-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.word-status-badge.mastered { background: var(--success-light); color: var(--success); }
.word-status-badge.review { background: var(--danger-light); color: var(--danger); }
.word-status-badge.unlearned { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

/* ==========================================================================
   4. Statistics Mode
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-card-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.green { background: var(--success-light); color: var(--success); }
.stat-card-icon.orange { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-card-icon.purple { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }

.stat-card-info h4 {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-card-num {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.reset-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-reset {
  padding: 10px 16px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   Mobile Responsive Optimizations (Clean Single Line Bottom Bar)
   ========================================================================== */
@media (max-width: 640px) {
  .app-container {
    padding: 8px 12px 75px 12px; /* Bottom padding for fixed bar */
  }

  /* Compact Mobile Header - Hide Heavy Banner Box & Icon */
  .app-header {
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 2px 4px;
    margin-bottom: 6px;
    justify-content: center;
  }

  .brand {
    gap: 6px;
  }

  .brand-icon {
    display: none; /* Hide heavy icon on mobile to save vertical space */
  }

  .brand-title {
    font-size: 15px;
    font-weight: 700;
  }

  .brand-badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  /* Fixed Native-like Bottom Navigation Bar */
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: 6px 4px max(8px, env(safe-area-inset-bottom)) 4px;
    display: flex;
    flex-direction: row !important;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  }

  .tab-btn {
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 8px;
    letter-spacing: -0.2px;
  }

  .tab-btn span:first-child {
    font-size: 15px;
  }

  .tab-btn span:last-child {
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }

  .progress-bar-container {
    margin-bottom: 12px;
    height: 4px;
  }

  .filter-group {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chip {
    flex-shrink: 0;
    padding: 5px 11px;
    font-size: 12px;
  }

  .progress-summary {
    justify-content: space-between;
    padding: 5px 10px;
    font-size: 12px;
  }

  /* Flashcard Mobile Size */
  .card-scene {
    height: 300px;
  }

  .card-face {
    padding: 18px 16px;
  }

  .card-word {
    font-size: 34px;
  }

  .card-phonetic {
    font-size: 17px;
  }

  .card-translation {
    font-size: 24px;
  }

  .card-example {
    font-size: 14px;
  }

  .action-btn {
    padding: 12px 14px;
    font-size: 14px;
  }

  .nav-circle-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .kbd {
    display: none; /* Hide keyboard shortcut hints on mobile */
  }

  .quiz-wrapper {
    padding: 16px 14px;
  }

  .quiz-translation-prompt {
    font-size: 22px;
  }

  .quiz-input {
    font-size: 20px;
    padding: 12px;
  }

  .words-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Mobile Virtual Keyboard Adaptation
   ========================================================================== */
body.keyboard-open .nav-tabs {
  display: none !important;
}

@media (max-width: 640px) {
  body.keyboard-open .app-header,
  body.keyboard-open .control-bar,
  body.keyboard-open .progress-bar-container {
    display: none !important;
  }

  body.keyboard-open .app-container {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body.keyboard-open .quiz-wrapper {
    padding: 16px 14px;
    margin-top: 4px;
  }

  body.keyboard-open .quiz-header {
    margin-bottom: 10px;
  }

  body.keyboard-open .quiz-question-card {
    margin-bottom: 10px;
  }
}
