/* ============================================================
   RiddlesQuest v2 — Full Design System
   Dark Vibe-Coding Premium + Light Theme Support
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   1. LIGHT THEME (default)
───────────────────────────────────────────────────────────── */
:root {
  /* Clean light palette */
  --bg:           #F8F9FA;
  --bg-secondary: #F1F3F5;
  --surface:      rgba(255, 255, 255, 0.95);
  --surface-solid:#FFFFFF;
  --surface-2:    rgba(241, 243, 245, 0.9);
  --surface-3:    rgba(233, 236, 239, 0.8);
  --border:       rgba(0, 163, 114, 0.12);
  --border-subtle:rgba(0, 0, 0, 0.06);

  /* Brand */
  --primary:       #009165;
  --primary-dark:  #007350;
  --primary-light: #26D99D;
  --accent:        #00A372;
  --accent-dim:    rgba(0, 163, 114, 0.08);

  /* Status */
  --success: #009165;
  --warning: #D4930A;
  --danger:  #D63B3B;
  --info:    #2D7DD2;

  /* Difficulty */
  --easy:   #009165;
  --medium: #D4930A;
  --hard:   #D63B3B;

  /* Text */
  --text:       #1A1D20;
  --text-muted: #495057;
  --text-faint: #868E96;

  /* Gradients */
  --gradient-primary:  linear-gradient(135deg, #009165 0%, #00A372 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(0, 145, 101, 0.12) 0%, rgba(0, 163, 114, 0.08) 100%);
  --gradient-success:  linear-gradient(135deg, #009165 0%, #00A372 100%);
  --gradient-warm:     linear-gradient(135deg, #D4930A 0%, #D63B3B 100%);
  --gradient-hero: linear-gradient(160deg, #FFFFFF 0%, #F8F9FA 40%, #F1F3F5 100%);
  --gradient-card: linear-gradient(135deg, rgba(0, 163, 114, 0.03) 0%, rgba(0, 163, 114, 0.01) 100%);
  --gradient-surface: linear-gradient(160deg, rgba(255,255,255,0.98) 0%, rgba(248,249,250,0.95) 100%);

  /* Glow shadows */
  --glow-primary: 0 4px 14px rgba(0, 145, 101, 0.12);
  --glow-accent:  0 4px 14px rgba(0, 163, 114, 0.1);
  --glow-success: 0 4px 12px rgba(0, 145, 101, 0.1);
  --shadow-sm:    0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md:    0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg:    0 8px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl:    0 20px 60px rgba(15, 23, 42, 0.15);

  /* Spacing */
  --sp-xs:  4px; --sp-sm:  8px;  --sp-md:  16px;
  --sp-lg:  24px; --sp-xl:  40px; --sp-2xl: 64px; --sp-3xl: 96px;

  /* Border radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-2xl: 32px; --r-full: 999px;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container:    1200px;
  --container-sm: 800px;
  --nav-height:   70px;
}

/* ─────────────────────────────────────────────────────────────
   2. DARK THEME
───────────────────────────────────────────────────────────── */
:root.dark-theme {
  /* Deep dark palette */
  --bg:           #020C1B;
  --bg-secondary: #04142D;
  --surface:      rgba(6, 26, 54, 0.85);
  --surface-solid:#061A36;
  --surface-2:    rgba(9, 38, 79, 0.7);
  --surface-3:    rgba(14, 53, 107, 0.6);
  --border:       rgba(0, 163, 114, 0.12);
  --border-subtle:rgba(255, 255, 255, 0.05);

  /* Brand */
  --primary:       #00A372;
  --primary-dark:  #00825B;
  --primary-light: #2DE3B0;
  --accent:        #00C48B;
  --accent-dim:    rgba(0, 196, 139, 0.12);

  /* Status */
  --success: #00A372;
  --warning: #FFD166;
  --danger:  #FF6B6B;
  --info:    #74B9FF;

  /* Difficulty */
  --easy:   #00A372;
  --medium: #FFD166;
  --hard:   #FF6B6B;

  /* Text */
  --text:       #E8ECF5;
  --text-muted: #8892A8;
  --text-faint: #4A5568;

  /* Gradients */
  --gradient-primary:  linear-gradient(135deg, #00A372 0%, #00C48B 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(0, 163, 114, 0.15) 0%, rgba(0, 196, 139, 0.08) 100%);
  --gradient-success:  linear-gradient(135deg, #00A372 0%, #00C48B 100%);
  --gradient-warm:     linear-gradient(135deg, #FFD166 0%, #FF6B6B 100%);
  --gradient-hero:     linear-gradient(160deg, #020C1B 0%, #051934 40%, #020C1B 100%);
  --gradient-card:     linear-gradient(135deg, rgba(0, 163, 114, 0.05) 0%, rgba(0, 196, 139, 0.02) 100%);
  --gradient-surface:  linear-gradient(160deg, rgba(6,26,54,0.95) 0%, rgba(2,12,27,0.98) 100%);

  /* Glow shadows */
  --glow-primary: 0 4px 16px rgba(0, 163, 114, 0.22);
  --glow-accent:  0 4px 14px rgba(0, 196, 139, 0.18);
  --glow-success: 0 4px 14px rgba(0, 163, 114, 0.18);
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl:    0 20px 60px rgba(0, 0, 0, 0.7);
}

/* ─────────────────────────────────────────────────────────────
   3. RESET & BASE
───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-slow), color var(--t-normal);
}

/* Aurora background overlay */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(0,163,114,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(0,196,139,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 60% 10%, rgba(0,163,114,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
  transition: opacity var(--t-slow);
}
:root.dark-theme body::before { opacity: 1; }

/* Grid dot pattern */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0,163,114,0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  transition: opacity var(--t-slow);
}
:root.dark-theme body::after { opacity: 0.4; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────────────────────────
   4. LAYOUT
───────────────────────────────────────────────────────────── */
.container      { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-lg); position: relative; z-index: 1; }
.container--sm  { max-width: var(--container-sm); }
.grid-2         { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); }
.grid-3         { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); }
.grid-4         { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-lg); }
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.gap-sm         { gap: var(--sp-sm); } .gap-md { gap: var(--sp-md); } .gap-lg { gap: var(--sp-lg); }
.text-center    { text-align: center; }
.text-muted     { color: var(--text-muted); }
.sr-only        { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.section        { padding-block: var(--sp-3xl); }
.section--sm    { padding-block: var(--sp-2xl); }

/* ─────────────────────────────────────────────────────────────
   5. TYPOGRAPHY
───────────────────────────────────────────────────────────── */
h1, h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
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); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────
   6. GLASSMORPHISM CARDS (base)
───────────────────────────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  border-radius: inherit;
  pointer-events: none;
}

/* Gradient border card */
.card-gradient-border {
  position: relative;
  border-radius: var(--r-xl);
  padding: 1px;
  background: var(--gradient-primary);
}
.card-gradient-border > * {
  background: var(--surface-solid);
  border-radius: calc(var(--r-xl) - 1px);
}

/* ─────────────────────────────────────────────────────────────
   7. BUTTONS
───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 14px 28px;
  border-radius: var(--r-full);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--t-normal);
  min-height: 48px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
}

/* Shimmer overlay on hover */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn:hover::before { left: 150%; }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--glow-primary), 0 0 0 1px rgba(124,111,247,0.3);
}
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124,111,247,0.08);
}

.btn-ghost {
  background: rgba(108,92,231,0.06);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}
:root.dark-theme .btn-ghost { background: rgba(255,255,255,0.05); }
.btn-ghost:hover { background: rgba(124,111,247,0.1); border-color: var(--border); }

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: var(--glow-success);
}

.btn-danger {
  background: linear-gradient(135deg, #FF6B6B, #FD79A8);
  color: #fff;
}

.btn-sm  { padding: 10px 20px; font-size: 0.875rem; min-height: 40px; }
.btn-lg  { padding: 18px 40px; font-size: 1.125rem; min-height: 56px; }
.btn-xl  { padding: 20px 48px; font-size: 1.25rem;  min-height: 64px; }
.btn-full { width: 100%; }

.btn.is-loading {
  pointer-events: none; opacity: 0.75;
}
.btn.is-loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* ─────────────────────────────────────────────────────────────
   8. NAVIGATION
───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(240, 244, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-normal);
}
:root.dark-theme .site-header {
  background: rgba(7, 9, 26, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-md);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--glow-primary);
  transition: transform var(--t-spring);
}
.site-logo:hover .logo-icon { transform: rotate(-5deg) scale(1.08); }
.logo-dot { color: var(--accent); }

/* 4-Tab Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  backdrop-filter: blur(16px);
  border-radius: var(--r-full);
  padding: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t-normal);
  white-space: nowrap;
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}

/* Navigation Hover Dropdown */
.nav-dropdown-wrap {
  position: relative;
  display: inline-block;
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-xs);
  min-width: 170px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  margin-top: 6px;
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity var(--t-normal) ease, transform var(--t-normal) ease;
}
/* Non-flicker bridge for nav menu */
.nav-dropdown-content::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
}
.nav-dropdown-wrap:hover .nav-dropdown-content {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-wrap:hover .nav-tab svg {
  transform: rotate(180deg);
}
.nav-dropdown-content a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t-fast);
  text-align: left;
}
.nav-dropdown-content a:hover {
  background: var(--gradient-primary-soft);
  color: var(--primary);
}

/* Header right */
.header-right { display: flex; align-items: center; gap: 10px; }

.header-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: all var(--t-normal);
}
.header-streak { color: var(--warning); }
.header-xp     { color: var(--accent); }
.header-pill:hover { border-color: rgba(124,111,247,0.4); }

/* Dark/Light Toggle */
.theme-toggle {
  width: 40px; height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--t-spring);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  font-family: inherit;
}
.theme-toggle:hover {
  background: rgba(124,111,247,0.15);
  border-color: var(--primary);
  transform: rotate(20deg) scale(1.1);
}
.theme-toggle .icon-dark  { display: none; }
.theme-toggle .icon-light { display: block; }
:root.dark-theme .theme-toggle .icon-dark  { display: block; }
:root.dark-theme .theme-toggle .icon-light { display: none; }

/* Mobile Hamburger */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--t-normal); }
.mobile-menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: rgba(240, 244, 255, 0.97);
  backdrop-filter: blur(24px);
  z-index: 99;
  padding: var(--sp-xl) var(--sp-lg);
  flex-direction: column;
  gap: var(--sp-md);
  overflow-y: auto;
}
:root.dark-theme .mobile-nav { background: rgba(7, 9, 26, 0.97); }
.mobile-nav.is-open { display: flex; }
.mobile-nav-tab {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 1.1rem; font-weight: 600;
  color: var(--text);
  transition: all var(--t-normal);
}
.mobile-nav-tab:hover, .mobile-nav-tab.active { border-color: var(--primary); color: var(--primary); background: rgba(124,111,247,0.1); }

/* ─────────────────────────────────────────────────────────────
   9. HERO SECTION
───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: 100px 80px;
  background: var(--gradient-hero);
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(124,111,247,0.18) 0%, transparent 65%);
  top: -200px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, transparent 70%);
  bottom: -100px; right: 5%;
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,111,247,0.12);
  border: 1px solid rgba(124,111,247,0.35);
  border-radius: var(--r-full);
  padding: 7px 20px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-lg);
  animation: fadeInDown 0.6s ease both;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-lg);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--sp-xl);
  line-height: 1.75;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-cta-group {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-md); flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-2xl); margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
  animation: fadeInUp 0.6s ease 0.4s both;
}
.hero-stat-number {
  font-size: 2.2rem; font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1;
}
.hero-stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.hero-divider { width: 1px; height: 44px; background: var(--border); }

/* ─────────────────────────────────────────────────────────────
   10. SOCIAL PROOF STRIP
───────────────────────────────────────────────────────────── */
.social-proof-strip {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-lg);
  position: relative; z-index: 1;
}
.social-proof-inner { display: flex; align-items: center; justify-content: center; gap: var(--sp-2xl); flex-wrap: wrap; }
.proof-item { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.proof-item strong { color: var(--text); font-weight: 800; }
.proof-dot { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; animation: pulse-dot 2s ease-in-out infinite; box-shadow: 0 0 8px var(--primary); }

/* ─────────────────────────────────────────────────────────────
   11. DAILY RIDDLE SECTION
───────────────────────────────────────────────────────────── */
.daily-riddle-section { padding-block: var(--sp-2xl); position: relative; }
.daily-riddle-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(124,111,247,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.riddle-card-main {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-2xl);
  max-width: 720px;
  margin-inline: auto;
  position: relative;
  box-shadow: 0 0 60px rgba(124,111,247,0.1), var(--shadow-xl);
}
.riddle-card-main::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,111,247,0.06) 0%, rgba(0,229,255,0.03) 100%);
  border-radius: inherit; pointer-events: none;
}
/* Top glowing line */
.riddle-card-main::after {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%;
  height: 1px;
  background: var(--gradient-primary);
  border-radius: var(--r-full);
  opacity: 0.6;
}

.riddle-countdown {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-xl); flex-wrap: wrap; gap: 8px;
}
.countdown-label { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

.countdown-timer {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.2rem; font-weight: 800; color: var(--accent);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--r-sm);
  padding: 7px 16px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 15px rgba(0,229,255,0.1);
}

.riddle-number { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }

.riddle-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: var(--sp-xl);
  font-style: italic;
  position: relative;
  padding-left: var(--sp-xl);
}
.riddle-text::before {
  content: '"';
  position: absolute; left: 0; top: -10px;
  font-size: 3.5rem; color: var(--primary); opacity: 0.35;
  line-height: 1; font-style: normal; font-weight: 900;
}

.riddle-meta-strip {
  display: flex; align-items: center; gap: var(--sp-lg);
  margin-bottom: var(--sp-xl); flex-wrap: wrap;
}
.riddle-meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.83rem; color: var(--text-muted); font-weight: 500; }
.riddle-meta-item .highlight { color: var(--text); font-weight: 700; }

/* Answer Form */
.answer-form { display: flex; flex-direction: column; gap: var(--sp-md); }
.answer-input-group { display: flex; gap: var(--sp-sm); }
.answer-input {
  flex: 1;
  background: rgba(255,255,255,0.8);
  border: 2px solid var(--border);
  border-radius: var(--r-full);
  padding: 14px 24px; font-size: 1rem;
  color: var(--text); outline: none;
  transition: all var(--t-normal);
  min-height: 52px; font-family: inherit;
  backdrop-filter: blur(8px);
}
:root.dark-theme .answer-input { background: rgba(255,255,255,0.04); }
.answer-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124,111,247,0.12), var(--glow-primary); }
.answer-input::placeholder { color: var(--text-faint); }

.hint-toggle { font-size: 0.8rem; color: var(--text-muted); background: none; border: none; cursor: pointer; transition: color var(--t-fast); display: flex; align-items: center; gap: 4px; font-family: inherit; }
.hint-toggle:hover { color: var(--accent); }

.hint-box { display: none; background: rgba(0,229,255,0.06); border: 1px solid rgba(0,229,255,0.2); border-radius: var(--r-md); padding: var(--sp-md); font-size: 0.88rem; color: var(--accent); }
.hint-box.is-visible { display: block; animation: slideInUp 0.3s ease; }

.answer-feedback { display: none; align-items: center; gap: 8px; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-weight: 600; font-size: 0.95rem; animation: slideInUp 0.3s ease; }
.answer-feedback.is-visible { display: flex; }
.answer-feedback.correct { background: rgba(0,163,114,0.1); border: 1px solid rgba(0,163,114,0.3); color: var(--success); }
.answer-feedback.wrong   { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); color: var(--danger); }

.already-solved-banner { display: flex; align-items: center; gap: 8px; background: rgba(0,163,114,0.1); border: 1px solid rgba(0,163,114,0.3); border-radius: var(--r-md); padding: var(--sp-md) var(--sp-lg); color: var(--success); font-weight: 600; }

/* Guest limited notice */
.guest-limited-notice {
  background: rgba(124,111,247,0.08);
  border: 1px solid rgba(124,111,247,0.2);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}

/* ─────────────────────────────────────────────────────────────
   12. BADGES
───────────────────────────────────────────────────────────── */
.rq-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-full); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.badge--easy   { background: rgba(0,163,114,0.12);  color: var(--easy);   border: 1px solid rgba(0,163,114,0.3);  box-shadow: 0 0 12px rgba(0,163,114,0.1); }
.badge--medium { background: rgba(255,209,102,0.12); color: var(--medium); border: 1px solid rgba(255,209,102,0.3); box-shadow: 0 0 12px rgba(255,209,102,0.1); }
.badge--hard   { background: rgba(255,107,107,0.12); color: var(--hard);   border: 1px solid rgba(255,107,107,0.3);  box-shadow: 0 0 12px rgba(255,107,107,0.1); }

/* ─────────────────────────────────────────────────────────────
   13. XP PROGRESS BAR
───────────────────────────────────────────────────────────── */
.xp-bar-container { background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-xl); }
.xp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-md); flex-wrap: wrap; gap: 8px; }
.xp-level-badge { display: flex; align-items: center; gap: 8px; background: rgba(124,111,247,0.12); border: 1px solid rgba(124,111,247,0.3); border-radius: var(--r-full); padding: 6px 16px; font-size: 0.88rem; font-weight: 700; color: var(--primary); box-shadow: 0 0 15px rgba(124,111,247,0.1); }
.xp-amount { font-size: 0.875rem; color: var(--text-muted); font-weight: 600; }
.xp-amount strong { color: var(--accent); }
.xp-track { height: 10px; background: var(--surface-2); border-radius: var(--r-full); overflow: hidden; margin-bottom: 8px; }
.xp-fill { height: 100%; background: var(--gradient-primary); border-radius: var(--r-full); transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 0 12px rgba(124,111,247,0.5); position: relative; }
.xp-fill::after { content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 100%; background: rgba(255,255,255,0.4); border-radius: var(--r-full); animation: shimmer 2s infinite; }

/* ─────────────────────────────────────────────────────────────
   14. STREAK BADGE
───────────────────────────────────────────────────────────── */
.streak-container { display: flex; align-items: center; gap: var(--sp-md); background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-xl); }
.streak-icon { font-size: 2.5rem; animation: flicker 3s ease-in-out infinite; line-height: 1; filter: drop-shadow(0 0 12px rgba(255,209,102,0.6)); }
.streak-count { font-size: 2rem; font-weight: 900; color: var(--warning); line-height: 1; text-shadow: 0 0 20px rgba(255,209,102,0.5); }
.streak-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────
   15. RIDDLE CARDS (Grid)
───────────────────────────────────────────────────────────── */
.riddle-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  display: flex; flex-direction: column; gap: var(--sp-md);
  transition: all var(--t-normal);
  cursor: pointer; text-decoration: none;
  color: inherit; position: relative; overflow: hidden;
}
.riddle-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--t-normal);
}
.riddle-card::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-card);
  opacity: 0; transition: opacity var(--t-normal);
  pointer-events: none; border-radius: inherit;
}
.riddle-card:hover::before { opacity: 1; }
.riddle-card:hover::after  { opacity: 1; }
.riddle-card:hover {
  border-color: var(--border);
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(124,111,247,0.1);
}
.riddle-card-header { display: flex; align-items: center; justify-content: space-between; }
.riddle-card-title  { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.4; }
.riddle-card-excerpt { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.riddle-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-md); border-top: 1px solid var(--border-subtle); font-size: 0.8rem; color: var(--text-muted); }
.riddle-card-xp { display: flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; }

/* ─────────────────────────────────────────────────────────────
   16. ENTRY PATHS
───────────────────────────────────────────────────────────── */
.entry-path-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  text-align: center;
  transition: all var(--t-normal);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-md);
  text-decoration: none; color: inherit;
}
.entry-path-card:hover {
  border-color: var(--border);
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(124,111,247,0.12);
}
.entry-path-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--glow-primary);
  transition: transform var(--t-spring);
}
.entry-path-card:hover .entry-path-icon { transform: scale(1.1) rotate(-5deg); }
.entry-path-title { font-size: 1.1rem; font-weight: 700; }
.entry-path-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ─────────────────────────────────────────────────────────────
   17. BLOG CARDS
───────────────────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: all var(--t-normal);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.post-card:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(124,111,247,0.08);
}
.post-card-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--gradient-primary-soft);
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--bg-secondary); transition: transform 0.4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body { padding: var(--sp-xl); display: flex; flex-direction: column; gap: var(--sp-sm); flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.post-card-category { display: inline-flex; align-items: center; gap: 4px; background: rgba(124,111,247,0.1); border: 1px solid rgba(124,111,247,0.2); border-radius: var(--r-full); padding: 3px 10px; font-size: 0.7rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; }
.post-card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: var(--text); }
.post-card-title:hover { color: var(--primary); }
.post-card-excerpt { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-footer { margin-top: auto; padding-top: var(--sp-md); border-top: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-faint); }
.read-more-link { color: var(--primary); font-weight: 600; font-size: 0.82rem; display: flex; align-items: center; gap: 4px; transition: gap var(--t-fast); }
.post-card:hover .read-more-link { gap: 8px; }

/* Featured Post */
.post-card-featured {
  background: var(--surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  text-decoration: none; color: inherit;
  transition: all var(--t-normal);
  box-shadow: var(--shadow-lg);
}
.post-card-featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl), 0 0 40px rgba(124,111,247,0.1); }
.post-card-featured .post-card-thumb { aspect-ratio: auto; height: 100%; min-height: 300px; }
.post-card-featured .post-card-body { padding: var(--sp-2xl); justify-content: center; }
.post-card-featured .post-card-title { font-size: 1.5rem; }

/* ─────────────────────────────────────────────────────────────
   18. SINGLE POST STYLES
───────────────────────────────────────────────────────────── */
.single-post-header {
  padding-block: var(--sp-2xl);
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
}
.single-post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-xl); padding-block: var(--sp-2xl); }
.post-content {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl);
}
.post-content h2,
.post-content h3 { margin-block: var(--sp-xl) var(--sp-md); }
.post-content p  { margin-bottom: var(--sp-md); color: var(--text-muted); line-height: 1.8; }
.post-content ul, .post-content ol { padding-left: var(--sp-xl); margin-bottom: var(--sp-md); }
.post-content li { margin-bottom: var(--sp-sm); color: var(--text-muted); }
.post-content a  { color: var(--primary); text-decoration: underline dotted; }
.post-content a:hover { color: var(--accent); }
.post-content blockquote { border-left: 3px solid var(--primary); padding-left: var(--sp-lg); margin-block: var(--sp-xl); font-style: italic; color: var(--text-muted); }
.post-content img {
  border-radius: var(--r-lg);
  margin-block: var(--sp-lg);
  box-shadow: var(--shadow-md);
  display: block !important;
  margin-inline: auto !important;
  max-width: 100% !important;
  height: auto !important;
}
.post-content figure.wp-block-image {
  display: table !important;
  margin-inline: auto !important;
  text-align: center !important;
}
.post-content figure.wp-block-image img {
  display: block !important;
  margin-inline: auto !important;
}
.post-content pre { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-lg); overflow-x: auto; margin-block: var(--sp-lg); border: 1px solid var(--border); }
.post-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 0.875rem; }

.reading-time { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); background: var(--surface-2); border-radius: var(--r-full); padding: 4px 12px; }

.post-author-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-xl); margin-top: var(--sp-xl); display: flex; align-items: center; gap: var(--sp-lg); }
.author-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.author-name { font-weight: 700; margin-bottom: 4px; }
.author-bio  { font-size: 0.875rem; color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────
   19. LEADERBOARD
───────────────────────────────────────────────────────────── */
.leaderboard-table { background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.leaderboard-row { display: grid; grid-template-columns: 60px 1fr 120px 100px; align-items: center; padding: var(--sp-md) var(--sp-xl); border-bottom: 1px solid var(--border-subtle); transition: background var(--t-fast); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: rgba(124,111,247,0.04); }
.leaderboard-row.header-row { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.leaderboard-row.is-me { background: rgba(124,111,247,0.08); border-left: 3px solid var(--primary); }
.rank-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 800; }
.rank-badge.gold   { background: rgba(255,209,102,0.15); border-color: var(--warning); color: var(--warning); box-shadow: 0 0 12px rgba(255,209,102,0.2); }
.rank-badge.silver { background: rgba(178,190,195,0.15); border-color: #b2bec3; color: #b2bec3; }
.rank-badge.bronze { background: rgba(210,105,30,0.15);  border-color: #cd853f; color: #cd853f; }
.leaderboard-user { display: flex; align-items: center; gap: var(--sp-md); }
.leaderboard-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.leaderboard-xp     { font-weight: 700; color: var(--accent); }
.leaderboard-streak { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--warning); }

/* ─────────────────────────────────────────────────────────────
   20. ARCHIVE / FILTERS
───────────────────────────────────────────────────────────── */
.page-hero { padding-block: var(--sp-2xl); text-align: center; background: var(--gradient-hero); border-bottom: 1px solid var(--border); position: relative; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-sm); justify-content: center; margin-bottom: var(--sp-xl); }
.filter-group { display: flex; align-items: center; gap: 4px; background: var(--surface); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--r-full); padding: 4px; }
.filter-btn { padding: 8px 18px; border-radius: var(--r-full); font-size: 0.85rem; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; transition: all var(--t-normal); min-height: 36px; font-family: inherit; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--gradient-primary); color: #fff; box-shadow: 0 2px 10px rgba(124,111,247,0.3); }
.riddle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-lg); }

/* ─────────────────────────────────────────────────────────────
   21. REWARD MODAL
───────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.75); backdrop-filter: blur(12px); z-index: 1000; align-items: center; justify-content: center; padding: var(--sp-lg); }
.modal-overlay.is-open { display: flex; }
:root.dark-theme .modal-overlay { background: rgba(7,9,26,0.88); }
.reward-modal { background: var(--surface); backdrop-filter: blur(32px) saturate(200%); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--sp-2xl); max-width: 480px; width: 100%; text-align: center; position: relative; animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: var(--glow-primary), var(--shadow-xl); }
.reward-modal::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(124,111,247,0.08) 0%, rgba(0,229,255,0.04) 100%); border-radius: inherit; pointer-events: none; }
.reward-emoji { font-size: 5rem; line-height: 1; margin-bottom: var(--sp-lg); animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); display: block; filter: drop-shadow(0 0 20px rgba(255,209,102,0.5)); }
.reward-title { font-size: 1.75rem; font-weight: 900; margin-bottom: 8px; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.reward-message { color: var(--text-muted); margin-bottom: var(--sp-xl); font-size: 1rem; }
.reward-xp-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.25); border-radius: var(--r-full); padding: 10px 24px; font-size: 1.25rem; font-weight: 900; color: var(--accent); margin-bottom: var(--sp-xl); box-shadow: var(--glow-accent); animation: fadeInUp 0.4s ease 0.3s both; }
.reward-actions { display: flex; gap: var(--sp-md); justify-content: center; flex-wrap: wrap; }
.modal-close { position: absolute; top: var(--sp-md); right: var(--sp-md); background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; transition: all var(--t-fast); font-family: inherit; }
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(124,111,247,0.1); border: 1px solid rgba(124,111,247,0.25); border-radius: var(--r-full); padding: 6px 14px; font-size: 0.8rem; font-weight: 600; color: var(--primary); }

/* ─────────────────────────────────────────────────────────────
   22. FOOTER
───────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); backdrop-filter: blur(20px); border-top: 1px solid var(--border); padding-top: var(--sp-2xl); padding-bottom: var(--sp-xl); position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--sp-2xl); margin-bottom: var(--sp-2xl); }
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; margin-top: var(--sp-md); max-width: 260px; line-height: 1.7; }
.footer-heading { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: var(--sp-md); }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-muted); font-size: 0.88rem; transition: color var(--t-fast); }
.footer-links a:hover { color: var(--primary); }
.footer-social { display: flex; gap: 8px; margin-top: var(--sp-md); }
.social-btn { width: 32px; height: 32px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 50% !important; display: inline-flex; align-items: center; justify-content: center; font-size: 0.88rem; transition: all var(--t-normal); color: var(--text-muted); cursor: pointer; }
.social-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 163, 114, 0.3); }
.social-btn svg { fill: currentColor; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-lg); border-top: 1px solid var(--border-subtle); font-size: 0.78rem; color: var(--text-faint); flex-wrap: wrap; gap: var(--sp-md); }

/* Mobile Sticky CTA */
.mobile-sticky-cta { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; padding: var(--sp-md) var(--sp-lg); background: rgba(240,244,255,0.95); backdrop-filter: blur(20px); border-top: 1px solid var(--border); }
:root.dark-theme .mobile-sticky-cta { background: rgba(7,9,26,0.95); }
.mobile-sticky-cta .btn { width: 100%; }

/* ─────────────────────────────────────────────────────────────
   23. BREADCRUMBS
───────────────────────────────────────────────────────────── */
.rq-breadcrumbs ol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; font-size: 0.8rem; color: var(--text-muted); }
.rq-breadcrumbs li:not(:last-child)::after { content: '›'; margin-left: 8px; color: var(--text-faint); }
.rq-breadcrumbs a {
  color: var(--primary) !important;
  text-decoration: underline !important;
}
.rq-breadcrumbs a:hover {
  color: var(--accent) !important;
}
.rq-breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────
   24. MISC COMPONENTS
───────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-subtle); margin-block: var(--sp-xl); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin-inline: auto; }
.empty-state { text-align: center; padding: var(--sp-3xl); color: var(--text-muted); }
.empty-state-icon { font-size: 4rem; margin-bottom: var(--sp-md); }

.rq-toast { position: fixed; top: calc(var(--nav-height) + var(--sp-md)); right: var(--sp-lg); z-index: 200; background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-md) var(--sp-lg); font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: slideInUp 0.3s ease; max-width: 320px; }
.rq-toast.success { border-color: var(--success); color: var(--success); }
.rq-toast.error   { border-color: var(--danger);  color: var(--danger);  }

.sidebar-section { background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-lg); }
.sidebar-section-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: var(--sp-md); }

.rq-pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-xl);
  width: 100%;
}
.rq-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.rq-pagination ul.page-numbers li {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rq-pagination a, 
.rq-pagination span,
.rq-pagination ul.page-numbers a,
.rq-pagination ul.page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--t-fast);
  color: var(--text-muted);
  text-decoration: none;
}
.rq-pagination a:hover,
.rq-pagination ul.page-numbers a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-2);
}
.rq-pagination .current,
.rq-pagination ul.page-numbers .current {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 163, 114, 0.3);
}

#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ─────────────────────────────────────────────────────────────
   25. ANIMATIONS
───────────────────────────────────────────────────────────── */
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown  { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn     { from { opacity: 0; transform: scale(0.85) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes bounceIn    { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes flicker     { 0%, 100% { transform: scale(1) rotate(-2deg); } 25% { transform: scale(1.06) rotate(2deg); } 50% { transform: scale(0.97) rotate(-1deg); } 75% { transform: scale(1.03) rotate(1deg); } }
@keyframes pulse-dot   { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: 0.6; } }
@keyframes float       { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes shimmer     { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }
@keyframes xpFlash     { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); color: var(--warning); } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────────────────────
   26. SINGLE RIDDLE PAGE
───────────────────────────────────────────────────────────── */
.single-riddle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-xl); padding-block: var(--sp-2xl); align-items: start; }
.riddle-experience-card { background: var(--surface); backdrop-filter: blur(24px); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--sp-2xl); box-shadow: var(--shadow-xl), 0 0 60px rgba(124,111,247,0.06); }
.riddle-sidebar { display: flex; flex-direction: column; gap: var(--sp-lg); position: sticky; top: calc(var(--nav-height) + var(--sp-lg)); }
.related-riddle-item { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) 0; border-bottom: 1px solid var(--border-subtle); text-decoration: none; color: inherit; transition: color var(--t-fast); }
.related-riddle-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-riddle-item:hover { color: var(--primary); }

/* ─────────────────────────────────────────────────────────────
   27. HOW IT WORKS
───────────────────────────────────────────────────────────── */
.step-card { text-align: center; padding: var(--sp-xl); }
.step-number { width: 56px; height: 56px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 900; color: #fff; margin-inline: auto; margin-bottom: var(--sp-lg); box-shadow: var(--glow-primary); }

/* ─────────────────────────────────────────────────────────────
   28. RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
  .header-streak, .header-xp { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-card-featured { grid-template-columns: 1fr; }
  .post-card-featured .post-card-thumb { height: 220px; }
  .single-riddle-layout { grid-template-columns: 1fr; }
  .riddle-sidebar { position: static; }
  .single-post-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sp-2xl: 48px; --sp-3xl: 64px; }
  .container { padding-inline: var(--sp-md); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding-block: 64px 48px; }
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; }
  .hero-stats { flex-direction: column; gap: var(--sp-lg); }
  .hero-divider { display: none; }
  .riddle-card-main { padding: var(--sp-lg); }
  .answer-input-group { flex-direction: column; }
  .answer-input-group .btn { width: 100%; }
  .leaderboard-row { grid-template-columns: 50px 1fr 80px; }
  .leaderboard-row > :last-child { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .social-proof-inner { flex-direction: column; gap: var(--sp-lg); }
  .mobile-sticky-cta { display: block; }
  body { padding-bottom: 80px; }
  .section { padding-block: var(--sp-xl); }
  .section--sm { padding-block: var(--sp-lg); }
}

/* ─────────────────────────────────────────────────────────────
   29. SCROLL TO TOP BUTTON
───────────────────────────────────────────────────────────── */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--primary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all var(--t-normal);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.scroll-to-top:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 90px;
    right: 20px;
  }
}

/* ─────────────────────────────────────────────────────────────
   30. LOAD MORE WRAPPER
───────────────────────────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-2xl);
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   31. FILTER CATEGORY DROPDOWN
───────────────────────────────────────────────────────────── */
.filter-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.filter-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 8px 20px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t-normal);
  min-height: 44px;
  font-family: inherit;
}

.filter-dropdown-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 163, 114, 0.15);
}

.dropdown-chevron {
  transition: transform var(--t-normal);
  color: var(--text-muted);
  display: inline-block;
}

.filter-dropdown-wrap:hover .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.filter-dropdown-content.filter-group {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-top: 8px;
}

/* Non-flicker bridge */
.filter-dropdown-content.filter-group::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
}

/* Show dropdown on hover */
.filter-dropdown-wrap:hover .filter-dropdown-content.filter-group {
  display: flex;
}

/* Adjust filter buttons inside the dropdown */
.filter-dropdown-content.filter-group .filter-btn {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  border-radius: var(--r-sm);
  padding: 8px 16px;
  min-height: auto;
}

.filter-dropdown-content.filter-group .filter-btn.active {
  background: var(--gradient-primary);
  color: #fff;
}

/* TOC styles */
.toc-link {
  transition: all var(--t-fast) ease;
}
.toc-link:hover {
  color: var(--primary) !important;
  transform: translateX(3px);
}

/* Load More center centering strictly */
.load-more-wrap {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin-block: var(--sp-2xl) !important;
  clear: both;
}
.load-more-wrap button {
  margin-inline: auto !important;
  display: inline-flex !important;
}

/* ============================================================
   PHASE 2 - ADDITIONAL COMPONENT STYLES
   ============================================================ */

/* Mobile Header Action Button Hiding */
@media (max-width: 1200px) {
  #header-login-btn,
  #header-signup-btn,
  #header-profile-btn {
    display: none !important;
  }
}

/* Honor X9d & Mobile Spacing Enhancements */
@media (max-width: 480px) {
  :root {
    --sp-xl: 24px;
    --sp-lg: 16px;
    --sp-md: 12px;
  }
  .container {
    padding-inline: 12px !important;
  }
  .post-content,
  .xp-bar-container,
  .streak-container,
  .sidebar-section,
  .post-author-card,
  .riddle-experience-card,
  .riddle-card-main,
  #comments {
    padding: 16px 12px !important;
    border-radius: var(--r-md) !important;
  }
  .btn {
    padding: 12px 20px;
    font-size: 0.88rem;
    min-height: 40px;
  }
  .logo-text {
    font-size: 1.1rem;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
}

/* Pagination Wrap Fix (One line) */
.rq-pagination ul.page-numbers {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  max-width: 100% !important;
  padding: 4px !important;
  scrollbar-width: none !important; /* Firefox */
}
.rq-pagination ul.page-numbers::-webkit-scrollbar {
  display: none !important; /* Safari and Chrome */
}
.rq-pagination ul.page-numbers li,
.rq-pagination a, 
.rq-pagination span,
.rq-pagination ul.page-numbers a,
.rq-pagination ul.page-numbers span {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Social Sharing Buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all var(--t-normal);
  cursor: pointer;
}
.share-btn svg {
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.share-btn:hover svg {
  transform: scale(1.15);
}
.share-btn--twitter:hover {
  background: rgba(29, 161, 242, 0.1);
  border-color: rgba(29, 161, 242, 0.4);
  color: #1da1f2;
}
.share-btn--facebook:hover {
  background: rgba(24, 119, 242, 0.1);
  border-color: rgba(24, 119, 242, 0.4);
  color: #1877f2;
}
.share-btn--pinterest:hover {
  background: rgba(230, 0, 35, 0.1);
  border-color: rgba(230, 0, 35, 0.4);
  color: #e60023;
}
.share-btn--copy:hover {
  background: var(--gradient-primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* Author Bio Premium Typography */
.post-author-card .author-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}
.post-author-card .author-bio {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Premium Comments Styling */
#comments {
  margin-top: var(--sp-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  backdrop-filter: blur(20px);
}
.comment-body-card {
  transition: transform var(--t-normal), border-color var(--t-normal);
}
.comment-body-card:hover {
  border-color: rgba(0, 163, 114, 0.3) !important;
}
.comment-reply-link {
  text-decoration: none !important;
  color: var(--primary) !important;
  font-weight: 700;
  font-size: 0.78rem;
  transition: color var(--t-fast);
}
.comment-reply-link:hover {
  color: var(--accent) !important;
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: var(--sp-xl);
}
.comment-form .comment-form-author,
.comment-form .comment-form-email {
  margin: 0;
}
@media (min-width: 600px) {
  .comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .comment-form .comment-form-comment,
  .comment-form .form-submit,
  .comment-form .comment-notes,
  .comment-form .logged-in-as {
    grid-column: span 2;
  }
}
.comment-form textarea.answer-input {
  min-height: 120px;
  resize: vertical;
}

/* Riddle Card Enhancements */
.riddle-card {
  position: relative;
}
.riddle-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color var(--t-normal);
}
.riddle-card:hover::after {
  border-color: rgba(0, 163, 114, 0.25);
}
.riddle-card:hover {
  transform: translateY(-6px) scale(1.01);
}

/* XP Badge White-space Wrap Prevention */
.riddle-card-xp,
.riddle-xp-reward,
.header-xp,
.reward-xp-badge,
.xp-amount {
  white-space: nowrap !important;
}

/* Horizontal category scroll bar on mobile/tablet */
@media (max-width: 1200px) {
  .filter-tabs {
    display: flex !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    width: 100% !important;
    padding-bottom: 8px !important;
    scrollbar-width: none !important;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .filter-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
  .filter-btn {
    flex-shrink: 0 !important;
  }
}

/* Layout track and element shrinking to prevent overflow */
.single-post-layout > *,
.single-riddle-layout > *,
#blog-main,
#blog-sidebar {
  min-width: 0 !important;
}
.options-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Featured Post Card mobile optimization */
@media (max-width: 768px) {
  .post-card-featured .post-card-thumb {
    min-height: 180px !important;
    height: 180px !important;
  }
  .post-card-featured .post-card-body {
    padding: var(--sp-md) !important;
  }
  .post-card-featured .post-card-title {
    font-size: 1.25rem !important;
  }
}

/* ============================================================
   PHASE 3 - BUGS AND PREMIUM LAYOUT CORRECTIONS
   ============================================================ */

/* 1. Mobile Header Clutter - Strong Hiding */
@media (max-width: 1200px) {
  #header-login-btn,
  #header-signup-btn,
  #header-profile-btn,
  .header-streak,
  .header-xp {
    display: none !important;
  }
}

/* 2. Desktop Sidebar Overlap & Grid Overflow prevention */
.single-post-layout,
.single-riddle-layout {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 3. Mobile Pagination wrapping in a single horizontal swipe row */
@media (max-width: 768px) {
  .rq-pagination {
    display: block !important;
    text-align: center !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding-block: var(--sp-sm) !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }
  .rq-pagination ul.page-numbers {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .rq-pagination ul.page-numbers li {
    display: inline-block !important;
    flex-shrink: 0 !important;
  }
  .rq-pagination ul.page-numbers a,
  .rq-pagination ul.page-numbers span {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

/* 4. Breadcrumb Styling for Rank Math and Fallback Breadcrumbs */
.rq-breadcrumbs a,
.rank-math-breadcrumb a {
  color: var(--primary) !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
}
.rq-breadcrumbs a:hover,
.rank-math-breadcrumb a:hover {
  color: var(--accent) !important;
}
.rq-breadcrumbs span,
.rank-math-breadcrumb span {
  color: var(--text-muted) !important;
}

/* 5. Centering images inside articles */
.post-content img,
.post-content figure img,
.entry-content img,
.entry-content figure img {
  display: block !important;
  margin-inline: auto !important;
  float: none !important;
  max-width: 100% !important;
  height: auto !important;
}
.post-content figure,
.entry-content figure {
  display: block !important;
  margin-inline: auto !important;
  text-align: center !important;
}

/* 6. Author Bio normal weight - bio text must NOT be bold */
.post-author-card .author-bio,
.post-author-card .author-bio strong,
.post-author-card .author-bio b,
.post-author-card .author-bio em {
  font-weight: 400 !important;
}
/* Author NAME stays bold */
.post-author-card .author-name {
  font-weight: 700 !important;
}

/* 7. More Riddles Collection link styling override */
.rq-more-riddles-heading,
.rq-more-riddles-heading strong,
.rq-more-riddles-heading b,
.rq-more-riddles-link,
.rq-more-riddles-link strong,
.rq-more-riddles-link b {
  font-weight: 400 !important;
}

/* ============================================================
   PHASE 4 - ADDITIONAL FIXES
   ============================================================ */

/* 8. Footer bold fix in articles — post-content strong/bold/headings
   must NOT leak into the site footer or other elements outside article */
.site-footer,
.site-footer .footer-links,
.site-footer .footer-links a,
.site-footer .footer-brand p,
.site-footer .footer-heading,
.site-footer .footer-bottom,
.site-footer p,
.site-footer a {
  font-weight: normal !important;
  font-style: normal !important;
}
.site-footer .footer-heading {
  font-weight: 700 !important; /* keep section headings bold */
}
/* Ensure .post-content strong/b stays INSIDE the post card only */
.post-content strong,
.post-content b {
  font-weight: 700;
}

/* 9. Image figcaption centered under images in articles */
.post-content figcaption,
.post-content .wp-element-caption,
.post-content .wp-caption-text,
.entry-content figcaption,
.entry-content .wp-element-caption,
.entry-content .wp-caption-text {
  text-align: center !important;
  display: block !important;
  margin-inline: auto !important;
  font-size: 0.82rem !important;
  color: var(--text-faint) !important;
  font-style: italic !important;
  margin-top: 6px !important;
  padding: 0 !important;
  max-width: 90% !important;
}
.post-content figure,
.post-content .wp-caption,
.entry-content figure,
.entry-content .wp-caption {
  display: block !important;
  margin-inline: auto !important;
  text-align: center !important;
  max-width: 100% !important;
}


/* 10. Mobile sticky-cta - the PHP conditional in footer.php now handles
   showing TOC button on single posts vs. Play button elsewhere.
   Keep the body.single* rule as a safety fallback for the Play button. */
body.single-post #mobile-sticky-cta,
body.single #mobile-sticky-cta {
  display: none !important;
}

/* ============================================================
   MOBILE TOC STICKY BUTTON + SLIDE-UP PANEL
   (shown only on single post pages via PHP conditional)
   ============================================================ */

/* The .mobile-toc-sticky-wrap inherits .mobile-sticky-cta base styles
   (position:fixed, bottom:0, left:0, right:0, z-index:90, etc.)
   Media query at line ~1269 already enables .mobile-sticky-cta on small screens */

/* Slide-up overlay panel */
.mobile-toc-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: flex-end;
}
.mobile-toc-panel.is-open {
  display: flex;
}

/* Dark backdrop */
.mobile-toc-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

/* Inner slide-up sheet */
.mobile-toc-panel-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--surface);
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  padding: var(--sp-lg);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
:root.dark-theme .mobile-toc-panel-inner {
  background: var(--surface-solid);
}
.mobile-toc-panel.is-open .mobile-toc-panel-inner {
  transform: translateY(0);
}

/* Panel header bar */
.mobile-toc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-toc-close-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all var(--t-fast);
}
.mobile-toc-close-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* TOC link items inside the panel */
#mobile-toc-panel-list li a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1.3;
}
#mobile-toc-panel-list li a:hover,
#mobile-toc-panel-list li a:active {
  background: rgba(0, 163, 114, 0.1);
  color: var(--primary);
}

/* Arrow rotates when panel is open */
.mobile-toc-sticky-wrap.is-open #toc-btn-arrow {
  transform: rotate(180deg);
}

/* Desktop: hide the mobile TOC button entirely */
@media (min-width: 1025px) {
  .mobile-toc-sticky-wrap,
  .mobile-toc-panel {
    display: none !important;
  }
}

/* 11. Desktop sidebar TOC toggle (≤1024px wide, but the
   sticky panel replaces this on actual phone widths) */
.toc-mobile-toggle {
  display: none;
}
@media (min-width: 769px) and (max-width: 1024px) {
  .toc-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    margin-bottom: var(--sp-md);
  }
  .toc-mobile-toggle .toc-toggle-arrow {
    margin-left: auto;
    transition: transform 0.25s ease;
  }
  .toc-mobile-toggle.is-open .toc-toggle-arrow {
    transform: rotate(180deg);
  }
  .toc-nav-mobile {
    display: none;
    overflow: hidden;
  }
  .toc-nav-mobile.is-open {
    display: block;
  }
}

/* Performance: content-visibility for offscreen footer */
@media (min-width: 769px) {
  .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 300px;
  }
}

/* ─────────────────────────────────────────────────────────────
   For Teachers Section — Mobile Responsive
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #teachers-section > .container > div,
  section[aria-labelledby="teachers-heading"] .container > div {
    grid-template-columns: 1fr !important;
  }
}

/* Teacher category link hover */
a[id^="teacher-cat-"]:hover {
  border-color: var(--primary) !important;
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────────────────────
   Newsletter Section — Mobile Responsive
───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #rq-newsletter-form {
    flex-direction: column !important;
  }
  #rq-newsletter-form input[type="email"] {
    border-radius: var(--r-lg) !important;
    width: 100%;
  }
  #newsletter-submit-btn {
    border-radius: var(--r-lg) !important;
    width: 100%;
    text-align: center;
  }
}

/* ─────────────────────────────────────────────────────────────
   Riddle Embed Card (inside blog articles)
───────────────────────────────────────────────────────────── */
.riddle-embed-card {
  transition: box-shadow 0.2s;
}
.riddle-embed-card:hover {
  box-shadow: var(--shadow-lg);
}
.riddle-embed-card .option-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────
   Quick Answer Box (riddle pages)
───────────────────────────────────────────────────────────── */
.quick-answer-box {
  animation: fadeInUp 0.4s ease;
}

/* ─────────────────────────────────────────────────────────────
   Reading Progress Bar
───────────────────────────────────────────────────────────── */
#rq-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ─────────────────────────────────────────────────────────────
   Homepage Random Challenge button card fix
───────────────────────────────────────────────────────────── */
button#rq-random-visual-btn {
  color: inherit;
  font-family: inherit;
}
button#rq-random-visual-btn:hover {
  border-color: var(--warning);
  box-shadow: var(--shadow-md);
}

/* Quick Answer Details Accordion */
.quick-answer-box summary::-webkit-details-marker {
  display: none !important;
}
.quick-answer-box summary {
  list-style: none !important;
}
.quick-answer-box details[open] summary svg#quick-answer-arrow {
  transform: rotate(180deg);
}


