/* ═══════════════════════════════════════════════════════════════
   QUIZ.CSS
   Page-specific styles for the quiz hub page.
   Load AFTER styles.css (global tokens, header/nav, footer).
═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   LOCAL TOKEN ADDITIONS / OVERRIDES
   This page's original design used a few colors and radius/shadow
   values that differ from the global scale in styles.css. New
   colors (red/purple) are added; shared names are overridden here
   so they only affect this page.
───────────────────────────────────────────────────────────── */
:root {
  /* new tokens not present in styles.css */
  --red:          #EF4444;
  --red-light:    #FEF2F2;
  --purple:       #7C3AED;
  --purple-light: #F5F3FF;

  /* local overrides of shared token names, scoped to this page */
  --green-light: #ECFDF5;
  --amber-light: #FFFBEB;
  --radius:      12px;
  --radius-lg:   16px;
  --shadow-lg:   0 8px 40px rgba(15,23,42,.14);
}

body {
  color: var(--ink-2);
  background: var(--white);
}

/* ── Page layout ── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* NOTE: styles.css sets #edukated-header to `position: fixed`.
   This page's original design used `position: sticky`. If you
   want sticky behavior here, add this override; otherwise the
   global fixed header will apply. */
#edukated-header { position: sticky; }

/* ─────────────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────────────── */
.quiz-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #1E1B4B 100%);
  padding: 72px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.quiz-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563EB' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.quiz-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(37,99,235,.35);
  color: #93C5FD;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
}
.quiz-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.quiz-hero h1 span {
  background: linear-gradient(90deg, #60A5FA, #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quiz-hero-desc {
  font-size: 1.05rem;
  color: #94A3B8;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.quiz-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons (page-local scale) ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.btn--outline-white {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,.3);
}
.btn--outline-white:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.btn--green {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn--green:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.btn--outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue-mid);
}
.btn--outline:hover { background: var(--blue-light); border-color: var(--blue); }
.btn--sm { padding: 8px 16px; font-size: 0.82rem; }
.btn--full { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }

.quiz-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 500;
  margin-top: 3px;
}
.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.1);
}

/* ─────────────────────────────────────────────────────────────
   SECTION WRAPPER + TITLES
───────────────────────────────────────────────────────────── */
.section {
  padding: 56px 20px;
}
.section--alt { background: var(--surface); }
.section--dark { background: var(--ink); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.section-title-dark { color: white; }
.section-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
}
.section-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}
.section-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────
   QUIZ FILTER TABS (level + subject)
───────────────────────────────────────────────────────────── */
.quiz-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.quiz-tabs-wrap + .quiz-tabs-wrap { margin-top: 10px; }

.quiz-tabs-sticky {
  display: flex;
  flex-shrink: 0;
  padding-right: 8px;
  border-right: 2px solid var(--border);
  margin-right: 10px;
}

.quiz-tabs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.quiz-tabs-scroll::-webkit-scrollbar { display: none; }

.quiz-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 99px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.quiz-tab:hover {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue-mid);
}
.quiz-tab.active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
#levelTabs .quiz-tab.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
#subjectTabs .quiz-tab.active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue);
}
.quiz-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.quiz-tabs .quiz-tab { border-radius: 8px; }

/* ─────────────────────────────────────────────────────────────
   CATEGORY CARDS GRID
───────────────────────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.category-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.category-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.category-card.active {
  border-color: var(--blue);
  background: var(--blue-light);
}
.category-emoji {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--surface);
}
.category-card.active .category-emoji { background: rgba(37,99,235,.12); }
.category-name {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.3;
}
.category-count {
  font-size: 0.72rem;
  color: var(--muted-2);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   FEATURED ROW — Daily + Weekly side-by-side
───────────────────────────────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.featured-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.featured-card--daily { background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 100%); color: white; }
.featured-card--weekly { background: linear-gradient(135deg, #14532D 0%, #059669 100%); color: white; }
.featured-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.featured-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: 30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  width: fit-content;
  position: relative;
  z-index: 1;
}
.featured-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}
.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.featured-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
}
.featured-card .btn {
  margin-top: auto;
  background: rgba(255,255,255,.2);
  color: white;
  border-color: rgba(255,255,255,.3);
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}
.featured-card .btn:hover {
  background: rgba(255,255,255,.32);
  border-color: rgba(255,255,255,.6);
  transform: none;
  box-shadow: none;
}
.featured-participants {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}
.participant-avatars { display: flex; }
.participant-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: 2px solid rgba(255,255,255,.5);
  margin-left: -6px;
  font-size: 0.55rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.participant-avatar:first-child { margin-left: 0; }
.timer-countdown {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   QUIZ CARDS
───────────────────────────────────────────────────────────── */
.quizzes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.quiz-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all .18s;
  position: relative;
}
.quiz-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.quiz-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quiz-subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge--math    { background: #EFF6FF; color: #1D4ED8; }
.badge--english { background: #F0FDF4; color: #15803D; }
.badge--science { background: #FFF7ED; color: #C2410C; }
.badge--social  { background: #F5F3FF; color: #6D28D9; }
.badge--general { background: #F8FAFC; color: #475569; }
.badge--tech    { background: #ECFDF5; color: #065F46; }
.badge--level-all       { background: #ECFDF5; color: #065F46; }
.badge--level-junior    { background: #FFFBEB; color: #92400E; }
.badge--level-senior    { background: #FFF7ED; color: #C2410C; }
.badge--level-undergrad { background: #FEF2F2; color: #991B1B; }

.quiz-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.35;
}
.quiz-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}
.quiz-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.quiz-card-footer .btn { flex: 1; }

/* ─────────────────────────────────────────────────────────────
   LEADERBOARD TABLE
───────────────────────────────────────────────────────────── */
.leaderboard-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
}
.leaderboard-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}
.lb-tab {
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  font-family: var(--font-sans);
}
.lb-tab:hover { color: var(--blue); }
.lb-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.leaderboard-table td {
  padding: 13px 16px;
  font-size: 0.86rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr:hover { background: var(--surface); }
.leaderboard-table tbody tr.is-me { background: var(--blue-light); }

.lb-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  width: 40px;
  text-align: center;
}
.lb-rank--1 { color: #D97706; }
.lb-rank--2 { color: #6B7280; }
.lb-rank--3 { color: #92400E; }

.lb-user { display: flex; align-items: center; gap: 10px; }
.lb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.lb-name { font-weight: 600; font-size: 0.88rem; }
.lb-location { font-size: 0.72rem; color: var(--muted-2); }
.lb-score { font-family: var(--font-display); font-weight: 800; color: var(--blue); }
.lb-percentage { font-size: 0.82rem; color: var(--green-dark); font-weight: 700; }
.medal { font-size: 1rem; }

/* ─────────────────────────────────────────────────────────────
   COMPETITIONS SECTION
───────────────────────────────────────────────────────────── */
.competitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.competition-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .18s;
}
.competition-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.competition-card-top { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.competition-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.comp-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.comp-status--active { background: #ECFDF5; color: #065F46; }
.comp-status--upcoming { background: #FFFBEB; color: #92400E; }
.comp-status--ended { background: var(--surface); color: var(--muted); }
.comp-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.comp-status--active .comp-status-dot { background: var(--green); }
.comp-status--upcoming .comp-status-dot { background: var(--amber); }
.comp-status--ended .comp-status-dot { background: var(--muted-2); }

.competition-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.3;
}
.competition-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.competition-card-bottom {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.comp-participants { font-size: 0.76rem; color: var(--muted); font-weight: 500; }
.comp-invite {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-sans);
}
.comp-invite:hover { background: var(--blue-light); color: var(--blue-dark); }

/* ─────────────────────────────────────────────────────────────
   CREATE-COMPETITION MODAL — question source tabs & panels
───────────────────────────────────────────────────────────── */
.cc-source-tabs {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}
.cc-source-tab {
  flex: 1;
  padding: 10px 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-right: 1.5px solid var(--border);
  transition: background .15s, color .15s;
  line-height: 1.3;
}
.cc-source-tab:last-child { border-right: none; }
.cc-source-tab:hover { background: white; color: var(--ink-2); }
.cc-source-tab.active { background: white; color: var(--blue); }
.cc-source-tab-icon { font-size: 1.15rem; }

.cc-panel { display: none; }
.cc-panel.show { display: block; }

.cc-q-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}
.cc-q-list::-webkit-scrollbar { width: 4px; }
.cc-q-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.cc-q-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 10px;
  background: var(--surface);
  position: relative;
  transition: border-color .15s;
}
.cc-q-item:focus-within { border-color: var(--blue-mid); background: white; }
.cc-q-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cc-q-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 6px;
}
.cc-q-remove {
  background: none;
  border: none;
  color: var(--muted-2);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 5px;
  transition: color .12s, background .12s;
}
.cc-q-remove:hover { color: var(--red); background: var(--red-light); }

.cc-q-text {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--ink);
  background: white;
  outline: none;
  resize: vertical;
  min-height: 54px;
  transition: border-color .15s;
  margin-bottom: 8px;
}
.cc-q-text:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.cc-q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.cc-opt-wrap { display: flex; align-items: center; gap: 5px; }
.cc-opt-letter {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cc-opt-input {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .15s;
}
.cc-opt-input:focus { border-color: var(--blue); }

.cc-correct-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cc-correct-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.cc-correct-select {
  height: 28px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink);
  background: white;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cc-correct-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.1); }

.cc-add-q-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  border: 1.5px dashed var(--blue-mid);
  border-radius: 9px;
  background: var(--blue-light);
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
}
.cc-add-q-btn:hover { background: #DBEAFE; border-color: var(--blue); }

/* ── CSV upload panel ── */
.cc-csv-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface);
  position: relative;
}
.cc-csv-drop:hover, .cc-csv-drop.drag-over { border-color: var(--blue); background: var(--blue-light); }
.cc-csv-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.cc-csv-icon { font-size: 2rem; margin-bottom: 8px; }
.cc-csv-hint { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.cc-csv-hint strong { color: var(--ink-2); }
.cc-csv-template {
  margin-top: 14px;
  padding: 11px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}
.cc-csv-template strong { color: var(--ink-2); font-family: var(--font-display); font-size: 0.76rem; }
.cc-csv-template code {
  display: block;
  margin-top: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.71rem;
  color: var(--blue);
  background: var(--blue-light);
  padding: 6px 8px;
  border-radius: 6px;
  white-space: pre;
  overflow-x: auto;
}
.cc-csv-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
}
.cc-csv-status.ok  { display: block; background: var(--green-light); color: #065F46; }
.cc-csv-status.err { display: block; background: var(--red-light); color: #991B1B; }

/* ── Existing quiz picker panel ── */
.cc-quiz-search { position: relative; margin-bottom: 12px; }
.cc-quiz-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.cc-quiz-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--ink);
  outline: none;
  background: white;
  transition: border-color .15s;
}
.cc-quiz-search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.cc-quiz-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}
.cc-quiz-pick-list::-webkit-scrollbar { width: 4px; }
.cc-quiz-pick-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.cc-quiz-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: white;
}
.cc-quiz-pick-item:hover { border-color: var(--blue-mid); background: var(--blue-light); }
.cc-quiz-pick-item.selected { border-color: var(--blue); background: var(--blue-light); }
.cc-quiz-pick-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s;
}
.cc-quiz-pick-item.selected .cc-quiz-pick-radio { border-color: var(--blue); background: var(--blue); }
.cc-quiz-pick-radio::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: white;
  display: none;
}
.cc-quiz-pick-item.selected .cc-quiz-pick-radio::after { display: block; }
.cc-quiz-pick-body { flex: 1; min-width: 0; }
.cc-quiz-pick-title {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-quiz-pick-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cc-quiz-pick-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--blue-light);
  color: var(--blue);
  flex-shrink: 0;
}

.cc-q-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--green-light);
  color: #065F46;
  margin-bottom: 12px;
}
.cc-q-summary.warn { background: var(--amber-light); color: #92400E; }
.cc-q-summary.empty { background: var(--surface); color: var(--muted); }

.cc-steps { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.cc-step { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted-2); }
.cc-step.active { color: var(--blue); }
.cc-step.done   { color: var(--green-dark); }
.cc-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.cc-step.active .cc-step-num { background: var(--blue); color: white; }
.cc-step.done   .cc-step-num { background: var(--green); color: white; }
.cc-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; }
.cc-step.done + .cc-step-line { background: var(--green); }

/* ─────────────────────────────────────────────────────────────
   JOIN COMPETITION SECTION
───────────────────────────────────────────────────────────── */
.join-comp-box {
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--blue-light) 100%);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.join-comp-text h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 5px;
}
.join-comp-text p { font-size: 0.86rem; color: var(--muted); }
.join-comp-input-wrap { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.join-code-input {
  height: 46px;
  width: 200px;
  padding: 0 16px;
  border: 1.5px solid var(--blue-mid);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.join-code-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.85rem;
  text-transform: none;
}
.join-code-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ─────────────────────────────────────────────────────────────
   GUEST WALL
───────────────────────────────────────────────────────────── */
.guest-wall {
  text-align: center;
  padding: 40px 20px;
  background: var(--blue-light);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius-lg);
}
.guest-wall-icon { font-size: 2.4rem; margin-bottom: 14px; }
.guest-wall h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}
.guest-wall p { font-size: 0.86rem; color: var(--muted); margin-bottom: 20px; }
.guest-wall-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted-2); }
.empty-state-icon { font-size: 2.8rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.empty-state p { font-size: 0.84rem; }

/* ─────────────────────────────────────────────────────────────
   LOADING SPINNER
───────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 32px auto;
}
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--muted-2);
  font-size: 0.86rem;
  grid-column: 1 / -1;
}

/* ─────────────────────────────────────────────────────────────
   STUDY RECOMMENDATIONS
───────────────────────────────────────────────────────────── */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.rec-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  transition: all .15s;
}
.rec-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.rec-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.rec-body h4 {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 3px;
}
.rec-body p { font-size: 0.76rem; color: var(--muted); }

/* ─────────────────────────────────────────────────────────────
   ADMIN PANEL PILL
───────────────────────────────────────────────────────────── */
.admin-toolbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink);
  border-radius: 10px;
  margin-bottom: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.admin-toolbar.show { display: flex; }
.admin-toolbar-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ─────────────────────────────────────────────────────────────
   TOAST (this page uses its own #toastHost stack — distinct
   from resources.css's single #toast pill)
───────────────────────────────────────────────────────────── */
#toastHost {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 100%;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  animation: toastIn .22s ease;
}
.toast--success { background: #065F46; }
.toast--error   { background: #991B1B; }
.toast--warning { background: #92400E; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast.toast--out { animation: toastOut .18s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ─────────────────────────────────────────────────────────────
   QUIZ PLAYER (inline quiz-taking overlay)
───────────────────────────────────────────────────────────── */
#quizPlayerOverlay {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 4000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
#quizPlayerOverlay.show { display: flex; }

.qp-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: white;
  border-bottom: 1.5px solid var(--border);
  padding: 14px 20px;
}
.qp-header-row {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.qp-close {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.qp-close:hover { background: var(--surface); color: var(--ink); }
.qp-header-info { flex: 1; min-width: 0; }
.qp-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qp-progress-text { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.qp-timer {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--blue-light);
}
.qp-timer.qp-timer--low { background: var(--red-light); color: var(--red); }

.qp-progress-bar {
  max-width: 720px;
  margin: 10px auto 0;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.qp-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  transition: width .25s ease;
}

.qp-body {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 120px;
}
.qp-question-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.qp-question-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--blue-light);
  color: var(--blue);
  margin-bottom: 14px;
}
.qp-question-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 22px;
}
.qp-options { display: flex; flex-direction: column; gap: 10px; }
.qp-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  background: white;
}
.qp-option:hover { border-color: var(--blue-mid); background: var(--blue-light); }
.qp-option.selected { border-color: var(--blue); background: var(--blue-light); }
.qp-option-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
  background: var(--surface);
}
.qp-option.selected .qp-option-letter { background: var(--blue); border-color: var(--blue); color: white; }
.qp-option-text { font-size: 0.92rem; color: var(--ink-2); font-weight: 500; line-height: 1.4; }

.qp-option.qp-correct { border-color: var(--green); background: var(--green-light); }
.qp-option.qp-correct .qp-option-letter { background: var(--green); border-color: var(--green); color: white; }
.qp-option.qp-incorrect { border-color: var(--red); background: var(--red-light); }
.qp-option.qp-incorrect .qp-option-letter { background: var(--red); border-color: var(--red); color: white; }

.qp-nav-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.qp-dot {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.qp-dot:hover { border-color: var(--blue-mid); }
.qp-dot.answered { background: var(--blue-light); border-color: var(--blue-mid); color: var(--blue); }
.qp-dot.current { border-color: var(--blue); background: var(--blue); color: white; }

.qp-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1.5px solid var(--border);
  padding: 14px 20px;
  z-index: 2;
}
.qp-footer-row {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.qp-footer-row .btn { flex: 1; justify-content: center; }
.qp-footer-row .btn--ghost {
  background: none;
  color: var(--ink-3);
  border-color: var(--border);
  flex: 0 0 auto;
  padding: 12px 18px;
}
.qp-footer-row .btn--ghost:hover { background: var(--surface); }
.qp-footer-row .btn--ghost[disabled] { opacity: .4; }

/* ── Results screen ── */
.qp-results { max-width: 560px; margin: 0 auto; text-align: center; padding: 12px 0; }
.qp-results-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: conic-gradient(var(--blue) calc(var(--pct, 0) * 1%), var(--border) 0);
  position: relative;
}
.qp-results-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: white;
}
.qp-results-ring-inner { position: relative; z-index: 1; }
.qp-results-pct { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1; }
.qp-results-pct-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.qp-results-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.qp-results-sub { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; }
.qp-results-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 28px; flex-wrap: wrap; }
.qp-results-stat-num { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.qp-results-stat-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.qp-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.qp-review-list { text-align: left; display: none; flex-direction: column; gap: 14px; margin-top: 8px; }
.qp-review-list.show { display: flex; }

/* ─────────────────────────────────────────────────────────────
   MODAL (create-competition / generic quiz modal)
───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface); color: var(--ink); }
.modal-body { padding: 20px 24px; flex: 1; overflow-y: auto; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: white;
}

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-error { font-size: 0.76rem; color: var(--red); font-weight: 600; margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input[type="datetime-local"].form-input {
  padding: 0 12px;
  cursor: pointer;
  color-scheme: light;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .quiz-hero { padding: 48px 16px 56px; }
  .featured-grid { grid-template-columns: 1fr; }
  .quizzes-grid { grid-template-columns: 1fr; }
  .competitions-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .join-comp-box { flex-direction: column; align-items: flex-start; }
  .join-code-input { width: 100%; }
  .join-comp-input-wrap { width: 100%; flex-direction: column; }
  .join-comp-input-wrap .btn { width: 100%; justify-content: center; }
  .section { padding: 40px 16px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  body { padding-bottom: 70px; }
  .quiz-hero-stats { flex-wrap: nowrap; gap: 14px; margin-top: 28px; }
  .hero-stat-num { font-size: 1.15rem; }
  .hero-stat-label { font-size: 0.62rem; white-space: nowrap; }
  .hero-stat-divider { height: 28px; }
  .quiz-hero-actions { flex-wrap: nowrap; gap: 8px; }
  .quiz-hero-actions .btn { padding: 11px 16px; font-size: 0.82rem; white-space: nowrap; }
}
@media (max-width: 480px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .quiz-hero h1 { font-size: 1.9rem; }
  .quiz-hero-stats { gap: 8px; }
  .hero-stat-num { font-size: 0.95rem; }
  .hero-stat-label { font-size: 0.56rem; }
  .quiz-hero-actions { gap: 6px; }
  .quiz-hero-actions .btn { padding: 10px 12px; font-size: 0.76rem; }
  .quiz-hero-actions .btn svg { width: 13px; height: 13px; }
}
@media (max-width: 640px) {
  .quiz-tab { padding: 6px 12px; font-size: 0.74rem; }
  .quiz-tabs-sticky { padding-right: 6px; margin-right: 6px; }
}
@media (max-width: 640px) {
  .leaderboard-scroll { overflow-x: hidden; }
  .leaderboard-table { min-width: 0; }
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
    font-size: 0.72rem;
  }
  .lb-avatar { width: 30px; height: 30px; font-size: 0.62rem; }
  .lb-user { gap: 8px; }
  .lb-name { font-size: 0.8rem; }
  .lb-location { font-size: 0.62rem; }
  .lb-score, .lb-percentage { font-size: 0.78rem; }
  .lb-rank { width: 28px; font-size: 0.82rem; }
}

@media (max-width: 380px) {
  .leaderboard-table th:nth-child(5),
  .leaderboard-table td:nth-child(5) { display: none; } /* hide Time only on very narrow phones */
}
