@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-light: #1e3a8a;
  --success-light: #064e3b;
  --danger-light: #7f1d1d;
  --warning-light: #78350f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

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

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: inline-flex !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-dropdown-btn:hover, .nav-dropdown:hover .nav-dropdown-btn {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  z-index: 200;
  min-width: 280px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease;
}

.grade-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dropdown-item {
  display: block;
  padding: 8px 10px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 1rem;
}

/* =========================================
   Hero Section & Data-Driven Stats Highlights
   ========================================= */
.hero-section {
  text-align: center;
  padding: 44px 0 28px;
}

.hero-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.hero-data-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  color: #92400e;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .hero-data-badge {
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  color: #fef08a;
  border-color: #d97706;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.hero-data-badge .badge-fire {
  font-size: 1.1rem;
  animation: pulse 1.5s infinite;
}

.hero-data-badge .highlight-number {
  background: linear-gradient(135deg, #d97706, #b45309);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(217, 119, 6, 0.4);
  text-underline-offset: 3px;
}

[data-theme="dark"] .hero-data-badge .highlight-number {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-data-badge .badge-text {
  font-weight: 800;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  line-height: 1.25;
}

/* Quick Stats Metric Bar */
.hero-stats-bar {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px auto 0;
  max-width: 860px;
}

.stat-pill {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.stat-pill:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 6px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .sep {
  opacity: 0.5;
}

/* Quiz Layout Grid */
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  margin-bottom: 50px;
}

@media (max-width: 900px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }
}

/* Quiz Hero Info Card */
.quiz-meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.quiz-badge-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-grade {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-subject {
  background: #fef3c7;
  color: #92400e;
}

.quiz-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}

.quiz-stats {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Question Card */
.question-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.question-item.active {
  border-color: var(--primary);
}

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

.q-number {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.q-prompt {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.q-prompt img, .q-option img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 8px;
}

/* Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-size: 1.05rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.option-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-btn.correct-highlight {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
  color: #065f46;
}

.option-btn.wrong-highlight {
  border-color: var(--danger) !important;
  background: var(--danger-light) !important;
  color: #991b1b;
}

.opt-key {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.option-btn.selected .opt-key {
  background: var(--primary);
  color: white;
}

.opt-text {
  flex: 1;
}

/* Explanation Box */
.explanation-box {
  display: none;
  margin-top: 18px;
  padding: 16px 20px;
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  font-size: 0.95rem;
}

.explanation-box.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Sidebar / Navigator */
.quiz-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.timer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.nav-q-btn {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nav-q-btn.answered {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.nav-q-btn.correct {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.nav-q-btn.wrong {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Result Modal / Banner */
.result-card {
  display: none;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.result-card.show {
  display: block;
}

.score-display {
  font-size: 3rem;
  font-weight: 800;
  color: #38bdf8;
  margin: 10px 0;
}

/* Homepage */
.hero-section {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1e293b, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 30px 0 60px;
}

.grade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

.quiz-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin: 40px 0 20px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Question List */
.question-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-card);
}

.footer-title {
  margin-bottom: 14px;
  line-height: 1.6;
}

.footer-links-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.footer-intro-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.footer-link strong {
  color: var(--primary);
}

.footer-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.footer-link svg {
  flex-shrink: 0;
  color: var(--primary);
}

.footer-subtitle {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Mobile & Responsive Optimization (<= 768px)
   ========================================= */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  .container {
    padding: 0 14px;
  }

  /* Universal Media & Table Responsive Containment */
  img, video, audio {
    max-width: 100% !important;
    height: auto !important;
  }

  audio {
    width: 100% !important;
    min-height: 40px;
  }

  table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 14px 0;
  }

  /* Header Mobile */
  .header-inner {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 0 8px;
    gap: 8px;
  }

  .brand-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .desktop-only {
    display: none !important;
  }

  .brand {
    font-size: 1.15rem;
    gap: 8px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    border-radius: 8px;
  }

  .theme-toggle {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 20px;
    font-weight: 700;
  }

  /* Horizontal Scrolling Nav Pills */
  .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 8px;
    width: 100%;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.88rem;
    padding: 7px 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .nav-dropdown {
    flex-shrink: 0;
  }

  .nav-dropdown-btn {
    font-size: 0.88rem;
    padding: 7px 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
    min-height: 36px;
    cursor: pointer;
  }

  .nav-dropdown-menu {
    position: fixed;
    top: 105px;
    left: 12px;
    right: 12px;
    transform: none;
    min-width: auto;
    max-height: 65vh;
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    padding: 16px;
    border-radius: 14px;
    z-index: 1000;
  }

  .grade-dropdown-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .dropdown-item {
    padding: 10px 8px;
    font-size: 0.9rem;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hero Section */
  .hero-section {
    padding: 24px 0 16px;
  }

  .hero-title {
    font-size: 1.55rem;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .hero-section p {
    font-size: 0.92rem !important;
    line-height: 1.5;
  }

  /* Grade Cards Grid */
  .grade-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0 32px;
  }

  .grade-card {
    padding: 16px 12px;
    border-radius: 12px;
    min-height: 80px;
  }

  /* Quiz List Cards */
  .quiz-list-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 32px;
  }

  .quiz-card {
    padding: 16px;
    border-radius: 12px;
  }

  .quiz-card h3 {
    font-size: 1.05rem !important;
    line-height: 1.4;
  }

  /* Question Cards */
  .question-list-grid {
    gap: 12px;
    margin-bottom: 32px;
  }

  .question-card {
    padding: 16px;
    border-radius: 12px;
  }

  .question-card h3 {
    font-size: 0.98rem !important;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin: 12px 0 16px;
  }

  .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  /* Quiz Meta Card Mobile */
  .quiz-meta-card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 18px;
  }

  .quiz-title {
    font-size: 1.25rem !important;
    line-height: 1.35;
    margin: 10px 0;
  }

  .quiz-stats {
    flex-direction: column;
    gap: 6px !important;
    font-size: 0.88rem;
  }

  /* Quiz Player Mobile Optimization */
  .quiz-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
  }

  .question-item {
    padding: 16px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
  }

  .q-header {
    margin-bottom: 12px;
  }

  .q-number {
    font-size: 1.05rem;
  }

  .q-prompt {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 16px;
    word-break: break-word;
  }

  /* Touch-optimized Options */
  .options-grid {
    gap: 10px;
  }

  .option-btn {
    padding: 12px 14px;
    font-size: 0.98rem;
    border-radius: 10px;
    min-height: 48px;
    gap: 12px;
    align-items: center;
  }

  .option-btn:active {
    transform: scale(0.99);
  }

  .opt-key {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .opt-text {
    word-break: break-word;
    line-height: 1.4;
  }

  /* Explanation Box */
  .explanation-box {
    padding: 14px;
    font-size: 0.92rem;
    border-radius: 8px;
    margin-top: 14px;
    word-break: break-word;
  }

  /* Sidebar & Question Navigator */
  .quiz-sidebar {
    position: static;
    top: auto;
    gap: 16px;
  }

  .sidebar-card {
    padding: 16px;
    border-radius: 12px;
  }

  .timer-box {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  #quiz-timer {
    font-size: 1.35rem !important;
  }

  .btn-submit {
    min-height: 48px;
    font-size: 0.95rem;
    border-radius: 10px;
    font-weight: 700;
  }

  .nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)) !important;
    gap: 6px;
  }

  .nav-q-btn {
    height: 42px !important;
    min-width: 42px;
    font-size: 0.9rem !important;
    border-radius: 8px;
    font-weight: 700;
  }

  /* Result Card Mobile */
  .result-card {
    padding: 24px 16px;
    border-radius: 14px;
    margin-bottom: 24px;
  }

  .result-card h2 {
    font-size: 1.35rem;
  }

  .score-display {
    font-size: 2.2rem;
  }

  /* Pagination Mobile */
  .pagination {
    gap: 6px;
    justify-content: center;
  }

  .page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 0.88rem;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.35rem;
  }

  .grade-dropdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand span {
    font-size: 1.05rem;
  }
}

