/* ════════════════════════════════════════════════════
   QuizVortex — Design System v3
   Fonts: Syne (headings) + Inter (body) — improved readability
   ════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --primary: #5b5ef4;
  --primary-dark: #4649d8;
  --primary-light: #818cf8;
  --accent: #f97316;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;

  --bg: #f8f9fc;
  --bg-alt: #f0f1f8;
  --bg-card: #ffffff;
  --bg-hover: #f5f6ff;

  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.14);

  --nav-h: 64px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', 'DM Sans', sans-serif;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s ease;
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0c0c18;
  --bg-alt: #11111e;
  --bg-card: #16162a;
  --bg-hover: #1c1c32;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #1e1e38;
  --border-strong: #2a2a48;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(250,250,250,0.88);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), background var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }
[data-theme="dark"] .navbar { background: rgba(13,13,26,0.88); }

.nav-container {
  display: flex; align-items: center; gap: 2rem; height: 100%;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
}
.brand-icon { font-size: 1.5rem; }
.brand-text { color: var(--text); }
.brand-text strong { color: var(--primary); }

.nav-links {
  display: flex; list-style: none; gap: 0.25rem; margin-left: auto;
}
.nav-link {
  padding: 0.45rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.925rem; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary); background: rgba(91,94,244,0.08);
}
.nav-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem; }

.btn-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border: 1px solid var(--border);
  font-size: 1rem; transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-card); box-shadow: var(--shadow-sm); }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"]  .theme-icon-light { display: none; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; padding: 8px; border-radius: var(--radius-sm);
  background: var(--bg-alt); border: 1px solid var(--border);
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: all var(--transition);
}

.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 999;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 1rem; display: none; flex-direction: column; gap: 0.5rem;
  box-shadow: var(--shadow);
}
.mobile-menu.open { display: flex; }
.mobile-link {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-weight: 500; transition: background var(--transition-fast);
}
.mobile-link:hover { background: var(--bg-alt); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.925rem; font-family: var(--font-body);
  transition: all var(--transition); white-space: nowrap;
  border: 2px solid transparent; cursor: pointer;
}
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(91,94,244,0.35);
}
.btn-primary:hover {
  background: var(--primary-dark); border-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(91,94,244,0.45); transform: translateY(-1px);
}
.btn-accent {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.btn-accent:hover { background: #ea6c0a; transform: translateY(-1px); }
.btn-outline {
  background: transparent; border-color: var(--primary); color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: var(--bg-alt); color: var(--text-muted); border-color: var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

/* ══════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════ */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center;
  padding-top: var(--nav-h); background: var(--bg);
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
}
[data-theme="dark"] .hero-orb { opacity: 0.12; }
.hero-orb-1 {
  width: 600px; height: 600px; background: var(--primary);
  top: -200px; right: -100px; animation: floatOrb 10s ease-in-out infinite;
}
.hero-orb-2 {
  width: 400px; height: 400px; background: var(--accent);
  bottom: -100px; left: -100px; animation: floatOrb 14s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: 300px; height: 300px; background: #06b6d4;
  top: 40%; left: 40%; animation: floatOrb 8s ease-in-out infinite 2s;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px; opacity: 0.4;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-40px) scale(1.05); }
}

.hero-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
  align-items: center; padding-top: 3rem; padding-bottom: 3rem;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 1rem; border-radius: 100px;
  background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.3);
  color: var(--accent); font-size: 0.875rem; font-weight: 500;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-heading {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1; margin-bottom: 1.25rem; font-weight: 800;
}
.heading-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: 1.125rem; color: var(--text-muted);
  max-width: 480px; margin-bottom: 2rem; line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.hero-stats { display: flex; align-items: center; gap: 1.5rem; }
.h-stat strong { display: block; font-size: 1.5rem; font-family: var(--font-display); font-weight: 800; }
.h-stat span { font-size: 0.85rem; color: var(--text-muted); }
.h-stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Hero Right — Floating Cards */
.hero-right { position: relative; height: 480px; }
.floating-card {
  position: absolute; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.fc-main {
  top: 20px; left: 0; right: 0; padding: 1.5rem;
  animation: float 6s ease-in-out infinite;
}
.fc-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.fc-icon { font-size: 2rem; }
.fc-title { font-weight: 700; font-family: var(--font-display); font-size: 1rem; }
.fc-meta { font-size: 0.8rem; color: var(--text-muted); }
.fc-question { font-weight: 600; margin-bottom: 1rem; font-size: 0.95rem; }
.fc-options { display: flex; flex-direction: column; gap: 0.5rem; }
.fc-opt {
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--bg-alt); font-size: 0.875rem;
  border: 1.5px solid transparent;
}
.fc-opt-correct {
  background: rgba(5,150,105,0.1); border-color: var(--success);
  color: var(--success); font-weight: 600;
}
.fc-badge {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem; border-radius: var(--radius);
}
.fc-badge span { font-size: 1.75rem; }
.fc-badge strong { display: block; font-size: 0.925rem; font-weight: 700; }
.fc-badge > div > span { font-size: 0.75rem; color: var(--text-muted); }
.fc-badge-1 { bottom: 80px; left: -20px; animation: float 5s ease-in-out infinite 1s; }
.fc-badge-2 { bottom: 80px; right: -20px; animation: float 7s ease-in-out infinite 0.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ══════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════ */
.section { padding: 5rem 0; }
.section-dark { background: var(--bg-dark-section); }

.section-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 2.5rem; gap: 1rem;
}
.section-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
.section-sub { color: var(--text-muted); margin-top: 0.25rem; }

/* ══════════════════════════════════════════
   QUIZ CARDS
══════════════════════════════════════════ */
.quiz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
}
.quiz-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: all var(--transition); display: flex; flex-direction: column;
  gap: 0.75rem; position: relative; overflow: hidden;
}
.quiz-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--cat-color, var(--primary));
  transform: scaleX(0); transform-origin: left; transition: transform var(--transition);
}
.quiz-card:hover {
  border-color: var(--cat-color, var(--primary));
  box-shadow: var(--shadow-lg); transform: translateY(-4px);
}
.quiz-card:hover::before { transform: scaleX(1); }
.qc-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.825rem; }
.qc-icon { font-size: 1.25rem; }
.qc-category { font-weight: 600; flex: 1; }
.qc-plays { color: var(--text-muted); margin-left: auto; }
.qc-title { font-size: 1.05rem; font-weight: 700; }
.qc-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.qc-footer {
  display: flex; align-items: center; gap: 0.5rem;
  padding-top: 0.5rem; border-top: 1px solid var(--border);
}
.qc-meta { font-size: 0.8rem; color: var(--text-muted); flex: 1; }
.qc-arrow {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border-radius: 50%; font-size: 0.875rem; transition: all var(--transition);
}
.quiz-card:hover .qc-arrow { background: var(--cat-color, var(--primary)); color: #fff; }

/* ══════════════════════════════════════════
   DIFFICULTY BADGE
══════════════════════════════════════════ */
.difficulty-badge {
  padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.75rem; font-weight: 600;
}
.difficulty-easy   { background: rgba(5,150,105,0.12); color: var(--success); }
.difficulty-medium { background: rgba(217,119,6,0.12);  color: var(--warning); }
.difficulty-hard   { background: rgba(220,38,38,0.12);  color: var(--danger); }

/* ══════════════════════════════════════════
   CATEGORIES GRIDS
══════════════════════════════════════════ */
.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem;
}
.cat-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  text-align: center; transition: all var(--transition); position: relative; overflow: hidden;
}
.cat-card:hover {
  border-color: var(--cat-color); box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-4px);
}
.cat-icon { font-size: 2rem; }
.cat-name { font-size: 0.825rem; font-weight: 600; }
.cat-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--cat-color, var(--primary)) 0%, transparent 70%);
  opacity: 0; transition: opacity var(--transition);
}
.cat-card:hover .cat-glow { opacity: 0.08; }

.categories-full-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem;
}
.cat-full-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.cat-full-card:hover {
  border-color: var(--cat-color); box-shadow: var(--shadow-lg); transform: translateY(-3px);
}
.cfc-icon { font-size: 2rem; flex-shrink: 0; }
.cfc-body { flex: 1; }
.cfc-body h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.cfc-body p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.cfc-arrow { color: var(--text-muted); transition: all var(--transition); }
.cat-full-card:hover .cfc-arrow { color: var(--cat-color); transform: translateX(4px); }
.cfc-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at left, var(--cat-color, var(--primary)) 0%, transparent 65%);
  opacity: 0; transition: opacity var(--transition);
}
.cat-full-card:hover .cfc-glow { opacity: 0.06; }

/* ══════════════════════════════════════════
   TRENDING LIST
══════════════════════════════════════════ */
.trending-list { display: flex; flex-direction: column; gap: 0.75rem; }
.trending-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition);
}
.trending-item:hover {
  border-color: var(--primary); box-shadow: var(--shadow); transform: translateX(4px);
}
.trending-num {
  font-size: 1.5rem; font-weight: 800; font-family: var(--font-display);
  color: var(--text-muted); min-width: 40px;
}
.trending-info { flex: 1; }
.trending-info strong { display: block; font-weight: 700; }
.trending-info span { font-size: 0.825rem; color: var(--text-muted); }
.trending-plays { text-align: right; min-width: 120px; }
.trending-plays span { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.trending-bar { height: 4px; border-radius: 2px; background: var(--bg-alt); overflow: hidden; }
.trending-fill { height: 100%; border-radius: 2px; transition: width 1s ease; }
.trending-arrow { color: var(--text-muted); transition: all var(--transition); }
.trending-item:hover .trending-arrow { color: var(--primary); transform: translateX(4px); }

/* ══════════════════════════════════════════
   DAILY CHALLENGE
══════════════════════════════════════════ */
.daily-challenge {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: var(--radius-xl); padding: 3rem;
  display: flex; align-items: center; gap: 4rem;
  color: #fff; position: relative; overflow: hidden;
}
.daily-challenge::before {
  content: ''; position: absolute;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.06); top: -100px; right: 200px;
}
.daily-left { flex: 1; }
.daily-badge {
  display: inline-block; padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.2); border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 1rem;
}
.daily-title { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.75rem; }
.daily-desc { opacity: 0.85; margin-bottom: 1.5rem; }
.daily-meta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 1.5rem; font-size: 0.875rem; opacity: 0.9;
}
.daily-right { text-align: center; min-width: 200px; }
.daily-countdown {
  background: rgba(0,0,0,0.2); border-radius: var(--radius); padding: 1.5rem;
}
.countdown-label { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.75rem; }
.countdown-time { display: flex; align-items: center; gap: 0.5rem; }
.countdown-unit strong { display: block; font-size: 2rem; font-family: var(--font-display); font-weight: 800; }
.countdown-unit span { font-size: 0.7rem; opacity: 0.7; }
.countdown-colon { font-size: 1.5rem; font-weight: 700; opacity: 0.7; }

/* ══════════════════════════════════════════
   LEADERBOARD PREVIEW (homepage)
══════════════════════════════════════════ */
.lb-preview { display: flex; flex-direction: column; gap: 0.75rem; }
.lb-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition);
}
.lb-row:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.lb-top { background: linear-gradient(135deg,rgba(91,94,244,0.06),rgba(249,115,22,0.04)); }
.lb-rank { font-size: 1.3rem; min-width: 36px; text-align: center; }
.lb-player { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 150px; }
.lb-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--font-display); font-size: 1rem;
}
.lb-player strong { display: block; font-weight: 700; }
.lb-player span { font-size: 0.8rem; color: var(--text-muted); }
.lb-rank-badge { padding: 0.25rem 0.65rem; border-radius: 100px; font-size: 0.8rem; font-weight: 700; }
.badge-bronze  { background: rgba(180,90,38,0.12);  color: #b45c26; }
.badge-silver  { background: rgba(100,116,139,0.12); color: #475569; }
.badge-gold    { background: rgba(217,119,6,0.12);   color: #92400e; }
.badge-diamond { background: rgba(91,94,244,0.12);   color: var(--primary); }
.lb-stats {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 0.825rem; min-width: 80px; text-align: right;
}
.lb-xp-bar {
  width: 100%; height: 4px; background: var(--bg-alt);
  border-radius: 2px; overflow: hidden; margin-top: 0.5rem;
}
.lb-xp-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 2px;
}

/* ══════════════════════════════════════════
   CTA SECTION
══════════════════════════════════════════ */
.cta-section { background: var(--bg); }
.cta-box {
  text-align: center; padding: 4rem 2rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card); border: 1px solid var(--border);
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.cta-orb { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.cta-orb-1 { width: 300px; height: 300px; background: var(--primary); opacity: 0.08; top: -100px; left: -50px; }
.cta-orb-2 { width: 250px; height: 250px; background: var(--accent); opacity: 0.08; bottom: -80px; right: -30px; }
.cta-box h2 { font-size: clamp(1.5rem,3vw,2.5rem); margin-bottom: 0.75rem; position: relative; }
.cta-box p  { color: var(--text-muted); max-width: 500px; margin: 0 auto 2rem; position: relative; }
.cta-badges {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.5rem; margin-bottom: 2rem;
}
.badge-item {
  padding: 0.4rem 0.9rem; border-radius: 100px;
  background: var(--bg-alt); border: 1px solid var(--border);
  font-size: 0.875rem; font-weight: 600;
}
.badge-arrow { color: var(--text-muted); }
.cta-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative;
}

/* ══════════════════════════════════════════
   PAGE HERO
══════════════════════════════════════════ */
.page-hero {
  padding: calc(var(--nav-h) + 3rem) 0 3rem;
  background: var(--bg-dark-section); border-bottom: 1px solid var(--border);
}
.page-hero-content { text-align: center; }
.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; }
.page-hero-lb {
  background: linear-gradient(135deg, rgba(91,94,244,0.08), rgba(249,115,22,0.05));
}
.cat-hero-icon { font-size: 4rem; margin-bottom: 0.75rem; display: block; }
.cat-hero-meta { margin-top: 0.75rem; color: var(--text-muted); font-size: 0.9rem; }

/* ══════════════════════════════════════════
   LEADERBOARD PAGE
══════════════════════════════════════════ */
.tab-bar {
  display: flex; gap: 0.5rem; background: var(--bg-alt);
  border-radius: var(--radius); padding: 0.4rem;
  margin-bottom: 2rem; width: fit-content;
}
.tab {
  padding: 0.5rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
  transition: all var(--transition-fast);
}
.tab.active, .tab:hover {
  background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm);
}

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1rem; margin-bottom: 3rem; }
.podium-place { text-align: center; flex: 1; max-width: 200px; }
.podium-crown { font-size: 1.5rem; margin-bottom: 0.5rem; }
.podium-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
}
.podium-avatar-1 { width: 68px; height: 68px; font-size: 1.5rem; }
.podium-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; }
.podium-xp { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.podium-flag { font-size: 1.25rem; margin-bottom: 0.5rem; }
.podium-block {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; padding: 0.75rem;
}
.podium-block-1 { background: linear-gradient(135deg,#fcd34d,#f59e0b); height: 90px; }
.podium-block-2 { background: linear-gradient(135deg,#cbd5e1,#94a3b8); height: 70px; }
.podium-block-3 { background: linear-gradient(135deg,#fdba74,#f97316); height: 55px; }

.lb-table-wrap {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 2rem;
}
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  padding: 0.875rem 1rem; background: var(--bg-alt);
  text-align: left; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.lb-table td {
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; background: var(--bg-card);
}
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:hover td { background: var(--bg-alt); }
.lb-top-row td { background: rgba(91,94,244,0.04); }
.lb-rank-cell { font-size: 1.2rem; }
.lb-player-cell { display: flex; align-items: center; gap: 0.75rem; }
.lb-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; flex-shrink: 0;
}
.rank-badge-sm { padding: 0.2rem 0.5rem; border-radius: 100px; font-size: 0.75rem; font-weight: 700; }

.your-rank-cta {
  border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; padding: 2rem;
}
.yrc-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.yrc-inner h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.yrc-inner p { opacity: 0.85; font-size: 0.9rem; }

/* ══════════════════════════════════════════
   QUIZ PAGE / ENGINE
══════════════════════════════════════════ */
.quiz-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(var(--nav-h) + 1rem) 1rem 2rem;
}
.quiz-screen { width: 100%; max-width: 660px; }
.quiz-screen.hidden { display: none; }

/* Start Screen */
.start-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.75rem 2rem;
  box-shadow: var(--shadow-lg); text-align: center;
}
.start-icon {
  width: 60px; height: 60px; border-radius: var(--radius);
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
}
.start-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem; margin-bottom: 0.6rem;
}
.start-title { font-size: clamp(1.2rem,2.5vw,1.6rem); margin-bottom: 0.5rem; }
.start-desc { color: var(--text-muted); max-width: 500px; margin: 0 auto 1rem; font-size: 0.9rem; }
.start-info {
  display: flex; justify-content: center; gap: 1.5rem;
  padding: 0.85rem 1rem; background: var(--bg-alt); border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.info-item { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.info-icon { font-size: 1rem; }
.info-item strong { font-size: 1.1rem; font-family: var(--font-display); font-weight: 800; }
.info-item span { font-size: 0.72rem; color: var(--text-muted); }
.start-form { text-align: left; max-width: 420px; margin: 0 auto; }

/* Form Styles */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.required { color: var(--danger); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.7rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 0.95rem; transition: border-color var(--transition-fast);
  -webkit-appearance: none; appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,94,244,0.12);
}
.form-group textarea { resize: vertical; }

/* Quiz Engine */
.quiz-header {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  position: sticky; top: var(--nav-h); z-index: 10;
}
.quiz-progress-bar { height: 3px; background: var(--bg-alt); }
.quiz-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width var(--transition-slow); width: 0;
}
.quiz-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
}
.quiz-progress-text { font-weight: 700; font-size: 0.82rem; display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.quiz-score-live { font-weight: 700; font-size: 0.82rem; color: var(--primary); }

/* Timer Circle — smaller */
.timer-circle { position: relative; width: 58px; height: 58px; }
.timer-circle svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--bg-alt); stroke-width: 4; }
.timer-arc {
  fill: none; stroke: var(--primary); stroke-width: 4;
  stroke-dasharray: 113; stroke-linecap: round;
  /* strokeDashoffset set entirely by JS */
}
.timer-arc.warning { stroke: var(--warning); }
.timer-arc.danger  { stroke: var(--danger); }
.timer-circle span {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 1rem;
  font-family: var(--font-display);
}
.timer-circle span.warning { color: var(--warning); }
.timer-circle span.danger  { color: var(--danger); }

.question-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: none; padding: 1rem 1.25rem 1.25rem;
}
.question-difficulty {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem;
}
.question-text {
  font-size: clamp(0.95rem, 2vw, 1.1rem); font-weight: 700; line-height: 1.45;
  margin-bottom: 1rem;
}
.options-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.option-btn {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-size: 0.9rem;
  transition: all var(--transition-fast); text-align: left; color: var(--text);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--primary); background: rgba(91,94,244,0.05);
}
.option-btn.selected { border-color: var(--primary); background: rgba(91,94,244,0.08); }
.option-btn.correct  { border-color: var(--success); background: rgba(5,150,105,0.1); color: var(--success); }
.option-btn.wrong    { border-color: var(--danger);  background: rgba(220,38,38,0.1);  color: var(--danger); }
.option-btn:disabled { cursor: default; }
.option-text { flex: 1; line-height: 1.35; }
.option-label {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-alt); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 0.75rem;
  flex-shrink: 0; transition: all var(--transition-fast);
}
.option-btn.correct  .option-label { background: var(--success); color: #fff; }
.option-btn.wrong    .option-label { background: var(--danger);  color: #fff; }
.option-btn.selected .option-label { background: var(--primary); color: #fff; }

/* Legacy feedback-panel (kept for compatibility) */
.feedback-panel.hidden { display: none; }
.feedback-icon { font-size: 1.5rem; }
.feedback-text { font-size: 0.95rem; font-weight: 700; }
.feedback-explanation { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

/* Result Screen */
.result-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-lg); text-align: center;
}
.result-trophy { font-size: 2.5rem; margin-bottom: 0.25rem; animation: bounceIn 0.6s ease; }
@keyframes bounceIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.result-title { font-size: 1.3rem; margin-bottom: 0.25rem; }
.result-player strong { display: block; font-size: 0.95rem; }
.result-player span { font-size: 0.8rem; color: var(--text-muted); }

/* Score Circle */
.result-score-circle {
  position: relative; width: 110px; height: 110px; margin: 0.75rem auto;
}
.rsc-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.rsc-score { font-size: 1.4rem; font-weight: 800; font-family: var(--font-display); }
.rsc-label { font-size: 0.7rem; color: var(--text-muted); }
.rsc-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.rsc-bg  { fill: none; stroke: var(--bg-alt); stroke-width: 8; }
.rsc-fill {
  fill: none; stroke: url(#scoreGrad); stroke-width: 8;
  stroke-dasharray: 327; stroke-dashoffset: 327; stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1) 0.3s;
}

.result-stats {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 0.5rem;
  padding: 0.85rem 0.75rem; background: var(--bg-alt); border-radius: var(--radius);
  margin: 0.75rem 0;
}
.rs-item { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rs-icon { font-size: 1rem; }
.rs-item strong { font-size: 1rem; font-family: var(--font-display); font-weight: 800; }
.rs-item span { font-size: 0.75rem; color: var(--text-muted); }

.result-grade {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 1rem 1.5rem; background: var(--bg-alt); border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.grade-label { font-size: 0.875rem; color: var(--text-muted); }
.grade-value {
  font-size: 2.5rem; font-weight: 800; font-family: var(--font-display);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.grade-title { font-weight: 600; font-size: 1rem; }

.result-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }

.suggested-quizzes { text-align: left; }
.suggested-quizzes h3 { font-size: 1rem; margin-bottom: 1rem; text-align: center; }
.suggested-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 0.75rem; }
.suggested-card {
  padding: 1rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all var(--transition); display: block;
}
.suggested-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.suggested-card .sc-cat { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.suggested-card .sc-title { font-size: 0.875rem; font-weight: 700; }
.suggested-card .sc-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  background: var(--bg-dark-section); border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem;
}
.footer-brand .nav-brand { margin-bottom: 1rem; }
.footer-tagline { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.footer-stats { display: flex; gap: 1.5rem; }
.f-stat strong { display: block; font-size: 1.1rem; font-weight: 800; font-family: var(--font-display); }
.f-stat span { font-size: 0.75rem; color: var(--text-muted); }
.footer-links h4 {
  font-size: 0.875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem;
}
.footer-links a {
  display: block; font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 0.5rem; transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.5rem;
}

/* ══════════════════════════════════════════
   EMPTY STATE & ALERTS
══════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 4rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-state span { font-size: 4rem; }
.empty-state h3 { font-size: 1.25rem; }
.empty-state p { color: var(--text-muted); }

.alert {
  padding: 0.875rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; margin-bottom: 1.5rem;
}
.alert-success { background: rgba(5,150,105,0.1); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.alert-danger  { background: rgba(220,38,38,0.1);  color: var(--danger);  border: 1px solid rgba(220,38,38,0.2); }
.alert-warning { background: rgba(217,119,6,0.1);  color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-right { display: none; }
  .daily-challenge { flex-direction: column; gap: 2rem; }
  .daily-right { width: 100%; }
  .countdown-time { justify-content: center; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .btn-ghost.btn-sm:not(.nav-actions .btn-ghost) { display: none; }
  .section { padding: 3rem 0; }
  .quiz-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); }
  .section-header { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .result-stats { grid-template-columns: repeat(2,1fr); }
  .start-info { gap: 1rem; }
  .hero-stats { flex-wrap: wrap; gap: 1rem; }
  .hero-heading { font-size: 2.2rem; }
  .podium { gap: 0.5rem; }
  .podium-place { max-width: 120px; }
  .daily-challenge { padding: 2rem 1.5rem; }
  .lb-table th:nth-child(n+6),
  .lb-table td:nth-child(n+6) { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .cta-badges { flex-direction: column; align-items: center; }
  .badge-arrow { transform: rotate(90deg); }
  .quiz-top { gap: 0.5rem; }
  .quiz-progress-text { font-size: 0.8rem; }
  .quiz-score-live { font-size: 0.8rem; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { justify-content: center; }
  .categories-full-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   LIVE SEARCH NAV
═══════════════════════════════════════════════════════════════ */
.nav-search-wrap { position: relative; }
.nav-search-box {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 200; overflow: hidden;
}
#navSearchInput {
  width: 100%; padding: .75rem 1rem; border: none; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text-primary); font-size: .95rem; outline: none;
}
.nav-search-results { max-height: 320px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem;
  text-decoration: none; color: var(--text-primary); transition: background .15s;
}
.search-result-item:hover { background: var(--bg-hover); }
.sri-icon { font-size: 1.4rem; flex-shrink: 0; }
.sri-title { font-size: .9rem; font-weight: 600; }
.sri-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.search-more-link {
  display: block; padding: .65rem 1rem; text-align: center; font-size: .85rem;
  color: var(--accent); border-top: 1px solid var(--border); font-weight: 600;
  text-decoration: none;
}
.search-nores { padding: .75rem 1rem; font-size: .88rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   SEARCH PAGE
═══════════════════════════════════════════════════════════════ */
.search-box-wrap { max-width: 800px; margin: 0 auto 2rem; }
.search-form-main {}
.search-input-group {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: 14px; padding: .4rem .75rem; transition: border-color .2s;
}
.search-input-group:focus-within { border-color: var(--accent); }
.search-icon { font-size: 1.2rem; }
.search-input-main {
  flex: 1; border: none; background: transparent; color: var(--text-primary);
  font-size: 1.05rem; outline: none; padding: .4rem;
}
.search-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.filter-select {
  padding: .45rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-primary); font-size: .88rem; cursor: pointer;
}
.filter-select:focus { outline: 2px solid var(--accent); }
.search-results-header {
  display: flex; gap: .5rem; align-items: center; margin-bottom: 1.5rem;
  font-size: .9rem; color: var(--text-muted);
}
.results-count { font-weight: 700; color: var(--text-primary); }
.search-suggestions { max-width: 700px; }
.search-suggestions h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.suggestion-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggestion-tag {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem;
  background: color-mix(in srgb, var(--tag-color,#5b5ef4) 12%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--tag-color,#5b5ef4) 30%, transparent);
  border-radius: 999px; color: var(--tag-color,#5b5ef4); font-weight: 600;
  font-size: .88rem; text-decoration: none; transition: all .2s;
}
.suggestion-tag:hover { background: color-mix(in srgb, var(--tag-color,#5b5ef4) 25%, var(--bg-card)); }

/* ═══════════════════════════════════════════════════════════════
   CATEGORY PAGE — LAYOUT WITH SIDEBAR + FILTERS
═══════════════════════════════════════════════════════════════ */
.category-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start;
}
@media(max-width:900px) { .category-layout { grid-template-columns: 1fr; } }
.category-main {}
.category-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-widget {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.25rem; overflow: hidden;
}
.sidebar-widget h4 { margin: 0 0 .75rem; font-size: .95rem; }
.sidebar-cat-link {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem;
  text-decoration: none; color: var(--text-primary); border-radius: 8px;
  font-size: .88rem; transition: background .15s; font-weight: 500;
}
.sidebar-cat-link:hover { background: var(--bg-hover); }
.sidebar-cat-link span:first-child { font-size: 1.1rem; }
.filter-bar {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.filter-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); min-width: 70px; }
.filter-btn {
  padding: .3rem .75rem; border-radius: 999px; font-size: .83rem; font-weight: 600;
  border: 1px solid var(--border); text-decoration: none; color: var(--text-secondary);
  background: var(--bg-card); transition: all .15s; cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem;
}
.auth-logo { font-size: 3rem; text-align: center; margin-bottom: .5rem; }
.auth-card h2 { text-align: center; margin: 0 0 .4rem; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; font-size: .88rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE
═══════════════════════════════════════════════════════════════ */
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 2rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; margin: 0 auto .75rem;
}
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
@media(max-width:768px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-stats-panel, .profile-history-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem;
}
.profile-stats-panel h3, .profile-history-panel h3 { margin: 0 0 1.25rem; }
.profile-stat-list { display: flex; flex-direction: column; gap: .1rem; margin-bottom: 1.25rem; }
.ps-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.ps-item:last-child { border-bottom: none; }
.ps-item span { color: var(--text-muted); }
.ps-item strong { font-weight: 700; }
.xp-progress-wrap { margin-top: .5rem; }
.xp-progress-label { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .35rem; color: var(--text-muted); }
.xp-bar { height: 8px; background: var(--bg-hover); border-radius: 99px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg,var(--accent),#f97316); border-radius: 99px; transition: width .8s ease; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: .9rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; text-decoration: none;
}
.history-list { display: flex; flex-direction: column; gap: .5rem; }
.history-item {
  display: flex; align-items: center; gap: .75rem; padding: .7rem;
  border-radius: 10px; text-decoration: none; color: var(--text-primary);
  border: 1px solid var(--border); transition: background .15s;
}
.history-item:hover { background: var(--bg-hover); }
.hi-icon { font-size: 1.5rem; flex-shrink: 0; }
.hi-info { flex: 1; min-width: 0; }
.hi-info strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-info span { font-size: .78rem; color: var(--text-muted); }
.hi-score { text-align: right; flex-shrink: 0; }
.hi-score strong { display: block; font-size: .88rem; font-weight: 700; }
.hi-score span { font-size: .78rem; color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   SHARE CARD
═══════════════════════════════════════════════════════════════ */
.share-card-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.share-modal {
  display: flex; flex-direction: column; gap: 1rem; max-width: 380px; width: 100%;
}
.share-card {
  background: linear-gradient(135deg,#0f0f1a 0%,#1a1035 50%,#0f0f1a 100%);
  border: 2px solid rgba(91,94,244,.4); border-radius: 20px; padding: 2rem;
  text-align: center; color: #fff;
}
.sc-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; justify-content: center; }
.sc-logo-icon { font-size: 2rem; }
.sc-brand { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.5); }
.sc-quiz { font-size: 1rem; font-weight: 700; color: #fff; }
.sc-score-big { font-size: 4rem; font-weight: 800; background: linear-gradient(135deg,#5b5ef4,#f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1rem; }
.sc-stats-row { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.25rem; }
.sc-stat { display: flex; flex-direction: column; align-items: center; }
.sc-stat span { font-size: 1.3rem; font-weight: 800; }
.sc-stat small { font-size: .72rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .05em; }
.sc-stat-accent span { color: #f97316; }
.sc-username { font-size: .9rem; color: rgba(255,255,255,.7); margin-bottom: .4rem; }
.sc-cat { font-size: .82rem; margin-bottom: .75rem; }
.sc-url { font-size: .72rem; color: rgba(255,255,255,.3); letter-spacing: .08em; }
.share-modal-actions { display: flex; gap: .5rem; }
.share-modal-actions .btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   SURVIVAL MODE
═══════════════════════════════════════════════════════════════ */
.survival-page .start-card { border: 2px solid rgba(239,68,68,.3); }
.survival-logo { font-size: 4rem; text-align: center; margin-bottom: .5rem; }
.survival-rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1.25rem 0;
  background: var(--bg-hover); border-radius: 12px; padding: 1rem;
}
.rule-item { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.survival-lives { font-size: 1.5rem; letter-spacing: 2px; }
.survival-streak {
  text-align: center; font-size: .9rem; font-weight: 700; color: #f97316;
  padding: .4rem; background: rgba(249,115,22,.1); border-radius: 8px;
  margin-bottom: .75rem;
}

/* ═══════════════════════════════════════════════════════════════
   ADSENSE SIDEBAR (placeholder styling)
═══════════════════════════════════════════════════════════════ */
.ad-placeholder {
  background: var(--bg-hover); border: 1px dashed var(--border);
  border-radius: 12px; min-height: 250px; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: .8rem;
}

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK PANEL — COMPACT, ABOVE QUESTION CARD
═══════════════════════════════════════════════════════════════ */
.feedback-panel {
  border-radius: 10px; padding: 0.75rem 1rem;
  margin-bottom: 0.6rem; border: 2px solid transparent;
  animation: feedbackSlide 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes feedbackSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.feedback-panel.hidden { display: none; }
.feedback-panel.feedback-correct {
  background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.35);
}
.feedback-panel.feedback-wrong {
  background: rgba(220,38,38,.07); border-color: rgba(220,38,38,.3);
}
.feedback-panel.feedback-timeout {
  background: rgba(217,119,6,.07); border-color: rgba(217,119,6,.3);
}
.feedback-top {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem;
}
.feedback-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.feedback-body { flex: 1; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.feedback-text { font-size: 0.88rem; font-weight: 700; }
.feedback-xp-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 99px;
}
.feedback-xp-badge.xp-positive { background: rgba(5,150,105,.2); color: #059669; }
.feedback-xp-badge.xp-zero     { background: rgba(100,116,139,.15); color: var(--text-muted); }
.feedback-explanation {
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.45;
  margin-bottom: 0.65rem; padding-left: 2rem;
}
.feedback-next-btn { width: 100%; padding: 0.65rem 1rem !important; font-size: 0.9rem !important; }

/* Question card tint on answer */
.question-card.card-correct { border-color: rgba(5,150,105,.35) !important; }
.question-card.card-wrong   { border-color: rgba(220,38,38,.35) !important; }

/* ═══════════════════════════════════════════════════════════════
   STREAK BADGE IN HEADER
═══════════════════════════════════════════════════════════════ */
.streak-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(249,115,22,.15); color: #f97316;
  border: 1px solid rgba(249,115,22,.3); border-radius: 99px;
  font-size: .72rem; font-weight: 700; padding: .15rem .5rem;
  margin-left: .5rem; animation: streakPop .3s ease;
}
@keyframes streakPop {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   TIMER PULSE (last 5 sec)
═══════════════════════════════════════════════════════════════ */
.timer-circle.timer-pulse {
  animation: timerPulse .5s ease infinite alternate;
}
@keyframes timerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.12); filter: drop-shadow(0 0 6px rgba(220,38,38,.6)); }
}

/* ═══════════════════════════════════════════════════════════════
   XP COUNTER POP
═══════════════════════════════════════════════════════════════ */
.quiz-score-live.xp-pop {
  animation: xpPop .35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes xpPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); color: #f97316; }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   XP TOAST (bottom-right)
═══════════════════════════════════════════════════════════════ */
.xp-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; align-items: center; gap: .75rem;
  background: linear-gradient(135deg,#1a1a2e,#16213e);
  border: 1px solid rgba(91,94,244,.4); border-radius: 14px;
  padding: .9rem 1.25rem; color: #fff; font-size: .9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  transform: translateX(120%); opacity: 0; transition: all .35s cubic-bezier(0.34,1.56,0.64,1);
}
.xp-toast.xp-toast-in { transform: translateX(0); opacity: 1; }
.xp-toast-icon { font-size: 1.5rem; }
.xp-toast strong { display: block; font-weight: 800; }
.xp-toast span { font-size: .78rem; color: rgba(255,255,255,.6); }

/* ═══════════════════════════════════════════════════════════════
   RANK PROMOTION OVERLAY
═══════════════════════════════════════════════════════════════ */
.rank-promo-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.75); display: flex;
  align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; transition: opacity .3s;
}
.rank-promo-overlay.rank-promo-in { opacity: 1; }
.rank-promo-card {
  position: relative; background: linear-gradient(135deg,#0f0f1a,#1a1035);
  border: 2px solid rgba(91,94,244,.5); border-radius: 24px;
  padding: 2.5rem 2rem; text-align: center; color: #fff;
  max-width: 340px; width: 100%; overflow: hidden;
  animation: rankCardIn .5s cubic-bezier(0.34,1.56,0.64,1) .1s both;
}
@keyframes rankCardIn {
  from { transform: scale(0.6) rotate(-6deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
.rp-confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -10px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110%) rotate(720deg); opacity: 0; }
}
.rp-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; color: rgba(255,255,255,.5); margin-bottom: 1rem; }
.rp-from  { font-size: 1.5rem; color: rgba(255,255,255,.45); margin-bottom: .25rem; }
.rp-arrow { font-size: 1.5rem; color: rgba(255,255,255,.3); margin-bottom: .25rem; }
.rp-to    { font-size: 2.5rem; font-weight: 800; margin-bottom: .5rem; animation: rankGlow 1.5s ease infinite alternate; }
@keyframes rankGlow {
  from { text-shadow: 0 0 20px rgba(249,115,22,.4); }
  to   { text-shadow: 0 0 40px rgba(91,94,244,.7), 0 0 60px rgba(249,115,22,.3); }
}
.rp-msg { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════
   START SCREEN NOTICES
═══════════════════════════════════════════════════════════════ */
.signed-in-notice {
  background: rgba(5,150,105,.12); border: 1px solid rgba(5,150,105,.3);
  color: #059669; border-radius: 10px; padding: .6rem 1rem;
  font-size: .85rem; margin-bottom: 1rem; text-align: center;
}
.guest-notice {
  background: rgba(91,94,244,.08); border: 1px solid rgba(91,94,244,.2);
  color: var(--text-muted); border-radius: 10px; padding: .6rem 1rem;
  font-size: .85rem; margin-bottom: 1rem; text-align: center;
}
.guest-notice a { color: var(--accent); font-weight: 600; }
.result-save-cta {
  background: rgba(91,94,244,.08); border: 1px solid rgba(91,94,244,.2);
  border-radius: 10px; padding: .6rem 1rem; font-size: .85rem;
  text-align: center; margin-bottom: 1rem;
}
.result-save-cta a { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   SUGGESTED QUIZZES — IMPROVED
═══════════════════════════════════════════════════════════════ */
.suggested-grid { display: flex; flex-direction: column; gap: .5rem; }
.suggested-card {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 12px; text-decoration: none; color: var(--text-primary);
  transition: all .2s; font-size: .88rem;
}
.suggested-card:hover { background: var(--bg-hover); border-color: var(--accent); transform: translateX(4px); }
.sug-icon { font-size: 1.4rem; flex-shrink: 0; }
.sug-info { flex: 1; min-width: 0; }
.sug-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-meta  { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.sug-arrow { color: var(--text-muted); flex-shrink: 0; }

/* Result stats — 5 items responsive */
@media(max-width:600px) {
  .result-stats { grid-template-columns: repeat(3,1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   OPTION BUTTONS — improved hit area & animation
═══════════════════════════════════════════════════════════════ */
.option-btn {
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.option-btn:not(:disabled):hover {
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(91,94,244,.2);
}
.option-btn:not(:disabled):active { transform: translateY(0); }
.option-btn.correct { animation: optionCorrect .4s ease; }
.option-btn.wrong   { animation: optionWrong   .4s ease; }
@keyframes optionCorrect {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes optionWrong {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE — FULL REDESIGN
═══════════════════════════════════════════════════════════════ */
.profile-hero {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-card) 100%);
  padding: 3rem 0 2.5rem;
}
.profile-header-content {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.profile-avatar-xl {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #fff; font-size: 2.2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 4px 20px rgba(91,94,244,.4);
}
.profile-hero-info h1 { margin: 0 0 .35rem; font-size: 1.8rem; }
.profile-rank-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(91,94,244,.12); border: 1px solid rgba(91,94,244,.25);
  border-radius: 99px; padding: .3rem .85rem; font-size: .9rem; margin-bottom: .35rem;
}
.profile-email  { font-size: .85rem; color: var(--text-muted); margin-bottom: .2rem; }
.profile-since  { font-size: .82rem; color: var(--text-muted); }

.profile-body { padding-top: 2rem; padding-bottom: 4rem; }

/* XP Progress card */
.xp-progress-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.xp-progress-header {
  display: flex; justify-content: space-between; font-size: .85rem;
  font-weight: 600; margin-bottom: .6rem; flex-wrap: wrap; gap: .25rem;
}
.xp-bar-track {
  height: 10px; background: var(--bg-alt); border-radius: 99px; overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f97316);
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.xp-progress-pct { font-size: .75rem; color: var(--text-muted); margin-top: .4rem; text-align: right; }

/* Stats row */
.profile-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
@media(max-width:700px) { .profile-stats-row { grid-template-columns: repeat(2,1fr); } }
.profile-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.25rem 1rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  transition: transform .2s; cursor: default;
}
.profile-stat-card:hover { transform: translateY(-2px); }
.psc-icon { font-size: 1.5rem; }
.profile-stat-card strong { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); }
.profile-stat-card span:last-child { font-size: .78rem; color: var(--text-muted); }

/* Profile grid */
.profile-grid {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 1.5rem; align-items: start;
}
@media(max-width:800px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-side { display: flex; flex-direction: column; gap: 1rem; }

/* Panel */
.profile-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem; overflow: hidden;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.panel-header h3 { margin: 0; font-size: 1rem; }

/* History */
.history-list { display: flex; flex-direction: column; gap: .45rem; }
.history-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem; border-radius: 10px;
  text-decoration: none; color: var(--text-primary);
  border: 1px solid var(--border); transition: all .15s;
}
.history-item:hover { background: var(--bg-hover); border-color: var(--accent); transform: translateX(3px); }
.hi-icon { font-size: 1.5rem; flex-shrink: 0; }
.hi-info { flex: 1; min-width: 0; }
.hi-info strong { display: block; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-info span { font-size: .76rem; color: var(--text-muted); }
.hi-result { text-align: right; flex-shrink: 0; }
.hi-score-pct { font-size: .95rem; font-weight: 800; font-family: var(--font-display); }
.hi-score-pct.hi-good { color: #059669; }
.hi-score-pct.hi-ok   { color: #d97706; }
.hi-score-pct.hi-bad  { color: #dc2626; }
.hi-xp { font-size: .75rem; color: var(--accent); font-weight: 600; }

/* Rank ladder */
.rank-ladder { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.rank-rung {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-alt); opacity: .5;
}
.rank-rung.rank-achieved { opacity: 1; border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.06); }
.rank-rung.rank-current  { opacity: 1; border-color: var(--accent); background: rgba(91,94,244,.08); }
.rr-emoji { font-size: 1.3rem; flex-shrink: 0; }
.rr-info { flex: 1; }
.rr-info strong { display: block; font-size: .88rem; font-weight: 700; }
.rr-info span   { font-size: .75rem; color: var(--text-muted); }
.rr-check   { color: #059669; font-size: .85rem; }
.rr-current { color: var(--accent); font-size: .75rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   QUIZ LAYOUT — COMPACT OVERRIDES (ensures no-scroll on desktop)
═══════════════════════════════════════════════════════════════ */

/* Tighter form groups inside quiz start */
.start-form .form-group { margin-bottom: 0.85rem; }
.start-form .form-group label { font-size: 0.82rem; margin-bottom: 0.3rem; }
.start-form .form-group input,
.start-form .form-group select {
  padding: 0.55rem 0.85rem; font-size: 0.88rem;
}

/* Signed-in / guest notices compact */
.signed-in-notice, .guest-notice {
  padding: 0.4rem 0.75rem; font-size: 0.78rem; margin-bottom: 0.75rem;
}

/* Result grade compact */
.result-grade {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.6rem; background: var(--bg-alt); border-radius: var(--radius);
  margin-bottom: 0.85rem;
}
.grade-label { font-size: 0.75rem; color: var(--text-muted); }
.grade-value { font-size: 1.5rem; font-weight: 900; font-family: var(--font-display); color: var(--primary); }
.grade-title { font-size: 0.85rem; font-weight: 600; }

/* Result actions compact */
.result-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1rem;
}
.result-actions .btn { flex: 1; min-width: 120px; max-width: 180px; padding: 0.6rem 0.75rem; font-size: 0.85rem; }

/* Result save CTA compact */
.result-save-cta {
  padding: 0.4rem 0.75rem; font-size: 0.78rem; margin-bottom: 0.75rem;
}

/* Suggested quizzes compact */
.suggested-quizzes h3 { font-size: 0.95rem; margin: 0 0 0.6rem; }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .quiz-page { padding: calc(var(--nav-h) + 0.5rem) 0.5rem 1.5rem; }
  .quiz-top { padding: 0.5rem 0.75rem; }
  .question-card { padding: 0.85rem 0.85rem 1rem; }
  .question-text { font-size: 0.92rem; margin-bottom: 0.75rem; }
  .option-btn { padding: 0.55rem 0.75rem; font-size: 0.85rem; gap: 0.6rem; }
  .option-label { width: 22px; height: 22px; font-size: 0.7rem; }
  .options-grid { gap: 0.4rem; }
  .feedback-panel { padding: 0.6rem 0.75rem; }
  .feedback-explanation { padding-left: 0; font-size: 0.78rem; }
  .result-card { padding: 1.1rem 1rem; }
  .result-stats { grid-template-columns: repeat(3,1fr); gap: 0.35rem; padding: 0.6rem 0.5rem; }
  .result-actions .btn { min-width: 100px; font-size: 0.78rem; padding: 0.5rem 0.5rem; }
  .start-card { padding: 1.25rem 1rem; }
  .start-info { gap: 1rem; padding: 0.6rem; }
}

/* ── LARGE DESKTOP — cap max-width to stay contained ── */
@media (min-width: 900px) {
  .quiz-screen { max-width: 620px; }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL TYPOGRAPHY IMPROVEMENTS
═══════════════════════════════════════════════════════════════ */
body {
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  letter-spacing: -0.03em;
  line-height: 1.15;
}
p { line-height: 1.65; color: var(--text-secondary); }
a { transition: color var(--transition-fast); }

/* Better section text */
.section-sub { 
  font-size: 0.95rem; 
  color: var(--text-muted); 
  line-height: 1.6;
  font-weight: 400;
}
.section-title { letter-spacing: -0.04em; }

/* Improve quiz-card text */
.qc-title { 
  font-size: 0.95rem; 
  font-weight: 700; 
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.qc-desc { 
  font-size: 0.82rem; 
  line-height: 1.5; 
  color: var(--text-muted);
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   AVATAR MODAL
═══════════════════════════════════════════════════════════════ */
.avatar-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: modalFadeIn .2s ease;
}
@keyframes modalFadeIn { from { opacity:0; } to { opacity:1; } }

.avatar-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.5rem;
  max-width: 420px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: modalSlideUp .25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalSlideUp {
  from { transform: translateY(24px) scale(0.96); opacity:0; }
  to   { transform: translateY(0) scale(1); opacity:1; }
}
.avatar-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.avatar-modal-header h3 { font-size: 1.1rem; margin: 0; }
.avatar-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-alt); border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.avatar-modal-close:hover { background: var(--danger); color: #fff; }

.avatar-preview-wrap {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-alt); border-radius: 12px;
  padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.avatar-preview-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
  transition: background .25s, transform .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.avatar-preview-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.avatar-preview-name { font-weight: 700; font-size: 0.95rem; }

.avatar-section-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 0.6rem;
}

.avatar-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem; margin-bottom: 1.1rem;
}
.avatar-option {
  aspect-ratio: 1; border-radius: 10px; font-size: 1.4rem;
  border: 2px solid transparent; background: var(--bg-alt);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.avatar-option:hover { background: var(--bg-hover); border-color: var(--primary); transform: scale(1.1); }
.avatar-option.selected { border-color: var(--primary); background: rgba(91,94,244,.12); transform: scale(1.08); }

.color-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem; margin-bottom: 1.1rem;
}
.color-option {
  aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  border: 2.5px solid transparent; transition: all .15s;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary), 0 2px 8px rgba(0,0,0,.3); transform: scale(1.1); }

.avatar-bio-wrap { margin-bottom: 1rem; }
.avatar-bio-input {
  width: 100%; padding: .6rem .85rem; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: .88rem; font-family: var(--font-body); resize: none;
  line-height: 1.5; min-height: 70px; transition: border-color .15s;
}
.avatar-bio-input:focus { outline: none; border-color: var(--primary); }

.avatar-modal-actions { margin-bottom: .5rem; }
.avatar-save-msg { text-align: center; font-size: .85rem; font-weight: 600; min-height: 1.2rem; }
.avatar-save-ok  { color: var(--success); }
.avatar-save-err { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE — NEW DESIGN
═══════════════════════════════════════════════════════════════ */
.profile-page { padding: calc(var(--nav-h) + 1.5rem) 0 4rem; }

.profile-hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.profile-hero-left { display: flex; align-items: center; gap: 1.25rem; flex: 1; min-width: 0; }

.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-big {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: transform .2s;
}
.profile-avatar-big:hover { transform: scale(1.05); }
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border);
  cursor: pointer; font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.avatar-edit-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.1); }

.profile-hero-info { min-width: 0; }
.profile-username { font-size: 1.5rem; margin-bottom: 0.25rem; letter-spacing: -0.04em; }
.profile-bio { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.6rem; line-height: 1.5; }
.profile-bio-empty { color: var(--text-light); }

.profile-rank-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.profile-rank-chip, .profile-xp-chip, .profile-since-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: 99px; border: 1px solid var(--border);
  background: var(--bg-alt);
}
.profile-rank-chip { color: var(--primary); border-color: rgba(91,94,244,.25); background: rgba(91,94,244,.08); }
.profile-xp-chip   { color: var(--accent);  border-color: rgba(249,115,22,.25); background: rgba(249,115,22,.08); }

.profile-hero-actions { display: flex; flex-direction: column; gap: 0.5rem; min-width: 140px; }
.profile-hero-actions .btn { text-align: center; }

/* XP bar card */
.profile-xp-bar-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.25rem;
  margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.pxb-labels { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; flex-wrap: wrap; gap: .25rem; }
.pxb-progress-text { color: var(--text-muted); font-weight: 500; }
.pxb-track { height: 10px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.pxb-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.pxb-pct { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; text-align: right; }

/* Stats grid */
.profile-stats-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 0.75rem; margin-bottom: 1rem;
}
@media(max-width:640px) { .profile-stats-grid { grid-template-columns: repeat(2,1fr); } }
.psg-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  text-align: center; transition: transform .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.psg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.psg-icon { font-size: 1.4rem; }
.psg-value { font-size: 1.4rem; font-weight: 800; font-family: var(--font-display); letter-spacing: -0.04em; }
.psg-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* Main grid */
.profile-main-grid { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; }
@media(max-width:768px) { .profile-main-grid { grid-template-columns: 1fr; } }

.profile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.pc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pc-header h3 { font-size: 0.95rem; margin: 0; }

.profile-empty { text-align: center; padding: 2rem 1rem; }
.profile-empty span { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.profile-empty p { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* History */
.profile-history { display: flex; flex-direction: column; gap: 0.4rem; }
.ph-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: 10px;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--border); transition: all .15s;
}
.ph-item:hover { background: var(--bg-hover); border-color: var(--primary); transform: translateX(3px); }
.phi-icon { font-size: 1.4rem; flex-shrink: 0; }
.phi-info { flex: 1; min-width: 0; }
.phi-title { font-size: 0.83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phi-meta  { font-size: 0.73rem; color: var(--text-muted); margin-top: 1px; }
.phi-result { text-align: right; flex-shrink: 0; }
.phi-grade { font-size: 1rem; font-weight: 800; font-family: var(--font-display); }
.phi-grade.grade-good { color: var(--success); }
.phi-grade.grade-ok   { color: var(--warning); }
.phi-grade.grade-bad  { color: var(--danger); }
.phi-score { font-size: 0.72rem; color: var(--text-muted); }
.phi-xp    { font-size: 0.72rem; color: var(--accent); font-weight: 600; }

/* Rank ladder new */
.rank-ladder-new { display: flex; flex-direction: column; gap: .4rem; }
.rln-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-alt);
  opacity: .5; transition: all .2s;
}
.rln-row.rln-done    { opacity: 1; border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.06); }
.rln-row.rln-current { opacity: 1; border-color: var(--primary); background: rgba(91,94,244,.08); }
.rln-emoji { font-size: 1.25rem; flex-shrink: 0; }
.rln-info { flex: 1; }
.rln-info strong { display: block; font-size: .85rem; font-weight: 700; }
.rln-info span   { font-size: .72rem; color: var(--text-muted); }
.rln-right { flex-shrink: 0; }
.rln-check  { color: var(--success); font-size: .85rem; }
.rln-you    { font-size: .72rem; font-weight: 700; color: var(--primary); background: rgba(91,94,244,.12); padding: .15rem .45rem; border-radius: 99px; }
.rln-locked { font-size: .85rem; opacity: .4; }

/* ═══════════════════════════════════════════════════════════════
   NAVBAR AVATAR (emoji version)
═══════════════════════════════════════════════════════════════ */
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: transform .2s, box-shadow .2s;
  border: 2px solid rgba(255,255,255,.2);
}
.nav-avatar:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

/* ═══════════════════════════════════════════════════════════════
   GLOBAL CARD & BUTTON POLISH
═══════════════════════════════════════════════════════════════ */
/* Smoother quiz cards */
.quiz-card {
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s, border-color .2s;
}
.quiz-card:hover { transform: translateY(-3px); }

/* Better alert boxes */
.alert {
  padding: .75rem 1rem; border-radius: 10px; font-size: .88rem;
  font-weight: 500; border: 1px solid transparent; margin-bottom: 1rem;
}
.alert-danger  { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); color: #dc2626; }
.alert-success { background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.25); color: #059669; }
.alert-info    { background: rgba(91,94,244,.08); border-color: rgba(91,94,244,.25); color: var(--primary); }

/* Difficulty badges */
.difficulty-badge {
  font-size: .72rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 99px; letter-spacing: .03em;
}
.difficulty-easy   { background: rgba(5,150,105,.12); color: #059669; }
.difficulty-medium { background: rgba(217,119,6,.12);  color: #d97706; }
.difficulty-hard   { background: rgba(220,38,38,.12);  color: #dc2626; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE PROFILE FIXES
═══════════════════════════════════════════════════════════════ */
@media(max-width: 600px) {
  .profile-hero-card { flex-direction: column; align-items: flex-start; }
  .profile-hero-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .profile-hero-actions .btn { flex: 1; min-width: 100px; }
  .profile-username { font-size: 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════════
   BLOG PAGES
═══════════════════════════════════════════════════════════════ */
.blog-hero {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-card) 100%);
  padding: calc(var(--nav-h) + 2.5rem) 0 3rem;
  border-bottom: 1px solid var(--border);
}
.blog-hero-content { max-width: 620px; }
.blog-hero-badge {
  display: inline-flex; align-items: center; gap:.4rem;
  background: rgba(91,94,244,.1); border: 1px solid rgba(91,94,244,.25);
  color: var(--primary); border-radius: 99px;
  padding: .3rem .85rem; font-size: .8rem; font-weight: 700;
  margin-bottom: .75rem;
}
.blog-hero h1 { font-size: clamp(1.6rem,4vw,2.5rem); margin-bottom: .6rem; }
.blog-hero p { font-size: 1rem; color: var(--text-muted); max-width: 520px; }

.blog-layout {
  display: grid; grid-template-columns: 1fr 260px;
  gap: 2rem; padding-top: 2.5rem; padding-bottom: 4rem;
  align-items: start;
}
@media(max-width:800px) { .blog-layout { grid-template-columns: 1fr; } }

.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media(max-width:600px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; text-decoration: none;
  color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: var(--shadow-sm);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.bc-icon {
  height: 80px; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.bc-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.bc-category { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.bc-title { font-size: .92rem; font-weight: 700; line-height: 1.3; margin-bottom: .4rem; letter-spacing: -0.02em; }
.bc-excerpt { font-size: .78rem; color: var(--text-muted); line-height: 1.5; flex: 1; margin-bottom: .75rem; }
.bc-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .72rem; color: var(--text-muted); }
.bc-read-more { margin-left: auto; color: var(--primary); font-weight: 600; }

.blog-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
.blog-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.blog-widget h3 { font-size: .9rem; margin-bottom: .75rem; }
.bw-cat-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .4rem; border-radius: 8px;
  text-decoration: none; color: var(--text); font-size: .82rem;
  font-weight: 500; transition: background .15s;
  border-left: 3px solid var(--c, var(--primary));
  margin-bottom: .25rem; padding-left: .6rem;
}
.bw-cat-link:hover { background: var(--bg-hover); }

/* Blog Post */
.blog-breadcrumb {
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  padding: .75rem 0; font-size: .82rem; color: var(--text-muted);
  margin-top: var(--nav-h);
}
.blog-breadcrumb a { color: var(--accent); text-decoration: none; }
.blog-breadcrumb a:hover { text-decoration: underline; }

.blog-post-layout {
  display: grid; grid-template-columns: 1fr 260px;
  gap: 2rem; padding-top: 2rem; padding-bottom: 4rem; align-items: start;
}
@media(max-width:900px) { .blog-post-layout { grid-template-columns: 1fr; } }

.blog-article { min-width: 0; }
.ba-header {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.ba-category-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: .25rem .7rem; border-radius: 99px;
  margin-bottom: .75rem;
}
.ba-title { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.04em; margin-bottom: .5rem; }
.ba-subtitle { font-size: .95rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.ba-meta { display: flex; flex-wrap: wrap; gap: .6rem; font-size: .8rem; color: var(--text-muted); margin-bottom: 1rem; }
.ba-cta-inline {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--bg-alt); border-radius: 10px; padding: .65rem 1rem;
  font-size: .85rem; color: var(--text-muted);
}

/* Article body */
.ba-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm); line-height: 1.75;
}
.ba-body h2 { font-size: 1.3rem; margin: 1.75rem 0 .75rem; letter-spacing: -0.03em; color: var(--text); }
.ba-body h2:first-child { margin-top: 0; }
.ba-body h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; color: var(--text); }
.ba-body p { margin-bottom: 1rem; color: var(--text-secondary); font-size: .93rem; }
.ba-body ul, .ba-body ol { margin: .75rem 0 1rem 1.25rem; }
.ba-body li { margin-bottom: .4rem; font-size: .93rem; color: var(--text-secondary); line-height: 1.6; }
.ba-body strong { color: var(--text); font-weight: 700; }
.ba-body a { color: var(--accent); }

/* FAQ */
.ba-faq {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem;
}
.ba-faq h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.faq-item {
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: .5rem; overflow: hidden;
}
.faq-item summary {
  padding: .85rem 1rem; cursor: pointer; font-weight: 600;
  font-size: .9rem; list-style: none; display: flex;
  justify-content: space-between; align-items: center;
  background: var(--bg-alt); transition: background .15s;
}
.faq-item summary:hover { background: var(--bg-hover); }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: .85rem 1rem; font-size: .88rem; color: var(--text-muted); line-height: 1.6; }

/* CTA box */
.ba-cta-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--cta-color) 8%, var(--bg-card)), var(--bg-card));
  border: 2px solid color-mix(in srgb, var(--cta-color) 30%, transparent);
  border-radius: 16px; padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ba-cta-icon { font-size: 2.5rem; flex-shrink: 0; }
.ba-cta-box > div { flex: 1; min-width: 180px; }
.ba-cta-box h3 { font-size: 1rem; margin-bottom: .3rem; }
.ba-cta-box p { font-size: .85rem; color: var(--text-muted); }
.ba-cta-box .btn { flex-shrink: 0; }

/* Related */
.ba-related { margin-bottom: 1rem; }
.ba-related h3 { font-size: .95rem; margin-bottom: .75rem; }
.ba-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media(max-width:500px) { .ba-related-grid { grid-template-columns: 1fr; } }
.bar-card {
  display: flex; align-items: center; gap: .6rem; padding: .65rem .85rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--text); font-size: .8rem; transition: all .15s;
}
.bar-card:hover { border-color: var(--primary); background: var(--bg-hover); }
.bar-card span { font-size: 1.3rem; flex-shrink: 0; }
.bar-card strong { display: block; font-weight: 700; font-size: .8rem; }
.bar-card small { color: var(--text-muted); font-size: .72rem; }

/* Blog sidebar */
.blog-post-sidebar { position: sticky; top: calc(var(--nav-h) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.bps-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.bps-widget h4 { font-size: .88rem; margin-bottom: .4rem; }
.bps-widget p { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.bps-link {
  display: flex; align-items: center; gap: .45rem;
  padding: .3rem .4rem; border-radius: 6px;
  text-decoration: none; color: var(--text); font-size: .8rem;
  font-weight: 500; transition: background .12s;
  border-left: 2px solid var(--c, var(--primary));
  padding-left: .5rem; margin-bottom: .2rem;
}
.bps-link:hover { background: var(--bg-hover); }

/* ══════════════════════════════════════════
   CATEGORY PAGE — BLOG / Q&A SECTION
══════════════════════════════════════════ */

/* Hero blog link */
.cat-hero-blog-link {
  color: inherit; text-decoration: none; font-weight: 600;
  background: rgba(255,255,255,0.15); border-radius: 20px;
  padding: .15rem .75rem; font-size: .85rem; transition: background .15s;
}
.cat-hero-blog-link:hover { background: rgba(255,255,255,0.3); }

/* Section wrapper */
.cat-blog-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border);
}

/* Header */
.cat-blog-header {
  display: flex; gap: 1.25rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem; margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.cat-blog-icon {
  font-size: 2.5rem; width: 64px; height: 64px;
  border-radius: 14px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.cat-blog-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .35rem; line-height: 1.35; }
.cat-blog-subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: .6rem; line-height: 1.5; }
.cat-blog-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); }
.cat-blog-full-link { font-weight: 600; text-decoration: none; }
.cat-blog-full-link:hover { text-decoration: underline; }

/* Article body */
.cat-blog-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
  margin-bottom: 2rem; box-shadow: var(--shadow-sm);
  font-size: .92rem; line-height: 1.7; color: var(--text);
}
.cat-blog-content h2 {
  font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .65rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--border);
  color: var(--heading);
}
.cat-blog-content h2:first-child { margin-top: 0; }
.cat-blog-content h3 { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .5rem; color: var(--heading); }
.cat-blog-content p { margin-bottom: .9rem; }
.cat-blog-content ul, .cat-blog-content ol {
  padding-left: 1.4rem; margin-bottom: 1rem;
}
.cat-blog-content li { margin-bottom: .4rem; }
.cat-blog-content strong { color: var(--heading); font-weight: 700; }
.cat-blog-content a { color: var(--primary); text-decoration: none; }
.cat-blog-content a:hover { text-decoration: underline; }

/* FAQ Section */
.cat-blog-faq {
  margin-bottom: 2rem;
}
.cat-blog-faq h2 {
  font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; color: var(--heading);
}
.cat-blog-faq-intro {
  font-size: .88rem; color: var(--text-muted); margin-bottom: 1.25rem;
}
.cat-faq-grid { display: flex; flex-direction: column; gap: .6rem; }
.cat-faq-item {
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: border-color .15s;
}
.cat-faq-item[open] { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.cat-faq-q {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.1rem; cursor: pointer; font-weight: 600;
  font-size: .9rem; list-style: none;
  background: var(--bg-card); transition: background .12s;
  user-select: none;
}
.cat-faq-q:hover { background: var(--bg-hover); }
.cat-faq-q::marker, .cat-faq-q::-webkit-details-marker { display: none; }
.cat-faq-item[open] .cat-faq-q { background: var(--bg-alt); }
.cat-faq-num {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; border-radius: 6px;
  padding: .15rem .4rem; flex-shrink: 0;
}
.cat-faq-a {
  padding: .9rem 1.1rem 1rem 1.1rem;
  background: var(--bg-alt); border-top: 1px solid var(--border);
}
.cat-faq-a p { font-size: .88rem; color: var(--text-muted); line-height: 1.65; margin: 0; }

/* CTA */
.cat-blog-cta {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cta-color) 8%, var(--bg-card)),
    var(--bg-card));
  border: 2px solid color-mix(in srgb, var(--cta-color) 30%, transparent);
  border-radius: 16px; padding: 1.5rem; margin-bottom: 1rem;
}
.cat-blog-cta-inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.cat-blog-cta-inner > div { flex: 1; min-width: 180px; }
.cat-blog-cta-inner strong { display: block; font-weight: 700; margin-bottom: .3rem; }
.cat-blog-cta-inner p { font-size: .85rem; color: var(--text-muted); margin: 0; }

@media (max-width: 640px) {
  .cat-blog-header { flex-direction: column; }
  .cat-blog-icon { width: 48px; height: 48px; font-size: 1.8rem; }
  .cat-blog-content { padding: 1.25rem; }
  .cat-blog-cta-inner { flex-direction: column; align-items: flex-start; }
  .cat-blog-cta-inner .btn { width: 100%; text-align: center; }
}

/* ══════════════════════════════════════════
   NEXT QUIZ PICKER PANEL (result screen)
══════════════════════════════════════════ */
.next-quiz-panel {
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.nqp-header {
  padding: 1.1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.nqp-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.nqp-cat-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.nqp-header h3 { font-size: .95rem; font-weight: 700; margin: 0 0 .15rem; }
.nqp-subtitle   { font-size: .78rem; color: var(--text-muted); margin: 0; }

/* Filter pills */
.nqp-filters {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.nqp-filter {
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.nqp-filter:hover  { border-color: var(--primary); color: var(--primary); }
.nqp-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Quiz cards grid */
.nqp-grid {
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nqp-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
}
.nqp-card:hover {
  border-color: var(--primary);
  background: var(--bg-hover, var(--bg-alt));
  transform: translateX(3px);
}
.nqp-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.nqp-card-body  { flex: 1; min-width: 0; }
.nqp-card-title {
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.nqp-card-meta  { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.nqp-diff       { font-weight: 700; }
.nqp-sep        { opacity: .4; }
.nqp-arrow      { font-size: 1rem; color: var(--text-muted); flex-shrink: 0; transition: transform .15s; }
.nqp-card:hover .nqp-arrow { color: var(--primary); transform: translateX(3px); }

.nqp-no-results {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: .85rem;
}

/* Footer */
.nqp-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-alt);
}

/* Empty state */
.nqp-empty {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.nqp-empty p { color: var(--text-muted); margin-bottom: 1rem; }

@media (max-width: 540px) {
  .nqp-card-meta { font-size: .7rem; }
  .nqp-filters   { gap: .3rem; }
  .nqp-filter    { padding: .25rem .6rem; font-size: .72rem; }
}

/* ══════════════════════════════════════════
   CATEGORY PAGE — CHOOSE YOUR QUIZ SECTION
══════════════════════════════════════════ */

/* Section heading */
.cq-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.cq-heading h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 .2rem;
}
.cq-heading p {
  font-size: .83rem;
  color: var(--text-muted);
  margin: 0;
}

/* Quiz picker grid — 2 columns on wide, 1 on mobile */
.cq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

/* Each quiz picker card */
.cq-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .2s;
  position: relative;
}
.cq-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s;
}
.cq-card:hover {
  border-color: var(--cat-color, var(--primary));
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  transform: translateY(-3px);
}
.cq-card:hover::before { transform: scaleX(1); }

/* Top bar: number, difficulty, plays */
.cq-card-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
}
.cq-num {
  font-weight: 800;
  color: var(--text-muted);
  font-size: .72rem;
  min-width: 24px;
}
.cq-plays {
  margin-left: auto;
  color: var(--text-muted);
  font-size: .75rem;
}

/* Body: icon + title + desc */
.cq-card-body {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1rem .75rem;
  flex: 1;
}
.cq-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.cq-card-info { flex: 1; min-width: 0; }
.cq-card-title {
  font-size: .95rem;
  font-weight: 800;
  margin: 0 0 .3rem;
  line-height: 1.3;
}
.cq-card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Stats row */
.cq-card-stats {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cq-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem .25rem;
  font-size: .72rem;
  gap: .1rem;
}
.cq-stat + .cq-stat { border-left: 1px solid var(--border); }
.cq-stat strong { font-size: .88rem; font-weight: 800; color: var(--heading); }
.cq-stat small  { color: var(--text-muted); font-size: .68rem; }
.cq-stat span   { font-size: .85rem; }

/* Play button — full width at bottom */
.cq-play-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--cat-color, var(--primary));
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: .88rem;
  transition: filter .15s, transform .1s;
}
.cq-play-btn:hover { filter: brightness(1.1); color: #fff; }
.cq-play-arrow {
  font-size: 1.1rem;
  transition: transform .15s;
}
.cq-card:hover .cq-play-arrow { transform: translateX(4px); }

@media (max-width: 600px) {
  .cq-grid { grid-template-columns: 1fr; }
  .cq-card-body { flex-direction: column; }
  .cq-card-icon { width: 36px; height: 36px; font-size: 1.1rem; }
}

/* ══════════════════════════════════════════
   START SCREEN v2 — Beautiful redesign
══════════════════════════════════════════ */
.start-card.v2 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  text-align: center;
}

/* Hero section */
.sc-hero {
  padding: 2rem 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.sc-hero-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .9rem;
}
.sc-hero-badges {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap;
}
.sc-cat-tag {
  font-size: .78rem; font-weight: 700;
  padding: .22rem .7rem; border-radius: 20px;
}
.sc-title {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
}
.sc-desc {
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto;
}

/* Stats row */
.sc-stats {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.sc-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem .5rem;
  gap: .2rem;
}
.sc-stat-divider {
  width: 1px;
  background: var(--border);
  margin: .75rem 0;
}
.sc-stat-icon { font-size: 1.1rem; }
.sc-stat-val  { font-size: 1.35rem; font-weight: 800; font-family: var(--font-display); }
.sc-stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Form area */
.sc-form-wrap {
  padding: 1.5rem 1.75rem 1.75rem;
}

/* Notices */
.sc-notice {
  border-radius: 10px;
  padding: .6rem 1rem;
  font-size: .83rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.sc-notice-success {
  background: rgba(5,150,105,.1);
  border: 1px solid rgba(5,150,105,.25);
  color: #059669;
}
.sc-notice-info {
  background: rgba(91,94,244,.08);
  border: 1px solid rgba(91,94,244,.2);
  color: var(--text-muted);
}
.sc-notice-info a { color: var(--primary); font-weight: 700; }

/* Fields row */
.sc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1.1rem;
  text-align: left;
}
.sc-field label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--text);
}
.sc-req { color: var(--danger); margin-left: .1rem; }
.sc-opt {
  font-size: .72rem; font-weight: 400;
  color: var(--text-muted); margin-left: .3rem;
  background: var(--bg-alt); padding: .05rem .35rem;
  border-radius: 4px;
}
.sc-field input,
.sc-field select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font-body);
  transition: border-color .15s;
  box-sizing: border-box;
}
.sc-field input:focus,
.sc-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,94,244,.12);
}

/* Start button */
.sc-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .95rem 1.5rem;
  background: var(--btn-color, var(--primary));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
  transition: filter .15s, transform .12s;
  letter-spacing: .01em;
}
.sc-start-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.sc-start-btn:active { filter: brightness(.95); transform: translateY(0); }
.sc-start-arrow { font-size: 1.15rem; transition: transform .2s; }
.sc-start-btn:hover .sc-start-arrow { transform: translateX(4px); }

/* Back link */
.sc-back-link {
  display: block;
  margin-top: .85rem;
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.sc-back-link:hover { color: var(--primary); }

@media (max-width: 480px) {
  .sc-fields { grid-template-columns: 1fr; }
  .sc-hero    { padding: 1.5rem 1.25rem 1.1rem; }
  .sc-form-wrap { padding: 1.1rem 1.25rem 1.25rem; }
  .sc-title   { font-size: 1.3rem; }
}

/* ══════════════════════════════════════════
   BIG TIMER BAR — inside question card
══════════════════════════════════════════ */
.qc-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}

.qc-timer-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  max-width: 220px;
}

.qct-track {
  flex: 1;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 99px;
  overflow: hidden;
}

.qct-fill {
  height: 100%;
  width: 100%;           /* always full width — JS uses scaleX to shrink */
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  transform-origin: left center;
  transform: scaleX(1);  /* JS overrides this every 50ms */
}

.qct-fill.qct-warning {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}
.qct-fill.qct-danger {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.qct-count {
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font-display);
  min-width: 26px;
  text-align: right;
  color: var(--text);
  transition: color .3s;
}
.qct-count.qct-txt-warning { color: #d97706; }
.qct-count.qct-txt-danger  { color: #dc2626; }

.qc-timer-bar.qct-pulse .qct-count {
  animation: timerPulse .5s ease infinite alternate;
}
@keyframes timerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.2); color: #dc2626; }
}

/* ══════════════════════════════════════════
   START SCREEN — NO-SCROLL SIDE-BY-SIDE LAYOUT
   (replaces the old .start-card.v2 approach)
══════════════════════════════════════════ */

/* Widen the quiz page for the side-by-side layout */
#startScreen.quiz-screen { max-width: 820px; }

.sc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-h) - 2rem);
  max-height: calc(100vh - var(--nav-h) - 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
}

/* LEFT panel — quiz info */
.sc-left { position: relative; border-right: 1px solid var(--border); }
.sc-left-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem;
  gap: .6rem;
}

.sc-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  font-size: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .25rem;
}

.sc-badges {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
}
.sc-cat-pill {
  font-size: .75rem; font-weight: 700;
  padding: .2rem .65rem; border-radius: 20px;
}

.sc-title {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: .1rem 0 .1rem;
}

.sc-desc {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.sc-stats-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: var(--bg-alt);
  border-radius: 12px;
  margin: .4rem 0;
}
.sc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  flex: 1;
}
.sc-stat-val  { font-size: 1.2rem; font-weight: 800; font-family: var(--font-display); }
.sc-stat-lbl  { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sc-stat-dot  { width: 4px; height: 4px; background: var(--border); border-radius: 50%; flex-shrink: 0; }

.sc-back-link {
  font-size: .78rem; color: var(--text-muted);
  text-decoration: none; margin-top: .3rem;
  transition: color .15s;
}
.sc-back-link:hover { color: var(--cat-color, var(--primary)); }

/* RIGHT panel — form */
.sc-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem;
  gap: .75rem;
}

.sc-notice {
  border-radius: 10px;
  padding: .55rem .9rem;
  font-size: .8rem;
  font-weight: 500;
}
.sc-notice-success {
  background: rgba(5,150,105,.1);
  border: 1px solid rgba(5,150,105,.25);
  color: #059669;
}
.sc-notice-info {
  background: rgba(91,94,244,.08);
  border: 1px solid rgba(91,94,244,.2);
  color: var(--text-muted);
}
.sc-notice-info a { color: var(--primary); font-weight: 700; }

.sc-form { display: flex; flex-direction: column; gap: .9rem; }

.sc-field { display: flex; flex-direction: column; gap: .3rem; }
.sc-field label { font-size: .82rem; font-weight: 700; color: var(--text); }
.sc-req { color: var(--danger); margin-left: .1rem; }
.sc-opt {
  font-size: .7rem; font-weight: 400; color: var(--text-muted);
  margin-left: .35rem; background: var(--bg-alt);
  padding: .05rem .3rem; border-radius: 4px;
}
.sc-field input,
.sc-field select {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg); color: var(--text);
  font-size: .9rem; font-family: var(--font-body);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.sc-field input:focus,
.sc-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,94,244,.12);
}

.sc-start-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .9rem 1.5rem;
  background: var(--btn-color, var(--primary));
  color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 800; font-family: var(--font-display);
  cursor: pointer; transition: filter .15s, transform .12s;
  margin-top: .25rem;
}
.sc-start-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.sc-start-btn:active { transform: translateY(0); filter: brightness(.96); }
.sc-start-arrow { font-size: 1.1rem; transition: transform .2s; }
.sc-start-btn:hover .sc-start-arrow { transform: translateX(4px); }

/* Mobile: stack vertically */
@media (max-width: 600px) {
  #startScreen.quiz-screen { max-width: 100%; }
  .sc-layout {
    grid-template-columns: 1fr;
    min-height: unset;
    max-height: unset;
  }
  .sc-left { border-right: none; border-bottom: 1px solid var(--border); }
  .sc-left-inner { padding: 1.5rem 1.25rem; }
  .sc-right { padding: 1.25rem 1.25rem 1.5rem; }
  .sc-title { font-size: 1.2rem; }
}

/* ══════════════════════════════════════════
   QUIZ QUESTION SCREEN — NO-SCROLL OPTIMIZED
   Tightens all spacing so Q+options fit without scrolling on 768px+ screens
══════════════════════════════════════════ */
@media (min-width: 640px) {
  /* Quiz page padding reduction */
  .quiz-page { padding-top: calc(var(--nav-h) + .5rem); padding-bottom: 1rem; }

  /* Header compact */
  .quiz-header { position: sticky; top: var(--nav-h); }
  .quiz-top    { padding: .45rem .9rem; }

  /* Question card tighter */
  .question-card { padding: .85rem 1.1rem 1rem; }
  .question-text { font-size: 1rem; margin-bottom: .75rem; line-height: 1.45; }
  .qc-top-bar    { margin-bottom: .65rem; }

  /* Options tighter */
  .options-grid  { gap: .4rem; }
  .option-btn    { padding: .6rem .85rem; font-size: .88rem; gap: .65rem; }
  .option-label  { width: 24px; height: 24px; font-size: .72rem; }

  /* Feedback panel compact */
  .feedback-panel { padding: .75rem 1rem; }
  .feedback-next-btn { padding: .6rem 1.25rem; font-size: .88rem; }

  /* Timer bar compact */
  .qct-track { height: 7px; }
  .qct-count { font-size: .9rem; }
}

/* ══════════════════════════════════════════
   BLOG ↔ QUIZ LINKING STYLES
══════════════════════════════════════════ */

/* Result screen — blog study guide CTA */
.result-blog-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  background: color-mix(in srgb, var(--cta-color) 8%, var(--bg-card));
  border: 1.5px solid color-mix(in srgb, var(--cta-color) 30%, transparent);
  border-radius: 14px;
  flex-wrap: wrap;
}
.rbc-icon { font-size: 1.8rem; flex-shrink: 0; }
.rbc-body { flex: 1; min-width: 140px; }
.rbc-body strong { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.rbc-body p { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* Categories page — card wrapper + blog link */
.categories-full-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cat-full-card-wrap { display: flex; flex-direction: column; gap: .35rem; }
.cfc-blog-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .4rem .75rem;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  background: color-mix(in srgb, var(--cat-color) 10%, var(--bg-alt));
  color: var(--cat-color);
  border: 1px solid color-mix(in srgb, var(--cat-color) 25%, transparent);
  transition: all .15s;
}
.cfc-blog-link:hover {
  background: color-mix(in srgb, var(--cat-color) 18%, var(--bg-alt));
  transform: translateX(2px);
}

/* Homepage — blog mini cards grid */
.blog-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.blog-mini-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all .18s;
}
.blog-mini-card:hover {
  border-color: var(--blog-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.bmc-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.bmc-body { flex: 1; min-width: 0; }
.bmc-cat  { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.bmc-title {
  font-size: .82rem; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.bmc-meta { font-size: .72rem; color: var(--text-muted); }
.bmc-arrow { font-size: 1rem; flex-shrink: 0; transition: transform .15s; }
.blog-mini-card:hover .bmc-arrow { transform: translateX(3px); }
.bg-alt-section { background: var(--bg-alt); }

/* blog-post.php — quiz cards grid */
.ba-quizzes-section {
  margin: 2rem 0;
  padding: 1.75rem;
  background: var(--bg-alt);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.ba-quizzes-section h2 {
  font-size: 1.1rem; font-weight: 800; margin-bottom: .3rem;
}
.ba-quizzes-intro {
  font-size: .85rem; color: var(--text-muted); margin-bottom: 1.25rem;
}
.ba-quizzes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.baq-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column;
  transition: all .18s;
}
.baq-card:hover {
  border-color: var(--cat-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.baq-card-top {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .8rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: .75rem;
}
.baq-icon { font-size: 1rem; }
.baq-plays { margin-left: auto; color: var(--text-muted); }
.baq-title {
  font-size: .88rem; font-weight: 700;
  padding: .65rem .85rem .35rem;
  line-height: 1.3;
  flex: 1;
}
.baq-meta {
  font-size: .75rem; color: var(--text-muted);
  padding: 0 .85rem .65rem;
}
.baq-play {
  padding: .55rem .85rem;
  font-size: .8rem; font-weight: 800;
  color: #fff;
  text-align: center;
}

@media (max-width: 600px) {
  .result-blog-cta { flex-direction: column; align-items: flex-start; }
  .blog-cards-grid  { grid-template-columns: 1fr; }
  .ba-quizzes-grid  { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   BLOG PAGE — SEARCH + HERO STATS + SEO
══════════════════════════════════════════ */
.blog-search-wrap {
  margin-top: 1.25rem;
}
.blog-search-form {
  display: flex;
  gap: .5rem;
  max-width: 560px;
  margin: 0 auto;
}
.blog-search-input {
  flex: 1;
  padding: .65rem 1rem;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .95rem;
  backdrop-filter: blur(8px);
  outline: none;
  transition: border-color .2s;
}
.blog-search-input::placeholder { color: rgba(255,255,255,.6); }
.blog-search-input:focus { border-color: rgba(255,255,255,.6); }

.blog-hero-stats {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.bhs-item { text-align: center; color: rgba(255,255,255,.9); }
.bhs-item strong { display: block; font-size: 1.4rem; font-weight: 800; color: #fff; }
.bhs-item span { font-size: .75rem; opacity: .8; }
.bhs-sep { color: rgba(255,255,255,.3); font-size: 1.2rem; }

.blog-search-result-msg {
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  background: var(--bg-alt);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
  font-size: .9rem;
  color: var(--text-muted);
}
.blog-search-result-msg p { margin: 0; }
.blog-search-result-msg strong { color: var(--text); }

.blog-seo-block {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.blog-seo-block h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .75rem;
  color: var(--text);
}
.blog-seo-block p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.blog-seo-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
  margin: 1rem 0;
}
.bst-item {
  padding: .5rem .75rem;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 600px) {
  .blog-search-form { flex-direction: column; }
  .blog-hero-stats { gap: .5rem; }
  .bhs-sep { display: none; }
  .blog-seo-topics { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════
   SEARCH PAGE — ENHANCED STYLES
══════════════════════════════════════════ */
.search-box-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.search-form-main { display: flex; flex-direction: column; gap: .75rem; }
.search-input-group {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: .4rem .75rem;
  transition: border-color .2s;
}
.search-input-group:focus-within { border-color: var(--primary); }
.search-icon { font-size: 1.1rem; }
.search-input-main {
  flex: 1; border: none; background: transparent;
  font-size: 1rem; color: var(--text); outline: none;
  padding: .45rem 0;
}
.search-filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filter-select {
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: .88rem;
  cursor: pointer;
}
.search-results-header {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1rem; font-size: .95rem; color: var(--text-muted);
}
.results-count { font-weight: 700; color: var(--text); }
.results-for strong { color: var(--primary); }
.search-suggestions h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: .75rem; color: var(--text);
}
.suggestion-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggestion-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .85rem; font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all .2s;
}
.suggestion-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Nav search result for blog */
.search-result-item {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .55rem .75rem; text-decoration: none;
  border-radius: 8px; transition: background .15s;
  color: var(--text);
}
.search-result-item:hover { background: var(--bg-alt); }
.sri-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.sri-title { font-size: .87rem; font-weight: 600; line-height: 1.3; }
.sri-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: .3rem; }
.search-more-link {
  display: block; text-align: center; padding: .5rem;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  border-top: 1px solid var(--border); margin-top: .25rem;
  text-decoration: none;
}
.search-nores { padding: .75rem; text-align: center; font-size: .85rem; color: var(--text-muted); }

@media (max-width: 600px) {
  .search-input-group { flex-wrap: wrap; }
  .filter-select { flex: 1; min-width: 140px; }
}

/* ── QUIZ COMPLETION (localStorage) ─────────────────────────────── */
.qv-done-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #059669;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(5,150,105,0.35);
  pointer-events: none;
  white-space: nowrap;
}
.qv-done-badge span {
  font-weight: 800;
}

/* Dim the card slightly to show it's been done */
[data-quiz-slug].qv-completed-dim {
  opacity: 0.85;
}

/* Already-completed notice on start screen */
.sc-notice-completed {
  background: linear-gradient(135deg, #05966918, #05966908);
  border: 1px solid #05966940;
  color: var(--text);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.sc-notice-completed strong {
  color: #059669;
}

/* Random Quiz button accent pulse */
.btn-accent {
  animation: none;
}
.hero-cta .btn-accent {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border: none;
}
.hero-cta .btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,0.4);
}

/* ── COMPLETION FILTER ENHANCEMENTS ─────────────────────────────── */

/* Completion filter group sits neatly in filter bar */
#completionFilterGroup .filter-btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
}
#completionFilterGroup .filter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
#completionFilterGroup .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Dimmed not-played cards when completed filter active */
.cq-card[style*="display: none"] { display: none !important; }

/* Play-again cue on completed cards */
.cq-card .qv-done-badge {
  top: 10px;
  right: 10px;
}

/* Accent btn in hero already styled — ensure it doesn't conflict */
.hero-cta .btn-accent {
  background: linear-gradient(135deg, #f97316, #ef4444) !important;
  color: #fff !important;
  border: none !important;
}

/* ═══════════════════════════════════════════════════
   BLOG PAGE — Rebuilt Layout 2026
═══════════════════════════════════════════════════ */

/* Category filter bar */
.blog-filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
  padding: .5rem 0;
}
.blog-filter-scroll {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .25rem .5rem;
  scrollbar-width: none;
}
.blog-filter-scroll::-webkit-scrollbar { display: none; }
.blog-filter-tab {
  flex-shrink: 0;
  padding: .35rem .85rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.blog-filter-tab:hover,
.blog-filter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Blog sections */
.blog-section {
  margin-bottom: 3rem;
}
.blog-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.blog-section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.blog-section-header p {
  font-size: .85rem;
  color: var(--text-muted);
  margin: .25rem 0 0;
}
.blog-section-link {
  font-size: .85rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.blog-section-link:hover { text-decoration: underline; }

/* Blog grids */
.blog-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.blog-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Blog card improvements */
.blog-card-featured .bc-title {
  font-size: 1rem;
  line-height: 1.4;
}
.blog-card-featured .bc-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar active category */
.bw-cat-active {
  background: var(--primary) !important;
  color: #fff !important;
}

/* Search result message */
.blog-search-result-msg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.blog-search-result-msg a { color: var(--primary); font-weight: 600; }

/* Popular guide sidebar links */
.bps-link {
  display: block;
  padding: .45rem .6rem;
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
  line-height: 1.4;
  margin-bottom: .2rem;
  border-left: 3px solid var(--c, var(--primary));
}
.bps-link:hover { background: var(--surface); }

/* SEO topics grid */
.blog-seo-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
  margin: 1rem 0;
}
.bst-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .85rem;
  font-weight: 500;
}

/* SEO block */
.blog-seo-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
}
.blog-seo-block h2 {
  font-size: 1.3rem;
  margin-bottom: .75rem;
}
