/* ============================================================
   CELESTIA DESIGN SYSTEM — Shared CSS
   Reference: index.html (landing page)
   Every page MUST link this file.
   ============================================================ */

/* 0. Reset
   ------------------------------------------------------------ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* 1. CSS Variables
   ------------------------------------------------------------ */
:root {
    /* Dark mode (primary) */
    --bg: #09090b;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text-white: #fafafa;
    --text-dim: rgba(255,255,255,0.5);
    --text-muted: rgba(255,255,255,0.35);

    /* Light mode (auth, forms) */
    --bg-light: #fafafa;
    --white: #ffffff;
    --border-light: rgba(0,0,0,0.06);
    --text-dark: #09090b;
    --text-dark-soft: #52525b;
    --text-dark-muted: #a1a1aa;

    /* Accent (orange) */
    --orange: #ff6b35;
    --orange-soft: #ff8f5c;
    --orange-glow: rgba(255,107,53,0.15);
    --orange-glow-strong: rgba(255,107,53,0.4);
    --gradient: linear-gradient(135deg, #ff6b35, #ff9a5c);

    /* Semantic */
    --success: #22c55e;
    --error: #ef4444;
    --star: #fbbf24;

    /* Radius */
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-full: 9999px;

    /* Easing */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Navbar */
    --navbar-h: 60px;
}

@media (max-width: 640px) {
    :root { --navbar-h: 54px; }
}

/* 2. Base Styles
   ------------------------------------------------------------ */
html { scroll-behavior: smooth; }
html, body { overscroll-behavior: none; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Noise grain overlay */
body::after {
    content: '';
    position: fixed; inset: 0; z-index: 9999;
    pointer-events: none; opacity: 0.02;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

::selection { background: var(--orange-glow); }
-webkit-tap-highlight-color: transparent;

/* 3. Typography
   ------------------------------------------------------------ */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-tag {
    font-size: 0.75rem; font-weight: 600;
    color: var(--orange); text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800; letter-spacing: -0.04em;
}

.section-header { text-align: center; margin-bottom: 3rem; }

.page-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* 4. Navigation — Glassmorphism Navbar
   ------------------------------------------------------------ */
.c-navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--navbar-h); z-index: 100;
    background: rgba(9,9,11,0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.c-navbar-inner {
    max-width: 1200px; margin: 0 auto;
    height: 100%; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
}

.c-logo {
    font-size: 1.125rem; font-weight: 800;
    color: var(--text-white); text-decoration: none;
    letter-spacing: -0.04em;
}
.c-logo span { color: var(--orange); }

.c-navbar-right { display: flex; align-items: center; gap: 0.25rem; }

.c-nav-link {
    font-size: 0.8125rem; font-weight: 500;
    color: var(--text-dim); text-decoration: none;
    padding: 0.4rem 0.75rem; border-radius: var(--r-full);
    transition: all 0.2s; border: none; background: none; cursor: pointer;
    font-family: inherit;
}
.c-nav-link:hover { color: var(--text-white); }

.c-nav-cta {
    font-size: 0.8125rem; font-weight: 600;
    color: var(--bg); background: var(--text-white);
    padding: 0.45rem 1.125rem; border-radius: var(--r-full);
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s; font-family: inherit;
}
.c-nav-cta:hover { opacity: 0.9; transform: scale(1.02); }

@media (max-width: 640px) {
    .c-nav-link--desktop { display: none; }
}

/* 5. Mobile Bottom Tab Bar
   ------------------------------------------------------------ */
.c-tab-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(9,9,11,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
    .c-tab-bar { display: flex; }
}

.c-tab-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 8px 0; min-height: 52px;
    border: none; background: none; cursor: pointer;
    color: var(--text-muted); font-family: inherit;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.c-tab-item svg { width: 20px; height: 20px; }

.c-tab-item span {
    font-size: 0.6rem; font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.c-tab-item.active { color: var(--orange); }
.c-tab-item.active::after {
    content: ''; position: absolute; top: 0;
    width: 24px; height: 2px;
    background: var(--orange);
    border-radius: 0 0 2px 2px;
}
.c-tab-item:active { opacity: 0.7; }

/* 6. Cards & Surfaces
   ------------------------------------------------------------ */
.c-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    position: relative; overflow: hidden;
    transition: all 0.4s var(--ease);
}

.c-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

/* Gradient border on hover */
.c-card--glow::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 30%, var(--orange-glow) 50%, transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}
.c-card--glow:hover::before { opacity: 1; }

/* Light card (auth/form context) */
.c-card--light {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 40px rgba(0,0,0,0.04);
}

/* Glassmorphism surface */
.c-glass {
    background: rgba(9,9,11,0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
}

/* 7. Buttons
   ------------------------------------------------------------ */
.c-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.8125rem 1.625rem;
    font-size: 0.9375rem; font-weight: 600;
    border-radius: var(--r-full);
    border: none; cursor: pointer;
    text-decoration: none; font-family: inherit;
    transition: all 0.25s var(--ease);
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}
.c-btn svg { flex-shrink: 0; }

/* White (primary on dark) */
.c-btn--white { background: var(--white); color: var(--bg); }
.c-btn--white:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,255,255,0.12); }

/* Ghost */
.c-btn--ghost {
    background: var(--bg-card); color: var(--text-dim);
    border: 1px solid var(--border);
}
.c-btn--ghost:hover { background: var(--bg-card-hover); color: var(--text-white); border-color: var(--border-hover); }

/* Orange gradient */
.c-btn--orange { background: var(--gradient); color: #fff; }
.c-btn--orange:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--orange-glow-strong); }

/* Submit (dark, used in light forms) */
.c-btn--submit {
    background: var(--text-dark); color: var(--white);
    border-radius: 12px; width: 100%;
}
.c-btn--submit:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.c-btn--submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Outline */
.c-btn--outline {
    background: none; color: var(--text-white);
    border: 1px solid var(--border);
}
.c-btn--outline:hover {
    border-color: var(--border-hover);
    color: var(--text-white);
    transform: translateY(-1px);
}

/* Small */
.c-btn--sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

/* Icon only */
.c-btn--icon {
    width: 44px; height: 44px; padding: 0;
    border-radius: 12px;
}

/* Touch devices */
@media (hover: none) {
    .c-btn:hover { transform: none; box-shadow: none; }
    .c-btn:active { transform: scale(0.97); }
}

/* 8. Form Inputs
   ------------------------------------------------------------ */
.c-input {
    width: 100%; padding: 0.6875rem 0.875rem;
    background: var(--bg-light);
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    color: var(--text-dark); font-size: 0.9375rem;
    font-family: inherit; outline: none;
    transition: all 0.2s;
}
.c-input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
    background: var(--white);
}
.c-input::placeholder { color: var(--text-dark-muted); }

/* Dark variant */
.c-input--dark {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-white);
}
.c-input--dark::placeholder { color: var(--text-muted); }
.c-input--dark:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
    background: var(--bg-card-hover);
}

.c-label {
    display: block;
    font-size: 0.8125rem; font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

.c-label--dark {
    color: var(--text-dim);
}

/* Select */
.c-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

/* Tabs (segmented control) */
.c-tabs {
    display: flex; padding: 3px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.c-tabs--light {
    background: rgba(0,0,0,0.04);
    border: none;
}

.c-tab {
    flex: 1; padding: 0.5rem;
    text-align: center;
    font-size: 0.8125rem; font-weight: 600;
    color: var(--text-muted); background: none;
    border: none; border-radius: 10px;
    cursor: pointer; transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.c-tab.active {
    background: var(--bg-card-hover);
    color: var(--text-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.c-tabs--light .c-tab.active {
    background: var(--white);
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 9. Alerts
   ------------------------------------------------------------ */
.c-alert {
    padding: 0.75rem 1rem;
    font-size: 0.875rem; font-weight: 500;
    border-radius: 12px; line-height: 1.5;
    display: none;
}
.c-alert.show { display: block; animation: cFadeIn 0.3s ease; }

.c-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.c-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.c-alert--info { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }

/* 10. Chip / Badge
   ------------------------------------------------------------ */
.c-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 0.8125rem; font-weight: 500;
    color: var(--text-dim);
    backdrop-filter: blur(10px);
}

.c-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.6875rem; font-weight: 600;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.c-badge--orange { background: var(--orange-glow); color: var(--orange); }
.c-badge--success { background: rgba(34,197,94,0.15); color: var(--success); }

/* 11. Icon Container
   ------------------------------------------------------------ */
.c-icon-box {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--orange-glow);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.c-icon-box svg { width: 20px; height: 20px; color: var(--orange); }

/* 12. Animations
   ------------------------------------------------------------ */
@keyframes cFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cSpin { to { transform: rotate(360deg); } }
@keyframes cSlideUp {
    from { transform: translateY(115%); }
    to { transform: translateY(0); }
}
@keyframes cPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* Reveal on scroll */
.c-reveal {
    opacity: 0; transform: translateY(24px);
    transition: all 0.7s var(--ease);
}
.c-reveal.vis { opacity: 1; transform: translateY(0); }
.c-rd1 { transition-delay: 0.06s; }
.c-rd2 { transition-delay: 0.12s; }
.c-rd3 { transition-delay: 0.18s; }
.c-rd4 { transition-delay: 0.24s; }

/* Spinner */
.c-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
    border-top-color: #fff; animation: cSpin 0.6s linear infinite;
}
.c-spinner--dark {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--text-dark);
}

/* Skeleton loading */
@keyframes cSkeletonPulse {
    0% { opacity: 0.06; }
    50% { opacity: 0.12; }
    100% { opacity: 0.06; }
}
.c-skeleton {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    animation: cSkeletonPulse 1.2s ease-in-out infinite;
}

/* 13. Layout
   ------------------------------------------------------------ */
.c-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.c-page {
    padding-top: calc(var(--navbar-h) + 1.5rem);
    padding-bottom: 2rem;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 768px) {
    .c-page { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .c-container { padding: 0 1rem; }
}

/* Two-column layout for desktop */
.c-layout {
    display: flex;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.c-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--navbar-h) + 1.5rem);
    height: fit-content;
    max-height: calc(100vh - var(--navbar-h) - 3rem);
    overflow-y: auto;
}

.c-main { flex: 1; min-width: 0; }

@media (max-width: 768px) {
    .c-layout { padding: 0 1rem; }
    .c-sidebar { display: none; }
    .c-main { width: 100%; }
}

/* 14. Sidebar Navigation
   ------------------------------------------------------------ */
.c-nav-menu { display: flex; flex-direction: column; gap: 2px; }

.c-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
    color: var(--text-muted);
    font-size: 0.875rem; font-weight: 500;
    border: none; background: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.c-nav-item:hover {
    color: var(--text-dim);
    background: var(--bg-card);
}
.c-nav-item.active {
    color: var(--text-white);
    background: var(--bg-card-hover);
}
.c-nav-item.active::before {
    content: '';
    width: 3px; height: 16px;
    background: var(--orange);
    border-radius: 2px;
    margin-right: -0.375rem;
}

.c-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.5; }
.c-nav-item.active svg { opacity: 1; color: var(--orange); }

/* User section in sidebar */
.c-user-card {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 1rem 0.875rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.c-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--orange-glow);
    display: flex; align-items: center; justify-content: center;
    color: var(--orange); font-weight: 700; font-size: 0.75rem;
    flex-shrink: 0;
}

.c-user-name {
    font-size: 0.8125rem; font-weight: 700;
    color: var(--text-white);
}

.c-user-label {
    font-size: 0.625rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.c-status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    margin-left: auto;
    animation: cPulse 2s ease-in-out infinite;
}

/* 15. Stat Cards
   ------------------------------------------------------------ */
.c-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.c-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s var(--ease);
}
.c-stat:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.c-stat__value {
    font-size: 1.5rem; font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.04em;
    margin-bottom: 0.125rem;
}

.c-stat__label {
    font-size: 0.6875rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.c-stat--accent .c-stat__value { color: var(--orange); }

/* 16. Podium (Leaderboard)
   ------------------------------------------------------------ */
.c-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 0 1rem;
    margin-bottom: 1.5rem;
}

.c-podium__item {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.5rem;
    flex: 1; max-width: 120px;
}

.c-podium__avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.875rem; color: #fff;
    position: relative;
}

.c-podium__item--1st .c-podium__avatar {
    width: 56px; height: 56px;
    background: var(--gradient);
    box-shadow: 0 0 20px var(--orange-glow-strong);
}

.c-podium__item--2nd .c-podium__avatar { background: rgba(255,255,255,0.15); }
.c-podium__item--3rd .c-podium__avatar { background: rgba(255,255,255,0.1); }

.c-podium__name {
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-white);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c-podium__score {
    font-size: 0.6875rem; font-weight: 600;
    color: var(--text-muted);
}

.c-podium__bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: none;
}
.c-podium__item--1st .c-podium__bar { height: 80px; background: rgba(255,107,53,0.08); border-color: rgba(255,107,53,0.2); }
.c-podium__item--2nd .c-podium__bar { height: 56px; }
.c-podium__item--3rd .c-podium__bar { height: 40px; }

/* 17. List Items (Ranking rows, history)
   ------------------------------------------------------------ */
.c-list-item {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}
.c-list-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.c-list-item__rank {
    font-size: 0.875rem; font-weight: 800;
    color: var(--text-muted);
    min-width: 24px; text-align: center;
}

.c-list-item__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

.c-list-item__name {
    font-size: 0.875rem; font-weight: 600;
    color: var(--text-white);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c-list-item__score {
    font-size: 0.875rem; font-weight: 700;
    color: var(--orange);
}

.c-list-item--me {
    border-color: rgba(255,107,53,0.2);
    background: rgba(255,107,53,0.04);
}

/* 18. Progress Bar
   ------------------------------------------------------------ */
.c-progress {
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.c-progress__bar {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    transition: width 0.6s var(--ease);
}

/* 19. Empty State
   ------------------------------------------------------------ */
.c-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.c-empty svg {
    width: 48px; height: 48px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.c-empty p {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* 20. Modal / Overlay
   ------------------------------------------------------------ */
.c-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(9,9,11,0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center; justify-content: center;
    padding: 1rem;
}
.c-overlay.show { display: flex; }

.c-modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    animation: cFadeUp 0.3s var(--ease);
}

/* 21. Utility: safe area */
@supports (padding: env(safe-area-inset-bottom)) {
    .c-safe-bottom { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

/* 22. Aurora Glow (for hero/dark sections) */
.c-aurora {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.c-aurora__beam {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform;
}
.c-aurora__beam:nth-child(1) {
    width: 60vw; height: 40vh;
    background: rgba(255,107,53,0.08);
    top: -10%; left: 15%;
    animation: cAurora1 14s ease-in-out infinite;
}
.c-aurora__beam:nth-child(2) {
    width: 40vw; height: 30vh;
    background: rgba(255,143,92,0.06);
    top: 30%; right: 0;
    animation: cAurora2 18s ease-in-out infinite;
}

@keyframes cAurora1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    50% { transform: translate(3vw, 2vh) scale(1.1); opacity: 1; }
}
@keyframes cAurora2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-3vw, -2vh) scale(1.1); opacity: 0.9; }
}

/* 23. Content sections hide/show */
.c-section { display: none; }
.c-section.active { display: block; }

/* 24. QCM Results
   ------------------------------------------------------------ */
.qcm-results {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem 6rem;
}

/* Score ring */
.qcm-results__ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem;
}
.qcm-results__ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.qcm-results__ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 8;
}
.qcm-results__ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s var(--ease);
}
.qcm-results__ring-fill--success { stroke: var(--success); }
.qcm-results__ring-fill--warning { stroke: var(--star); }
.qcm-results__ring-fill--danger  { stroke: var(--error); }

.qcm-results__score {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.qcm-results__score-num {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-white);
}
.qcm-results__score-pct {
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Timeout notice */
.qcm-results__timeout {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: var(--r-full);
    font-size: 0.75rem;
    color: var(--star);
    margin-bottom: 1.5rem;
}

/* Quick stats row */
.qcm-results__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
    margin-bottom: 2rem;
}
.qcm-results__stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 0.875rem 0.5rem;
    text-align: center;
}
.qcm-results__stat-val {
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1;
}
.qcm-results__stat-val--ok   { color: var(--success); }
.qcm-results__stat-val--fail { color: var(--error); }
.qcm-results__stat-val--time { color: var(--star); }
.qcm-results__stat-lbl {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

/* Section title */
.qcm-results__title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

/* Question cards */
.qcm-results__card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--r);
    padding: 1rem 1.125rem;
    margin-bottom: 0.625rem;
    opacity: 0;
    transform: translateY(12px);
    animation: cFadeUp 0.5s var(--ease) forwards;
}
.qcm-results__card--ok   { border-left-color: var(--success); }
.qcm-results__card--fail { border-left-color: var(--error); }
.qcm-results__card--time { border-left-color: var(--star); }

.qcm-results__card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.625rem;
}
.qcm-results__card-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
}
.qcm-results__card-tag {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.qcm-results__card-tag--ok {
    background: rgba(34,197,94,0.15);
    color: var(--success);
}
.qcm-results__card-tag--fail {
    background: rgba(239,68,68,0.15);
    color: var(--error);
}
.qcm-results__card-tag--time {
    background: rgba(251,191,36,0.15);
    color: var(--star);
}

.qcm-results__question {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-white);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.qcm-results__answers {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}
.qcm-results__answer {
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.4;
}
.qcm-results__answer span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.qcm-results__explain {
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.55;
    border: 1px solid rgba(255,255,255,0.04);
}
.qcm-results__explain-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

/* Action buttons */
.qcm-results__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: center;
}

@media (max-width: 640px) {
    .qcm-results {
        padding: 0 0.75rem 7rem;
    }
    .qcm-results__ring {
        width: 132px;
        height: 132px;
    }
    .qcm-results__score-num {
        font-size: 1.875rem;
    }
    .qcm-results__stats {
        gap: 0.5rem;
    }
    .qcm-results__stat {
        padding: 0.75rem 0.375rem;
    }
    .qcm-results__stat-val {
        font-size: 1.125rem;
    }
    .qcm-results__actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        background: linear-gradient(to top, var(--bg) 70%, transparent);
        z-index: 50;
        justify-content: stretch;
    }
    .qcm-results__actions .c-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}
