/**
 * LORCANA QUIZ - CSS Mobile First
 * Design sombre inspirÃƒÆ’Ã‚Â© de l'univers Disney Lorcana
 * Version amÃƒÆ’Ã‚Â©liorÃƒÆ’Ã‚Â©e avec focus mobile et UX optimisÃƒÆ’Ã‚Â©e
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a10;
    --bg-secondary: #12121c;
    --bg-tertiary: #1a1a28;
    --bg-card: #1e1e30;
    --bg-hover: #252538;
    --bg-input: #16161f;
    
    /* Accent Colors */
    --accent-purple: #7c3aed;
    --accent-purple-light: #a78bfa;
    --accent-purple-dark: #5b21b6;
    --accent-gold: #d4af37;
    --accent-gold-light: #f0d875;
    --accent-blue: #3b82f6;
    --accent-cyan: #22d3ee;
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    
    /* Text Colors */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #0a0a10;
    
    /* Border */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: var(--accent-purple);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
/* Typography */
--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-display: 'Poppins', 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Container */
    --container-max: 1200px;
    --container-padding: 1rem;
    
    /* Header */
    --header-height: 60px;
    
    /* Safe areas for mobile */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========================================
   CSS RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(
            1200px circle at 50% -10%,
            rgba(124, 58, 237, 0.12),
            transparent 60%
        ),
        linear-gradient(
            180deg,
            #0a0a10 0%,
            #0f0c1a 50%,
            #07070d 100%
        );
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    position: relative; /* IMPORTANT */
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.09'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    z-index: 1;
}

a {
    color: var(--accent-purple-light);
    text-decoration: none;
    transition: color var(--transition-fast);
    -webkit-touch-callout: none;
}

a:hover, a:focus {
    color: var(--accent-purple);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    touch-action: manipulation;
}

input, textarea, select {
    font-family: inherit;
    font-size: 16px; /* Prevent zoom on iOS */
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

::selection {
    background: var(--accent-purple);
    color: white;
}

:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* Hide focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}


/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    flex: 1;
    padding: var(--space-lg) 0;
    padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--space-lg) 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer p {
    margin: 0;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 44px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-purple-light), var(--accent-purple));
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: var(--text-inverse);
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #2563eb);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1rem;
}

.btn-xl {
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
    min-height: 56px;
}

.btn-block {
    width: 100%;
}

.btn-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: var(--shadow-glow); }
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    min-height: 48px;
}

.form-control:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2371717a' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5rem;
    padding-right: 2.5rem;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.card-header h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-md);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - var(--space-md) * 2);
}

@media (min-width: 768px) {
    .toast-container {
        top: 90px;
        right: var(--space-lg);
        width: 380px;
    }
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast.toast-removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    margin: -4px -8px -4px 0;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast types */
.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-success .toast-icon {
    background: var(--success-bg);
    color: var(--success);
}

.toast-success .toast-title {
    color: var(--success);
}

.toast-success .toast-progress {
    background: var(--success);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-error .toast-icon {
    background: var(--error-bg);
    color: var(--error);
}

.toast-error .toast-title {
    color: var(--error);
}

.toast-error .toast-progress {
    background: var(--error);
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.toast-warning .toast-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.toast-warning .toast-title {
    color: var(--warning);
}

.toast-warning .toast-progress {
    background: var(--warning);
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-info .toast-icon {
    background: var(--info-bg);
    color: var(--info);
}

.toast-info .toast-title {
    color: var(--info);
}

.toast-info .toast-progress {
    background: var(--info);
}

/* Lorcana theme toasts */
[data-theme="lorcana"] .toast {
    background: linear-gradient(160deg, 
        rgba(55, 59, 112, 0.98) 0%, 
        rgba(42, 45, 84, 0.98) 100%);
    border-color: rgba(211, 186, 132, 0.25);
}

[data-theme="lorcana"] .toast-title {
    font-family: var(--font-display);
}

/* Legacy alerts (hidden but kept for fallback) */
.alert {
    display: none;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-easy {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-hard {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.badge-advanced {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--error-bg);
    color: var(--error);
}

.badge-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent-purple-light);
}

.badge-gold {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-gold);
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.mt-2 { margin-top: var(--space-sm); }
.mt-4 { margin-top: var(--space-md); }
.mt-6 { margin-top: var(--space-lg); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-4 { margin-bottom: var(--space-md); }
.mb-6 { margin-bottom: var(--space-lg); }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination-wrapper {
    padding: var(--space-lg);
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination-link.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    color: var(--text-muted);
}

/* ========================================
   HOME PAGE
   ======================================== */
.home-hero {
    text-align: center;
    padding: var(--space-xl) 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-full);
    color: var(--accent-purple-light);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 6vw, 3rem);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(0.9375rem, 2.5vw, 1.125rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 480px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
        max-width: none;
    }
}

.hero-btn {
    flex: 1;
    max-width: 200px;
}

.hero-btn .btn-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* Features Grid */
.features-section {
    padding: var(--space-2xl) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 600px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.feature-title {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Stats Section */
.stats-section {
    padding: var(--space-xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* CTA Section */
.cta-section {
    padding: var(--space-2xl) 0;
    text-align: center;
}

.cta-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(212, 175, 55, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-lg);
}

.cta-card i {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: var(--space-md);
}

.cta-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.cta-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ========================================
   QUIZ CREATE PAGE
   ======================================== */
.quiz-create-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page-header-mobile {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.page-header-mobile h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.remaining-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    color: var(--info);
    font-size: 0.875rem;
}

.remaining-badge.warning {
    background: var(--warning-bg);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.remaining-badge.empty {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.remaining-number {
    font-weight: 700;
    font-size: 1.125rem;
}

/* User Stars Summary Card */
.user-stars-summary {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    text-align: center;
}

.stars-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.stars-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.next-unlock {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.progress-mini {
    width: 150px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-mini .progress-fill {
    height: 100%;
    background: var(--accent-purple);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Form Sections */
.quiz-create-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.section-header i {
    color: var(--accent-purple);
    font-size: 1.125rem;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Difficulty Grid */
.difficulty-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.difficulty-option {
    cursor: pointer;
}

.difficulty-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.difficulty-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.difficulty-option:hover .difficulty-card {
    background: var(--bg-tertiary);
}

.difficulty-option input:checked + .difficulty-card {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
}

.difficulty-option.locked .difficulty-card {
    opacity: 0.5;
    cursor: not-allowed;
}

.difficulty-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.difficulty-icon.easy {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
}

.difficulty-icon.medium {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: var(--text-inverse);
}

.difficulty-icon.hard {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
}

.difficulty-icon.advanced {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
}

.difficulty-content {
    flex: 1;
    min-width: 0;
}

.difficulty-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.difficulty-desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.difficulty-count {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.difficulty-star-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    margin-top: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.difficulty-star-type i {
    font-size: 0.7rem;
}

.difficulty-star-type .stars-bronze {
    color: #CD7F32;
}
.difficulty-star-type .stars-silver {
    color: #C0C0C0;
}
.difficulty-star-type .stars-gold {
    color: #FFD700;
}
.difficulty-star-type .stars-mythic {
    color: #A855F7;
}

.lock-reason {
    display: block;
    font-size: 0.5rem;
    text-align: center;
    margin-top: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.difficulty-check {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
    flex-shrink: 0;
    background: var(--bg-primary);
    color: var(--text-muted);
}

.difficulty-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-sm);
    min-width: 60px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.difficulty-lock i {
    font-size: 1rem;
    margin-bottom: 2px;
}

.difficulty-option input:checked + .difficulty-card .difficulty-check {
    background: var(--accent-purple);
    color: white;
}

.login-prompt {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--warning-bg);
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--warning);
}

.login-prompt a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* Questions Grid */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md);
}

.questions-option {
    cursor: pointer;
}

.questions-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.questions-card {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.questions-option:hover .questions-card {
    background: var(--bg-tertiary);
}

.questions-option input:checked + .questions-card {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
}

.questions-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
}

.questions-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.questions-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--accent-gold);
    margin-top: var(--space-sm);
    font-weight: 600;
}

.questions-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Form Submit */
.form-submit {
    text-align: center;
    padding: var(--space-md) 0;
}

.form-submit .btn {
    width: 100%;
    max-width: 300px;
}

/* Limit Reached */
.limit-reached {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.limit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: var(--warning-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--warning);
}

.limit-reached h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.limit-reached p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.benefits-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    margin: 0 auto;
}

.benefits-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.benefits-list {
    text-align: left;
    margin-bottom: var(--space-lg);
}

.benefits-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
}

.benefits-list li i {
    color: var(--success);
}

/* Sidebar (desktop) */
.create-sidebar {
    display: none;
}

@media (min-width: 900px) {
    .quiz-create-page {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: var(--space-xl);
        max-width: 1000px;
    }
    
    .page-header-mobile {
        grid-column: 1 / -1;
    }
    
    .user-stars-summary {
        grid-column: 1;
    }
    
    .quiz-create-form {
        grid-column: 1;
    }
    
    .limit-reached {
        grid-column: 1;
    }
    
    .create-sidebar {
        display: block;
        grid-column: 2;
        grid-row: 2 / span 5;
        align-self: start;
    }
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
}

.info-card h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.info-card h4 i {
    color: var(--accent-purple);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.info-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   QUIZ PLAY PAGE
   ======================================== */
.quiz-play-page {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 100px; /* Space for navigation */
}

.quiz-header {
    position: relative;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.quiz-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.quiz-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

.quiz-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.quiz-progress-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold));
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    width: 0;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
    text-align: right;
}

/* Question Slide */
.question-slide {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.question-slide[hidden] {
    display: none;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.question-counter {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.question-type {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.question-type.multiple {
    color: var(--accent-purple-light);
    background: rgba(124, 58, 237, 0.1);
}

/* Question Body */
.question-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.question-text {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Question Images */
.question-images,
.question-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding: var(--space-sm) 0;
    justify-content: center;
}

.question-images.multiple,
.question-cards.multiple {
    justify-content: flex-start;
}

.card-image,
.lorcana-card {
    flex: 0 0 auto;
    width: 140px;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
}

.card-image:hover,
.lorcana-card:hover {
    border-color: var(--accent-purple);
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

.card-image img,
.lorcana-card img {
    width: 100%;
    height: auto;
    display: block;
}

.card-image figcaption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.lorcana-card figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    position: relative;
}

.lorcana-card .card-name {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    width: 100%;
}

.lorcana-card .card-click-hint {
    position: absolute;
    top: -24px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.lorcana-card:hover .card-click-hint {
    opacity: 1;
}

@media (max-width: 600px) {
    .question-images,
    .question-cards {
        justify-content: flex-start;
        padding: var(--space-sm);
        margin: var(--space-md) calc(-1 * var(--space-md));
        gap: var(--space-sm);
    }
    
    .card-image,
    .lorcana-card {
        width: 120px;
    }
}

/* Question Options */
.question-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.option-item {
    cursor: pointer;
    display: block;
}

.option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: 56px;
}

.option-item:hover .option-card {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.option-item:active .option-card {
    transform: scale(0.99);
}

.option-input:checked + .option-card {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
}

.option-marker {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-input:checked + .option-card .option-marker {
    background: var(--accent-purple);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.option-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    color: var(--accent-purple);
    transition: opacity var(--transition-fast);
}

.option-input:checked + .option-card .option-indicator {
    opacity: 1;
}

/* Question Navigation */
.question-nav {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.btn-nav {
    flex: 1;
    justify-content: center;
}

.btn-nav.btn-prev {
    flex: 0 0 auto;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-nav.btn-prev:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-nav.btn-prev:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-nav .btn-text {
    display: none;
}

@media (min-width: 480px) {
    .btn-nav .btn-text {
        display: inline;
    }
    
    .btn-nav.btn-prev {
        flex: 1;
        padding: var(--space-md) var(--space-lg);
    }
}

/* Quick Navigation Dots */
.quick-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--safe-bottom));
    z-index: 50;
}

.quick-nav-label {
    display: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.quick-nav-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.nav-dot {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.nav-dot:hover {
    background: var(--bg-tertiary);
}

.nav-dot.active {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
}

.nav-dot.answered {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.nav-dot.answered.active {
    border-color: var(--success);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.25rem;
    z-index: 10;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: var(--primary);
    color: white;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 90vh;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    max-width: 100%;
}

.lightbox-caption:empty {
    display: none;
}

/* ========================================
   QUIZ RESULTS PAGE
   ======================================== */
.quiz-results-page {
    max-width: 700px;
    margin: 0 auto;
}

/* Results Hero */
.results-hero {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
}

.results-hero.excellent {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-color: rgba(34, 197, 94, 0.3);
}

.results-hero.good {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.3);
}

.results-hero.average {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.3);
}

.results-hero.poor {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
}

.hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.results-hero.excellent .hero-icon { background: var(--success-bg); color: var(--success); }
.results-hero.good .hero-icon { background: var(--info-bg); color: var(--info); }
.results-hero.average .hero-icon { background: var(--warning-bg); color: var(--warning); }
.results-hero.poor .hero-icon { background: var(--error-bg); color: var(--error); }

.hero-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.hero-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* Score Display */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Score circle with SVG (results hero page only) */
.results-hero .score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.results-hero .score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.results-hero.excellent .circle-progress { stroke: var(--success); }
.results-hero.good .circle-progress { stroke: var(--info); }
.results-hero.average .circle-progress { stroke: var(--warning); }
.results-hero.poor .circle-progress { stroke: var(--error); }

.results-hero .score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.results-hero .score-symbol {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

.results-hero .score-detail {
    text-align: center;
    margin-top: var(--space-sm);
}

.results-hero .score-fraction {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-hero .score-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.results-meta {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Results Actions */
.results-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (min-width: 480px) {
    .results-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Results Summary */
.results-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.summary-item i {
    font-size: 1.5rem;
}

.summary-item.correct i { color: var(--success); }
.summary-item.incorrect i { color: var(--error); }

.summary-count {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Results Detail */
.results-detail {
    margin-bottom: var(--space-xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
}

.section-title i {
    color: var(--accent-purple);
}

/* Review Cards */
.questions-review {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.review-card.correct {
    border-left: 4px solid var(--success);
}

.review-card.incorrect {
    border-left: 4px solid var(--error);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    cursor: pointer;
    min-height: 56px;
}

.review-header:hover {
    background: var(--bg-hover);
}

.review-left, .review-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.review-status-icon {
    font-size: 1.25rem;
}

.review-card.correct .review-status-icon { color: var(--success); }
.review-card.incorrect .review-status-icon { color: var(--error); }

.review-number {
    font-weight: 600;
    color: var(--text-primary);
}

.review-status-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.review-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.review-toggle.rotated {
    transform: rotate(180deg);
}

.review-content {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

.review-content.collapsed {
    display: none;
}

.review-question {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.review-images {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.review-images img {
    width: 80px;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
}

/* Review Cards (Lorcana) */
.review-cards {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.review-card-item {
    flex: 0 0 auto;
    width: 90px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.review-card-item:hover {
    transform: scale(1.05);
}

.review-card-item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.review-card-item:hover img {
    border-color: var(--accent-purple);
}

.review-card-name {
    display: block;
    font-size: 0.5625rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
}

/* Review Options */
.review-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.review-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.review-option.option-correct {
    background: var(--success-bg);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.review-option.option-wrong {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.option-letter {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.review-option.option-correct .option-letter {
    background: var(--success);
    color: white;
}

.review-option.option-wrong .option-letter {
    background: var(--error);
    color: white;
}

.review-option .option-text {
    flex: 1;
    color: var(--text-primary);
}

.option-badges {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.option-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.6875rem;
}

.option-badge.correct {
    background: var(--success);
    color: white;
}

.option-badge.wrong {
    background: var(--error);
    color: white;
}

.your-answer {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Explanation */
.review-explanation {
    padding: var(--space-md);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
}

.explanation-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
}

.explanation-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Results CTA */
.results-cta .cta-card {
    text-align: center;
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-page {
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(212, 175, 55, 0.05));
    border-bottom: 1px solid var(--border);
}

.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.auth-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.auth-header p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.auth-body {
    padding: var(--space-xl) var(--space-lg);
}

.auth-footer {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ========================================
   PROFILE PAGE
   ======================================== */
.profile-page .page-header {
    margin-bottom: var(--space-xl);
}

.profile-page .page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.profile-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .profile-grid {
        display: grid;
        grid-template-columns: 1fr 300px;
    }
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

@media (max-width: 767px) {
    .profile-sidebar {
        order: -1;
    }
}

.profile-card .card-body {
    padding: var(--space-xl);
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.profile-avatar.large {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
}

.profile-avatar-img {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-purple);
}

.profile-avatar-img.large {
    width: 100px;
    height: 100px;
}

.oauth-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.oauth-badge i {
    font-size: 1rem;
}

.profile-name {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.profile-email {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.profile-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.profile-meta i {
    margin-right: var(--space-xs);
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
}

.stats-list .stat-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.stats-list .stat-item:last-child {
    border-bottom: none;
}

.stats-list .stat-label {
    color: var(--text-secondary);
}

.stats-list .stat-value {
    font-weight: 600;
    color: var(--accent-gold);
}

/* Quick Links */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quick-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    min-height: 48px;
}

.quick-link:hover {
    background: var(--accent-purple);
    color: white;
}

.quick-link i {
    width: 20px;
    text-align: center;
}

/* Delete Form */
.delete-form {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.delete-form .form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

/* Card Danger */
.card-danger {
    border-color: var(--error);
}

.card-danger .card-header {
    background: var(--error-bg);
    color: var(--error);
}

/* ========================================
   RESULTS HISTORY PAGE
   ======================================== */
.results-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.results-page .page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (min-width: 600px) {
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.history-item:last-child {
    border-bottom: none;
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-icon.success { background: var(--success-bg); color: var(--success); }
.history-icon.warning { background: var(--warning-bg); color: var(--warning); }
.history-icon.danger { background: var(--error-bg); color: var(--error); }

.history-content {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.history-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.history-score {
    text-align: center;
    flex-shrink: 0;
}

/* Generic score-circle moved to end of file with proper scoping */

.history-actions {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .history-score, .history-actions {
        width: 100%;
        margin-top: var(--space-sm);
    }
    
    .history-score {
        display: flex;
        align-items: center;
        gap: var(--space-md);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: var(--space-lg);
}

/* ========================================
   ADMIN STYLES
   ======================================== */
.admin-page {
    padding: var(--space-md) 0;
}

.admin-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.admin-page .page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.admin-page .page-header h1 i {
    color: var(--accent-purple);
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card .stat-link {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-md);
    font-size: 0.75rem;
    color: var(--accent-purple-light);
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.admin-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
}

.admin-card .card-header h3 i {
    color: var(--accent-purple);
}

/* Category & Status Lists */
.category-list, .status-list, .user-list, .quiz-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.category-item, .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.category-item:last-child, .status-item:last-child {
    border-bottom: none;
}

.category-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.category-count {
    background: var(--bg-hover);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.status-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* User List */
.user-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
}

.user-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Quiz List */
.quiz-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.quiz-item:last-child {
    border-bottom: none;
}

.quiz-user {
    flex: 1;
}

.quiz-details {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.quiz-score {
    font-weight: 600;
    color: var(--accent-gold);
}

.quiz-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (min-width: 600px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    min-height: 100px;
}

.quick-action:hover {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.quick-action i {
    font-size: 1.5rem;
}

/* Admin Filters - Unified Horizontal */
.filters-card,
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

.admin-page .filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.admin-page .filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
    flex: 1;
    min-width: 0;
}

.admin-page .filter-group {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    flex: 1 1 130px;
    max-width: 180px;
}

.admin-page .filter-group label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    white-space: nowrap;
}

.admin-page .filter-group .form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
}

.admin-page .filters-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .admin-page .filters-grid {
        width: 100%;
    }
    
    .admin-page .filter-group {
        flex: 1 1 45%;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .admin-page .filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-page .filter-group {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }
    
    .admin-page .filters-actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border);
        margin-top: var(--space-xs);
    }
}

/* Admin Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th {
    text-align: left;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: var(--bg-hover);
}

.admin-table .row-inactive td {
    opacity: 0.6;
}

.question-preview {
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 300px;
}

.question-meta {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
    flex-wrap: wrap;
}

.meta-badge {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-sm);
}

.category-badge {
    font-size: 0.75rem;
    color: var(--accent-purple-light);
    background: rgba(124, 58, 237, 0.15);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Form Grid */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

@media (min-width: 900px) {
    .form-grid {
        display: grid;
        grid-template-columns: 1fr 300px;
    }
}

.form-main .card-body {
    padding: var(--space-lg);
}

.form-sidebar .card-body {
    padding: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 480px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Options Container */
.options-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.option-check {
    position: relative;
}

.option-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.option-check label {
    display: block;
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-check input:checked + label {
    background: var(--success);
    border-color: var(--success);
}

.option-check input:checked + label::after {
    content: 'ÃƒÂ¢Ã…â€œÃ¢â‚¬Å“';
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    height: 100%;
}

.option-row .form-control {
    flex: 1;
}

/* Images Container */
.images-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.image-row {
    display: flex;
    gap: var(--space-sm);
}

.image-row .form-control {
    flex: 1;
}

.image-previews {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.image-preview {
    width: 80px;
    height: 112px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Metadata */
.metadata p {
    margin: var(--space-sm) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metadata strong {
    color: var(--text-muted);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    min-height: 44px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-purple);
}

/* User Stats */
.user-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.user-stats .stat-row:last-child {
    border-bottom: none;
}

.user-stats .stat-label {
    color: var(--text-muted);
}

.user-stats .stat-value {
    font-weight: 600;
}

/* ========================================
   ERROR PAGES
   ======================================== */
.error-page {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.error-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
    background: var(--error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--error);
}

.error-page h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-slideUp {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   STARS SYSTEM - IMPROVED
   ======================================== */

.stars-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stars-display.compact {
    font-size: 0.75rem;
    gap: 4px;
}

.stars-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.stars-group.complete {
    gap: 0;
}

.stars-bronze { color: #cd7f32; }
.stars-silver { color: #c0c0c0; }
.stars-gold { color: #ffd700; }
.stars-mythic { 
    color: #a855f7;
    animation: mythicGlow 2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

@keyframes mythicGlow {
    0%, 100% { filter: brightness(1); opacity: 1; }
    50% { filter: brightness(1.3); opacity: 0.9; }
}

.no-stars {
    color: var(--text-muted);
    opacity: 0.4;
}

/* ÃƒÆ’Ã¢â‚¬Â°toile consolidÃƒÆ’Ã‚Â©e (quand 5 ÃƒÆ’Ã‚Â©toiles complÃƒÆ’Ã‚Â¨tes) */
.star-consolidated {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.star-consolidated .star-count-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.45em;
    font-weight: 700;
    color: var(--bg-primary);
    text-shadow: none;
    line-height: 1;
}

.stars-mythic .star-consolidated .star-count-badge {
    color: #1a0030;
}

/* Badges de comptage ÃƒÆ’Ã‚Â©toiles */
.star-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.star-badge i {
    font-size: 0.875rem;
}

.star-badge.stars-bronze {
    background: rgba(205, 127, 50, 0.15);
    border-color: rgba(205, 127, 50, 0.3);
    color: #e8a862;
}

.star-badge.stars-silver {
    background: rgba(192, 192, 192, 0.15);
    border-color: rgba(192, 192, 192, 0.3);
    color: #d8d8d8;
}

.star-badge.stars-gold {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.star-badge.stars-mythic {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
    animation: mythicBadgeGlow 3s ease-in-out infinite;
}

.star-badge.complete {
    font-weight: 700;
}

.star-badge.complete i {
    font-size: 1rem;
}

@keyframes mythicBadgeGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(168, 85, 247, 0); }
    50% { box-shadow: 0 0 12px rgba(168, 85, 247, 0.4); }
}

.no-stars-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Detailed stars display for members page */
.stars-detailed {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.star-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.star-count.bronze {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
}

.star-count.silver {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
}

.star-count.gold {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.star-count.mythic {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.user-stars-summary {
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.stars-overview {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stars-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.next-unlock {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.next-unlock i { color: var(--warning); }

.progress-mini {
    width: 60px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-mini .progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.stars-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stars-info i { color: var(--primary); }

.difficulty-star-type {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.8;
}

.questions-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-top: 4px;
}

.stars-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.star-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.star-name {
    flex: 1;
    font-weight: 500;
}

.star-unlock {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   MEMBERS PAGE
   ======================================== */

.members-page {
    max-width: 1000px;
    margin: 0 auto;
}

.members-filters {
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.members-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.member-card {
    display: grid;
    grid-template-columns: 50px 48px 1fr auto;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.member-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .member-card {
        grid-template-columns: 36px 40px 1fr auto;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }
    
    .member-stars {
        justify-content: flex-end;
    }
    
    .stars-inline {
        gap: 4px;
    }
    
    .star-inline {
        font-size: 0.6875rem;
    }
    
    .star-inline i {
        font-size: 0.75rem;
    }
}

.member-rank { 
    width: 50px; 
    text-align: center;
    flex-shrink: 0;
}

.rank-badge {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rank-1 { 
    background: linear-gradient(135deg, #ffd700, #ffb800); 
    color: #1a1625;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.4);
}

.rank-2 { 
    background: linear-gradient(135deg, #e8e8e8, #c0c0c0); 
    color: #1a1625;
    box-shadow: 0 2px 12px rgba(192, 192, 192, 0.4);
}

.rank-3 { 
    background: linear-gradient(135deg, #e8a862, #cd7f32); 
    color: white;
    box-shadow: 0 2px 12px rgba(205, 127, 50, 0.4);
}

.rank-number { 
    font-weight: 700; 
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.member-avatar { 
    width: 48px; 
    height: 48px; 
    flex-shrink: 0;
}

.member-avatar img { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%; 
    object-fit: cover;
    border: 2px solid var(--border);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.25rem;
    text-transform: uppercase;
}

.member-info { 
    min-width: 0;
    overflow: hidden;
}

.member-name { 
    font-size: 1rem; 
    font-weight: 600; 
    margin: 0; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.member-city { 
    font-size: 0.8125rem; 
    color: var(--text-muted); 
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-city i { 
    font-size: 0.75rem;
    opacity: 0.7;
}

.member-stars { 
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Inline stars display (horizontal compact for members) */
.stars-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.star-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.star-inline i {
    font-size: 0.875rem;
}

.star-inline span {
    font-size: 0.8125rem;
}

.star-bronze { color: #e8a862; }
.star-silver { color: #d8d8d8; }
.star-gold { color: #ffd700; }
.star-mythic { 
    color: #c084fc;
    text-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
}
.star-none { 
    color: var(--text-muted); 
    opacity: 0.5;
}

/* Nav star badge (compact for navbar) */
.nav-star-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    vertical-align: middle;
}

.nav-star-badge i {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-star-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%); /* slight optical adjustment */
    font-size: 0.5rem;
    font-weight: 900;
    color: #1a1a2e;
    text-shadow: none;
    line-height: 1;
}

/* No stars */
.nav-star-none {
    opacity: 0.5;
}
.nav-star-none i {
    color: var(--text-muted);
}
.nav-star-none .nav-star-value {
    color: var(--text-muted);
}

/* Bronze */
.nav-star-bronze i {
    color: #CD7F32;
    filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.6));
}
.nav-star-bronze .nav-star-value {
    color: #3d2410;
}

/* Silver */
.nav-star-silver i {
    color: #C0C0C0;
    filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.6));
}
.nav-star-silver .nav-star-value {
    color: #2a2a2a;
}

/* Gold */
.nav-star-gold i {
    color: #FFD700;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
}
.nav-star-gold .nav-star-value {
    color: #4a3800;
}

/* Mythic */
.nav-star-mythic i {
    color: #A855F7;
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.8));
    animation: mythicStarPulse 2s ease-in-out infinite;
}
.nav-star-mythic .nav-star-value {
    color: #2d1548;
}

@keyframes mythicStarPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
    }
    50% { 
        filter: drop-shadow(0 0 12px rgba(168, 85, 247, 1));
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-star-badge {
        width: 24px;
        height: 24px;
    }
    
    .nav-star-badge i {
        font-size: 1.25rem;
    }
    
    .nav-star-value {
        font-size: 0.5rem;
    }
}

/* Lorcana theme overrides */
[data-theme="lorcana"] .nav-star-gold i {
    color: var(--illuminary-gold, #D3BA84);
}

[data-theme="lorcana"] .nav-star-mythic {
    color: var(--ink-amethyst, #9B59B6);
    border-color: var(--ink-amethyst, #9B59B6);
    background: rgba(155, 89, 182, 0.2);
}

.members-page .page-header {
    margin-bottom: var(--space-lg);
}

.members-page .members-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.members-page .empty-state { 
    text-align: center; 
    padding: var(--space-xl) var(--space-lg); 
    color: var(--text-muted);
}

.members-page .empty-state i { 
    font-size: 3rem; 
    opacity: 0.3; 
    margin-bottom: var(--space-md);
    display: block;
}

.pagination-nav { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: var(--space-md); 
    margin-top: var(--space-xl); 
    padding: var(--space-md);
}

.pagination-info { 
    color: var(--text-muted); 
    font-size: 0.875rem;
}

.nav-avatar { 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    object-fit: cover;
    flex-shrink: 0;
}

/* Nav profile with star badge */
.nav-profile {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.nav-profile span {
    display: inline; /* Always show username */
}

.nav-profile .nav-star-badge {
    margin-left: 2px;
}

.nav-profile .stars-display { 
    margin-left: var(--space-xs);
}

.lock-reason { 
    display: block; 
    font-size: 0.625rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    margin-top: 2px; 
    opacity: 0.8;
}

/* Stars Earned Display (Results Page) */
.stars-earned-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.stars-earned-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.stars-earned-value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.5rem;
}

.stars-earned-value .star-type-name {
    font-size: 0.875rem;
    margin-left: var(--space-xs);
    opacity: 0.9;
}

.stars-earned-display.no-stars {
    opacity: 0.6;
}

.stars-earned-display.no-stars .stars-earned-label {
    font-size: 0.8125rem;
}

/* Star Progress (Profile Page) - Improved */
.profile-stars {
    font-size: 1.25rem;
    text-align: center;
    padding: var(--space-sm);
}

.profile-stars .stars-display {
    justify-content: center;
}

.star-progress-item {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.star-progress-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.star-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.star-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

.star-type i {
    font-size: 1rem;
}

.star-progress-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.star-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease-out;
    position: relative;
}

.star-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.stars-bronze-bg { 
    background: linear-gradient(90deg, #cd7f32, #e8a862); 
}

.stars-silver-bg { 
    background: linear-gradient(90deg, #a8a8a8, #d8d8d8); 
}

.stars-gold-bg { 
    background: linear-gradient(90deg, #d4af37, #ffd700); 
}

.stars-mythic-bg { 
    background: linear-gradient(90deg, #7c3aed, #a855f7); 
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.star-difficulty {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.star-progress-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========================================
   AUTH PAGES - IMPROVED
   ======================================== */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.auth-card.login-card,
.auth-card.register-card {
    max-width: 440px;
}

.auth-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid var(--border);
}

.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin: 0 0 var(--space-xs);
}

.auth-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

.auth-body {
    padding: var(--space-lg);
}

.auth-footer {
    text-align: center;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
}

.auth-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* OAuth Buttons */
.oauth-section {
    margin-bottom: var(--space-md);
}

.oauth-instruction {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    min-height: 50px;
    text-decoration: none;
}

.oauth-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.btn-discord {
    background: #5865F2;
    color: white;
    border: none;
}

.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
    color: white;
}

.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
    gap: var(--space-md);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auth Form */
.auth-form .form-group {
    margin-bottom: var(--space-md);
}

.auth-form label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form label i {
    font-size: 0.8125rem;
    opacity: 0.7;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.forgot-link {
    color: var(--primary);
    font-size: 0.8125rem;
}

/* Security Notice (Register) */
.security-notice {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.security-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.125rem;
}

.security-content h3 {
    font-size: 0.9375rem;
    margin: 0 0 var(--space-xs);
    color: var(--text-primary);
}

.security-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Register Benefits */
.register-benefits {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.register-benefits h4 {
    font-size: 0.9375rem;
    margin: 0 0 var(--space-md);
    color: var(--text-primary);
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.benefits-list i {
    color: var(--success);
    font-size: 0.875rem;
}

/* Privacy Info */
.privacy-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-lg);
    padding: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.privacy-info i {
    font-size: 0.6875rem;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .header, .footer, .quick-navigation, .results-actions, .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* ========================================
   THEME SWITCHER
   ======================================== */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-left: var(--space-md);
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.875rem;
}

.theme-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .theme-switcher {
        position: absolute;
        top: var(--space-sm);
        right: 60px;
        margin-left: 0;
    }
    
    .theme-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
}

/* ========================================
   LORCANA LOADING SPINNER
   ======================================== */
.lorcana-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 16, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lorcana-spinner-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lorcana-spinner {
    position: relative;
    width: 100px;
    height: 100px;
}

/* Outer ring - rotates */
.lorcana-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid transparent;
    border-top-color: var(--accent-gold, #d4af37);
    border-right-color: var(--accent-gold, #d4af37);
    border-radius: 50%;
    animation: spinnerRotate 1.2s linear infinite;
}

/* Inner ring - rotates opposite */
.lorcana-spinner::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 3px solid transparent;
    border-bottom-color: var(--accent-purple, #7c3aed);
    border-left-color: var(--accent-purple, #7c3aed);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite reverse;
}

/* Center star */
.lorcana-spinner-star {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    color: var(--accent-gold, #d4af37);
    animation: spinnerPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

.lorcana-spinner-text {
    margin-top: var(--space-lg);
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: spinnerTextPulse 1.5s ease-in-out infinite;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinnerPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
}

@keyframes spinnerTextPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Lorcana theme spinner */
[data-theme="lorcana"] .lorcana-spinner-overlay {
    background: rgba(28, 28, 26, 0.9);
}

[data-theme="lorcana"] .lorcana-spinner::before {
    border-top-color: var(--illuminary-gold, #D3BA84);
    border-right-color: var(--illuminary-gold, #D3BA84);
}

[data-theme="lorcana"] .lorcana-spinner::after {
    border-bottom-color: var(--lorcana-indigo, #373B70);
    border-left-color: var(--lorcana-indigo, #373B70);
}

[data-theme="lorcana"] .lorcana-spinner-star {
    color: var(--illuminary-gold, #D3BA84);
    filter: drop-shadow(0 0 15px rgba(211, 186, 132, 0.7));
}

[data-theme="lorcana"] .lorcana-spinner-text {
    color: var(--parchment, #E3CAA8);
}

/* Mini spinner for inline use */
.mini-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

/* Question transition overlay */
.question-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 16, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.question-loading.active {
    opacity: 1;
    visibility: visible;
}

.question-loading .lorcana-spinner {
    width: 60px;
    height: 60px;
}

.question-loading .lorcana-spinner-star {
    font-size: 1.25rem;
}

[data-theme="lorcana"] .question-loading {
    background: rgba(28, 28, 26, 0.85);
}

/* ========== QUIZ PAGE FIXES ========== */

/* Navigation dots - horizontal layout */
.nav-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* Option card - selected state (input inside label) */
.option-card {
    cursor: pointer;
    position: relative;
}

.option-card:has(.option-input:checked) {
    border-color: var(--accent-purple) !important;
    background: rgba(124, 58, 237, 0.15) !important;
}

.option-card:has(.option-input:checked) .option-letter {
    background: var(--accent-purple);
    color: white;
}

.option-card:has(.option-input:checked) .option-check {
    opacity: 1;
    color: var(--accent-purple);
}

.option-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

/* Hide the actual radio/checkbox input */
.option-card .option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Option letter styling */
.option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

/* Option check icon */
.option-check {
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: var(--accent-purple);
}

/* Quiz spinner (between questions) */
#quiz-spinner {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 13, 20, 0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

#quiz-spinner.active {
    opacity: 1;
    visibility: visible;
}

#quiz-spinner .spinner-content {
    position: relative;
    width: 80px;
    height: 80px;
}

#quiz-spinner .quiz-ink-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: inkPulse 1s ease-in-out infinite;
}

#quiz-spinner .ink-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid var(--accent-purple);
    border-radius: 50%;
    animation: inkRipple 1.5s ease-out infinite;
}

#quiz-spinner .ink-ripple.delay-1 {
    animation-delay: 0.5s;
}

#quiz-spinner .ink-ripple.delay-2 {
    animation-delay: 1s;
}

@keyframes inkPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

@keyframes inkRipple {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Hide main page spinner by default on quiz pages */
.quiz-play-page ~ .lorcana-spinner-overlay,
.lorcana-spinner-overlay {
    display: none !important;
}

/* Quick nav container */
.quick-nav {
    margin-top: var(--space-lg);
    text-align: center;
}

.quick-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

/* ========== HISTORY SCORE CIRCLES ========== */

/* History List - Small score circles (no SVG) */
.history-score .score-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    font-family: var(--font-body);
    border: 3px solid;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

.history-score .score-circle .score-value {
    display: block;
    position: static;
    font-size: inherit;
    line-height: 1;
}

.history-score .score-circle.success { 
    color: var(--success); 
    border-color: var(--success); 
}
.history-score .score-circle.warning { 
    color: var(--warning); 
    border-color: var(--warning); 
}
.history-score .score-circle.danger { 
    color: var(--error); 
    border-color: var(--error); 
}

.history-score .score-detail {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-align: center;
}

/* Text Formatting for Quiz Content */
.fmt-card {
    color: #D4AF37;
    font-weight: 600;
}

.fmt-ability {
    color: #A855F7;
    font-style: italic;
    font-weight: 500;
}

.fmt-keyword {
    color: #22D3EE;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.02em;
}


/* ===========================
   EXTERNAL IMAGES IN QUIZ
   =========================== */
.question-external-images {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
}

.question-external-images.multiple {
    justify-content: center;
}

.external-image {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 200px;
    transition: transform 0.2s;
}

.external-image:hover {
    transform: scale(1.02);
}

.external-image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: var(--radius-md);
    display: block;
}

.external-image .image-zoom-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.external-image:hover .image-zoom-hint {
    opacity: 1;
}

@media (max-width: 600px) {
    .external-image {
        max-width: 150px;
    }
    
    .external-image img {
        max-height: 180px;
    }
}

/* ===========================
   ADMIN QUESTION FORM STYLES
   =========================== */

/* Upload zone in admin form */
.admin-page .upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.admin-page .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.admin-page .upload-placeholder {
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
}

.admin-page .upload-placeholder i {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.admin-page .upload-placeholder:hover {
    color: var(--primary);
}

/* Uploaded images grid */
.uploaded-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    min-height: 40px;
}

.uploaded-image-item {
    position: relative;
    width: 60px;
    height: 60px;
}

.uploaded-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.uploaded-image-item .remove-img-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--error);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.uploaded-image-item .remove-img-btn:hover {
    transform: scale(1.1);
}

/* Preview modal improvements */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    margin-top: 60px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-close {
    width: 34px;
    height: 34px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: var(--space-md);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--border);
}

/* Preview content styling */
.preview-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.preview-tab {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.preview-tab:hover {
    border-color: var(--primary);
}

.preview-tab.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    justify-content: center;
}

.preview-images img {
    max-width: 150px;
    max-height: 200px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.preview-question {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.preview-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.preview-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.preview-option.is-correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.preview-option-letter {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.preview-option.is-correct .preview-option-letter {
    background: var(--success);
    color: white;
}

.preview-explanation {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent-purple);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
}

.preview-meta {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.loading-spinner {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.loading-spinner i {
    margin-right: var(--space-sm);
}
/* ===========================
   PROFILE ENHANCEMENTS CSS
   Add these styles to app.css
   =========================== */

/* Profile Page Grid Layout */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-lg);
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        order: -1;
    }
}

/* Avatar Section */
.avatar-section {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.avatar-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon .form-control {
    padding-left: 38px;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.radio-label:hover {
    background: var(--bg-tertiary);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.radio-label input[type="radio"]:disabled + .radio-custom {
    opacity: 0.5;
}

/* Privacy Toggles */
.privacy-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.privacy-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.privacy-toggle:hover {
    background: var(--bg-hover);
}

.privacy-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.privacy-info i {
    width: 20px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-primary);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Stars Summary in Profile */
.stars-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.star-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.star-type {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.star-count {
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-stars-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-md) 0;
    min-height: 60px;
}

.profile-stars-display .stars-display {
    font-size: 1.2rem;
}

.profile-stars-display .stars-group {
    margin: 0 4px;
}

.profile-stars-display .star-consolidated {
    font-size: 1.8em;
}

.stars-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
    font-weight: 600;
}

.total-value {
    font-size: 1.25rem;
    color: var(--primary);
}

/* Stats Items */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
}

/* OAuth Badges */
.oauth-connection {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.oauth-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.oauth-badge.discord {
    background: #5865F2;
    color: white;
}

.oauth-badge.google {
    background: #4285F4;
    color: white;
}

/* Danger Card */
.card-danger .card-header {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    margin-top: 60px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: var(--space-md);
}

.modal-body ul {
    margin: var(--space-sm) 0;
    padding-left: var(--space-lg);
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Text utilities */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--space-md); }
/**
 * ============================================
 * MOBILE FIX - Corrections for default theme
 * ============================================
 * Add this file AFTER app.css
 * Or append these styles to the end of app.css
 */

/* ============================================
   MOBILE MENU FIX
   ============================================ */
/* Ensure mobile menu displays correctly when active */
.nav.active {
    display: flex !important;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    padding: var(--space-md);
    flex-direction: column;
    gap: var(--space-xs);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 99;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu toggle button always visible on mobile */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex !important;
    }
    
    /* Hide nav by default on mobile, show only when active */
    .nav:not(.active) {
        display: none !important;
    }
}

/* ============================================
   GLOBAL MOBILE SPACING REDUCTION
   ============================================ */
@media (max-width: 767px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.25rem;
        --space-2xl: 1.5rem;
        --container-padding: 0.75rem;
    }
    
    .main {
        padding: var(--space-md) 0;
    }
    
    .container {
        padding: 0 var(--container-padding);
    }
}

/* ============================================
   HOME PAGE - HERO SECTION FIX
   ============================================ */
.home-hero {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

@media (max-width: 767px) {
    .home-hero {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: var(--space-sm);
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--space-lg);
        line-height: 1.5;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
        margin-bottom: var(--space-md);
    }
}

/* Hero Actions - Buttons Fix */
.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .hero-actions {
        max-width: 100%;
        padding: 0;
    }
    
    .hero-btn {
        width: 100%;
        max-width: none;
        flex: none;
    }
    
    .hero-btn .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
    }
    
    .hero-btn .btn-desc {
        display: none;
    }
}

@media (min-width: 480px) {
    .hero-actions {
        flex-direction: row;
        max-width: 500px;
    }
    
    .hero-btn {
        flex: 1;
    }
}

/* ============================================
   FEATURES SECTION - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .features-section {
        padding: var(--space-lg) 0;
    }
    
    .features-grid {
        gap: var(--space-sm);
    }
    
    .feature-card {
        padding: var(--space-md);
        display: flex;
        align-items: center;
        gap: var(--space-md);
        text-align: left;
    }
    
    .feature-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        margin: 0;
        font-size: 1.125rem;
    }
    
    .feature-card:hover {
        transform: none;
    }
    
    .feature-title {
        font-size: 0.9375rem;
        margin-bottom: 2px;
    }
    
    .feature-desc {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
}

/* ============================================
   STATS SECTION - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .stats-section {
        padding: var(--space-md) 0;
    }
    
    .stats-grid {
        gap: var(--space-sm);
    }
    
    .stat-item {
        padding: var(--space-sm);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* ============================================
   CTA SECTION - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .cta-section {
        padding: var(--space-lg) 0;
    }
    
    .cta-card {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .cta-card i {
        font-size: 2rem;
        margin-bottom: var(--space-sm);
    }
    
    .cta-card h3 {
        font-size: 1.125rem;
        margin-bottom: var(--space-xs);
    }
    
    .cta-card p {
        font-size: 0.875rem;
        margin-bottom: var(--space-md);
    }
    
    .benefits-list {
        text-align: left;
        margin-bottom: var(--space-md);
    }
    
    .benefits-list li {
        font-size: 0.875rem;
        padding: var(--space-xs) 0;
    }
}

/* ============================================
   CARDS - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .card {
        border-radius: var(--radius-md);
    }
    
    .card-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .card-header h2,
    .card-header h3 {
        font-size: 0.9375rem;
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    .card-footer {
        padding: var(--space-sm) var(--space-md);
    }
}

/* ============================================
   PAGE HEADERS - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .page-header {
        margin-bottom: var(--space-md);
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .page-header-mobile {
        margin-bottom: var(--space-md);
    }
    
    .page-header-mobile h1 {
        font-size: 1.25rem;
        margin-bottom: var(--space-sm);
    }
}

/* ============================================
   PROFILE PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .profile-page {
        padding: 0;
    }
    
    .profile-grid {
        gap: var(--space-md);
    }
    
    .profile-sidebar {
        order: -1;
    }
    
    .profile-card .card-body {
        padding: var(--space-md);
    }
    
    .profile-avatar,
    .profile-avatar.large {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .profile-avatar-img,
    .profile-avatar-img.large {
        width: 70px;
        height: 70px;
    }
    
    .profile-name {
        font-size: 1.125rem;
    }
    
    .profile-preview-card .card-body,
    .profile-preview-header {
        padding: var(--space-md);
    }
    
    .profile-avatar-large,
    .avatar-placeholder-large {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }
    
    .profile-form .form-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .form-row {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .avatar-section {
        flex-direction: column;
        text-align: center;
    }
    
    .avatar-preview {
        margin: 0 auto var(--space-sm);
    }
}

/* ============================================
   MEMBERS PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .members-page {
        padding: 0;
    }
    
    .members-toolbar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm);
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .sort-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-options select {
        flex: 1;
    }
    
    .members-list {
        gap: var(--space-sm);
    }
    
    .member-card {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
    }
    
    .member-avatar,
    .member-avatar img,
    .member-avatar .avatar-placeholder {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
    
    .member-info {
        min-width: 0;
    }
    
    .member-name {
        font-size: 0.9375rem;
    }
    
    .member-city {
        font-size: 0.75rem;
    }
    
    .member-stars {
        display: none;
    }
    
    /* Pagination compact */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    
    .pagination .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 var(--space-xs);
        font-size: 0.8125rem;
    }
    
    .pagination .page-info {
        width: 100%;
        text-align: center;
        font-size: 0.75rem;
        order: -1;
        margin-bottom: var(--space-xs);
    }
}

/* ============================================
   QUIZ CREATE PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .quiz-create-page {
        padding: 0 var(--space-sm);
    }
    
    .quiz-create-form {
        gap: var(--space-md);
    }
    
    .form-section {
        border-radius: var(--radius-md);
    }
    
    .section-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .section-header h3 {
        font-size: 0.9375rem;
    }
    
    .section-body {
        padding: var(--space-md);
    }
    
    /* Difficulty options */
    .difficulty-options {
        gap: var(--space-sm);
    }
    
    .difficulty-option {
        padding: var(--space-sm);
    }
    
    .difficulty-option .option-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .difficulty-option .option-label {
        font-size: 0.875rem;
    }
    
    .difficulty-option .option-desc {
        font-size: 0.75rem;
    }
    
    /* Count options */
    .count-options {
        gap: var(--space-sm);
    }
    
    .count-option {
        padding: var(--space-md);
    }
    
    .count-option .count-number {
        font-size: 1.5rem;
    }
    
    .count-option .count-label {
        font-size: 0.75rem;
    }
    
    /* User stars summary */
    .user-stars-summary {
        padding: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    
    .stars-overview {
        gap: var(--space-sm);
    }
    
    .next-unlock {
        margin-top: var(--space-sm);
        padding-top: var(--space-sm);
    }
}

/* ============================================
   QUIZ PLAY PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .quiz-page {
        padding: 0;
    }
    
    .quiz-progress {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
    }
    
    .quiz-progress-text {
        font-size: 0.8125rem;
    }
    
    .quiz-card {
        border-radius: var(--radius-md);
    }
    
    .quiz-card .card-body {
        padding: var(--space-md);
    }
    
    .question-text {
        font-size: 0.9375rem;
        line-height: 1.6;
        margin-bottom: var(--space-md);
    }
    
    .quiz-options {
        gap: var(--space-xs);
    }
    
    .quiz-option {
        padding: var(--space-sm) var(--space-md);
        min-height: 48px;
        gap: var(--space-sm);
    }
    
    .quiz-option .option-letter {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
    
    .quiz-option .option-text {
        font-size: 0.875rem;
    }
    
    .quiz-actions {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
        flex-direction: row;
    }
    
    .quiz-actions .btn {
        flex: 1;
        padding: var(--space-sm);
        font-size: 0.875rem;
    }
    
    /* Question dots navigation */
    .question-dots {
        gap: 6px;
        padding: var(--space-xs) 0;
    }
    
    .question-dot {
        width: 10px;
        height: 10px;
    }
}

/* ============================================
   RESULTS PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .results-page {
        padding: 0;
    }
    
    .results-hero {
        padding: var(--space-md);
        margin-bottom: var(--space-md);
        border-radius: var(--radius-md);
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
        margin-bottom: var(--space-sm);
    }
    
    .score-percent,
    .score-value {
        font-size: 1.75rem;
    }
    
    .score-label {
        font-size: 0.75rem;
    }
    
    .results-summary {
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    
    .summary-item {
        padding: var(--space-sm);
    }
    
    .summary-item i {
        font-size: 1.125rem;
    }
    
    .summary-count {
        font-size: 1.5rem;
    }
    
    .summary-label {
        font-size: 0.75rem;
    }
    
    .results-actions {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .stars-earned-section {
        padding: var(--space-md);
    }
    
    .star-earned-visual i {
        font-size: 2rem;
    }
    
    /* Review cards compact */
    .questions-review {
        gap: var(--space-sm);
    }
    
    .review-card {
        border-radius: var(--radius-md);
    }
    
    .review-header {
        padding: var(--space-sm) var(--space-md);
        min-height: 48px;
    }
    
    .review-number {
        font-size: 0.875rem;
    }
    
    .review-content {
        padding: var(--space-md);
    }
    
    .review-question {
        font-size: 0.875rem;
    }
    
    .review-options {
        gap: var(--space-xs);
    }
    
    .review-option {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8125rem;
    }
    
    .option-letter {
        width: 22px;
        height: 22px;
        font-size: 0.6875rem;
    }
}

/* ============================================
   HISTORY PAGE - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .history-list {
        gap: var(--space-sm);
    }
    
    .history-item {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .history-score-circle {
        width: 44px;
        height: 44px;
        font-size: 0.8125rem;
    }
    
    .history-details {
        min-width: 0;
    }
    
    .history-title {
        font-size: 0.875rem;
    }
    
    .history-meta {
        font-size: 0.75rem;
        gap: var(--space-xs);
        flex-wrap: wrap;
    }
    
    .history-badge {
        font-size: 0.625rem;
        padding: 2px 6px;
    }
}

/* ============================================
   ADMIN PAGES - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .admin-page {
        padding: 0;
    }
    
    .admin-nav-grid {
        gap: var(--space-sm);
    }
    
    .admin-nav-card {
        padding: var(--space-md);
    }
    
    .nav-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .nav-card-content h3 {
        font-size: 0.9375rem;
    }
    
    .nav-card-content p {
        font-size: 0.75rem;
    }
    
    /* Filters compact */
    .filters-bar {
        padding: var(--space-sm);
        gap: var(--space-sm);
        flex-wrap: wrap;
    }
    
    .filters-bar .form-group {
        flex: 1 1 calc(50% - var(--space-sm));
        min-width: 120px;
    }
    
    .filters-bar .form-control {
        font-size: 0.8125rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .filters-bar .btn {
        width: 100%;
    }
    
    /* Tables - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 calc(var(--space-md) * -1);
        padding: 0 var(--space-md);
    }
    
    .admin-table {
        min-width: 600px;
        font-size: 0.8125rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--space-sm);
    }
    
    .admin-table .btn-sm {
        padding: var(--space-xs);
        font-size: 0.75rem;
    }
}

/* ============================================
   FORMS - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: var(--space-sm);
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: var(--space-xs);
    }
    
    .form-control {
        padding: var(--space-sm);
        font-size: 0.9375rem;
    }
    
    .form-hint {
        font-size: 0.75rem;
        margin-top: 4px;
    }
    
    .form-actions {
        gap: var(--space-sm);
        flex-wrap: wrap;
    }
    
    .form-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* ============================================
   BUTTONS - MOBILE TOUCH FRIENDLY
   ============================================ */
@media (max-width: 767px) {
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .btn-block {
        width: 100%;
    }
}

/* ============================================
   ALERTS - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .alert {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
        border-radius: var(--radius-md);
    }
    
    .alert-icon {
        font-size: 1rem;
    }
}

/* ============================================
   MODALS - MOBILE FULL WIDTH
   ============================================ */
@media (max-width: 767px) {
    .modal-overlay {
        padding: var(--space-sm);
        align-items: flex-end;
    }
    
    .modal-content {
        width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .modal-header {
        padding: var(--space-md);
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: var(--space-md);
    }
    
    .modal-footer {
        padding: var(--space-sm) var(--space-md);
    }
}

/* ============================================
   FOOTER - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .footer {
        padding: var(--space-md) 0;
        font-size: 0.75rem;
    }
    
    .footer br {
        display: none;
    }
    
    .footer small {
        display: block;
        margin-top: var(--space-xs);
    }
}

/* ============================================
   UTILITY - HIDE ON MOBILE
   ============================================ */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block !important;
    }
}

/* ============================================
   STAR PROGRESS - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .star-progress-container {
        gap: var(--space-sm);
    }
    
    .star-progress-item {
        padding: var(--space-sm) 0;
    }
    
    .star-progress-header {
        font-size: 0.875rem;
    }
    
    .star-progress-bar {
        height: 6px;
    }
    
    .star-difficulty {
        font-size: 0.6875rem;
    }
}

/* ============================================
   PRIVACY TOGGLES - COMPACT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .privacy-options {
        gap: var(--space-xs);
    }
    
    .privacy-toggle {
        padding: var(--space-sm);
    }
    
    .privacy-info {
        font-size: 0.875rem;
    }
    
    .privacy-info i {
        width: 20px;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .toggle-slider::before {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   FIX iOS SAFE AREAS
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .nav.active {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .main {
        padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
    }
    
    .modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   PREVENT HORIZONTAL OVERFLOW
   ============================================ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, iframe {
    max-width: 100%;
}

/* ============================================
   TOUCH IMPROVEMENTS
   ============================================ */
@media (max-width: 767px) {
    /* Larger touch targets */
    a, button, input, select, textarea {
        touch-action: manipulation;
    }
    
    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent text selection on buttons */
    .btn, .nav-link, .member-card, .quiz-option {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ============================================
   MOBILE SIDEBAR NAVIGATION
   ============================================
   Panneau latÃ©ral depuis la droite
   ============================================ */

/* Z-INDEX HIERARCHY */
.header {
    z-index: 10000 !important;
    position: relative;
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

#lorcana-spinner {
    z-index: 9000 !important;
}

.toast-container {
    z-index: 9500 !important;
}

.main-content,
.main,
main,
.footer {
    position: relative;
    z-index: 1;
}

/* ============================================
   DESKTOP NAVIGATION (>= 768px)
   ============================================ */
@media (min-width: 768px) {
    .menu-toggle {
        display: none !important;
    }
    
    .nav-overlay {
        display: none !important;
    }
    
    .nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        background: transparent !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: var(--space-xs) !important;
    }
}

/* ============================================
   MOBILE NAVIGATION (< 768px) - SIDEBAR
   ============================================ */
@media (max-width: 767px) {
    /* Menu toggle visible */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        color: var(--text-primary, #f5f5f7);
        font-size: 1.25rem;
        border-radius: var(--radius-md, 8px);
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10001;
        position: relative;
    }
    
    .menu-toggle:hover,
    .menu-toggle:active {
        background: var(--bg-hover, rgba(255,255,255,0.1));
    }
    
    /* SIDEBAR - Panneau latÃ©ral depuis la droite */
    .nav {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 280px !important;
        max-width: 85vw !important;
        background: var(--bg-secondary, #12121c) !important;
        padding: 80px 1rem 1.5rem 1rem !important;
        gap: 0.25rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        z-index: 9998 !important;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5) !important;
        border-left: 1px solid var(--border, rgba(255,255,255,0.1)) !important;
        
        /* Hidden by default - slide from right */
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease, visibility 0s 0.3s, opacity 0.3s ease !important;
        pointer-events: none !important;
    }
    
    /* SIDEBAR OPEN */
    .nav.active {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        transition: transform 0.3s ease, visibility 0s 0s, opacity 0.3s ease !important;
        pointer-events: auto !important;
    }
    
    /* Nav links */
    .nav .nav-link {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
        color: var(--text-secondary, #a1a1aa);
        font-weight: 500;
        font-size: 0.9375rem;
        border-radius: var(--radius-md, 8px);
        transition: all 0.2s ease;
        min-height: 44px;
    }
    
    .nav .nav-link span {
        display: inline !important;
    }
    
    .nav .nav-link i {
        width: 22px;
        text-align: center;
        font-size: 1rem;
        opacity: 0.8;
    }
    
    .nav .nav-link:hover,
    .nav .nav-link.active {
        background: var(--bg-hover, rgba(124, 58, 237, 0.1));
        color: var(--text-primary, #f5f5f7);
    }
    
    .nav .nav-link.active {
        color: var(--accent-purple-light, #a78bfa);
    }
    
    .nav .nav-link.active i {
        opacity: 1;
    }
    
    /* Divider */
    .nav .nav-divider {
        height: 1px;
        width: 100%;
        background: var(--border, rgba(255,255,255,0.1));
        margin: 0.5rem 0;
    }
    
    /* Profile */
    .nav .nav-profile {
        background: var(--bg-tertiary, rgba(255,255,255,0.05));
        margin-top: 0.5rem;
    }
    
    .nav .nav-avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    /* Logout */
    .nav .logout-form {
        width: 100%;
    }
    
    .nav .nav-button {
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        cursor: pointer;
        color: inherit;
        font: inherit;
    }
    
    /* Register button */
    .nav .btn.btn-primary {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding: 0.875rem 1rem;
        width: 100%;
        border-radius: var(--radius-md, 8px);
    }
    
    .nav .btn.btn-primary span {
        display: inline !important;
    }
    
    /* Language selector */
    .nav .lang-selector {
        margin-top: auto;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border, rgba(255,255,255,0.1));
        position: relative;
    }
    
    .nav .lang-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        width: 100%;
        color: var(--text-secondary, #a1a1aa);
        font-weight: 500;
        border-radius: var(--radius-md, 8px);
        min-height: 44px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .nav .lang-toggle:hover {
        background: var(--bg-hover, rgba(124, 58, 237, 0.1));
    }
    
    .nav .lang-dropdown {
        display: none;
        padding: 0.25rem 0 0.25rem 1.5rem;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
    }
    
    .nav .lang-selector.open .lang-dropdown {
        display: block;
    }
    
    .nav .lang-option {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        color: var(--text-secondary, #a1a1aa);
        min-height: 40px;
        border-radius: var(--radius-sm, 6px);
    }
    
    .nav .lang-option:hover,
    .nav .lang-option.active {
        background: var(--bg-hover, rgba(124, 58, 237, 0.1));
        color: var(--text-primary, #f5f5f7);
    }
    
    /* Theme switcher */
    .nav .theme-switcher {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        margin-top: 0.5rem;
    }
    
    .nav .theme-switcher .theme-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-tertiary, rgba(255,255,255,0.05));
        border: 1px solid var(--border, rgba(255,255,255,0.1));
        border-radius: var(--radius-md, 8px);
        color: var(--text-secondary, #a1a1aa);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .nav .theme-switcher .theme-btn:hover,
    .nav .theme-switcher .theme-btn.active {
        background: var(--accent-purple, #7c3aed);
        border-color: var(--accent-purple, #7c3aed);
        color: white;
    }
    
    /* Stars badge */
    .nav .stars-nav-badge {
        margin-left: auto;
    }
}

/* Stats Section - Fix centering */
.stat-item {
    text-align: center;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Section title in forms */
.form-section-title {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-section-title h4 {
    margin: 0 0 var(--space-xs);
    font-size: 1rem;
    color: var(--text-primary);
}

.form-section-title p {
    margin: 0;
    font-size: 0.85rem;
}

/* Spotify preview in profile form */
.spotify-preview {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Input with icon adjustments for social networks */
.input-with-icon i.fab {
    font-size: 1.1rem;
}


/* ===========================================
   DISPLAY NAME OPTIONS (Radio buttons style)
   =========================================== */
.display-name-options {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.display-name-option {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.display-name-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.display-name-option .option-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.display-name-option .option-content > i {
    font-size: 1.25rem;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
}

.display-name-option .option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.display-name-option .option-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.display-name-option .option-value {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.display-name-option .option-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.display-name-option .check-icon {
    color: var(--success);
    opacity: 0;
    transition: opacity 0.2s;
}

.display-name-option:hover:not(.disabled) {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

.display-name-option.selected {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.1);
}

.display-name-option.selected .option-content > i {
    color: var(--primary);
}

.display-name-option.selected .check-icon {
    opacity: 1;
}

.display-name-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   PRIVACY GRID (Compact checkboxes)
   =========================================== */
.privacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.privacy-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.privacy-item input[type="checkbox"] {
    display: none;
}

.privacy-item i {
    font-size: 1rem;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    transition: color 0.2s;
}

.privacy-item span {
    color: var(--text-secondary);
    transition: color 0.2s;
    white-space: nowrap;
}

.privacy-item:hover {
    border-color: var(--primary);
}

/* Ã‰tat checked */
.privacy-item:has(input:checked) {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
}

.privacy-item:has(input:checked) i {
    color: var(--success);
}

.privacy-item:has(input:checked) span {
    color: var(--text-primary);
}

/* Fallback pour navigateurs sans :has() */
.privacy-item.checked {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
}

.privacy-item.checked i {
    color: var(--success);
}

.privacy-item.checked span {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 480px) {
    .display-name-options {
        flex-direction: column;
    }
    
    .display-name-option {
        min-width: 100%;
    }
    
    .privacy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* ============================================
   FIX SIDEBAR STICKY - CREATE PAGE
   ============================================ */
@media (min-width: 900px) {
    .quiz-create-page {
        display: grid !important;
        grid-template-columns: 1fr 280px !important;
        gap: var(--space-xl) !important;
        max-width: 1000px !important;
        align-items: start !important;
    }
    
    .quiz-create-page > .page-header-mobile {
        grid-column: 1 / -1 !important;
    }
    
    .quiz-create-page > .user-stars-summary {
        grid-column: 1 / -1 !important;
    }
    
    .quiz-create-page > .quiz-create-form {
        grid-column: 1 !important;
    }
    
    .quiz-create-page > .create-sidebar {
    grid-column: 2 !important;
    grid-row: 2 / 0 !important;
    align-self: start !important;
    position: sticky !important;
    top: 80px !important;
}
    
    .quiz-create-page > .create-sidebar > .info-card {
        position: static !important;
    }
}

.bg-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}


/* ============================================
 * Question Author Attribution
 * Discreet italic display for question authors
 * ============================================ */

.question-author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.4rem 0;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.45));
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.question-author:hover {
    opacity: 1;
}

.question-author i {
    font-size: 0.7rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

/* In results page - slightly different positioning */
.review-content .question-author {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/**
 * CSS Ã€ AJOUTER pour le bouton warning
 * (si pas dÃ©jÃ  prÃ©sent dans app.css)
 */

/* Bouton Warning (orange) */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Bouton Gold (pour featured) */
.btn-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    border: none;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a2e;
}

/* Texte gold */
.text-gold {
    color: #fbbf24 !important;
}

/* Badge archived */
.badge-archived {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Lorcana theme overrides */
[data-theme="lorcana"] .btn-warning {
    background: linear-gradient(135deg, #D3BA84, #B89D5E);
    color: #0D0F1A;
}

[data-theme="lorcana"] .btn-warning:hover {
    background: linear-gradient(135deg, #B89D5E, #8B7355);
    box-shadow: 0 4px 12px rgba(211, 186, 132, 0.3);
}

[data-theme="lorcana"] .btn-gold {
    background: linear-gradient(135deg, #D3BA84, #B89D5E);
    color: #0D0F1A;
}

[data-theme="lorcana"] .text-gold {
    color: #D3BA84 !important;
}