/* ================================
   QUIZREALM DESIGN SYSTEM v1
   Global tokens + components
   ================================ */
/* * © 2025 QuizRealm Inc. - All Rights Reserved.
 * * UNAUTHORIZED COPYING OF THIS FILE, VIA ANY MEDIUM, IS STRICTLY PROHIBITED.
 * PROPRIETARY AND CONFIDENTIAL.
 * * Written by [Your Name/Handle], December 2025.
 */
 
/* ==== TOKENS / ROOT VARIABLES ==== */
:root {
  /* Colors */
  --qr-bg: #020617;
  --qr-bg-soft: #0b1120;
  --qr-bg-card: #111827;
  --qr-bg-card-alt: #020617;

  --qr-border-soft: rgba(148, 163, 184, 0.25);
  --qr-border-strong: rgba(148, 163, 184, 0.6);

  --qr-text-main: #e5e7eb;
  --qr-text-muted: #9ca3af;
  --qr-text-soft: #6b7280;

  --qr-primary: #eab308;
  --qr-primary-soft: rgba(234, 179, 8, 0.16);
  --qr-primary-strong: #f97316;

  --qr-accent: #38bdf8;
  --qr-accent-soft: rgba(56, 189, 248, 0.2);

  --qr-success: #22c55e;
  --qr-success-soft: rgba(34, 197, 94, 0.18);

  --qr-danger: #ef4444;
  --qr-danger-soft: rgba(239, 68, 68, 0.18);

  /* Radii */
  --qr-radius-lg: 24px;
  --qr-radius-md: 18px;
  --qr-radius-sm: 12px;
  --qr-radius-pill: 999px;

  /* Spacing scale */
  --qr-space-xs: 4px;
  --qr-space-sm: 8px;
  --qr-space-md: 12px;
  --qr-space-lg: 16px;
  --qr-space-xl: 24px;

  /* Shadows */
  --qr-shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.55);
  --qr-shadow-strong: 0 30px 90px rgba(0, 0, 0, 0.95);
}

.option-5050-disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}


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

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at top, #1f2937, var(--qr-bg));
  color: var(--qr-text-main);
  min-height: 100vh;
}

/* Wrapper */
.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;

  opacity: 0;
  transform: translateY(8px);
  animation: qr-fade-in 0.5s ease-out forwards;
}

@keyframes qr-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth transitions on cards / quiz boxes */
.card,
.category-card,
.mode-card,
.quiz-box,
.results-box {
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    border-color 0.2s ease-out,
    background 0.2s ease-out;
}
/* === QUIZ LOADING OVERLAY === */
.quiz-container {
  position: relative;
}

.qr-loading-overlay {
  position: absolute;
  inset: 0;
  display: none; /* shown via JS */
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(15,23,42,0.92), rgba(3,7,18,0.96));
  backdrop-filter: blur(6px);
  z-index: 30;
}

.qr-loading-card {
  background: rgba(15,23,42,0.98);
  border-radius: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 24px 70px rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e5e7eb;
}

.qr-loading-spinner {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 3px solid rgba(148,163,184,0.5);
  border-top-color: #38bdf8;
  animation: qrSpinner 0.8s linear infinite;
}

.qr-loading-text {
  font-size: 12px;
  color: #9ca3af;
}

@keyframes qrSpinner {
  to { transform: rotate(360deg); }
}

/* Hover lift for cards + primary buttons */
.card:hover,
.category-card:hover,
.mode-card:hover,
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Answer reveal animations */
.answer-btn {
  position: relative;
  overflow: hidden;
  transition:
    background 0.2s ease-out,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.answer-btn.correct {
  animation: qr-correct-pop 0.35s ease-out;
}

.answer-btn.wrong {
  animation: qr-wrong-shake 0.25s ease-out;
}

@keyframes qr-correct-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes qr-wrong-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Generic fullscreen overlay (XP, achievements, streak, minigame, etc.) */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0,255,255,0.12), transparent),
              rgba(5, 7, 20, 0.78);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* Generic overlay card */
.qr-overlay-card {
  background: rgba(15, 20, 40, 0.95);
  border-radius: var(--qr-radius-lg);
  padding: 22px 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.2);
}

/* Pill styles (streak, mini labels, etc.) */
.qr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--qr-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  background: linear-gradient(135deg, rgba(0, 255, 180, 0.18), rgba(0, 120, 255, 0.12));
}

.qr-pill-streak-hot {
  border-color: rgba(255, 174, 0, 0.9);
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.25), rgba(255, 80, 0, 0.18));
}

/* ============ HEADER / NAV ============ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--qr-primary);
}

.logo span {
  color: var(--qr-accent);
}

.nav-links a {
  margin-left: 16px;
  text-decoration: none;
  color: #cbd5f5;
  font-size: 14px;
  opacity: 0.85;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border 0.15s ease;
  padding: 4px 0;
}

.nav-links a:hover {
  color: var(--qr-primary);
  opacity: 1;
}

.nav-links a.active {
  border-radius: var(--qr-radius-pill);
  padding-inline: 10px;
  background: radial-gradient(circle at top, rgba(56,189,248,0.2), transparent 70%);
  border: 1px solid rgba(56,189,248,0.6);
}

/* ============ CARDS ============ */
.card {
  background: linear-gradient(135deg, var(--qr-bg-card), var(--qr-bg-card-alt));
  border-radius: var(--qr-radius-md);
  padding: 20px 20px 24px;
  box-shadow: var(--qr-shadow-soft);
  border: 1px solid var(--qr-border-soft);
}

.card-header {
  margin-bottom: 16px;
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 14px;
  color: var(--qr-text-muted);
}

/* ============ BUTTONS ============ */
.btn {
  border: none;
  border-radius: var(--qr-radius-pill);
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, opacity 0.1s ease;
  text-decoration: none;
}

/* Sizes */
.btn-lg {
  padding: 12px 22px;
  font-size: 16px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--qr-primary), var(--qr-primary-strong));
  color: #0b1120;
  box-shadow: 0 10px 25px rgba(234, 179, 8, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(234, 179, 8, 0.65);
}

.btn-ghost {
  background: transparent;
  color: var(--qr-text-main);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* New: success / danger for minigames etc. */
.btn-success {
  background: linear-gradient(135deg, var(--qr-success), #bbf7d0);
  color: #052e16;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.45);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.65);
}

.btn-danger {
  background: linear-gradient(135deg, var(--qr-danger), #fecaca);
  color: #7f1d1d;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.45);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.65);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* ============ POWER-UPS ============ */
.powerups-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.power-btn {
  position: relative;                 /* NEW: anchor pseudo-elements */
  flex: 1;
  padding: 8px 0;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,0.6);
  background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.95));
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 28px rgba(8,47,73,0.7);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  overflow: hidden;                   /* NEW: keep any glow inside the button */
}


.power-btn:hover:not(.power-btn-disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(56,189,248,0.8);
}

.power-btn-disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}


/* Turn off glow sweep + tiny dot on power-ups (fix gold glitch) */
.power-btn::before,
.power-btn::after {
  content: none !important;
}


/* Hover state */
.power-btn:hover:not(.power-btn-disabled):not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(234,179,8,0.9);
  box-shadow: 0 10px 28px rgba(0,0,0,0.9);
  background: radial-gradient(circle at top, rgba(234,179,8,0.18), rgba(15,23,42,0.98));
}

.power-btn:hover::before {
  opacity: 1;
  transform: translateX(0%);
}

/* Clicked */
.power-btn:active:not(.power-btn-disabled):not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 10px rgba(0,0,0,0.9);
}


.power-btn:not(.power-btn-disabled):not(:disabled) {
  animation: none;
}


@keyframes powerIdle {
  0%   { box-shadow: 0 0 0 rgba(234,179,8,0); }
  60%  { box-shadow: 0 0 16px rgba(56,189,248,0.45); }
  100% { box-shadow: 0 0 0 rgba(234,179,8,0); }
}

/* Hint highlight for correct option */
.option-button.hint {
  box-shadow: 0 0 18px rgba(56,189,248,0.8);
  border-color: rgba(56,189,248,0.95);
}

/* ============ HERO (HOME) ============ */
/* (Home-specific background orbs live in index.html inline CSS) */

/* ============ CATEGORY LAYOUT ============ */
/* ============ CATEGORY LAYOUT ============ */

.category-section {
    margin-top: 24px;
}

.category-section:first-of-type {
    margin-top: 8px;
}

/* ============================
   UPGRADED CATEGORY SECTION HEADERS
   ============================ */

/* ============ CATEGORY SECTION HEADERS ============ */

.section-title {
    position: relative;
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
    padding-bottom: 4px;
}

/* animated glow underline */
.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #eab308, #22c55e);
    box-shadow: 0 0 14px rgba(56,189,248,0.7);
    animation: sectionUnderlinePulse 2.4s ease-in-out infinite;
}

@keyframes sectionUnderlinePulse {
    0%   { transform: scaleX(0.6); opacity: 0.7; }
    40%  { transform: scaleX(1);   opacity: 1;   }
    100% { transform: scaleX(0.6); opacity: 0.7; }
}

.section-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
    line-height: 1.35;
    max-width: 460px;
}


.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

/* MAIN CATEGORY CARD – clean & simple */

.category-card {
    position: relative;
    background: radial-gradient(circle at top, rgba(15,23,42,0.97), #020617);
    border-radius: 20px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(30,64,175,0.65);
    text-decoration: none;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    margin-bottom: 6px;              /* so hover doesn’t overlap others */
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        filter 0.16s ease;
}

.category-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(56,189,248,0.18), transparent 55%);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.category-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(234,179,8,0.9);
    box-shadow: 0 18px 40px rgba(0,0,0,0.85);
    filter: brightness(1.03);
}

.category-card:hover::before {
    opacity: 1;
}

/* Title row: icon + name */

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.category-title span:first-child {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(2,6,23,1));
}

.category-title span:last-child {
    font-size: 15px;
    font-weight: 600;
}

/* Short descriptive line under title */

.category-card-simple-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1px;
    margin-bottom: 4px;
}

/* Small pill showing type (TV Show, Movies, Logic, etc.) */

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.5);
    color: #cbd5f5;
}

/* Bottom row: mode + quick label / HOT */

.category-card-footer {
    margin-top: 8px;
    font-size: 10px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-card-footer span:last-child {
    opacity: 0.9;
}

/* HOT badge used in “Hot right now” section */

.category-badge-hot {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(248,250,252,0.06);
    border: 1px solid rgba(234,179,8,0.9);
    color: #fde68a;
}

/* ============ CATEGORY DIVIDERS ============ */

.category-divider {
    margin: 18px 0 14px;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(15,23,42,0),
        rgba(148,163,184,0.55),
        rgba(15,23,42,0)
    );
    opacity: 0.9;
}
/* ============ HOT & TRENDING HERO ============ */

.category-hero {
    margin-bottom: 20px;
    padding: 16px 16px 14px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top left, rgba(56,189,248,0.25), transparent 65%),
        radial-gradient(circle at bottom right, rgba(234,179,8,0.25), transparent 70%),
        rgba(15,23,42,0.98);
    border: 1px solid rgba(148,163,184,0.6);
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
    gap: 14px;
    align-items: center;
}

@media (max-width: 720px) {
    .category-hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

.category-hero-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-hero-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(56,189,248,0.7);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-hero-badge span.dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: radial-gradient(circle, #22c55e, #eab308);
    box-shadow: 0 0 10px rgba(34,197,94,0.7);
}

.category-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #f9fafb;
}

.category-hero-text {
    font-size: 13px;
    color: #cbd5f5;
}

.category-hero-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}

.category-hero-tag {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    background: rgba(15,23,42,0.94);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.category-hero-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.75);
    border-color: rgba(234,179,8,0.9);
}

.category-hero-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.category-hero-right-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.category-hero-cta {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #e5e7eb;
    cursor: pointer;
    opacity: 0.9;
}

.category-hero-cta:hover {
    opacity: 1;
}


/* Mobile tweaks */

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .category-card {
        padding: 12px 11px 10px;
        border-radius: 18px;
    }

    .category-title span:last-child {
        font-size: 14px;
    }
}


/* ============ ROW CARDS (HOME SECTIONS) ============ */
.home-section {
  margin-top: 4px;
}

.home-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.home-row-title {
  font-size: 14px;
  font-weight: 600;
}

.home-row-subtitle {
  font-size: 11px;
  color: var(--qr-text-muted);
}

.home-row-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 6px 8px 6px; /* margin/padding to avoid overlap on hover */
  scrollbar-width: thin;
}

.row-card {
  flex: 0 0 160px;
  border-radius: var(--qr-radius-md);
  background: radial-gradient(circle at top, rgba(15,23,42,0.97), var(--qr-bg));
  border: 1px solid rgba(31,41,55,0.95);
  padding: 11px 10px 9px;
  text-decoration: none;
  color: var(--qr-text-main);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.row-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(56,189,248,0.2), transparent 55%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.row-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(234,179,8,0.95);
  box-shadow: 0 18px 40px rgba(0,0,0,0.95);
  background: radial-gradient(circle at top, rgba(15,23,42,1), var(--qr-bg));
}

.row-card:hover::before {
  opacity: 1;
}

.row-card-top {
  font-size: 13px;
  font-weight: 600;
}

.row-card-tag {
  font-size: 11px;
  color: var(--qr-text-muted);
}

.row-card-meta {
  margin-top: 2px;
  font-size: 10px;
  color: var(--qr-text-soft);
}

.row-card-play {
  position: absolute;
  right: 8px;
  bottom: 7px;
  font-size: 10px;
  opacity: 0.9;
}

/* Goals styling (uses row-card) */
.goal-card {
  position: relative;
}

.goal-card-done {
  border-color: var(--qr-success);
}

.goal-card-done .row-card-meta {
  color: var(--qr-success);
}

.goal-card-status {
  font-size: 10px;
  color: var(--qr-text-muted);
}

/* ============ QUIZ PAGE ============ */
.quiz-container {
  margin-top: 8px;
}

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

#quizProgressText {
  padding: 6px 12px;
  border-radius: 999px;
  background: radial-gradient(circle at top, rgba(56,189,248,0.25), rgba(15,23,42,1));
  border: 1px solid rgba(56,189,248,0.9);
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#quizProgressText .qp-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148,163,184,0.9);
}

.timer-warning {
  color: #fecaca !important;
  border-color: rgba(248,113,113,0.9) !important;
  box-shadow: 0 0 12px rgba(248,113,113,0.7);
}

.quiz-meta {
  font-size: 12px;
  color: var(--qr-text-muted);
}

.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: var(--qr-radius-pill);
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--qr-accent), var(--qr-success));
  transition: width 0.25s ease;
}

.question-text {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.7));
  border: 1px solid rgba(148,163,184,0.5);
  box-shadow: 0 12px 30px rgba(15,23,42,0.9);
}


.options {
  list-style: none;
}

.option-item {
  margin-bottom: 8px;
}

.option-button {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--qr-radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  color: var(--qr-text-main);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}

.option-button:hover {
  border-color: var(--qr-accent);
  transform: translateY(-1px);
}

.option-button.selected {
  border-color: var(--qr-primary);
  background: var(--qr-primary-soft);
}

/* Correct / wrong answer highlights */
.option-button.correct {
  border-color: var(--qr-success);
  background: var(--qr-success-soft);
}

.option-button.wrong {
  border-color: var(--qr-danger);
  background: var(--qr-danger-soft);
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}

.quiz-status {
  font-size: 12px;
  color: #f97316;
}

/* ============ RESULTS / REVIEW ============ */
.results {
  text-align: center;
  padding: 16px 8px 8px;
}

.results-score {
  font-size: 20px;
  margin-bottom: 4px;
}

.results-detail {
  font-size: 13px;
  color: var(--qr-text-muted);
}

/* Results pop-in animation */
.results-animate {
  animation: resultsPop 0.45s ease-out;
}
.results {
    padding: 16px 0 8px;
    text-align: left;
}

.results-summary {
    text-align: center;
    margin-bottom: 12px;
}

.results-score {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.results-detail {
    font-size: 13px;
    color: #9ca3af;
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.results-review {
    margin-top: 4px;
}

/* Optional: nicer per-question blocks if you want */
.results-review > div {
    margin-top: 10px;
    padding: 8px 10px;
    border-top: 1px solid rgba(148,163,184,0.3);
}


@keyframes resultsPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.quiz-status {
  font-size: 15px;
  font-weight: 600;
  min-height: 22px;
  margin-top: 6px;
  color: #e5e7eb;
}

.quiz-status-pop {
  animation: quizStatusPop 0.35s ease-out;
}

@keyframes quizStatusPop {
  0%   { transform: scale(0.9) translateY(2px); opacity: 0; }
  60%  { transform: scale(1.05) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}


/* ============ FOOTER ============ */
.footer {
  margin-top: 24px;
  font-size: 11px;
  text-align: center;
  color: var(--qr-text-soft);
}

/* ============ ACHIEVEMENT POPUP ============ */
.achievements-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15,23,42,0.96), rgba(3,7,18,0.96));
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  animation: overlayFadeIn 0.25s ease-out forwards;
}

.achievements-popup {
  position: relative;
  width: min(520px, 96vw);
  background: radial-gradient(circle at top, rgba(56,189,248,0.24), rgba(15,23,42,0.98));
  border-radius: var(--qr-radius-lg);
  border: 1px solid rgba(148,163,184,0.8);
  box-shadow: 0 40px 100px rgba(0,0,0,0.98);
  padding: 18px 18px 16px;
  color: var(--qr-text-main);
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  overflow: hidden;
  animation: popupSlideIn 0.28s ease-out forwards;
}

.achievement-sparkles {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.9;
}

.achievement-sparkles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: radial-gradient(circle, #facc15 0, #f97316 40%, transparent 70%);
  opacity: 0;
  animation: sparkleFloat 1.6s ease-out infinite;
}

.achievement-sparkles span:nth-child(1) { top: 14%; left: 18%; animation-delay: 0s; }
.achievement-sparkles span:nth-child(2) { top: 22%; right: 12%; animation-delay: 0.25s; }
.achievement-sparkles span:nth-child(3) { bottom: 18%; left: 24%; animation-delay: 0.5s; }
.achievement-sparkles span:nth-child(4) { bottom: 10%; right: 20%; animation-delay: 0.75s; }
.achievement-sparkles span:nth-child(5) { top: 50%; left: 6%; animation-delay: 1s; }
.achievement-sparkles span:nth-child(6) { top: 46%; right: 4%; animation-delay: 1.25s; }

.achievements-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.achievements-popup-title {
  font-size: 16px;
  font-weight: 600;
}

.achievements-popup-subtitle {
  font-size: 12px;
  color: var(--qr-text-muted);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.achievements-list {
  margin: 0;
  padding: 0;
  list-style: none;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 14px;
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(55,65,81,0.95);
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(6px);
  animation: achievementItemIn 0.24s ease-out forwards;
}

.achievement-item-title {
  font-size: 13px;
  font-weight: 500;
}

.achievement-item-desc {
  font-size: 11px;
  color: var(--qr-text-muted);
}

.achievements-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--qr-text-muted);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.achievements-popup-footer button {
  font-size: 11px;
  padding: 4px 12px;
}

/* Animations */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupSlideIn {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes sparkleFloat {
  0%   { opacity: 0; transform: translateY(4px) scale(0.6); }
  25%  { opacity: 1; transform: translateY(-2px) scale(1); }
  70%  { opacity: 0.8; transform: translateY(-8px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.7); }
}

/* ============ NICKNAME MODAL ============ */
.nickname-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,7,18,0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.nickname-modal {
  width: min(360px, 92vw);
  background: radial-gradient(circle at top, rgba(56,189,248,0.25), rgba(15,23,42,0.98));
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 30px 80px rgba(0,0,0,0.96);
  padding: 16px 16px 14px;
  color: var(--qr-text-main);
}

.nickname-modal h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.nickname-modal p {
  font-size: 12px;
  color: var(--qr-text-muted);
  margin-bottom: 10px;
}

.nickname-modal input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.96);
  color: var(--qr-text-main);
  font-size: 13px;
  margin-bottom: 10px;
}

/* ============ XP / RESULT TOAST ============ */
.xp-toast-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15,23,42,0.92), rgba(3,7,18,0.96));
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  animation: xpOverlayIn 0.25s ease-out forwards;
}

.xp-toast-card {
  position: relative;
  width: min(420px, 94vw);
  border-radius: var(--qr-radius-lg);
  padding: 18px 18px 14px;
  background: radial-gradient(circle at top, rgba(56,189,248,0.3), rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.85);
  box-shadow: 0 40px 110px rgba(0,0,0,0.98);
  color: var(--qr-text-main);
  text-align: center;
  transform: translateY(16px) scale(0.94);
  opacity: 0;
  overflow: hidden;
  animation: xpToastIn 0.28s ease-out forwards;
}

.xp-toast-burst {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at top, rgba(250,250,250,0.18), transparent 60%),
    radial-gradient(circle at bottom, rgba(234,179,8,0.35), transparent 65%);
  opacity: 0.85;
  pointer-events: none;
}

.xp-toast-sparkle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle, #facc15 0, #f97316 40%, transparent 70%);
  opacity: 0;
  animation: xpSparkle 1.7s ease-out infinite;
}

.xp-toast-sparkle:nth-child(1) { top: 14%; left: 20%; animation-delay: 0s; }
.xp-toast-sparkle:nth-child(2) { top: 18%; right: 18%; animation-delay: 0.25s; }
.xp-toast-sparkle:nth-child(3) { bottom: 10%; left: 24%; animation-delay: 0.5s; }
.xp-toast-sparkle:nth-child(4) { bottom: 16%; right: 22%; animation-delay: 0.75s; }

.xp-toast-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qr-text-muted);
  margin-bottom: 4px;
}

.xp-toast-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.xp-toast-xp {
  font-size: 26px;
  font-weight: 700;
  color: var(--qr-primary);
  margin-bottom: 4px;
}

.xp-toast-level {
  font-size: 13px;
  color: var(--qr-text-main);
  margin-bottom: 4px;
}

.xp-toast-bar {
  margin: 8px auto 4px;
  width: 80%;
  height: 6px;
  border-radius: var(--qr-radius-pill);
  background: rgba(15,23,42,0.95);
  overflow: hidden;
  position: relative;
}

.xp-toast-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--qr-success), var(--qr-primary), var(--qr-accent));
  animation: xpToastFill 1.1s ease-out forwards;
}

.xp-toast-sub {
  font-size: 11px;
  color: var(--qr-text-muted);
  margin-top: 4px;
}

.xp-toast-note {
  font-size: 11px;
  color: var(--qr-text-muted);
  margin-top: 6px;
  opacity: 0.8;
}

@keyframes xpOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xpToastIn {
  from { opacity: 0; transform: translateY(18px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes xpToastFill {
  from { width: 0%; }
  to   { width: 100%; }
}

@keyframes xpSparkle {
  0%   { opacity: 0; transform: translateY(4px) scale(0.6); }
  30%  { opacity: 1; transform: translateY(-2px) scale(1); }
  70%  { opacity: 0.8; transform: translateY(-8px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.7); }
}

/* ============ HOME FOOTER STATS ============ */
.home-footer-stats {
  margin-top: 14px;
  font-size: 11px;
  color: var(--qr-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.stat-pill {
  padding: 4px 9px;
  border-radius: var(--qr-radius-pill);
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(55,65,81,0.95);
}
/* === GLOBAL CARD SYSTEM CLEANUP =================================== */

/* Make all interactive cards behave consistently */
.card,
.category-card,
.mode-card,
.row-card {
  position: relative;
  z-index: 0;
}

/* Extra breathing room so hover-scale never collides/overlaps */
.category-card,
.row-card {
  margin: 8px 6px;          /* space on top/bottom/left/right */
}

/* Lift hovered cards ABOVE neighbors instead of under them */
.category-card:hover,
.mode-card:hover,
.row-card:hover {
  z-index: 3;
}

/* Keep card radius & shadow consistent across pages */
.card,
.category-card,
.mode-card,
.row-card {
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
}

/* Slightly softer hover transformation so UI feels less “jumpy” */
.category-card:hover,
.mode-card:hover,
.row-card:hover,
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Ensure scroll rows don’t clip shadows on mobile */
.home-row-scroll {
  padding-top: 4px;
  padding-bottom: 6px;
}

/* Better spacing between category sections on all pages */
.category-section {
  margin-top: 24px;
  margin-bottom: 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    padding: 16px 10px 28px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .logo {
    font-size: 22px;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-links a {
    margin-left: 0;
    font-size: 12px;
    padding: 4px 8px;
  }

  .card {
    padding: 14px 12px 18px;
  }

  .card-title {
    font-size: 18px;
  }

  .card-subtitle {
    font-size: 12px;
  }

  /* Category / achievements grids */
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }

  .category-card {
    padding: 10px 10px;
    margin: 6px 4px;
  }

  /* Quiz page */
  .quiz-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .question-text {
    font-size: 16px;
  }

  .option-button {
    font-size: 13px;
    padding: 9px 10px;
  }

  .quiz-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Results review list spacing */
  #reviewBox div {
    padding-inline: 4px;
  }

  /* Home scroll rows */
  .home-row-scroll {
    gap: 8px;
  }

  .row-card {
    flex: 0 0 70%;
  }
}

/* === GLOBAL FOOTER === */

.qr-footer {
  margin-top: 40px;
  background: rgba(15,23,42,0.96);
  border-top: 1px solid rgba(56,189,248,0.2);
  padding: 28px 0 18px;
}

.qr-footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 26px;
}

.qr-footer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-footer-logo {
  font-size: 20px;
  font-weight: 700;
}

.qr-footer-logo span {
  color: #38bdf8;
}

.qr-footer-tag {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.qr-footer-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-footer-link {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
  transition: 0.15s ease;
}

.qr-footer-link:hover {
  color: #38bdf8;
}

.qr-footer-bottom {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding-top: 12px;
  border-top: 1px solid rgba(56,189,248,0.12);
}
/* QUIZ: override weird gold hover on options + power-ups */
/* QUIZ: override weird gold hover on options ONLY */
.option-button {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.96));
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.power-btn:hover,
.power-btn:focus,
.option-button:hover,
.option-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(56,189,248,0.55);
  border-color: rgba(56,189,248,0.95);
}

/* Used / disabled power-ups */
.power-btn.power-btn-disabled,
.power-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}


/* === TIP BANNER === */
.qr-tip-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #22c55e22, #0b1120);
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.18);
}

.qr-tip-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.qr-tip-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  opacity: 0.95;
}


/* === FACT / BLOG SECTION === */
.qr-fact-section {
  margin-top: 1.5rem;
  border-radius: 1.25rem;
  overflow: hidden;
  background: linear-gradient(145deg, #020617, #020617, #111827);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.85);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  gap: 0;
}

.qr-fact-image-wrapper {
  position: relative;
  overflow: hidden;
}

.qr-fact-image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.1), transparent);
  pointer-events: none;
}

#factImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* big, poster-style image */
}

.qr-fact-content {
  padding: 1.3rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.qr-fact-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e5e7eb;
  margin: 0;
}

.qr-fact-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #cbd5f5;
  margin: 0;
}
.qr-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin: 16px auto 24px;
  max-width: 1100px;
  min-height: 260px;
  background-image: url("assets/qr-hero-banner-1920x900.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 28px 80px rgba(0,0,0,0.9);
}


/* ==========================
   HERO: QUIZREALM LANDING
   ========================== */

.qr-hero {
  position: relative;
  width: 100%;
  padding: 70px 0 40px;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 60%),
    radial-gradient(circle at bottom right, rgba(234,179,8,0.15), transparent 65%),
    #020617;
  overflow: hidden;
}

/* background image you created (hero banner) */
.qr-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/qr-hero-banner-1920x900.png") center/cover no-repeat;
  opacity: 0.28;
  filter: saturate(1.1) contrast(1.1);
  pointer-events: none;
}

/* dark overlay + subtle vignette */
.qr-hero-overlay {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.qr-hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,0.85), transparent 60%),
    radial-gradient(circle at bottom, rgba(15,23,42,0.95), rgba(15,23,42,0.98));
  pointer-events: none;
  z-index: 0;
}

/* layout card */
.hero-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 24px;
  padding: 20px 22px;
  border-radius: 26px;
  background: radial-gradient(circle at top left,
              rgba(15,23,42,0.96),
              rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.45);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.95),
    0 0 0 1px rgba(15,23,42,0.9);
  overflow: hidden;
}

/* floating glow in card */
.hero-card::after {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at top right, rgba(56,189,248,0.22), transparent 70%),
    radial-gradient(circle at bottom left, rgba(234,179,8,0.18), transparent 70%);
  opacity: 0.7;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ==========================
   LEFT SIDE: TEXT & CTA
   ========================== */

.hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-brand-accent {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle, #22c55e, #0ea5e9);
  box-shadow: 0 0 18px rgba(56,189,248,0.9);
}

.hero-brand-text {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(120deg,#e5e7eb,#38bdf8,#eab308);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-tagline {
  margin-top: 4px;
  font-size: 14px;
  color: #cbd5f5;
  max-width: 480px;
}

/* buttons */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-buttons .btn {
  min-width: 130px;
}

.hero-buttons .btn-primary {
  position: relative;
  overflow: hidden;
}

.hero-buttons .btn-primary::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top,
    rgba(248,250,252,0.16),
    transparent 70%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hero-buttons .btn-primary:hover::before {
  opacity: 1;
}

/* subtle hover for ghost buttons */
.hero-buttons .btn-ghost {
  border-radius: 999px;
  border-width: 1px;
}

/* feature chips */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hero-chip {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.95);
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #e5e7eb;
  box-shadow: 0 12px 30px rgba(0,0,0,0.85);
}

.hero-chip span {
  font-size: 10px;
  color: #9ca3af;
}

/* slight float animation for chips */
.hero-chip:nth-child(1) { animation: qrFloat 7s ease-in-out infinite; }
.hero-chip:nth-child(2) { animation: qrFloat 8s ease-in-out infinite 0.6s; }
.hero-chip:nth-child(3) { animation: qrFloat 9s ease-in-out infinite 1.1s; }

@keyframes qrFloat {
  0%,100% { transform: translateY(0px); }
  50%     { transform: translateY(-3px); }
}

/* ==========================
   RIGHT SIDE: STATS PANEL
   ========================== */

.hero-right {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-stat-card {
  position: relative;
  width: 100%;
  max-width: 310px;
  border-radius: 22px;
  padding: 14px 14px 12px;
  background:
    radial-gradient(circle at top left, rgba(15,23,42,0.92), rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.96);
  backdrop-filter: blur(22px);
}

.hero-stat-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at top right,
    rgba(56,189,248,0.3),
    transparent 70%);
  opacity: 0.45;
  pointer-events: none;
}

.hero-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(56,189,248,0.7);
  color: #bae6fd;
  margin-bottom: 10px;
}

.hero-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: #cbd5f5;
  margin-bottom: 4px;
}

.hero-stat-label {
  opacity: 0.8;
}

.hero-stat-value {
  font-weight: 600;
  color: #e5e7eb;
}

/* XP bar */
.hero-xp-bar {
  position: relative;
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15,23,42,1);
  border: 1px solid rgba(30,64,175,0.9);
  overflow: hidden;
}

.hero-xp-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg,#22c55e,#eab308,#38bdf8);
  box-shadow: 0 0 20px rgba(56,189,248,0.9);
  transition: width 0.7s ease-out;
}

.hero-xp-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at right, rgba(248,250,252,0.18), transparent 70%);
  pointer-events: none;
}

/* streak pill */
.hero-streak-pill {
  margin-top: 10px;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(248,250,252,0.08);
  color: #fed7aa;
}

/* note + deep link */
.hero-stat-note {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
}

.secondary-link {
  margin-top: 6px;
  font-size: 11px;
  color: #38bdf8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.secondary-link:hover {
  text-decoration: underline;
}

/* ==========================
   RESPONSIVE
   ========================== */

@media (max-width: 880px) {
  .hero-card {
    grid-template-columns: minmax(0,1fr);
    padding: 18px 16px;
  }

  .hero-right {
    justify-content: flex-start;
  }

  .hero-stat-card {
    max-width: 100%;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-brand-text {
    font-size: 26px;
  }

  .hero-tagline {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .qr-hero {
    padding-top: 56px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-meta {
    gap: 6px;
  }
}


/* Dark overlay so text is readable */
.qr-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left,
              rgba(56,189,248,0.18),
              rgba(15,23,42,0.9));
  mix-blend-mode: normal;
}

/* Content inside the hero */
.qr-hero-overlay {
  position: relative;
  z-index: 1;
  padding: 26px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-tagline {
  font-size: 14px;
  color: #cbd5f5;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .qr-hero {
    margin-inline: 10px;
    border-radius: 18px;
    min-height: 220px;
    background-position: center top;
  }

  .qr-hero-overlay {
    padding: 18px 14px 20px;
  }

  .hero-tagline {
    font-size: 13px;
    max-width: 100%;
  }
}


/* Mobile layout for fact section */
@media (max-width: 768px) {
  .qr-fact-section {
    grid-template-columns: 1fr;
  }

  .qr-fact-content {
    padding: 1rem 1rem 1.1rem;
  }

  .qr-fact-title {
    font-size: 1rem;
  }

  .qr-fact-body {
    font-size: 0.9rem;
  }
}

/* --- Cosmic Glow Styling --- */



.nav-badge-cosmic {
    padding: 0.2rem 0.7rem;
    border-radius: 9999px; /* Pill shape */
    font-weight: 800; /* Extra bold */
    text-transform: uppercase;
    font-size: 0.85rem;
    line-height: 1;

    /* Deep purple to blue gradient */
    background: linear-gradient(to right, #4a0e71, #2563eb); /* Dark violet to bright blue */
    color: #e0f2fe; /* Light blue/white text */
    border: 1px solid #7c3aed; /* Purple border */
    
    /* Subtle starry texture */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cg fill='%2393c5fd' fill-opacity='0.2'%3E%3Cpath fill-rule='evenodd' d='M0 0h1v1H0V0zm2 0h1v1H2V0zm2 0h1v1H4V0zm2 0h1v1H6V0zm2 0h1v1H8V0zm0 2h1v1H8V2zm0 2h1v1H8V4zm0 2h1v1H8V6zm0 2h1v1H8V8zm-2 0h1v1H6V8zm-2 0h1v1H4V8zm-2 0h1v1H2V8zm-2 0h1v1H0V8zm0-2h1v1H0V6zm0-2h1v1H0V4zm0-2h1v1H0V2zM2 2h1v1H2V2zm2 2h1v1H4V4zm2 2h1v1H6V6zm2 2h1v1H8V8z'/%3E%3C/g%3E%3C/svg%3E");
    background-blend-mode: overlay; /* Blend texture nicely */

    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother transition */
    position: relative;
    overflow: hidden; /* Hide overflowing glow */
    z-index: 1;
}

.nav-badge-cosmic::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, rgba(139,92,246,0) 70%); /* Inner glow */
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: -1;
}

.nav-badge-cosmic:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.nav-badge-cosmic:hover {
    color: #ffffff;
    box-shadow: 0 0 25px rgba(139,92,246,0.7), 0 0 40px rgba(99,102,241,0.5); /* Stronger glow */
    transform: scale(1.08); /* More pronounced scale */
}
/* =========================================
   QUIZREALM DESIGN SYSTEM v5.1 (Unified)
   ========================================= */

:root {
    --bg-deep: #020617;
    --bg-cosmic: radial-gradient(circle at 50% 0%, #2e1065, #020617 60%);
    --card-bg: rgba(15, 23, 42, 0.85); /* Slightly opaque for readability */
    --card-border: 1px solid rgba(255, 255, 255, 0.1);
    
    --neon-cyan: #22d3ee;
    --neon-pink: #f472b6;
    --neon-gold: #fbbf24;
    --neon-green: #4ade80;
    --neon-red: #fb7185;
    --neon-purple: #c084fc;
    
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    background-image: var(--bg-cosmic);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

/* Grid Background */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

/* ==== LAYOUT SYSTEM ==== */
.app-container {
    max-width: 1400px; /* Wider for category grid */
    margin: 0 auto;
    padding: 20px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media(min-width: 1024px) {
    .main-grid {
        grid-template-columns: 3fr 1fr; /* Content (3) : Sidebar (1) */
        align-items: start;
    }
}

/* ==== HEADER ==== */
.app-header {
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: var(--card-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo { font-family: 'Bungee', cursive; font-size: 1.5rem; color: white; text-decoration: none; }

/* ==== GENERIC GLASS CARD ==== */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: var(--card-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ==== CATEGORIES PAGE SPECIFICS ==== */

/* Hero Banner in Categories */
.cat-hero {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}
@media(min-width: 768px) {
    .cat-hero { flex-direction: row; align-items: center; justify-content: space-between; }
}

.cat-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(234, 179, 8, 0.1); border: 1px solid var(--neon-gold);
    color: var(--neon-gold); padding: 4px 12px; border-radius: 50px;
    font-size: 0.75rem; text-transform: uppercase; font-weight: 800; letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Tabs */
.cat-tabs {
    display: flex;
    background: rgba(0,0,0,0.4);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
    width: fit-content;
}
.cat-tab-btn {
    padding: 8px 24px;
    border-radius: 50px;
    background: transparent;
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.cat-tab-btn.active {
    background: var(--neon-cyan);
    color: #020617;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}
/* Custom Scrollbar for the Timeline */
.custom-scrollbar::-webkit-scrollbar {
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(234, 179, 8, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(234, 179, 8, 0.5);
}
/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.section-title { font-family: 'Bungee'; font-size: 1.2rem; color: white; margin: 0; }
.section-subtitle { font-size: 0.85rem; color: var(--text-dim); }

/* Category Grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* The Category Card (Tile) */
.cat-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-purple);
    box-shadow: 0 10px 30px -5px rgba(168, 85, 247, 0.3);
    background: rgba(255,255,255,0.08);
}

.cat-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.cat-name { font-weight: 800; font-size: 1.1rem; color: white; margin-bottom: 4px; }
.cat-desc { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; flex-grow: 1; margin-bottom: 15px; }

.cat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: rgba(30, 41, 59, 0.6);
    border: var(--card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-title {
    font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim);
    letter-spacing: 1px; margin-bottom: 12px; font-weight: 800;
}

/* Utils */
.text-gold { color: var(--neon-gold); }
.hidden { display: none !important; }

/* Mobile */
@media(max-width: 768px) {
    .app-container { padding: 10px; }
    .cat-hero { padding: 20px; }
}












/* Gallows line build-in */
.g-anim { stroke-dasharray: 500; stroke-dashoffset: 500; animation: gdraw .6s ease forwards; }
@keyframes gdraw { to { stroke-dashoffset: 0; } }

/* Part drawing (head/body/limbs) */
.draw { stroke-dasharray: 400; stroke-dashoffset: 400; animation: partdraw .5s ease forwards; }
@keyframes partdraw { to { stroke-dashoffset: 0; } }

/* Rope sway (subtle physical feel) */
.rope { transform-origin: 130px 20px; animation: sway 3.5s ease-in-out infinite; }
@keyframes sway {
  0%,100% { transform: rotate(-2deg); }
  50%     { transform: rotate(2deg); }
}

/* Hit shake on mistake */
.figure.hit, .rope.hit { animation: hit .2s ease; }
@keyframes hit {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-2px); }
  75%     { transform: translateX(2px); }
}

/* Fall on game over */
.figure.fall { animation: fall .8s cubic-bezier(.2,.9,.2,1) forwards; transform-origin: 130px 50px; }
@keyframes fall {
  0%   { transform: rotate(0) translateY(0); }
  100% { transform: rotate(25deg) translateY(120px); opacity:.85; }
}
.rope.cut { animation: ropeCut .25s linear forwards; }
@keyframes ropeCut { to { opacity: 0; transform: scaleY(0.2); } }
