/* =============================================================
   TriviaMaster — Main Stylesheet
   File:    css/styles.css
   Author:  TriviaMaster Team
   Purpose: All visual styles for the TriviaMaster UI, including
            CSS custom properties (design tokens), neumorphic
            component styles, layout, animations, and responsive
            breakpoints.
   ============================================================= */


/* ─────────────────────────────────────────
   1. GLOBAL RESET & BOX MODEL
   ───────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    /* Smooth theme transitions on every element */
    transition:
        background-color 0.3s ease,
        color            0.3s ease,
        box-shadow       0.2s ease,
        transform        0.2s ease;
}


/* ─────────────────────────────────────────
   2. DESIGN TOKENS — LIGHT MODE (default)
   CSS custom properties act as a single
   source of truth for all colors/shadows.
   ───────────────────────────────────────── */
:root {
    /* Backgrounds & surface */
    --primary-bg:     #e0e5ec;

    /* Brand colours */
    --primary-accent: #6d5dfc;
    --primary-dark:   #5b0eeb;
    --text-dark:      #3d3d3d;

    /* Neumorphic shadows — outer & inner (pressed) */
    --neumorphic-shadow: 8px 8px 16px #c1c8d1, -8px -8px 16px #ffffff;
    --neumorphic-inset:  inset 5px 5px 10px #c1c8d1, inset -5px -5px 10px #ffffff;

    /* Misc utility tokens */
    --transition:            all 0.3s ease;
    --notification-badge-bg: #ff4757;
    --border-light:          rgba(0, 0, 0, 0.05);
    --modal-overlay:         rgba(0, 0, 0, 0.5);
}


/* ─────────────────────────────────────────
   3. DESIGN TOKENS — DARK MODE
   Toggled via .dark-mode class on <body>.
   ───────────────────────────────────────── */
body.dark-mode {
    --primary-bg:        #1e1e2e;
    --primary-accent:    #9370db;
    --primary-dark:      #7b68ee;
    --text-dark:         #f0f8ff;
    --neumorphic-shadow: 8px 8px 16px #0f0f1a, -8px -8px 16px #2d2d42;
    --neumorphic-inset:  inset 5px 5px 10px #0f0f1a, inset -5px -5px 10px #2d2d42;
    --border-light:      rgba(255, 255, 255, 0.05);
    --modal-overlay:     rgba(0, 0, 0, 0.7);
}


/* ─────────────────────────────────────────
   4. BASE BODY & LAYOUT WRAPPER
   ───────────────────────────────────────── */
body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 20px;
    position: relative;

    /* Layered ambient background — soft brand-color glows + diagonal base.
       Fixed so it doesn't scroll, giving the whole site a premium, cinematic feel. */
    background:
        radial-gradient(circle at 12% 8%,  rgba(109, 93, 252, 0.22), transparent 45%),
        radial-gradient(circle at 88% 92%, rgba(91, 14, 235, 0.18), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4),  transparent 70%),
        linear-gradient(135deg, #f5f7fa 0%, #e0e5ec 55%, #d4d9e3 100%);
    background-attachment: fixed;
}

/* Decorative floating orbs — soft, blurred, anchored to viewport */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
    opacity: 0.55;
}
body::before {
    width: 420px; height: 420px;
    top: -120px; right: -100px;
    background: radial-gradient(circle, var(--primary-accent), transparent 70%);
    animation: orbDriftA 18s ease-in-out infinite;
}
body::after {
    width: 340px; height: 340px;
    bottom: -120px; left: -120px;
    background: radial-gradient(circle, var(--primary-dark), transparent 70%);
    animation: orbDriftB 22s ease-in-out infinite;
}

@keyframes orbDriftA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-30px, 40px) scale(1.08); }
}
@keyframes orbDriftB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(35px, -25px) scale(0.94); }
}

body.dark-mode {
    background:
        radial-gradient(circle at 12% 8%,  rgba(147, 112, 219, 0.20), transparent 45%),
        radial-gradient(circle at 88% 92%, rgba(123, 104, 238, 0.18), transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f1424 100%);
    background-attachment: fixed;
}
body.dark-mode::before { opacity: 0.35; }
body.dark-mode::after  { opacity: 0.30; }

/* Centred content wrapper — 90 % wide, max 1200 px */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Reusable neumorphic card surface */
.neumorphic {
    background: var(--primary-bg);
    border-radius: 20px;
    box-shadow: var(--neumorphic-shadow);
}


/* ─────────────────────────────────────────
   5. ANIMATIONS
   ───────────────────────────────────────── */

/* Wobbling brain logo icon */
@keyframes sillyBrain {
    0%   { transform: scale(1)   rotate(0deg);  }
    25%  { transform: scale(1.2) rotate(-8deg); }
    50%  { transform: scale(1.1) rotate(8deg);  }
    75%  { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1)   rotate(0deg);  }
}

/* Gentle vertical float for topic cards */
@keyframes float {
    0%,
    100% { transform: translateY(0);     }
    50%  { transform: translateY(-10px); }
}

/* Dropdown entrance */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0);     }
}


/* ─────────────────────────────────────────
   6. HEADER & NAVBAR
   ───────────────────────────────────────── */
.main-header {
    padding: 15px 0;
    position: sticky;
    top: 20px;
    z-index: 100;
    margin-bottom: 30px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--primary-bg);
    border-radius: 20px;
    box-shadow: var(--neumorphic-shadow);
    position: sticky;
    top: 8px;
    z-index: 100;
}

/* ── Logo ── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary-accent);
    animation: sillyBrain 2s ease-in-out infinite;
    transform-origin: center;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Nav items group ── */
.nav-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ── Pill segmented nav ──
   Links sit inside an inset "track". A single sliding highlight (.nav-pill)
   moves under the active/hovered link — positioned by navbar.js. */
.nav-links {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 5px;
    border-radius: 40px;
    background: var(--primary-bg);
    box-shadow: var(--neumorphic-inset);
}

/* The sliding highlight behind the active link */
.nav-pill {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 10px);
    width: 0;                /* set by JS */
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(109, 93, 252, 0.35);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}
.nav-links.pill-ready .nav-pill { opacity: 1; }

.nav-links a {
    position: relative;
    z-index: 1;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 30px;
    white-space: nowrap;
    transition: color 0.25s ease;
}

/* When the sliding pill is active, both the current link AND the hovered
   link sit on the coloured pill → their text/icons go white. */
.nav-links.pill-ready a.active,
.nav-links.pill-ready a:hover {
    color: #fff;
}

/* Fallback when JS hasn't positioned the pill (no-JS / first paint / mobile):
   tint with the accent + inset instead of relying on the pill. */
.nav-links:not(.pill-ready) a.active {
    color: var(--primary-accent);
    box-shadow: var(--neumorphic-inset);
}
.nav-links:not(.pill-ready) a:not(.active):hover {
    color: var(--primary-accent);
}


/* ─────────────────────────────────────────
   7. ICON BUTTONS (bell, dark-mode toggle)
   ───────────────────────────────────────── */
.notification-btn,
.dark-mode-toggle {
    background: var(--primary-bg);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    transition: var(--transition);
}

/* Language selector — pill-shaped, slightly wider than icon buttons */
.language-btn {
    background: var(--primary-bg);
    border: none;
    border-radius: 30px;
    padding: 0 12px;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* Pressed/hover state for all icon buttons */
.notification-btn:hover,
.dark-mode-toggle:hover,
.language-btn:hover {
    box-shadow: var(--neumorphic-inset);
    color: var(--primary-accent);
}


/* ─────────────────────────────────────────
   8. NOTIFICATION BADGE
   Red dot with unread count shown over bell.
   ───────────────────────────────────────── */
.notification-container {
    position: relative;     /* anchor for the badge & dropdown */
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--notification-badge-bg);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ─────────────────────────────────────────
   9. DROPDOWN PANELS (notifications, lang,
      profile)
   ───────────────────────────────────────── */
.notification-dropdown,
.language-dropdown,
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: var(--primary-bg);
    border-radius: 20px;
    width: 320px;
    display: none;          /* hidden by default; .active shows it */
    box-shadow: var(--neumorphic-shadow);
    z-index: 1000;
    overflow: hidden;
}

/* Narrower panel for language selector */
.language-dropdown { width: 180px; }

/* Profile panel overrides */
.profile-dropdown { width: 220px !important; }

/* Visible state — slide-in entrance animation */
.notification-dropdown.active,
.language-dropdown.active,
.profile-dropdown.active {
    display: block;
    animation: fadeSlideDown 0.2s ease;
}

/* ─────────────────────────────────────────
   9b. NOTIFICATION DROPDOWN INTERNALS
   Header, settings panel, list, actions
   ───────────────────────────────────────── */
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.notif-settings-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 6px;
    border-radius: 8px;
    transition: var(--transition);
}
.notif-settings-btn:hover {
    color: var(--primary-accent);
    background: rgba(109, 93, 252, 0.08);
}
.notif-settings-btn.active {
    color: var(--primary-accent);
}

/* Settings panel — slides open/closed */
.notif-settings-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(109, 93, 252, 0.03);
    border-bottom: 1px solid transparent;
}
.notif-settings-panel.active {
    max-height: 300px;
    padding: 8px 0;
    border-bottom-color: var(--border-light);
}

.notif-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-dark);
}
.notif-setting-row span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-setting-row i {
    color: var(--primary-accent);
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
}

/* Mini toggle switch */
.notif-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.notif-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.notif-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}
.notif-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.notif-toggle input:checked + .notif-slider {
    background: var(--primary-accent);
}
.notif-toggle input:checked + .notif-slider::before {
    transform: translateX(16px);
}

/* Notification list */
.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(109, 93, 252, 0.04); }
.notif-item.unread { background: rgba(109, 93, 252, 0.07); }
.notif-item.unread:hover { background: rgba(109, 93, 252, 0.12); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.notif-icon.updates    { background: rgba(109, 93, 252, 0.12); color: var(--primary-accent); }
.notif-icon.achievements { background: rgba(255, 193, 7, 0.15); color: #f59e0b; }
.notif-icon.social     { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.notif-icon.streaks    { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.notif-icon.system      { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.notif-icon.tournaments { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 2px;
}
.notif-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
}
.notif-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-accent);
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
}

/* Empty state */
.notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}
.notif-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.4;
    display: block;
}
.notif-empty span {
    font-size: 0.85rem;
}

/* Bottom action buttons */
.notif-actions {
    display: flex;
    border-top: 1px solid var(--border-light);
}
.notif-action-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.notif-action-btn:first-child {
    border-right: 1px solid var(--border-light);
}
.notif-action-btn:hover {
    color: var(--primary-accent);
    background: rgba(109, 93, 252, 0.05);
}
.notif-action-danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}


/* ─────────────────────────────────────────
   10. PROFILE PICTURE & DROPDOWN CONTENT
   ───────────────────────────────────────── */
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neumorphic-shadow);
    cursor: pointer;
    overflow: hidden;
}

.profile-dropdown-inner    { padding: 16px; }
.profile-dropdown-name     { font-weight: 700; margin-bottom: 2px; }
.profile-dropdown-level    { font-size: 0.8rem; opacity: 0.7; }
.profile-dropdown-divider  { height: 1px; background: var(--border-light); margin: 10px 0; }

/* Buttons/links inside the profile panel */
.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--primary-bg);
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 6px;
    box-shadow: var(--neumorphic-shadow);
}

.profile-action-btn:hover { box-shadow: var(--neumorphic-inset); color: var(--primary-accent); }
.profile-action-btn i     { color: var(--primary-accent); width: 18px; text-align: center; }


/* ─────────────────────────────────────────
   11. LANGUAGE OPTION ROWS
   ───────────────────────────────────────── */
.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.language-option:hover       { background: rgba(109, 93, 252, 0.08); color: var(--primary-accent); }
.language-option img         { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }


/* ─────────────────────────────────────────
   12. HERO SECTION
   ───────────────────────────────────────── */
.hero {
    padding: 50px 0;
    margin-bottom: 50px;
}

.hero-content {
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* CTA button row */
.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ─────────────────────────────────────────
   13. NEUMORPHIC BUTTONS
   ───────────────────────────────────────── */
.neumorphic-btn {
    background: var(--primary-bg);
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
    color: var(--text-dark);
    box-shadow: var(--neumorphic-shadow);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.neumorphic-btn:hover { box-shadow: var(--neumorphic-inset); }

/* Primary variant — filled with accent colour */
.neumorphic-btn.primary {
    background: var(--primary-accent);
    color: white;
    box-shadow: 5px 5px 10px #c1c8d1, -5px -5px 10px #ffffff;
}

.neumorphic-btn.primary:hover {
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.2),
                inset -3px -3px 6px rgba(255, 255, 255, 0.7);
}


/* ─────────────────────────────────────────
   14. TOPICS SECTION
   ───────────────────────────────────────── */
.topics-section { margin-bottom: 50px; }

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    opacity: 0.8;
}

/* Auto-filling CSS grid — min 180 px per card */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

/* Individual topic card */
.topic-card {
    background: var(--primary-bg);
    border-radius: 1.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    box-shadow: var(--neumorphic-shadow);
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--neumorphic-inset);
}

.topic-card i           { font-size: 2.5rem; margin-bottom: 15px; color: var(--primary-accent); }
.topic-card h3          { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.25rem; }
.topic-card p           { font-size: 0.8rem; opacity: 0.7; }

/* Floating animation helpers — staggered delays for visual rhythm */
.floating              { animation: float 4s ease-in-out infinite; }
.delay-1               { animation-delay: 0.5s; }
.delay-2               { animation-delay: 1s;   }
.delay-3               { animation-delay: 1.5s; }


/* ─────────────────────────────────────────
   15. FEATURES SECTION
   ───────────────────────────────────────── */
.features-section { margin-bottom: 50px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--primary-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--neumorphic-shadow);
}

.feature-card:hover  { transform: translateY(-5px); box-shadow: var(--neumorphic-inset); }

.feature-icon        { font-size: 3rem;  margin-bottom: 1rem;   color: var(--primary-accent); }
.feature-title       { font-size: 1.3rem; font-weight: 600;     margin-bottom: 0.5rem; }
.feature-description { font-size: 0.9rem; opacity: 0.8; }


/* ─────────────────────────────────────────
   16. LEVEL MODAL
   Full-screen overlay with blur backdrop.
   ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;

    /* Hidden by default — transitions in when .active is added */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

/* Modal card — glass effect */
.modal-container {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 2rem;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(109, 93, 252, 0.15), 0 2px 8px rgba(0,0,0,0.08);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

body.dark-mode .modal-container {
    background: rgba(30, 30, 50, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0,0,0,0.3);
}

.modal-overlay.active .modal-container { transform: scale(1); }

/* Modal top bar */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-accent);
}

.modal-topic-info  { display: flex; align-items: center; gap: 1rem; }

/* Coloured icon badge in the modal header */
.modal-topic-icon {
    width: 55px; height: 55px;
    background: rgba(109, 93, 252, 0.15);
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: var(--primary-accent);
}

.modal-topic-title { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }

/* Close × button */
.close-modal {
    background: var(--primary-bg);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    transition: var(--transition);
    color: var(--text-dark);
}

.close-modal:hover { box-shadow: var(--neumorphic-inset); color: var(--primary-accent); }

/* Custom scrollbar inside the modal */
.modal-container::-webkit-scrollbar       { width: 6px; }
.modal-container::-webkit-scrollbar-track { background: var(--border-light); border-radius: 10px; }
.modal-container::-webkit-scrollbar-thumb { background: var(--primary-accent); border-radius: 10px; }


/* ─────────────────────────────────────────
   17. LEVEL TILES GRID
   ───────────────────────────────────────── */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 105px));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Single level tile */
.level-tile {
    background: var(--primary-bg);
    border-radius: 1rem;
    padding: 0.8rem 0.2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    box-shadow: var(--neumorphic-shadow);
}

.level-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--neumorphic-inset);
    background: var(--primary-accent);
    color: white;
}

/* SVG stroke turns white on hover */
.level-tile:hover .level-svg svg { stroke: white; }

/* SVG icon wrapper inside each tile */
.level-svg {
    width: 44px; height: 44px;
    margin: 0 auto 0.5rem;
    display: flex; align-items: center; justify-content: center;
}

.level-svg svg {
    width: 32px; height: 32px;
    stroke: var(--primary-accent);
    stroke-width: 1.5;
    fill: none;
}

/* Level number pill */
.level-number {
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(109, 93, 252, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    display: inline-block;
}

/* Locked tile — muted and non-interactive hover */
.level-tile.locked { opacity: 0.55; cursor: not-allowed; }
.level-tile.locked:hover {
    background: var(--primary-bg);
    transform: none;
    box-shadow: var(--neumorphic-shadow);
    color: inherit;
}

/* Lock icon shown below the level number on locked tiles */
.level-lock-icon {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 5px;
    text-align: center;
}


/* ─────────────────────────────────────────
   18. MODAL PAGINATION
   ───────────────────────────────────────── */
.level-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.page-nav-btn {
    background: var(--primary-bg);
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    box-shadow: var(--neumorphic-shadow);
    cursor: pointer;
    color: var(--text-dark);
    font-size: 1.2rem;
    transition: var(--transition);
}

.page-nav-btn:hover:not(:disabled) { box-shadow: var(--neumorphic-inset); color: var(--primary-accent); }
.page-nav-btn:disabled             { opacity: 0.4; cursor: not-allowed; }

.page-indicator {
    font-weight: 600;
    background: rgba(109, 93, 252, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
}


/* ─────────────────────────────────────────
   19. FOOTER
   ───────────────────────────────────────── */
footer {
    margin-top: 70px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* Section heading with accent underline */
.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 50px; height: 2px;
    background: var(--primary-accent);
}

.footer-column p { opacity: 0.8; margin-bottom: 15px; }

/* Footer navigation list */
.footer-links         { list-style: none; }
.footer-links li      { margin-bottom: 8px; }
.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer-links a:hover { color: var(--primary-accent); transform: translateX(5px); opacity: 1; }

/* Social media icon circles */
.social-icons { display: flex; gap: 15px; margin-top: 15px; }
.social-icons a {
    width: 42px; height: 42px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--neumorphic-shadow);
    color: var(--primary-accent);
    transition: var(--transition);
    text-decoration: none;
}
.social-icons a:hover { box-shadow: var(--neumorphic-inset); transform: translateY(-5px); }

/* App download column */
.app-download         { text-align: center; }
.qr-code              { display: flex; justify-content: center; margin: 15px 0; }
.qr-code img {
    width: 110px; height: 110px;
    border-radius: 15px;
    box-shadow: var(--neumorphic-shadow);
    background: white; padding: 8px;
}

.app-buttons { display: flex; gap: 20px; justify-content: center; margin-top: 10px; }
.app-buttons a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    background: var(--primary-bg);
    border-radius: 50%;
    color: var(--primary-accent);
    font-size: 1.8rem;
    box-shadow: var(--neumorphic-shadow);
    text-decoration: none;
    transition: var(--transition);
}
.app-buttons a:hover { transform: translateY(-4px); box-shadow: var(--neumorphic-inset); }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    opacity: 0.7;
}


/* ─────────────────────────────────────────
   20. TOAST NOTIFICATION
   Slides up from bottom-right corner.
   ───────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px; right: 30px;
    background: var(--primary-bg);
    padding: 12px 20px;
    border-radius: 40px;
    display: flex; align-items: center; gap: 10px;

    /* Hidden off-screen by default */
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
    box-shadow: var(--neumorphic-shadow);
    color: var(--text-dark);
}

/* .show class is toggled by JS to reveal the toast */
.toast.show { transform: translateY(0); opacity: 1; }


/* ─────────────────────────────────────────
   21. MOBILE HAMBURGER TOGGLE
   Hidden on desktop; shown at ≤ 768 px.
   ───────────────────────────────────────── */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}


/* ─────────────────────────────────────────
   22. RESPONSIVE — TABLET (≤ 768 px)
   ───────────────────────────────────────── */
@media (max-width: 768px) {

    /* Tighter navbar padding so the logo + hamburger fit comfortably */
    .navbar { padding: 8px 14px; }

    /* Logo stays prominent even without the wordmark */
    .logo-icon { font-size: 26px; }

    /* Show the hamburger icon */
    .mobile-toggle { display: block; }

    /* Collapse nav into an animated drawer below the navbar */
    .nav-content {
        position: absolute;
        top: 100%; left: 0; right: 0;
        max-height: 0;
        overflow: hidden;
        flex-direction: column;
        background: var(--primary-bg);
        border-radius: 0 0 20px 20px;
        padding: 0 20px;
        transition: max-height 0.4s ease, padding 0.3s ease;
        box-shadow: var(--neumorphic-shadow);
        z-index: 99;
    }

    /* When open — allow dropdowns to overflow and float on top */
    .nav-content.active {
        max-height: 520px;
        overflow: visible;
        padding: 16px 20px 20px;
    }

    /* In the mobile drawer the pill track is dropped for a clean vertical list. */
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 4px;
        padding: 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    /* Hide the sliding pill on mobile — the list uses a simple highlight. */
    .nav-pill { display: none; }

    .nav-links a {
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 0.97rem;
        font-weight: 600;
        color: var(--text-dark);
    }

    .nav-links a:hover {
        background: rgba(109, 93, 252, 0.08);
    }

    /* Active row gets the brand gradient + a left accent for clarity. */
    .nav-links a.active {
        color: #fff;
        background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
        box-shadow: 0 4px 12px rgba(109, 93, 252, 0.3);
    }

    /* ── Mobile nav action row — align icon buttons in a row ── */
    .mobile-nav-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--border-light);
        flex-wrap: wrap;
    }

    .hero h1                { font-size: 2rem; }
    .hero-content           { padding: 25px; }
    .topics-grid            { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .levels-grid            { grid-template-columns: repeat(auto-fill, minmax(80px, 85px)); }
    .footer-content         { gap: 30px; text-align: center; }
    .footer-column h3::after { left: 50%; transform: translateX(-50%); }
    .social-icons           { justify-content: center; }
    .toast                  { right: 15px; left: 15px; }

    /* Dropdowns must appear above all content and not be clipped */
    .notification-dropdown,
    .language-dropdown,
    .profile-dropdown {
        position: absolute;
        z-index: 1050;
        margin-top: 8px;
    }

    /* Center-align dropdowns on mobile so they don't overflow */
    .notification-dropdown {
        width: calc(100vw - 60px);
        max-width: 320px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .profile-dropdown {
        right: 0;
        left: auto;
    }
    .language-dropdown {
        right: auto;
        left: 0;
    }
}


/* ─────────────────────────────────────────
   23. RESPONSIVE — MOBILE (≤ 480 px)
   ───────────────────────────────────────── */
@media (max-width: 480px) {
    body                { padding: 12px; }
    .navbar             { padding: 6px 12px; }
    .logo-icon          { font-size: 24px; }
    .hero h1            { font-size: 1.6rem; }
    .levels-grid        { grid-template-columns: repeat(auto-fill, minmax(70px, 75px)); }
    .level-svg svg      { width: 26px; height: 26px; }
    .topics-grid        { grid-template-columns: repeat(2, 1fr); }
    .notification-dropdown { width: 260px; right: -10px; }
}


/* ═══════════════════════════════════════════════
   24. HERO INTERACTIVE SECTION
   ═══════════════════════════════════════════════ */

/* Time-of-day greeting */
.hero-greeting {
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.6;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

/* Stats bar */
.hero-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 26px 0 22px;
    background: var(--primary-bg);
    border-radius: 1.2rem;
    padding: 18px 28px;
    box-shadow: var(--neumorphic-shadow);
}

.hstat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 26px;
    gap: 5px;
    transition: var(--transition);
    cursor: default;
}

.hstat-card:hover { transform: translateY(-3px); }

.hstat-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-accent);
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: center;
}

.hstat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
    opacity: 0.6;
    white-space: nowrap;
}

.hstat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-light);
    flex-shrink: 0;
}

/* Mastery progress bar */
.hero-mastery {
    max-width: 480px;
    margin: 0 auto 28px;
}

.mastery-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 8px;
}

.mastery-track {
    height: 8px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

.mastery-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-accent), var(--primary-dark));
    border-radius: 10px;
    transition: width 1.4s cubic-bezier(.4, 0, .2, 1);
}

@media (max-width: 768px) {
    .hero-stats-bar { padding: 14px 12px; }
    .hstat-card     { padding: 0 16px; }
    .hstat-num      { font-size: 1.6rem; }
    .hstat-divider  { height: 32px; }
}

@media (max-width: 480px) {
    .hero-stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 16px;
    }
    .hstat-divider  { display: none; }
    .hstat-card     { padding: 8px; border-radius: 10px; box-shadow: var(--neumorphic-shadow); }
    .hstat-num      { font-size: 1.5rem; }
}

/* Tournament anchor styled as a neumorphic button */
.neumorphic-btn--link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* ═══════════════════════════════════════════════
   25. DAILY CHALLENGE BANNER
   ═══════════════════════════════════════════════ */
.daily-challenge-section { margin-bottom: 40px; }

.daily-challenge-card {
    background: var(--primary-bg);
    border-radius: 24px;
    padding: 26px 30px;
    box-shadow: var(--neumorphic-shadow);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.daily-challenge-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(109,93,252,0.07), rgba(91,14,235,0.03));
    pointer-events: none;
}

.dc-badge {
    position: absolute;
    top: 14px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
}

.dc-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 22px rgba(109,93,252,0.38);
}

.dc-info           { flex: 1; min-width: 140px; }
.dc-info h3        { font-size: 1.25rem; font-weight: 700; margin-bottom: 5px; }
.dc-info p         { font-size: 0.85rem; opacity: 0.68; }
.dc-action         { margin-left: auto; }


/* ═══════════════════════════════════════════════
   26. TOPIC FILTER CHIPS & SEARCH
   ═══════════════════════════════════════════════ */
.topics-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-chip {
    background: var(--primary-bg);
    border: 2px solid transparent;
    border-radius: 30px;
    padding: 8px 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    box-shadow: var(--neumorphic-inset);
    color: var(--primary-accent);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(109,93,252,0.40);
}

.topic-search-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.topic-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-accent);
    font-size: 0.88rem;
    pointer-events: none;
    opacity: 0.65;
    z-index: 1;
}

.topic-search-input {
    width: 100%;
    background: var(--primary-bg);
    border: none;
    border-radius: 50px;
    padding: 12px 20px 12px 44px;
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    box-shadow: var(--neumorphic-inset);
    outline: none;
    transition: box-shadow 0.22s ease;
}

.topic-search-input:focus         { box-shadow: var(--neumorphic-shadow); }
.topic-search-input::placeholder  { opacity: 0.45; }

/* No-results message */
.no-topics-msg {
    text-align: center;
    padding: 30px;
    opacity: 0.7;
    font-size: 0.95rem;
}

/* [hidden] attribute hides it — JS toggles removeAttribute / setAttribute */
.no-topics-msg[hidden] { display: none; }

.no-topics-msg button {
    background: none;
    border: none;
    color: var(--primary-accent);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}


/* ═══════════════════════════════════════════════
   27. TOPIC CARD — progress bar
   ═══════════════════════════════════════════════ */
.tc-progress-wrap {
    height: 4px;
    background: rgba(0,0,0,0.09);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

body.dark-mode .tc-progress-wrap { background: rgba(255,255,255,0.10); }

.tc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-accent), var(--primary-dark));
    border-radius: 4px;
    min-width: 0;
    transition: width 0.8s ease;
}

.tc-progress-label {
    display: block;
    font-size: 0.68rem;
    opacity: 0.58;
    margin-top: 4px;
    font-weight: 500;
}


/* ═══════════════════════════════════════════════
   28. SCROLL REVEAL
   ═══════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for sibling feature cards */
.feature-card--delay-1 { transition-delay: 0.15s; }
.feature-card--delay-2 { transition-delay: 0.30s; }


/* ═══════════════════════════════════════════════
   29. BACK-TO-TOP BUTTON
   ═══════════════════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    color: #fff;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(109,93,252,0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    z-index: 600;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 6px 24px rgba(109,93,252,0.60);
    transform: translateY(-3px);
}


/* ═══════════════════════════════════════════════
   30. FEATURE CARDS — action links
   ═══════════════════════════════════════════════ */
.fc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    color: var(--primary-accent);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    opacity: 0.85;
    transition: gap 0.22s ease, opacity 0.22s ease;
}

.fc-link:hover { gap: 10px; opacity: 1; }


/* ═══════════════════════════════════════════════
   31. DAILY TRIVIA TEASER
   ═══════════════════════════════════════════════ */
.teaser-section   { margin-bottom: 40px; }

.teaser-card {
    background: var(--primary-bg);
    border-radius: 24px;
    padding: 28px 30px;
    box-shadow: var(--neumorphic-shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.teaser-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(109,93,252,0.06), transparent 70%);
    pointer-events: none;
}

.teaser-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.teaser-badge {
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.teaser-topic-tag {
    background: rgba(109,93,252,0.12);
    color: var(--primary-accent);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.teaser-question {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 22px;
    line-height: 1.5;
}

.teaser-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.teaser-opt-btn {
    background: var(--primary-bg);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 12px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    text-align: left;
    transition: var(--transition);
    line-height: 1.4;
}

.teaser-opt-btn:hover:not(:disabled) {
    box-shadow: var(--neumorphic-inset);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

.teaser-opt-btn.correct {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(34,197,94,0.4);
    cursor: default;
}

.teaser-opt-btn.wrong {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(239,68,68,0.4);
    cursor: default;
}

.teaser-opt-btn.reveal-correct {
    border-color: #22c55e;
    color: #22c55e;
    cursor: default;
}

.teaser-opt-btn:disabled { cursor: default; }

.teaser-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(109,93,252,0.08);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    animation: fadeSlideDown 0.3s ease;
}

.teaser-result[hidden] { display: none; }

.teaser-play-link {
    color: var(--primary-accent);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s ease;
}
.teaser-play-link:hover { gap: 9px; }


/* ═══════════════════════════════════════════════
   32. CONTINUE PLAYING
   ═══════════════════════════════════════════════ */
.continue-section {
    margin-bottom: 50px;
    text-align: center;
}

.continue-section[hidden] { display: none; }

.continue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
    text-align: left;
}

.continue-card {
    background: var(--primary-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--neumorphic-shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border-light);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.continue-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--neumorphic-inset);
}

.continue-card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    box-shadow: 0 6px 16px rgba(109,93,252,0.32);
}

.continue-card-title {
    font-weight: 700;
    font-size: 1rem;
}

.continue-card-sub {
    font-size: 0.78rem;
    opacity: 0.65;
}

.continue-card-bar {
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 5px;
    overflow: hidden;
}

body.dark-mode .continue-card-bar { background: rgba(255,255,255,0.10); }

.continue-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-accent), var(--primary-dark));
    border-radius: 5px;
    transition: width 0.8s ease;
}

.continue-card-btn {
    margin-top: 4px;
    background: var(--primary-accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 9px 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    box-shadow: 0 4px 12px rgba(109,93,252,0.35);
    align-self: flex-start;
}

.continue-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(109,93,252,0.50);
}


/* ═══════════════════════════════════════════════
   33. ACHIEVEMENT SHELF
   ═══════════════════════════════════════════════ */
.achievements-section { margin-bottom: 50px; }

.achievements-shelf {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 4px 18px;
    scroll-snap-type: x mandatory;
    /* Scrollbar appearance handled by ::-webkit-scrollbar rules below */
}

.achievements-shelf::-webkit-scrollbar        { height: 4px; }
.achievements-shelf::-webkit-scrollbar-track  { background: transparent; }
.achievements-shelf::-webkit-scrollbar-thumb  { background: var(--primary-accent); border-radius: 4px; }

.achievement-badge {
    background: var(--primary-bg);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: var(--neumorphic-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 130px;
    max-width: 130px;
    text-align: center;
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.achievement-badge.unlocked {
    border-color: rgba(109,93,252,0.35);
    box-shadow: var(--neumorphic-shadow), 0 0 20px rgba(109,93,252,0.18);
}

.achievement-badge.locked { opacity: 0.52; }

.badge-icon-wrap {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}

.achievement-badge.unlocked .badge-icon-wrap {
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(109,93,252,0.40);
}

.achievement-badge.locked .badge-icon-wrap {
    background: var(--primary-bg);
    box-shadow: var(--neumorphic-inset);
    color: #94a3b8;
}

.badge-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.badge-desc {
    font-size: 0.65rem;
    opacity: 0.6;
    line-height: 1.4;
}

/* Shimmer glow on unlocked badges.
   opacity is the only CSS property that animates purely on the compositor
   with zero Layout and zero Paint cost — ideal for a looping decoration. */
.achievement-badge.unlocked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(255,255,255,0.20) 50%,
        transparent 70%
    );
    opacity: 0;
    will-change: opacity;
    animation: badgeShimmer 2.8s ease-in-out infinite;
}

@keyframes badgeShimmer {
    0%,100% { opacity: 0;    }
    50%     { opacity: 1;    }
}


/* ═══════════════════════════════════════════════
   34. RESPONSIVE — new sections
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-stats            { gap: 22px; }
    .stat-num              { font-size: 1.8rem; }
    .teaser-options        { grid-template-columns: 1fr; }
    .filter-chip           { padding: 7px 14px; font-size: 0.78rem; }
    .continue-grid         { grid-template-columns: 1fr 1fr; }
    .achievements-shelf    { gap: 12px; }
    .achievement-badge     { min-width: 110px; max-width: 110px; padding: 16px 12px; }
}

@media (max-width: 480px) {
    .hero-stats    { gap: 16px; }
    .stat-num      { font-size: 1.5rem; }
    .back-to-top   { bottom: 70px; right: 16px; }
    .continue-grid { grid-template-columns: 1fr; }
}
