/* ============================================================
   QuizGate — QuizHub-inspired front-end theme
   Clean, modern design with Inter font, indigo/purple palette,
   8px-radius buttons, and refined card system.
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    --qg-primary: #6366f1;
    --qg-primary-dark: #4f46e5;
    --qg-primary-light: #8b5cf6;
    --qg-primary-soft: rgba(99, 102, 241, .08);
    --qg-primary-rgb: 99, 102, 241;
    --qg-primary-2: #a5b4fc;
    --qg-primary-ink: #ffffff;
    --qg-ink: #0f172a;
    --qg-muted: #64748b;
    --qg-surface: #ffffff;
    --qg-cream: #f8fafc;
    --qg-card: #ffffff;
    --qg-line: #e5e7eb;
    --qg-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
    --qg-grad-wide: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --qg-grad-soft: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .08));
    --qg-glow: 0 10px 30px rgba(99, 102, 241, .28);
    --qg-shadow-sm: 0 1px 3px rgba(0, 0, 0, .1);
    --qg-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    --qg-shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);
    --qg-radius: 12px;
    --qg-radius-sm: 8px;
    --qg-footer: #0f172a;

    --c-purple: #8b5cf6;
    --c-purple-soft: #ede9fe;
    --c-blue: #3b82f6;
    --c-blue-soft: #dbeafe;
    --c-pink: #ec4899;
    --c-pink-soft: #fce7f3;
    --c-yellow: #f59e0b;
    --c-yellow-soft: #fef3c7;
    --c-green: #10b981;
    --c-green-soft: #d1fae5;
}

* { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: var(--qg-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Prevent any section/card from overflowing the viewport */
section, .container, .card, .row, [class*="col-"] {
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
}

h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

/* ============================================================
   LAYOUT — Sidebar + Header + Main
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 250px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--qg-line);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid var(--qg-line);
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--qg-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(var(--qg-primary-rgb), .3);
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -.02em;
    background: var(--qg-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-close {
    background: none; border: none;
    color: var(--qg-muted);
    font-size: 1.1rem;
    padding: 4px;
    cursor: pointer;
}
.sidebar-close:hover { color: var(--qg-ink); }

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 12px 20px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--qg-line); border-radius: 4px; }

.sidebar-heading {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--qg-muted);
    padding: 16px 12px 6px;
    opacity: .7;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all .15s ease;
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-link:hover {
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
}
.sidebar-link.active {
    color: var(--qg-primary-ink);
    background: var(--qg-grad);
    box-shadow: 0 2px 8px rgba(var(--qg-primary-rgb), .28);
}
.sidebar-link.active i { color: var(--qg-primary-ink); }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--qg-line);
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ---------- Main area ---------- */
.app-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
}

/* ---------- Top header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 64px;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--qg-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-toggle {
    display: none;
    background: none; border: 1px solid var(--qg-line);
    border-radius: 8px;
    width: 38px; height: 38px;
    font-size: 1.2rem;
    color: var(--qg-ink);
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: all .15s;
}
.header-brand {
    display: none;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--qg-ink);
    font-weight: 800;
    font-size: 1.05rem;
    white-space: nowrap;
}
.header-brand img { height: 28px; }
.header-brand i { font-size: 1.3rem; color: var(--qg-primary); }
.header-brand-text {
    background: linear-gradient(135deg, var(--qg-primary), var(--qg-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
}
.header-search form {
    background: #f1f5f9;
    border: 1px solid var(--qg-line);
    border-radius: 50rem;
    padding: 6px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.header-search form:focus-within {
    border-color: var(--qg-primary);
    box-shadow: 0 0 0 3px var(--qg-primary-soft);
    background: #fff;
}
.header-search .form-control {
    background: transparent;
    font-size: .85rem;
}
.header-search .form-control:focus {
    box-shadow: none;
    outline: none;
}

/* Mobile search toggle button (hidden on desktop, shown below 1200px) */
.mobile-search-toggle {
    display: none;
    background: none;
    border: 1px solid var(--qg-line);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    color: var(--qg-ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.mobile-search-toggle:hover { background: #f8fafc; color: var(--qg-primary); }

/* Mobile search overlay */
.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 60px 16px 16px;
}
.mobile-search-overlay.show { display: flex; align-items: flex-start; justify-content: center; }
.mobile-search-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    animation: slideDown .2s ease;
}
.mobile-search-box form {
    background: #f1f5f9;
    border: 1px solid var(--qg-line);
    border-radius: 50rem;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile-search-box form:focus-within {
    border-color: var(--qg-primary);
    box-shadow: 0 0 0 3px var(--qg-primary-soft);
    background: #fff;
}
.mobile-search-box .form-control {
    background: transparent;
    font-size: .95rem;
    flex: 1;
}
.mobile-search-box .form-control:focus { box-shadow: none; outline: none; }
.mobile-search-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #fff;
    position: absolute;
    top: 70px;
    right: 20px;
    cursor: pointer;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-toggle:hover { background: #f8fafc; border-color: var(--qg-primary); color: var(--qg-primary); }

.header-wallet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: 50rem;
    padding: 6px 14px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--qg-ink);
}
.header-wallet i { color: var(--c-yellow); }

.header-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--qg-line);
    padding: 0;
    background: var(--qg-primary-soft);
    color: var(--qg-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .15s;
}
.header-avatar:hover { border-color: var(--qg-primary); }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Content ---------- */
.app-content {
    flex: 1;
    padding: 1px;
}

/* Homepage: no outer padding — hero and sections stretch full width */
.app-content-home {
    padding: 0;
}
/* Sections below hero: full width containers with vertical spacing */
.app-content-home > .container,
.app-content-home > section:not(.qg-hero) > .container,
.app-content-home > div > .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.app-content-home > section:not(.qg-hero) {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* ============================================================
   Global overflow fix
   ============================================================ */
html { overflow-x: clip; }
body { overflow-x: clip; -webkit-overflow-scrolling: touch; }
.app-layout { max-width: 100%; }
.app-main { min-width: 0; }
.app-content { overflow-wrap: break-word; word-wrap: break-word; min-width: 0; }
.app-content-home { overflow-wrap: break-word; word-wrap: break-word; min-width: 0; }

/* ============================================================
   Responsive: sidebar hidden on < xl (1200px)
   ============================================================ */
@media (max-width: 1199.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .header-brand { display: flex; }
    .header-search { display: none; }
    .mobile-search-toggle { display: flex; }
}

/* ============================================================
   Responsive: mobile (≤575px)
   ============================================================ */
@media (max-width: 575.98px) {

    /* --- Quiz Detail Hero --- */
    .qg-quiz-hero { padding: 2rem 0 1.5rem; min-height: auto; }
    .qg-quiz-title { font-size: 1.4rem; }
    .qg-quiz-subtitle { font-size: .82rem; }
    .qg-quiz-stats { gap: 1rem; }
    .qg-stat span { font-size: .88rem; }
    .qg-stat small { font-size: .65rem; }
    .qg-quiz-hero-img { max-width: 160px; max-height: 140px; }
    .qg-tabs .nav-link { font-size: .78rem; padding: .5rem .8rem; }

    /* --- Header --- */
    .app-header { padding: 0 10px; height: 52px; gap: 4px; }
    .header-left { gap: 4px; }
    .sidebar-toggle { width: 32px; height: 32px; font-size: 1rem; border-radius: 6px; }
    .mobile-search-toggle { width: 32px; height: 32px; font-size: .95rem; border-radius: 6px; }
    .header-right { gap: 5px; }
    .header-right .btn { padding: .28rem .6rem; font-size: .75rem; height: auto; }
    .header-wallet { padding: 4px 8px; font-size: .75rem; gap: 4px; }
    .header-wallet span { display: none; }
    .header-wallet i { font-size: .9rem; }

    /* --- Homepage full-width --- */
    .app-content-home { padding: 0; overflow: hidden; }
    .app-content-home > .container,
    .app-content-home > section:not(.qg-hero) > .container,
    .app-content-home > div > .container {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
    }
    .app-content-home > section:not(.qg-hero) {
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
    }

    /* --- Section headers --- */
    .sec-kicker { font-size: .65rem; padding: .25rem .65rem; max-width: 100%; }
    .sec-title { font-size: 1.1rem; font-weight: 800; line-height: 1.25; margin-top: .3rem !important; max-width: 100%; overflow-wrap: break-word; }
    .sec-sub { font-size: .78rem; line-height: 1.4; max-width: 100%; }
    .sec-title + .sec-sub { margin-top: .15rem; }
    .text-center h2 { max-width: 100%; overflow-wrap: break-word; }
    .text-center .sec-sub { max-width: 100%; }
    .display-6 { font-size: 1.4rem !important; line-height: 1.2 !important; overflow-wrap: break-word; word-wrap: break-word; max-width: 100%; }

    /* --- Section header flex layout: stack vertically --- */
    .d-flex.flex-wrap.align-items-end.justify-content-between.gap-3.mb-4 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .4rem !important;
        margin-bottom: .8rem !important;
    }
    .d-flex.flex-wrap.align-items-end.justify-content-between.gap-3.mb-4 .btn {
        font-size: .75rem;
        padding: .3rem .7rem;
        height: auto;
        align-self: flex-start;
    }

    /* --- Hero (mobile) --- */
    .qg-hero {
        padding: 2rem 1rem 1.5rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    .qg-hero .container { padding-left: 0; padding-right: 0; }
    .qg-hero h1 { font-size: 1.4rem; }
    .qg-hero .lead { font-size: .85rem; line-height: 1.45; margin-bottom: 1rem; max-width: 100%; }
    .qg-hero-badge { font-size: .65rem; padding: .25rem .7rem; margin-bottom: .6rem; max-width: 100%; }
    .qg-hero .hero-actions { flex-direction: column; align-items: stretch; gap: .5rem; max-width: 100%; }
    .qg-hero .hero-actions .btn { width: 100%; font-size: .82rem; padding: .55rem 1rem; height: auto; min-width: 0; }
    .qg-hero .hero-trust { font-size: .68rem; gap: .2rem !important; margin-top: .6rem !important; flex-wrap: wrap; }
    .qg-hero .hero-trust li { gap: .2rem; padding: .15rem .4rem; font-size: .65rem; }
    .hero-chip { display: none; }
    .qg-hero::before { width: 200px; height: 200px; top: -80px; right: -60px; }
    .qg-hero::after { width: 150px; height: 150px; bottom: -70px; left: -40px; }
    .hero-visual-stack { min-height: 260px; margin-top: 1rem; }
    .hero-quiz-card { max-width: 100%; margin-left: 0; padding: 1rem; }
    .hq-question { font-size: .85rem; }
    .hq-opt { font-size: .75rem; padding: .35rem .55rem; }
    .hq-badge { font-size: .58rem; }
    .hero-score-card { top: -5px; left: 0; }
    .hero-streak-card { bottom: 8px; right: 0; }

    /* --- Stat strip --- */
    .qg-stat-strip { grid-template-columns: repeat(2, 1fr); gap: 0; border-radius: var(--qg-radius-sm); }
    .qg-stat { padding: .65rem .3rem; }
    .qg-stat .num { font-size: 1.1rem; }
    .qg-stat .lbl { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; }
    .qg-stat + .qg-stat::before { display: none; }

    /* --- Carousel --- */
    .qg-carousel { margin: 0 -12px; overflow: hidden; }
    .qg-carousel-track { padding: .2rem 12px 1rem; gap: .6rem; }
    .qg-carousel-item { flex: 0 0 72%; scroll-snap-align: start; min-width: 0; }
    .qg-carousel-arrow { width: 28px; height: 28px; font-size: .7rem; border-radius: 50%; }
    .qg-carousel-arrow.prev { left: 6px; }
    .qg-carousel-arrow.next { right: 6px; }

    /* --- Card thumbnails --- */
    .topic-thumb { height: 100px; border-radius: var(--qg-radius-sm) var(--qg-radius-sm) 0 0; }
    .cat-thumb { height: 100px; border-radius: var(--qg-radius-sm) var(--qg-radius-sm) 0 0; }
    .cat-card-v .cat-thumb { height: 90px; }
    .collection-card .cc-thumb { height: 100px; }

    /* --- Quiz/topic cards --- */
    .card-quiz { border-radius: var(--qg-radius-sm); }
    .card-quiz .p-3 { padding: .6rem !important; }
    .card-quiz h6 { font-size: .8rem; font-weight: 700; }
    .card-quiz .small { font-size: .7rem; }
    .card-quiz .btn-sm { font-size: .72rem; padding: .3rem .6rem; height: auto; }
    .card-quiz .btn-primary-qg { height: auto; }

    /* Card grid: full width on mobile */
    .row.g-3 { gap: .5rem !important; }
    .row.g-4 { gap: .6rem !important; }

    /* --- Daily Dose / CTA banners --- */
    .container.py-5 { padding: 1rem 12px !important; }
    .container.py-4 { padding: .8rem 12px !important; }
    .card-quiz.p-4 { padding: .8rem !important; }
    .card-quiz.p-md-5 { padding: .8rem !important; }
    .card-quiz h2 { font-size: 1rem; max-width: 100%; overflow-wrap: break-word; }
    .card-quiz h2 + p { font-size: .75rem; max-width: 100%; }
    .card-quiz .btn-lg { font-size: .8rem; padding: .45rem 1.2rem; height: auto; min-width: 0; }
    .card-quiz .btn { min-width: 0; }
    .card-quiz [style*="max-width"] { max-width: 100% !important; }

    /* --- Game Modes cards --- */
    .mode-card { padding: .75rem !important; }
    .mode-card .icon { width: 36px; height: 36px; font-size: 1rem; }
    .mode-card h6 { font-size: .78rem; }
    .mode-card small { font-size: .68rem; }
    .mode-card .btn-sm { font-size: .7rem; padding: .28rem .55rem; height: auto; }

    /* --- Community / Feature cards --- */
    .community-card { padding: .9rem !important; }
    .community-card .co-stat { font-size: 1.15rem; }
    .community-card h6 { font-size: .78rem; }
    .community-card p { font-size: .72rem; }
    .feature-card { padding: .9rem !important; }
    .feature-card h5 { font-size: .9rem; }
    .feature-card p { font-size: .78rem; }

    /* --- Create zone --- */
    .create-zone { padding: 1rem !important; border-radius: var(--qg-radius-sm); }
    .create-step { padding: .7rem .8rem; gap: .6rem; }
    .create-step .cs-num { width: 30px; height: 30px; font-size: .7rem; }
    .create-step h6 { font-size: .8rem; }
    .create-step small { font-size: .7rem; }
    .text-center .btn-lg { font-size: .8rem; padding: .45rem 1.2rem !important; height: auto !important; }

    /* --- Footer --- */
    .footer .footer-top { padding: 1.5rem 0 1rem; }
    .footer .footer-top .row { gap: .8rem 0; }
    .footer .col-lg-4,
    .footer .col-md-4.col-lg-4 { flex: 0 0 100%; max-width: 100%; }
    .footer .col-6 { flex: 0 0 50%; max-width: 50%; }
    .footer .col-lg-2 { flex: 0 0 50%; max-width: 50%; }
    .footer .foot-head { font-size: .75rem; margin-bottom: .4rem; }
    .footer .foot-link { font-size: .72rem; margin-bottom: .25rem !important; }
    .footer .small { font-size: .7rem; }
    .footer-bottom { padding: .6rem 0; }
    .footer-bottom .small { text-align: center; }
    .footer-pages { text-align: center; width: 100%; margin-top: .3rem; }
    .footer-pages a { font-size: .7rem; }
    .newsletter-form .form-control { font-size: .8rem; padding: .45rem .7rem; }

    /* --- Sidebar on mobile --- */
    .sidebar { width: 260px; }

    /* --- Inner pages --- */
    .dash-header, .page-hero .container { padding: .8rem; }
    .page-title { font-size: 1.1rem; }
    .page-subtitle { font-size: .75rem; }
    .container-fluid.py-4 { padding-top: .8rem !important; padding-bottom: .8rem !important; }

    /* --- Play shell --- */
    .play-shell { border-radius: var(--qg-radius-sm); padding: .75rem; }

    /* --- Search panel --- */
    .search-panel { border-radius: var(--qg-radius-sm); padding: .8rem; }

    /* --- Dropdowns --- */
    .dropdown-menu { min-width: 160px; font-size: .82rem; }

    /* --- Collection / pop / hero / auth cards --- */
    .collection-card { border-radius: var(--qg-radius-sm); padding: .7rem !important; }
    .community-card { border-radius: var(--qg-radius-sm); }
    .hero-card { border-radius: var(--qg-radius-sm); }
    .auth-card { border-radius: var(--qg-radius-sm); }

    /* --- Mascot --- */
    .qg-mascot { width: 72px; height: 72px; font-size: 2.5rem; border-width: 2px; }
}

/* ============================================================
   Tablet (576–991px) — comprehensive
   ============================================================ */
@media (min-width: 576px) and (max-width: 991.98px) {

    /* --- Header --- */
    .header-search { max-width: 260px; margin: 0 10px; }

    /* --- Homepage containers --- */
    .app-content-home > .container,
    .app-content-home > section:not(.qg-hero) > .container,
    .app-content-home > div > .container {
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 1.8rem;
        padding-bottom: 1.8rem;
    }
    .app-content-home > section:not(.qg-hero) {
        padding-top: 1.8rem;
        padding-bottom: 1.8rem;
    }

    /* --- Section headers --- */
    .sec-title { font-size: 1.4rem; }
    .sec-sub { font-size: .85rem; }
    .d-flex.flex-wrap.align-items-end.justify-content-between.gap-3.mb-4 {
        gap: .6rem !important;
        margin-bottom: 1.2rem !important;
    }

    /* --- Hero --- */
    .qg-hero { padding: 3rem 2rem; }
    .qg-hero h1 { font-size: 2.2rem; }
    .qg-hero .lead { font-size: 1rem; max-width: 500px; }
    .qg-hero-badge { font-size: .78rem; }
    .qg-hero .hero-actions { gap: .8rem; }

    /* --- Carousel --- */
    .qg-carousel-arrow { width: 34px; height: 34px; font-size: .85rem; }
    .qg-carousel-arrow.prev { left: -8px; }
    .qg-carousel-arrow.next { right: -8px; }

    /* --- Thumbnails --- */
    .topic-thumb { height: 120px; }
    .cat-thumb { height: 120px; }
    .cat-card-v .cat-thumb { height: 110px; }

    /* --- Card sizing --- */
    .card-quiz h6 { font-size: .85rem; }
    .card-quiz .small { font-size: .75rem; }

    /* --- Gaming: 3 cols at tablet (override col-md-4 → 33%) --- */
    .row.g-3 > .col-lg-3 { flex: 0 0 33.333%; max-width: 33.333%; }

    /* --- Community: 2 cols at tablet for better spacing --- */
    .row.g-4 > .col-lg-3 { flex: 0 0 33.333%; max-width: 33.333%; }

    /* --- Community cards --- */
    .community-card { padding: 1.1rem; }
    .community-card .co-stat { font-size: 1.3rem; }

    /* --- Feature cards --- */
    .feature-card { padding: 1.2rem; }

    /* --- Create zone --- */
    .create-zone { padding: 1.8rem; }
    .create-step { padding: .9rem 1rem; }

    /* --- Daily dose / CTA --- */
    .card-quiz.p-4 { padding: 1.5rem !important; }
    .card-quiz.p-md-5 { padding: 2rem !important; }

    /* --- Footer --- */
    .footer .footer-top { padding: 2.5rem 0 1.8rem; }
    .footer .col-lg-4 { flex: 0 0 50%; max-width: 50%; }
    .footer .col-md-4.col-lg-4 { flex: 0 0 50%; max-width: 50%; }
    .footer .col-lg-2 { flex: 0 0 33.333%; max-width: 33.333%; }
    .footer .col-6 { flex: 0 0 50%; max-width: 50%; }

    /* --- Mascot --- */
    .qg-mascot { width: 100px; height: 100px; font-size: 3.5rem; }
}

/* ============================================================
   Desktop (992+)
   ============================================================ */
@media (min-width: 992px) {
    .qg-hero h1 { font-size: 2.8rem; }
    .sec-title { font-size: 1.8rem; }
}
@media (min-width: 1200px) {
    .sidebar-toggle { display: none; }
}

::selection { background: rgba(var(--qg-primary-rgb), .18); }

img { max-width: 100%; height: auto; }

/* ============================================================
   Buttons
   ============================================================ */

.btn-primary-qg {
    background: var(--qg-grad);
    border: 0;
    color: var(--qg-primary-ink);
    font-weight: 700;
    font-size: .92rem;
    border-radius: var(--qg-radius-sm);
    padding: .6rem 1.4rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(var(--qg-primary-rgb), .28);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-primary-qg:hover,
.btn-primary-qg:focus {
    color: var(--qg-primary-ink);
    filter: brightness(1.06);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(var(--qg-primary-rgb), .36);
}
.btn-primary-qg:active { transform: translateY(0); filter: brightness(1); }
.btn-primary-qg:disabled { color: var(--qg-primary-ink); opacity: .55; }

.btn-white-qg {
    background: #fff;
    border: 0;
    color: var(--qg-primary-dark);
    font-weight: 700;
    font-size: .92rem;
    border-radius: var(--qg-radius-sm);
    padding: .6rem 1.4rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn-white-qg:hover {
    color: var(--qg-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.btn-outline-qg {
    border: 1px solid var(--qg-primary);
    color: var(--qg-primary-dark);
    font-weight: 700;
    font-size: .92rem;
    border-radius: var(--qg-radius-sm);
    background: #fff;
    padding: .6rem 1.4rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
}
.btn-outline-qg:hover {
    background: var(--qg-primary-soft);
    border-color: var(--qg-primary-dark);
    color: var(--qg-primary-dark);
    transform: translateY(-3px);
}

.btn-ghost-qg {
    background: #fff;
    color: var(--qg-ink);
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius-sm);
    font-weight: 700;
    font-size: .92rem;
    padding: .6rem 1.4rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--qg-shadow-sm);
    transition: all .18s ease;
}
.btn-ghost-qg:hover {
    background: #f9fafb;
    color: var(--qg-ink);
    transform: translateY(-3px);
    box-shadow: var(--qg-shadow);
}

.btn-glass {
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(var(--qg-primary-rgb), .15);
    color: var(--qg-ink);
    font-weight: 700;
    font-size: .92rem;
    border-radius: var(--qg-radius-sm);
    backdrop-filter: blur(8px);
    padding: .6rem 1.4rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
}
.btn-glass:hover {
    background: rgba(255, 255, 255, .9);
    color: var(--qg-ink);
    transform: translateY(-3px);
    box-shadow: var(--qg-shadow);
}

.bg-qg { background: var(--qg-primary) !important; }
.bg-qg-soft { background: var(--qg-primary-soft) !important; }
.text-qg { color: var(--qg-primary) !important; }
.badge.bg-qg { color: var(--qg-primary-ink); }

/* ============================================================
   Quiz option buttons
   ============================================================ */

.opt-btn {
    border-radius: var(--qg-radius-sm);
    border: 1px solid var(--qg-line);
    background: #fff;
    color: var(--qg-ink);
    padding: .75rem 1.1rem;
    text-align: left;
    font-weight: 600;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.opt-btn:hover {
    border-color: rgba(var(--qg-primary-rgb), .4);
    box-shadow: 0 4px 12px rgba(var(--qg-primary-rgb), .1);
    transform: translateY(-2px);
}

/* Correct / wrong feedback */
.opt-btn:disabled { cursor: default; }

.opt-btn.opt-right {
    background: #e7f8ee;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.opt-btn.opt-right .opt-key,
.opt-btn.opt-right .badge.bg-qg {
    background: #10b981;
    color: #fff;
}

.opt-btn.opt-wrong {
    background: #fdecec;
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.opt-btn.opt-wrong .opt-key,
.opt-btn.opt-wrong .badge.bg-qg {
    background: #ef4444;
    color: #fff;
}

.qg-feedback {
    border-radius: var(--qg-radius-sm);
    font-weight: 700;
    animation: qg-fade-up .25s ease both;
}
.qg-feedback.correct { background: #e7f8ee; border: 1px solid #a7e3c4; color: #065f46; }
.qg-feedback.wrong { background: #fdecec; border: 1px solid #f3b8b8; color: #991b1b; }
.qg-feedback .fb-answer { font-weight: 800; }

/* Would You Rather */
.wyr-btn { border-width: 2px; transition: all .2s ease; }
.wyr-btn:hover:not(.disabled) { transform: scale(1.02); box-shadow: 0 4px 15px rgba(0,0,0,.15); }

/* Ranking Quiz */
.rank-item { background: #f8f9fa; border-radius: 8px; padding: 8px 12px; border: 1px solid #e9ecef; }
.rank-item .rank-num { min-width: 28px; text-align: center; }

/* Poll */
.poll-opt.poll-voted { border-color: var(--qg-primary); background: var(--qg-primary); color: #fff; }

/* ============================================================
   Navbar
   ============================================================ */

.navbar-qg {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--qg-line);
}
.navbar-qg .navbar-brand {
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--qg-ink);
}
.navbar-qg .navbar-brand i {
    background: var(--qg-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.navbar-qg .nav-link {
    font-weight: 600;
    font-size: .88rem;
    color: #475569;
    border-radius: var(--qg-radius-sm);
    padding: .45rem .95rem;
    transition: all .15s ease;
}
.navbar-qg .nav-link:hover {
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
}
.navbar-qg .nav-link.active {
    color: var(--qg-primary-ink);
    background: var(--qg-grad);
    box-shadow: 0 2px 8px rgba(var(--qg-primary-rgb), .28);
}
.navbar-qg .nav-link.dropdown-toggle.active {
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
    box-shadow: none;
}
.navbar-qg .dropdown-menu {
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow);
    padding: .5rem;
}
.navbar-qg .dropdown-item {
    font-weight: 600;
    border-radius: var(--qg-radius-sm);
    padding: .5rem .9rem;
    font-size: .88rem;
}
.navbar-qg .dropdown-item:hover {
    background: var(--qg-primary-soft);
    color: var(--qg-primary-dark);
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--qg-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(var(--qg-primary-rgb), .3);
}
.brand-text {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    background: var(--qg-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.user-btn {
    background: none;
    border: 1px solid var(--qg-line);
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    transition: all .15s ease;
}
.user-btn:hover { border-color: var(--qg-primary); box-shadow: 0 0 0 3px var(--qg-primary-soft); }
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--qg-primary-soft);
    color: var(--qg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}

.coin-pill {
    background: var(--qg-ink);
    color: #fff;
    border: none;
    border-radius: 50rem;
    padding: .3rem .9rem;
    font-weight: 800;
    font-size: .88rem;
    box-shadow: var(--qg-shadow-sm);
    white-space: nowrap;
}
.coin-pill i { color: #f59e0b; }

/* ============================================================
   Hero section — QuizHub style
   Gradient card, white text, two CTAs, blur decorations
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.qg-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--hero-c1, #4f46e5) 0%, var(--hero-c2, #7c3aed) 40%, var(--hero-c3, #a855f7) 100%);
    border-radius: var(--qg-radius);
    padding: 3.5rem 2.5rem 3rem;
    margin-bottom: 2rem;
}
.qg-hero::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -160px; right: -100px;
    pointer-events: none;
}
.qg-hero::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -140px; left: -60px;
    pointer-events: none;
}
.qg-hero h1 {
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.12;
    color: #fff;
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: .75rem;
}
.qg-hero .lead {
    color: rgba(255,255,255,.85);
    max-width: 480px;
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}
.qg-hero .hero-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.qg-hero .btn-white-qg {
    background: #fff;
    color: var(--qg-primary-dark);
    border: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.qg-hero .btn-white-qg:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
    transform: translateY(-2px);
}
.qg-hero .btn-glass {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
}
.qg-hero .btn-glass:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
    transform: translateY(-2px);
}
.qg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    padding: .35rem 1rem;
    border-radius: 50rem;
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

/* hero chips (floating tags) */
.hero-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    padding: .5rem .95rem;
    border-radius: var(--qg-radius-sm);
    z-index: 3;
    animation: heroFloat 4s ease-in-out infinite;
    white-space: nowrap;
}
.hero-chip:nth-child(2) { animation-delay: 1.2s; }
.hero-chip:nth-child(3) { animation-delay: 2.4s; }
.hero-chip .emoji { font-size: 1.1rem; }

/* hero trust bar */
.qg-hero .hero-trust {
    font-size: .82rem;
    font-weight: 600;
    gap: .3rem;
}
.qg-hero .hero-trust li {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    padding: .3rem .7rem;
    border-radius: 50rem;
    white-space: nowrap;
}

/* ---------- Hero visual: quiz preview stack ---------- */
.hero-visual-stack {
    position: relative;
    min-height: 340px;
    perspective: 800px;
}

/* main quiz card */
.hero-quiz-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
    position: relative;
    z-index: 2;
    color: #1e293b;
    max-width: 380px;
    margin-left: auto;
}
.hq-top {
    display: flex;
    gap: .4rem;
    margin-bottom: .75rem;
}
.hq-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .55rem;
    border-radius: 50rem;
    background: rgba(99,102,241,.1);
    color: #6366f1;
}
.hq-badge-light {
    background: #f1f5f9;
    color: #64748b;
}
.hq-badge-light i { font-size: .6rem; }
.hq-question {
    font-size: .95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: .75rem;
    line-height: 1.4;
}
.hq-options {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .75rem;
}
.hq-opt {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
    transition: all .2s;
}
.hq-opt-letter {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.hq-opt-correct {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}
.hq-opt-correct .hq-opt-letter {
    background: #10b981;
    color: #fff;
}
.hq-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 50rem;
    overflow: hidden;
    margin-bottom: .25rem;
}
.hq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 50rem;
    transition: width .6s ease;
}
.hq-progress-text {
    color: #94a3b8;
    font-size: .7rem;
}

/* floating score card */
.hero-score-card {
    position: absolute;
    top: -10px;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border-radius: 12px;
    padding: .5rem .8rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    animation: heroFloat 4s ease-in-out infinite;
    animation-delay: .6s;
}
.hsc-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
}
.hsc-name { font-size: .72rem; font-weight: 700; color: #0f172a; }
.hsc-score { font-size: .7rem; font-weight: 600; color: #6366f1; }
.hsc-score i { font-size: .6rem; }

/* floating streak card */
.hero-streak-card {
    position: absolute;
    bottom: 20px;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    backdrop-filter: blur(8px);
    border-radius: 50rem;
    padding: .4rem .85rem;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    animation: heroFloat 4s ease-in-out infinite;
    animation-delay: 1.8s;
}
.hero-streak-card i { font-size: .9rem; }

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

/* responsive */
@media (max-width: 991.98px) {
    .qg-hero { padding: 2.5rem 1.5rem 2rem; }
    .qg-hero h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
    .qg-hero .lead { font-size: .9rem; max-width: 100%; }
    .qg-hero .hero-actions { flex-direction: column; align-items: stretch; gap: .5rem; }
    .qg-hero .hero-actions .btn { width: 100%; font-size: .85rem; }
    .qg-hero .hero-trust { font-size: .72rem; gap: .25rem !important; }
    .qg-hero .hero-trust li { padding: .2rem .5rem; font-size: .7rem; }
    .hero-visual-stack { min-height: 280px; margin-top: 1.5rem; }
    .hero-quiz-card { max-width: 100%; margin-left: 0; }
    .hero-score-card { top: -5px; left: 0; }
    .hero-streak-card { bottom: 10px; right: 0; }
}
@media (max-width: 575.98px) {
    .qg-hero { padding: 2rem 1rem 1.5rem; border-radius: 12px; }
    .qg-hero h1 { font-size: 1.4rem; }
    .hero-visual-stack { min-height: 260px; }
    .hero-chip { display: none; }
}

.carousel-caption .qg-hero-badge {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

/* ============================================================
   Potato mascot
   ============================================================ */

.qg-mascot {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    background: radial-gradient(circle at 32% 28%, #f6e2b0, #e7bd66 55%, #c5923d);
    border-radius: 42% 58% 48% 52% / 55% 48% 52% 45%;
    border: 3px solid rgba(255, 255, 255, .75);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    animation: qg-bob 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}
.qg-mascot::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    width: 42px;
    height: 16px;
    transform: translateX(-50%);
    border-radius: 50% 50% 40% 40%;
    background: #8a5a12;
}
.qg-mascot::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), transparent 45%);
    pointer-events: none;
}

.qg-mascot-sm {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 32% 28%, #f6e2b0, #e7bd66 55%, #c5923d);
    border-radius: 42% 58% 48% 52% / 55% 48% 52% 45%;
    border: 2px solid rgba(255, 255, 255, .7);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
    flex: 0 0 auto;
}

/* ============================================================
   Stats strip — clean row, no negative margin hack
   ============================================================ */

.qg-stat-strip {
    background: #fff;
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow-sm);
    position: relative;
    z-index: 3;
    border: 1px solid var(--qg-line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.qg-stat {
    text-align: center;
    padding: 1.3rem .5rem;
    position: relative;
}
.qg-stat + .qg-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--qg-line);
}
.qg-stat:first-child::before { display: none; }
.qg-stat .num {
    font-size: 1.65rem;
    font-weight: 900;
    color: var(--qg-ink);
    letter-spacing: -.02em;
}
.qg-stat .lbl {
    font-size: .78rem;
    color: var(--qg-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ============================================================
   Neutral accent colors (modern white)
   ============================================================ */

.st-amber, .st-indigo, .st-emerald, .st-rose, .st-sky, .st-violet { color: var(--qg-ink); }

.kicker-amber, .kicker-indigo, .kicker-emerald,
.kicker-rose, .kicker-sky, .kicker-violet {
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
}

.hero-chip.c-amber, .hero-chip.c-indigo, .hero-chip.c-emerald,
.hero-chip.c-rose, .hero-chip.c-sky, .hero-chip.c-violet {
    color: var(--qg-ink);
    border-color: var(--qg-line);
    background: #fff;
}

.feat-amber, .feat-indigo, .feat-emerald,
.feat-rose, .feat-sky, .feat-violet {
    background: var(--qg-grad);
}

/* ============================================================
   Section headings
   ============================================================ */

.section-title { letter-spacing: -.02em; font-weight: 900; }
.section-sub { color: var(--qg-muted); font-weight: 500; }

.section-kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
    padding: .3rem .85rem;
    border-radius: 50rem;
    margin-bottom: .65rem;
}

.view-all {
    font-weight: 700;
    font-size: .88rem;
    color: var(--qg-primary-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, gap .15s ease;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.view-all:hover { color: var(--qg-primary); gap: .45rem; }

/* ============================================================
   Cards — quiz cards, general cards
   ============================================================ */

.card-quiz {
    border: 1px solid var(--qg-line);
    background: var(--qg-card);
    box-shadow: var(--qg-shadow-sm);
    border-radius: var(--qg-radius);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-quiz:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    border-color: rgba(var(--qg-primary-rgb), .3);
}

.quiz-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 6px 14px rgba(17, 24, 39, .15);
    flex: 0 0 auto;
}

/* ============================================================
   Battle arena
   ============================================================ */

.opt-btn.btn-primary-qg,
.opt-btn.btn-primary-qg:hover {
    background: var(--qg-grad);
    border-color: transparent;
    color: var(--qg-primary-ink);
    box-shadow: 0 4px 14px rgba(var(--qg-primary-rgb), .28);
}

.opt-btn .opt-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: var(--qg-radius-sm);
    background: var(--qg-primary);
    color: var(--qg-primary-ink);
    font-weight: 800;
    font-size: .72rem;
    margin-right: .6rem;
}
.opt-btn.btn-primary-qg .opt-key { background: rgba(255, 255, 255, .18); }

.opt-btn.pick-me {
    background: linear-gradient(135deg, var(--qg-primary-dark), var(--qg-primary));
    border-color: transparent;
    color: var(--qg-primary-ink);
    box-shadow: 0 4px 14px rgba(var(--qg-primary-rgb), .32);
}
.opt-btn.pick-me .opt-key { background: rgba(255, 255, 255, .18); }

.opt-btn.pick-bot {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, .32);
}
.opt-btn.pick-bot .opt-key { background: rgba(255, 255, 255, .22); }

.opt-btn.pick-both {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .32);
}
.opt-btn.pick-both .opt-key { background: rgba(255, 255, 255, .22); }

.battle-mode {
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.battle-mode:hover { transform: translateY(-3px); box-shadow: var(--qg-shadow); }

.battle-mode-active,
.battle-mode-active:hover {
    border-color: var(--qg-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--qg-primary-rgb), .15), var(--qg-shadow);
    transform: translateY(-3px);
}

.battle-coin {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-weight: 800;
    font-size: .78rem;
    padding: .25rem .65rem;
    border-radius: 50rem;
}
.battle-coin i { color: #f59e0b; }

.qg-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: .3rem .9rem;
    border-radius: 50rem;
    background: var(--qg-primary-soft);
    color: var(--qg-primary-dark);
    font-weight: 800;
    font-size: 1.25rem;
    transition: background .2s ease, color .2s ease;
}
.qg-timer.warn {
    background: #fee2e2;
    color: #b91c1c;
    animation: qg-timer-pulse .5s ease-in-out infinite alternate;
}

@keyframes qg-timer-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* ============================================================
   Mode cards — cleaner
   ============================================================ */

.mode-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    padding: 1.5rem;
    box-shadow: var(--qg-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.mode-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    opacity: .12;
    pointer-events: none;
}
.mode-card .mode-top { display: flex; align-items: center; gap: .85rem; margin-bottom: .75rem; }
.mode-card .mode-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: .14;
    pointer-events: none;
    filter: blur(2px);
}
.mode-card h6 { font-weight: 800; margin: 0; font-size: 1rem; }
.mode-card small { color: var(--qg-muted); line-height: 1.4; display: block; margin-bottom: .75rem; }
.mode-card .btn { width: 100%; margin-top: auto; border-radius: var(--qg-radius-sm); }

/* ============================================================
   Topic cards
   ============================================================ */

.topic-card { height: 100%; }
.topic-card .topic-top { display: flex; align-items: center; gap: .85rem; margin-bottom: .5rem; }
.topic-card h6 { font-weight: 800; margin: 0; }
.topic-card small { color: var(--qg-muted); line-height: 1.4; }
.topic-card .btn { width: 100%; margin-top: auto; border-radius: var(--qg-radius-sm); }

.new-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .68rem;
    font-weight: 800;
    color: var(--qg-primary-dark);
    background: var(--qg-primary-soft);
    border-radius: 50rem;
    padding: .2rem .55rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .68rem;
    font-weight: 800;
    color: #ea580c;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    border-radius: 50rem;
    padding: .2rem .55rem;
    white-space: nowrap;
}

/* ============================================================
   Theme thumbs — taller for QuizHub style
   ============================================================ */

.theme-thumb,
.topic-thumb {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--qg-radius);
    background: linear-gradient(135deg, var(--qg-primary), #8b5cf6);
}
.topic-thumb img,
.theme-thumb img { width: 100%; height: 100%; object-fit: cover; }
.topic-thumb i,
.theme-thumb i {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, .92);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .25));
}

.theme-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, .4));
    pointer-events: none;
}

.level-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, .6);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    padding: .2rem .6rem;
    border-radius: 50rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

/* ============================================================
   Category cards — QuizHub style with large image thumbnail
   ============================================================ */

.cat-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.05rem;
    height: 100%;
    text-decoration: none;
    color: var(--qg-ink);
}
.cat-card:hover { color: var(--qg-ink); }

.cat-card .cat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--qg-primary-ink);
    flex: 0 0 auto;
}
.cat-card h6 { font-weight: 800; margin: 0; }
.cat-card small { color: var(--qg-muted); }
.cat-card .bi-chevron-right { transition: transform .15s ease; }
.cat-card:hover .bi-chevron-right { transform: translateX(3px); color: var(--qg-primary) !important; }

/* Homepage category scroll strip */
.cat-scroll-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: none;
}
.cat-scroll-strip::-webkit-scrollbar { display: none; }
.cat-scroll-item {
    flex: 0 0 calc(25% - .75rem);
    min-width: 0;
    scroll-snap-align: start;
}
@media (max-width: 991px) {
    .cat-scroll-item { flex: 0 0 calc(33.333% - .67rem); }
}
@media (max-width: 767px) {
    .cat-scroll-strip { gap: .75rem; padding-bottom: .25rem; }
    .cat-scroll-item { flex: 0 0 calc(80% - .38rem); }
}
@media (max-width: 575px) {
    .cat-scroll-item { flex: 0 0 calc(85% - .32rem); }
}
.cat-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
    background: var(--qg-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-thumb i {
    font-size: 2.2rem;
    color: var(--qg-primary);
}

.cat-card-v {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 0;
    padding: 0;
    height: 100%;
    border-radius: var(--qg-radius);
    background: #fff;
    border: 1px solid var(--qg-line);
    overflow: hidden;
    box-shadow: var(--qg-shadow-sm);
    text-decoration: none;
    color: var(--qg-ink);
    transition: transform .2s ease, box-shadow .2s ease;
}
.cat-card-v:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    color: var(--qg-ink);
}
.cat-card-v .cat-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
    background: var(--qg-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-card-v .cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-card-v .cat-thumb i {
    font-size: 2.2rem;
    color: var(--qg-primary);
}
.cat-card-v .cat-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.cat-card-v .cat-icon {
    display: none;
}
.cat-card-v h6 {
    font-weight: 800;
    margin: 0;
    font-size: .98rem;
}
.cat-card-v .cat-meta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--qg-muted);
    font-weight: 600;
}
.cat-card-v .cat-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--qg-primary-soft);
    color: var(--qg-primary-dark);
    margin-top: .5rem;
    align-self: flex-start;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.cat-card-v:hover .cat-arrow {
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    transform: translateX(2px);
}

/* ============================================================
   Feature cards — clean centered, no step numbers
   ============================================================ */

.feature-card {
    position: relative;
    height: 100%;
    text-align: center;
    padding: 2rem 1.3rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.feature-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--qg-grad);
    opacity: .06;
    pointer-events: none;
}
.feature-card .feat-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 1rem;
    border-radius: var(--qg-radius);
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: var(--qg-glow);
    transition: transform .2s ease;
}
.feature-card:hover .feat-icon { transform: translateY(-4px) rotate(-3deg) scale(1.04); }

.feature-card .feat-step { display: none; }
.feature-card h5 { font-weight: 800; margin-bottom: .45rem; }
.feature-card p { color: var(--qg-muted); font-weight: 500; margin-bottom: 0; font-size: .92rem; }

.feature-blurb { text-align: center; padding: 1.5rem 1rem; }
.feature-blurb .feat-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto .9rem;
    border-radius: var(--qg-radius);
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--qg-glow);
}
.feature-blurb h6 { font-weight: 800; }
.feature-blurb p { color: var(--qg-muted); font-size: .88rem; font-weight: 500; }

/* ============================================================
   Dashboard stat cards
   ============================================================ */

.stat-card {
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--qg-shadow-sm);
    display: flex;
    align-items: center;
    gap: .85rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--qg-shadow); }

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--qg-primary-ink);
    flex: 0 0 auto;
}
.stat-card .stat-value { font-size: 1.3rem; font-weight: 900; line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: var(--qg-muted); font-weight: 600; }

/* ============================================================
   Page hero (inner pages)
   ============================================================ */

.page-hero {
    background:
        radial-gradient(700px 300px at 92% -25%, rgba(var(--qg-primary-rgb), .05), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--qg-line);
    color: var(--qg-ink);
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(var(--qg-primary-rgb), .05);
    top: -90px;
    right: -50px;
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; padding-top: 2rem; padding-bottom: 2rem; }

.page-hero-icon {
    width: 68px;
    height: 68px;
    border-radius: var(--qg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--qg-primary-dark);
    background: #fff;
    border: 1px solid rgba(var(--qg-primary-rgb), .25);
    flex: 0 0 auto;
    box-shadow: var(--qg-shadow);
}
.page-hero-img {
    width: 68px;
    height: 68px;
    border-radius: var(--qg-radius);
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: var(--qg-shadow);
    border: 2px solid rgba(var(--qg-primary-rgb), .25);
}

.page-kicker {
    display: inline-block;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    background: var(--qg-primary-soft);
    border: 1px solid rgba(var(--qg-primary-rgb), .25);
    padding: .25rem .75rem;
    border-radius: 50rem;
    margin-bottom: .4rem;
    color: var(--qg-primary-dark);
}
.page-title {
    font-weight: 900;
    letter-spacing: -.02em;
    margin: 0;
    font-size: 1.55rem;
    color: var(--qg-ink);
}
.page-sub { color: var(--qg-muted); font-weight: 500; margin-bottom: 0; }

.btn-back {
    background: #fff;
    border: 1px solid var(--qg-line);
    color: var(--qg-ink);
    font-weight: 700;
    border-radius: var(--qg-radius-sm);
    white-space: nowrap;
    transition: all .18s ease;
}
.btn-back:hover { background: var(--qg-primary-soft); color: var(--qg-primary-dark); transform: translateY(-2px); }

/* Legacy dash-header */
.dash-header {
    background:
        radial-gradient(600px 240px at 95% -20%, rgba(var(--qg-primary-rgb), .06), transparent 55%),
        #ffffff;
    color: var(--qg-ink);
    border-radius: var(--qg-radius);
    padding: 1.5rem 1.6rem;
    box-shadow: var(--qg-shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--qg-line);
}
.dash-header::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(var(--qg-primary-rgb), .05);
    top: -70px;
    right: -40px;
    pointer-events: none;
}

/* Page inner headings */
.page-head h4 { font-weight: 900; letter-spacing: -.02em; }
.page-head small { color: var(--qg-muted); font-weight: 500; }

/* ============================================================
   Player / quiz screens
   ============================================================ */

.play-shell {
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow);
}
.opt-shell {
    background: var(--qg-surface);
    border-radius: var(--qg-radius-sm);
    border: 1px solid var(--qg-line);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.opt-shell:hover { border-color: rgba(var(--qg-primary-rgb), .4); transform: translateY(-1px); }
.opt-shell .form-check-input:checked,
.opt-shell .form-check-input:focus { border-color: var(--qg-primary); background-color: var(--qg-primary); box-shadow: none; }
.opt-shell.border-primary { border-color: var(--qg-primary) !important; box-shadow: 0 0 0 3px var(--qg-primary-soft); }

/* ============================================================
   Search
   ============================================================ */

.search-panel {
    border-radius: var(--qg-radius);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(600px 240px at 95% -20%, rgba(var(--qg-primary-rgb), .05), transparent 55%),
        #ffffff;
    border: 1px solid var(--qg-line);
}
.search-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(var(--qg-primary-rgb), .05);
    pointer-events: none;
}
.search-panel .section-kicker { color: var(--qg-primary-dark); }
.search-panel .search-panel-title { color: var(--qg-ink); }
.search-panel .search-count { color: var(--qg-muted); }

.search-box { position: relative; max-width: 540px; }
.search-box > i {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--qg-muted);
    z-index: 2;
}
.search-box .form-control {
    padding: .8rem 1rem .8rem 2.8rem;
    border-radius: var(--qg-radius-sm);
    border: 1px solid var(--qg-line);
    font-size: .95rem;
    font-weight: 500;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box .form-control:focus {
    border-color: var(--qg-primary);
    box-shadow: 0 0 0 3px var(--qg-primary-soft);
}

.search-panel-title {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 800;
    color: var(--qg-ink);
    text-align: center;
    margin: 0 0 1rem;
}
.search-count {
    display: none;
    font-size: .8rem;
    font-weight: 700;
    color: var(--qg-muted);
}
.search-count.show { display: inline-block; }
.search-no-result { display: none; }

.search-results {
    max-width: 620px;
    margin: .7rem auto 0;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    background: var(--qg-card);
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow);
    padding: .8rem .8rem .35rem;
}
.search-results .res-group + .res-group { margin-top: .85rem; }
.search-results .res-group-title {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--qg-muted);
    margin: 0 0 .3rem .3rem;
}
.search-results .res-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .65rem;
    border-radius: var(--qg-radius-sm);
    text-decoration: none;
    color: var(--qg-ink);
    transition: background .14s ease, color .14s ease;
}
.search-results .res-item:hover { background: var(--qg-primary-soft); color: var(--qg-primary-dark); }

.search-results .res-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #fff;
    flex: 0 0 auto;
}
.qg-res-categories { background: var(--qg-grad); color: var(--qg-primary-ink); }
.qg-res-subcategories { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.qg-res-quizzes { background: linear-gradient(135deg, #f97316, #f59e0b); }

.search-results .res-meta { display: flex; flex-direction: column; min-width: 0; }
.search-results .res-label { font-weight: 700; font-size: .9rem; }
.search-results .res-meta small { color: var(--qg-muted); }
.search-results .res-meta .res-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-results-empty {
    text-align: center;
    color: var(--qg-muted);
    font-weight: 500;
    padding: 1.1rem .5rem;
}
.search-results-empty i { display: block; font-size: 1.5rem; margin-bottom: .35rem; }

/* ============================================================
   Daily Dose banner
   ============================================================ */

.dose-banner {
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(255, 255, 255, .07), transparent 55%),
        linear-gradient(135deg, #111c33, #0f172a);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--qg-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--qg-shadow-lg);
}
.dose-banner::after {
    content: '\F1F6';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: -24px;
    bottom: -40px;
    font-size: 12rem;
    opacity: .1;
    transform: rotate(-8deg);
    pointer-events: none;
}
.dose-banner h2 { font-weight: 900; letter-spacing: -.02em; color: #fff; }
.dose-banner p { color: rgba(226, 232, 240, .75); font-weight: 500; }
.dose-banner .btn-primary-qg { font-weight: 700; }
.dose-banner .qg-hero-badge { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }

/* ============================================================
   CTA banner — rounded-xl card with gradient
   ============================================================ */

.qg-cta {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    border-radius: var(--qg-radius);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--qg-shadow-lg);
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 3rem 2.5rem;
}
.qg-cta::before,
.qg-cta::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.qg-cta::before {
    width: 220px;
    height: 220px;
    top: -100px;
    left: -50px;
    background: rgba(255, 255, 255, .08);
}
.qg-cta::after {
    width: 160px;
    height: 160px;
    bottom: -70px;
    right: 80px;
    background: rgba(255, 255, 255, .06);
}
.qg-cta h2 { font-weight: 900; letter-spacing: -.02em; color: #fff; }
.qg-cta p { color: rgba(255, 255, 255, .85); font-weight: 500; }
.qg-cta .btn-white-qg { font-weight: 700; }
.qg-cta .btn-primary-qg { font-weight: 700; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); }
.qg-cta .btn-primary-qg:hover { background: rgba(255,255,255,.3); }
.qg-cta .qg-hero-badge { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }

/* ============================================================
   Sidebar extras
   ============================================================ */

.sidebar-card { border-radius: var(--qg-radius); }
.sidebar-card .side-title {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--qg-primary-dark);
}

/* ============================================================
   Auth pages
   ============================================================ */

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 3rem 1rem;
    background:
        radial-gradient(700px 320px at 8% 0%, rgba(var(--qg-primary-rgb), .1), transparent 55%),
        radial-gradient(700px 320px at 100% 100%, rgba(var(--qg-primary-rgb), .08), transparent 55%),
        var(--qg-cream);
}
.auth-card {
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow-lg);
    border: 1px solid var(--qg-line);
}
.auth-brand {
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    border-radius: var(--qg-radius);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--qg-glow);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--qg-line);
    background: #fff;
    color: var(--qg-ink);
    font-weight: 600;
    border-radius: var(--qg-radius-sm);
    transition: all .15s ease;
}
.btn-google:hover,
.btn-google:focus {
    border-color: rgba(var(--qg-primary-rgb), .4);
    background: #fafbff;
    color: var(--qg-ink);
    box-shadow: 0 4px 14px rgba(var(--qg-primary-rgb), .1);
}

.divider-text {
    position: relative;
    color: var(--qg-muted);
    font-size: .8rem;
}
.divider-text::before,
.divider-text::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--qg-line);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }
.divider-text span { background: #fff; padding: 0 .6rem; position: relative; z-index: 1; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
    background: var(--qg-footer);
    color: #94a3b8;
    position: relative;
}
.footer-gradient-bar {
    height: 4px;
    background: var(--qg-grad-wide);
    border: none;
}
.footer a { color: #94a3b8; text-decoration: none; transition: color .15s ease; }
.footer a:hover { color: #fff; }
.footer h6 { color: #fff; font-weight: 800; letter-spacing: .02em; }

.footer .footer-desc {
    max-width: 320px;
    opacity: .8;
    font-size: .85rem;
    line-height: 1.6;
}
.footer .footer-small-text {
    font-size: .8rem;
    opacity: .7;
    line-height: 1.5;
}

.footer .footer-badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 600;
    color: #a5b4fc;
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(99, 102, 241, .2);
    padding: .2rem .6rem;
    border-radius: 20px;
}

.footer .foot-link {
    transition: color .15s ease, padding-left .15s ease, opacity .15s ease;
    opacity: .85;
    font-size: .88rem;
}
.footer .foot-link:hover { padding-left: 4px; opacity: 1; color: #fff; }

.footer .foot-head {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
    color: #e2e8f0;
}
.footer .foot-head i { color: var(--qg-primary-2); }

.footer .footer-top { padding: 3.5rem 0 2.5rem; }
.footer .footer-brand { text-decoration: none; }
.footer .footer-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--qg-radius-sm);
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    font-size: 1.2rem;
    box-shadow: var(--qg-glow);
}
.footer .footer-contact p { color: #94a3b8; font-size: .82rem; }
.footer .footer-contact i { color: var(--qg-primary-2); }

.footer .newsletter-form .form-control {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    border-radius: var(--qg-radius-sm) 0 0 var(--qg-radius-sm);
    padding: .55rem .85rem;
    font-size: .85rem;
}
.footer .newsletter-form .form-control::placeholder { color: #64748b; }
.footer .newsletter-form .form-control:focus {
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
    border-color: var(--qg-primary);
    color: #fff;
}
.footer .newsletter-form .btn {
    border-radius: 0 var(--qg-radius-sm) var(--qg-radius-sm) 0;
    padding: .55rem .9rem;
}

.footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 1.2rem 0;
    background: rgba(0, 0, 0, .25);
}
.footer .footer-bottom a { font-size: .82rem; }
.footer .footer-bottom a:hover { color: var(--qg-primary-2); }

.footer-accent { display: none; }

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #cbd5e1;
    transition: all .2s ease;
    text-decoration: none;
}
.footer-social:hover {
    background: var(--qg-primary);
    border-color: var(--qg-primary);
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
.footer-social img { filter: brightness(0) invert(1); opacity: .8; }
.footer-social:hover img { filter: none; opacity: 1; }

/* ============================================================
   Page Hero (Category / Subcategory pages)
   ============================================================ */

.qg-page-hero {
    position: relative;
    padding: 3rem 0 2.5rem;
    color: #fff;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.qg-page-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(.4);
    transform: scale(1.1);
}
.qg-page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,.88) 0%, rgba(15,23,42,.7) 100%);
}
.qg-page-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--qg-radius);
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.qg-page-hero-img {
    width: 56px;
    height: 56px;
    border-radius: var(--qg-radius);
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.2);
    flex-shrink: 0;
}
.qg-page-kicker {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    opacity: .7;
}
.qg-page-title {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
}
.qg-page-subtitle {
    font-size: .9rem;
    opacity: .8;
    margin-top: .4rem;
}
.qg-back-link {
    font-size: .82rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-bottom: .8rem;
    transition: color .15s;
}
.qg-back-link:hover { color: #fff; }

.qg-category-card {
    transition: transform .2s, box-shadow .2s;
}
.qg-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--qg-shadow-lg);
}
.qg-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: .2rem .6rem;
    border-radius: 12px;
    font-size: .68rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

/* ============================================================
   Play Hero (Start / Result screens)
   ============================================================ */

.qg-play-hero {
    border-radius: var(--qg-radius);
    padding: 3rem 2rem;
    color: #fff;
    overflow: hidden;
    position: relative;
}
.qg-play-hero::before {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -80px;
    right: -40px;
    pointer-events: none;
}
.qg-play-hero::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    bottom: -60px;
    left: -30px;
    pointer-events: none;
}
.qg-play-hero-content {
    position: relative;
    z-index: 2;
}
.qg-play-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin: .3rem 0;
}
.qg-play-subtitle {
    font-size: .9rem;
    opacity: .85;
    margin-bottom: .5rem;
}

.qg-play-hero .form-select {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    border-radius: var(--qg-radius-sm);
}
.qg-play-hero .form-select option { color: #000; background: #fff; }
.qg-play-hero .form-select:focus {
    border-color: rgba(255,255,255,.4);
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.15);
}

/* ============================================================
   Quiz Detail Page
   ============================================================ */

.qg-quiz-hero {
    position: relative;
    padding: 4rem 0 3rem;
    margin-bottom: 0;
    overflow: hidden;
    color: #fff;
    min-height: 380px;
    display: flex;
    align-items: center;
}
.qg-quiz-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(.35);
    transform: scale(1.1);
}
.qg-quiz-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,.92) 0%, rgba(15,23,42,.75) 100%);
}
.qg-quiz-title {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: .5rem;
    max-width: 550px;
}
.qg-quiz-subtitle {
    font-size: .95rem;
    opacity: .8;
    margin-bottom: 1.2rem;
}
.qg-quiz-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.qg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
}
.qg-stat i { font-size: 1.1rem; opacity: .9; }
.qg-stat span { font-weight: 700; font-size: 1rem; }
.qg-stat small { font-size: .7rem; opacity: .65; text-transform: uppercase; letter-spacing: .04em; }
.qg-quiz-hero-img {
    max-width: 260px;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--qg-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    border: 3px solid rgba(255,255,255,.15);
}
.qg-quiz-hero-placeholder {
    width: 180px;
    height: 180px;
    border-radius: var(--qg-radius);
    background: rgba(255,255,255,.08);
    border: 2px dashed rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    opacity: .5;
    margin: 0 auto;
}
.qg-badge {
    display: inline-flex;
    align-items: center;
    padding: .3rem .8rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.qg-tabs .nav-link {
    border-radius: var(--qg-radius-sm);
    font-weight: 600;
    font-size: .88rem;
    color: var(--qg-muted);
    padding: .6rem 1.2rem;
    transition: all .2s;
}
.qg-tabs .nav-link.active {
    background: var(--qg-primary) !important;
    color: #fff !important;
}
.qg-tabs .nav-link:not(.active):hover {
    background: var(--qg-primary-soft);
    color: var(--qg-primary);
}

/* ============================================================
   Empty states
   ============================================================ */

.empty-state { padding: 3rem 1.5rem; text-align: center; }
.empty-state i { font-size: 2.5rem; }
.empty-state p { color: var(--qg-muted); font-weight: 500; }

/* ============================================================
   Animations
   ============================================================ */

@keyframes qg-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: qg-fade-up .45s ease both; }

@keyframes qg-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-16px) scale(1.04); }
}

@keyframes chip-bob {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-8px) rotate(var(--rot, 0deg)); }
}

@keyframes qg-bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

/* ============================================================
   Playful homepage sections — NO colored tint backgrounds
   ============================================================ */

.section-tint { padding: 3.5rem 0; }
.bg-tint-purple,
.bg-tint-blue,
.bg-tint-pink,
.bg-tint-yellow,
.bg-tint-green,
.bg-tint-gray {
    background: transparent !important;
}

/* Section headers */
.sec-head { margin-bottom: 2.2rem; }
.sec-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: .35rem .9rem;
    border-radius: 50rem;
}
.sec-kicker.k-purple { color: #7c3aed; background: #ede9fe; }
.sec-kicker.k-blue { color: #2563eb; background: #dbeafe; }
.sec-kicker.k-pink { color: #db2777; background: #fce7f3; }
.sec-kicker.k-yellow { color: #b45309; background: #fef3c7; }
.sec-kicker.k-green { color: #047857; background: #d1fae5; }
.sec-kicker.k-navy { color: #1e293b; background: #e2e8f0; }

.sec-title { font-weight: 900; letter-spacing: -.02em; color: var(--qg-ink); }
.sec-sub { color: var(--qg-muted); font-weight: 500; max-width: 600px; }

/* Gradient icon chips */
.grad-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.grad-blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.grad-pink { background: linear-gradient(135deg, #ec4899, #f472b6); }
.grad-yellow { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.grad-green { background: linear-gradient(135deg, #10b981, #34d399); }
.grad-navy { background: linear-gradient(135deg, #1e293b, #334155); }

/* Hero quiz cards (right rail) — kept for legacy */
.hero-play { position: relative; }
.hero-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .9rem;
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow);
    padding: .95rem 1.1rem;
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 1;
    color: inherit;
}
.hero-card:hover { transform: translateY(-3px); box-shadow: var(--qg-shadow-lg); }

.hero-card .hc-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .14);
}
.hero-card h6 { font-weight: 800; margin: 0; font-size: .95rem; }
.hero-card small { color: var(--qg-muted); font-weight: 500; }

.hero-card .hc-go {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--qg-primary-soft);
    color: var(--qg-primary-dark);
    flex: 0 0 auto;
    transition: all .15s ease;
}
.hero-card:hover .hc-go {
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    transform: translateX(2px);
}
.hero-card.float-a { animation: chip-bob 6s ease-in-out infinite; }
.hero-card.float-b { animation: chip-bob 7s ease-in-out infinite reverse; animation-delay: .6s; }
.hero-card.float-c { animation: chip-bob 5.5s ease-in-out infinite; animation-delay: 1.1s; }

/* Hero CTA */
.hero-cta .btn { font-weight: 700; }
.hero-tagline { color: var(--qg-muted); font-weight: 500; }
.hero-bullets li { list-style: none; display: flex; align-items: center; gap: .5rem; font-weight: 600; color: #475569; }
.hero-bullets i { color: var(--c-green); }

/* Popular / trending cards */
.pop-card { height: 100%; border-radius: var(--qg-radius); color: inherit; }
.pop-card:hover { color: inherit; }
.pop-card .pop-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex: 0 0 auto;
}
.pop-card .pop-meta {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .76rem;
    font-weight: 600;
    color: var(--qg-muted);
}
.pop-card .pop-meta i { color: var(--c-yellow); }
.pop-card h6 { font-weight: 800; }
.pop-card .btn { border-radius: var(--qg-radius-sm); }

/* ============================================================
   Featured collections — QuizHub style
   Image thumbnail at top, title, description, action link
   ============================================================ */

.collection-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    border-radius: var(--qg-radius);
    background: #fff;
    border: 1px solid var(--qg-line);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--qg-ink);
    box-shadow: var(--qg-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.collection-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); color: var(--qg-ink); }

.collection-card .cc-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
}
.collection-card .cc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.collection-card:hover .cc-thumb img {
    transform: scale(1.05);
}
.collection-card .cc-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.collection-card .cc-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--qg-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
}
.collection-card .cc-body {
    padding: 1.1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.collection-card h5 { font-weight: 800; letter-spacing: -.01em; margin-bottom: .3rem; }
.collection-card p { color: var(--qg-muted); font-weight: 500; font-size: .88rem; margin-bottom: .75rem; flex: 1; }
.collection-card .cc-count { font-size: .78rem; font-weight: 800; color: var(--qg-muted); }
.collection-card .cc-arrow {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 700;
    font-size: .88rem;
    border-radius: 50rem;
    padding: .4rem 1rem;
    background: var(--qg-primary-soft);
    color: var(--qg-primary-dark);
    transition: gap .15s ease, background .15s ease, color .15s ease;
}
.collection-card:hover .cc-arrow {
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    gap: .6rem;
}

.cc-purple { background: linear-gradient(160deg, #ede9fe, #ddd6fe); }
.cc-blue { background: linear-gradient(160deg, #dbeafe, #bfdbfe); }
.cc-pink { background: linear-gradient(160deg, #fce7f3, #fbcfe8); }
.cc-yellow { background: linear-gradient(160deg, #fef3c7, #fde68a); }
.cc-green { background: linear-gradient(160deg, #d1fae5, #a7f3d0); }

/* ============================================================
   Create-your-own-quiz
   ============================================================ */

.create-zone {
    position: relative;
    border: 2px dashed rgba(var(--qg-primary-rgb), .35);
    border-radius: var(--qg-radius);
    padding: 2.8rem 1.8rem;
    background:
        radial-gradient(600px 240px at 90% -20%, rgba(var(--qg-primary-rgb), .06), transparent 55%),
        linear-gradient(180deg, #ffffff, #f8f7ff);
    overflow: hidden;
}
.create-step {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    padding: .95rem 1.1rem;
    height: 100%;
    box-shadow: var(--qg-shadow-sm);
}
.create-step .cs-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    flex: 0 0 auto;
}
.create-step h6 { font-weight: 800; margin: 0; font-size: .95rem; }
.create-step small { color: var(--qg-muted); font-weight: 500; }

/* ============================================================
   Community / social
   ============================================================ */

.community-card {
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: var(--qg-radius);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    box-shadow: var(--qg-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.community-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }

.community-card .co-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--qg-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}
.community-card h6 { font-weight: 800; margin: 0; }
.community-card p { color: var(--qg-muted); font-weight: 500; font-size: .9rem; margin: 0; }
.community-card .co-stat { font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; }

.social-big {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--qg-radius-sm);
    color: #fff;
    font-size: 1.2rem;
    transition: transform .18s ease, box-shadow .18s ease;
}
.social-big:hover { transform: translateY(-3px); color: #fff; box-shadow: 0 8px 20px rgba(15, 23, 42, .18); }

/* ============================================================
   Quiz carousel
   ============================================================ */

.qg-carousel { position: relative; }
.qg-carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--qg-line) transparent;
    padding: .2rem .2rem 1.2rem;
    -webkit-overflow-scrolling: touch;
}
.qg-carousel-track::-webkit-scrollbar { height: 6px; }
.qg-carousel-track::-webkit-scrollbar-thumb { background: var(--qg-line); border-radius: 50rem; }

.qg-carousel-item {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: start;
}
@media (min-width: 576px) { .qg-carousel-item { flex: 0 0 calc(50% - .5rem); } }
@media (min-width: 992px) { .qg-carousel-item { flex: 0 0 calc(33.333% - .667rem); } }
@media (min-width: 1200px) { .qg-carousel-item { flex: 0 0 calc(25% - .75rem); } }

.qg-carousel-arrow {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--qg-line);
    background: #fff;
    color: var(--qg-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--qg-shadow);
    z-index: 5;
    cursor: pointer;
    transition: all .15s ease;
}
.qg-carousel-arrow:hover {
    background: var(--qg-grad);
    color: var(--qg-primary-ink);
    border-color: transparent;
}
.qg-carousel-arrow.prev { left: -14px; }
.qg-carousel-arrow.next { right: -14px; }

/* ============================================================
   Utility helpers
   ============================================================ */

.text-gradient {
    background: var(--qg-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.shadow-soft { box-shadow: var(--qg-shadow-sm); }
.shadow-normal { box-shadow: var(--qg-shadow); }
.shadow-lifted { box-shadow: var(--qg-shadow-lg); }
.rounded-qg { border-radius: var(--qg-radius); }
.rounded-qg-sm { border-radius: var(--qg-radius-sm); }

/* Smooth transitions for all interactive elements */
a, button, .card-quiz, .hero-card, .community-card, .collection-card,
.pop-card, .cat-card, .cat-card-v, .mode-card, .topic-card, .stat-card,
.feature-card, .btn-primary-qg, .btn-outline-qg, .btn-ghost-qg, .btn-glass,
.btn-white-qg {
    transition-property: transform, box-shadow, color, background, border-color, opacity;
    transition-duration: .18s;
    transition-timing-function: ease;
}

/* Focus-visible ring for accessibility */
:focus-visible {
    outline: 2px solid var(--qg-primary);
    outline-offset: 2px;
}
.btn-primary-qg:focus-visible,
.btn-outline-qg:focus-visible {
    box-shadow: 0 0 0 3px rgba(var(--qg-primary-rgb), .3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--qg-line); border-radius: 50rem; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* Print */
@media print {
    .navbar-qg, .footer, .qg-carousel-arrow { display: none !important; }
    .qg-hero { padding: 1.5rem 0; }
    body { background: #fff; }
}

/* ============================================================
   NEW HOMEPAGE SECTIONS
   ============================================================ */

/* --- Section utils --- */
.section-kicker { display: inline-block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--qg-primary); margin-bottom: .25rem; }
.section-title { font-size: 1.75rem; font-weight: 800; margin-bottom: .25rem; }
.section-sub { color: var(--qg-muted); max-width: 480px; margin: 0 auto; }
.bg-light-subtle { background: #f8fafc; }
.bg-gradient-dark { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }

/* --- Category cards --- */
.cat-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem .75rem; border-radius: 12px; background: #fff; border: 1px solid var(--qg-line); transition: all .25s ease; text-decoration: none; color: inherit; }
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(99,102,241,.12); border-color: var(--qg-primary); color: inherit; }
.cat-card-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--qg-primary), var(--qg-secondary)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: .5rem; }
.cat-card-name { font-size: .85rem; font-weight: 600; margin-bottom: .15rem; }
.cat-card-count { font-size: .72rem; color: var(--qg-muted); }

/* --- Tabs --- */
.qg-tabs { gap: .5rem; flex-wrap: wrap; }
.qg-tabs .nav-link { border-radius: 50rem; padding: .4rem 1.1rem; font-size: .85rem; font-weight: 600; color: var(--qg-muted); border: 1px solid var(--qg-line); background: #fff; transition: all .2s; }
.qg-tabs .nav-link:hover { color: var(--qg-primary); border-color: var(--qg-primary); }
.qg-tabs .nav-link.active { background: var(--qg-primary); color: #fff; border-color: var(--qg-primary); }

/* --- Player cards --- */
.player-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 1.25rem 1rem; text-align: center; position: relative; transition: transform .25s; }
.player-card:hover { transform: translateY(-4px); }
.player-card-top { border-color: rgba(251,191,36,.3); }
.player-rank-badge { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: #fff; }
.rank-1 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); }
.player-avatar-wrap { width: 64px; height: 64px; margin: 0 auto .5rem; border-radius: 50%; overflow: hidden; border: 3px solid rgba(255,255,255,.2); }
.player-avatar { width: 100%; height: 100%; object-fit: cover; }
.player-avatar-placeholder { width: 100%; height: 100%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: rgba(255,255,255,.5); }
.player-name { font-size: .9rem; font-weight: 700; color: #fff; margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-rank-num { font-size: .75rem; color: rgba(255,255,255,.5); margin-bottom: .5rem; }
.player-stats { display: flex; justify-content: center; gap: 1rem; }
.ps-item { display: flex; flex-direction: column; align-items: center; }
.ps-val { font-size: .95rem; font-weight: 800; color: #fff; }
.ps-lbl { font-size: .65rem; color: rgba(255,255,255,.5); text-transform: uppercase; }

/* --- Winner cards --- */
.winner-card { background: #fff; border: 1px solid var(--qg-line); border-radius: 12px; padding: 1rem; }
.winner-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.winner-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .9rem; }
.winner-name { font-weight: 600; font-size: .85rem; }
.winner-prize { font-weight: 700; color: var(--qg-primary); font-size: .95rem; margin-top: .25rem; }

/* --- How It Works --- */
.hiw-card { text-align: center; padding: 2rem 1.5rem; border-radius: 16px; background: #fff; border: 1px solid var(--qg-line); position: relative; transition: transform .25s; }
.hiw-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.hiw-num { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 50%; background: var(--qg-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.hiw-icon { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1)); color: var(--qg-primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1rem; }

/* --- Testimonials --- */
.testimonial-card { background: #fff; border: 1px solid var(--qg-line); border-radius: 16px; padding: 1.5rem; height: 100%; }
.testimonial-stars { color: #f59e0b; font-size: .85rem; margin-bottom: .75rem; }
.testimonial-text { font-size: .95rem; color: #475569; line-height: 1.6; margin-bottom: 0; font-style: italic; }
.testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--qg-primary), var(--qg-secondary)); color: #fff; display: flex; align-items: center; justify-content: center; }
.testimonial-stats { display: flex; gap: 1rem; padding-top: .75rem; border-top: 1px solid var(--qg-line); }
.testimonial-stats span { font-size: .75rem; color: var(--qg-muted); }

/* --- Refer & Earn --- */
.refer-banner { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%); border-radius: 20px; padding: 3rem; overflow: hidden; }
.refer-visual { font-size: 6rem; opacity: .3; animation: heroFloat 4s ease-in-out infinite; }

/* --- Creator Tips --- */
.tip-card { background: #fff; border: 1px solid var(--qg-line); border-radius: 16px; padding: 1.5rem; height: 100%; transition: transform .25s; }
.tip-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.tip-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1)); color: var(--qg-primary); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: .75rem; }

/* --- Newsletter --- */
.newsletter-box { background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%); border: 1px solid var(--qg-line); border-radius: 16px; padding: 2.5rem; }

/* --- Pagination overrides (Tailwind -> compact) --- */
nav[aria-label="Pagination Navigation"] { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }
nav[aria-label="Pagination Navigation"] a,
nav[aria-label="Pagination Navigation"] span[aria-disabled="true"] {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 4px 10px;
    font-size: .82rem; font-weight: 600; border-radius: 8px;
    border: 1px solid #e2e8f0; background: #fff; color: #475569;
    transition: all .15s;
}
nav[aria-label="Pagination Navigation"] a:hover { background: var(--qg-primary); color: #fff; border-color: var(--qg-primary); }
nav[aria-label="Pagination Navigation"] span[aria-disabled="true"] { opacity: .4; cursor: default; background: #f8fafc; }
nav[aria-label="Pagination Navigation"] .active-page { background: var(--qg-primary); color: #fff; border-color: var(--qg-primary); }

/* --- Community Thoughts horizontal scroll --- */
.community-thoughts-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.community-thoughts-scroll::-webkit-scrollbar { height: 6px; }
.community-thoughts-scroll::-webkit-scrollbar-track { background: transparent; }
.community-thoughts-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.thought-card { cursor: pointer; }

/* --- Jigsaw Puzzle grid --- */
.jigsaw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.jigsaw-piece {
    border-radius: var(--qg-radius);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.jigsaw-piece:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.jigsaw-head {
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.jigsaw-head h6 { font-size: .95rem; line-height: 1.2; }
.jigsaw-count {
    font-size: .7rem;
    font-weight: 600;
    background: rgba(255,255,255,.25);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.jigsaw-subs {
    padding: .6rem 1rem .8rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.jigsaw-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: .82rem;
    color: #475569;
    text-decoration: none;
    transition: background .15s;
}
.jigsaw-sub-item:hover { background: #f1f5f9; color: #1e293b; }
.jigsaw-sub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.jigsaw-more { color: var(--qg-primary); font-weight: 600; }
