/* Correction position croix modal */
.modal-content {
    position: relative;
}
/* Croix en haut à droite du modal domaines */
.modal-close-top-right {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 10;
}
:root {
    /* Light Theme */
    --bg-gradient-1: #ffffff;
    --bg-gradient-2: #f0f2f5;
    --primary-color: #1a1a1a;
    --accent-color: #3b82f6; /* Blue for Shuffle */
    --text-main: #1a1a1a;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --glass-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --skeleton-base: #e5e7eb;
    --skeleton-highlight: #f3f4f6;
    --btn-primary-bg: #1a1a1a;
    --btn-primary-text: #ffffff;
}

[data-theme="dark"] {
    --bg-gradient-1: #071026; /* deep navy */
    --bg-gradient-2: #0b1420; /* slightly lighter */
    --primary-color: #f8fafc; /* near white for headings */
    --accent-color: #60a5fa; /* bright blue accent */
    --text-main: #e6eef8; /* softer main text */
    --text-secondary: #9fb0c8; /* muted secondary */
    --card-bg: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    --card-solid-bg: #0f1724; /* fallback solid surface color */
    --card-border: rgba(255,255,255,0.04);
    --glass-shadow: 0 8px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
    --skeleton-base: #23303d;
    --skeleton-highlight: #2f4858;
    --btn-primary-bg: linear-gradient(90deg, #60a5fa, #7c3aed);
    --btn-primary-text: #071026;
    --muted-surface: rgba(255,255,255,0.02);
}

/* Dark-mode specific refinements */
[data-theme="dark"] body {
    background: radial-gradient(1200px 600px at 10% 10%, rgba(96,165,250,0.06), transparent 8%), radial-gradient(900px 450px at 90% 85%, rgba(124,58,237,0.04), transparent 12%), var(--bg-gradient-2);
    color: var(--text-main);
}

[data-theme="dark"] .background-gradient {
    background: linear-gradient(180deg, rgba(7,16,38,0.9), rgba(11,20,32,0.95));
    background-blend-mode: overlay;
}

[data-theme="dark"] .card {
    background: var(--card-solid-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--glass-shadow);
}

[data-theme="dark"] .card.challenge-quiz-card,
[data-theme="dark"] .card.challenge-setup-card {
    padding: 40px;
}

[data-theme="dark"] .quiz-modal {
    background: linear-gradient(180deg, rgba(3,7,18,0.82), rgba(3,7,18,0.9));
}

[data-theme="dark"] .quiz-modal-content,
[data-theme="dark"] .quiz-section,
[data-theme="dark"] .quiz-modal-content .quiz-section {
    background: linear-gradient(180deg, rgba(15,23,36,0.98), rgba(10,16,26,0.98));
    border: 1px solid rgba(255,255,255,0.03);
}

[data-theme="dark"] .btn.primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: 0 6px 20px rgba(96,165,250,0.12);
}

[data-theme="dark"] .btn.primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 30px rgba(96,165,250,0.16);
}

[data-theme="dark"] .btn.secondary {
    background: var(--muted-surface);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.03);
}

[data-theme="dark"] .badge {
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.03);
}

[data-theme="dark"] .history-item,
[data-theme="dark"] .history-thumb,
[data-theme="dark"] .badge-item,
[data-theme="dark"] .mode-btn,
[data-theme="dark"] .xp-progress-card {
    background: var(--card-solid-bg);
    border: 1px solid var(--card-border);
}

[data-theme="dark"] .notification {
    background: rgba(10, 18, 28, 0.95);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.03);
}

[data-theme="dark"] .domain-item.selected {
    background: linear-gradient(90deg, rgba(96,165,250,0.14), rgba(124,58,237,0.12));
    border-color: rgba(96,165,250,0.28);
}

/* Smooth transitions for theme switch */
* { transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.2s ease; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
    transition: color 0.3s ease;
}

/* Backgrounds */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--bg-gradient-2); /* Solid clean background */
    transition: background 0.5s ease;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ensure nav sits above interactive content so buttons remain clickable */
.top-nav {
    position: relative;
    z-index: 60;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}



.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -1px;
}

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

/* Small quoted detail near the logo */


.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(128, 128, 128, 0.1);
}

.top-nav .btn-icon.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* User Level Badge */
.user-level-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 20%;
    background: linear-gradient(
142deg, #0093ff, #025af900);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Layout */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 4rem;
    display: block;
}


.two-column {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 1.5rem;
    align-items: start;
}

.left-col, .center-col, .right-col {
    display: block;
}

@media (max-width: 980px) {
    .two-column { grid-template-columns: 1fr; }
}

.hero-header {
    text-align: center;
    margin: 3rem 0 4rem;
}

/* ----------------------------
   Mobile responsive tweaks
   ---------------------------- */
@media (max-width: 768px) {
    :root {
        --card-border-radius: 20px;
    }

    /* Make navigation more compact and touch-friendly */
    .top-nav {
        padding: 0.8rem 1rem;
    }
    .logo { font-size: 1.4rem; }
    .nav-actions { gap: 0.25rem; }
    .btn-icon { padding: 10px; font-size: 1.1rem; min-width:44px; min-height:44px; }

    /* Stack main content into a single column */
    .three-column, .two-column {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .card { border-radius: 20px; min-height: 200px; }

    /* Image area smaller on phones */
    .image-wrapper { height: 200px; }
    .skeleton-image { height: 200px; }

    /* Tighter text content and buttons */
    .text-content { padding: 1rem 1.25rem 1.5rem; }
    .actions { gap: 0.5rem; }
    .btn.primary { padding: 12px 18px; font-size: 1rem; }
    .big-btn { padding: 16px; font-size: 1rem; }

    /* Quiz adjustments */
    .quiz-section { padding: 1rem; border-radius: 16px; }
    .quiz-question { font-size: 1rem; }
    .quiz-excerpt { font-size: 0.95rem; }
    .quiz-option { padding: 0.9rem 1rem; font-size: 0.95rem; }

    /* History/favorites compact list */
    .history-item { padding: 0.75rem; gap: 0.6rem; }
    .history-thumb { width: 40px; height: 40px; }

    /* Page container spacing */
    .page-container { margin: 1rem auto 3rem; width: 96%; }
}

@media (max-width: 480px) {
    /* Extra small phones */
    .logo { font-size: 1.2rem; }
    .btn-icon { font-size: 1rem; padding: 10px; }
    .card { border-radius: 16px; }
    .image-wrapper { height: 160px; }
    .skeleton-image { height: 160px; }
    .quiz-question { font-size: 0.98rem; }
    .text-content h2 { font-size: 1.4rem; }
    .big-btn { padding: 12px; font-size: 0.98rem; }

    /* Ensure interactive elements in control area are full-width (primary action)
       but keep article action buttons side-by-side. */
    .controls-area { padding: 0 1rem; }
    .controls-area .btn.primary { width: 100%; display:block; }

    /* Keep article actions on one row on very small screens; allow wrap if needed */
    .actions { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

    /* Make the remaining action buttons share available space (two buttons side-by-side) */
    /* kept responsive layout simple for very small screens */

    /* Ensure link buttons render as flex items so their inner text/icon centers */
    .actions a.btn { display: inline-flex; align-items: center; justify-content: center; }

    /* Reduce gaps to save space */
    .three-column, .two-column { gap: 0.8rem; }
}

.hero-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.hero-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px; /* More rounded */
    width: 100%;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 3rem;
    position: relative;
}

/* --- AMÉLIORATIONS CHALLENGE.HTML (Nouveau Design) --- */

/* Conteneur principal centré pour un meilleur look sur grand écran */
.main-content.challenge-content {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

/* Amélioration des badges de difficulté */
.challenge-difficulty-badge {
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* Couleurs spécifiques pour chaque difficulté */
.challenge-difficulty-badge[data-difficulty="easy"] {
    background: #d1fae5; /* Vert clair */
    color: #065f46;
    border: 1px solid #34d399;
}
.challenge-difficulty-badge[data-difficulty="medium"] {
    background: #fef3c7; /* Jaune clair */
    color: #b45309;
    border: 1px solid #fcd34d;
}
.challenge-difficulty-badge[data-difficulty="hard"] {
    background: #fee2e2; /* Rouge clair */
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Amélioration des options de quiz */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1.5rem;
}

.quiz-option {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-weight: 600;
}

.quiz-option:hover {
    border-color: var(--accent-color);
    /* Utiliser accent-color si possible ou une couleur définie */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
    transform: translateY(-1px);
}

.card {
    min-height: 400px;
}
.card.challenge-quiz-card,
.card.challenge-setup-card {
    padding: 50px;
}

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

/* Image Area */
.image-wrapper {
    width: 100%;
    height: 320px; /* Taller */
    position: relative;
    overflow: hidden;
    background-color: var(--skeleton-base);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.image-wrapper:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--card-bg), transparent);
    pointer-events: none;
}

.badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Text Content */
.text-content {
    padding: 1rem 2.5rem 2.5rem;
    position: relative;
}

.text-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

.description {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

#article-extract {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    border: none;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    padding: 15px;
}

.btn.primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn.primary:hover {
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: var(--skeleton-base);
    color: var(--text-main);
    padding: 14px 24px;
    font-size: 1rem;
}

.btn.secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn.icon-only {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid var(--skeleton-base);
}

.btn.icon-only:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: transparent;
}

.controls-area {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.big-btn {
    width: 100%;
    border-radius: 24px;
    font-size: 1.3rem;
    padding: 24px;
}

/* Skeleton Loader */
.skeleton-loader {
    padding: 0;
    width: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: var(--card-bg);
    border-radius: 32px;
}

.skeleton-loader.hidden {
    display: none;
}

.content {
    position: relative;
    z-index: 1;
}

/* Prevent content flash: hide main content until JS sets `body.page-ready` */
body:not(.page-ready) #article-content,
body:not(.page-ready) .content,
body:not(.page-ready) #content-card,
body:not(.page-ready) .skeleton-loader {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.skeleton-image {
    width: 100%;
    height: 320px;
    background-color: var(--skeleton-base);
    animation: pulse 1.5s infinite;
}

.skeleton-content {
    padding: 2.5rem;
}

.skeleton-title {
    height: 40px;
    width: 80%;
    background-color: var(--skeleton-base);
    margin-bottom: 1.5rem;
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

.skeleton-text {
    height: 18px;
    width: 100%;
    background-color: var(--skeleton-base);
    margin-bottom: 0.8rem;
    border-radius: 6px;
    animation: pulse 1.5s infinite;
    animation-delay: 0.1s;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* History */
.history-section {
    width: 100%;
    margin-top: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.history-actions {
    display: flex;
    align-items: center;
}

.history-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.btn-text:hover {
    text-decoration: underline;
}

/* -----------------------------
   Profile Page - Social Card
   ----------------------------- */
.page-container {
    max-width: 980px;
    margin: 2.5rem auto 6rem;
    width: 94%;
    display: grid;
    gap: 2rem;
    align-items: start;
}

.social-profile-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
}

.profile-cover {
    height: 140px;
    background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(99,102,241,0.08));
    position: relative;
}

.profile-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05), transparent);
}

.profile-main-info {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    align-items: center;
}

.profile-avatar-container {
    position: relative;
    width: 110px;
    flex-shrink: 0;
}

.profile-avatar-xl {
    width: 110px;
    height: 110px;
    border-radius: 18px;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--text-secondary);
    border: 4px solid var(--card-bg);
}

.profile-level-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.profile-identity {
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

#profile-display-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-username-social {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.profile-stats-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-stat-item {
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
}

.profile-stat-item .stat-number {
    font-weight: 700;
    font-size: 1.05rem;
}

.profile-actions-top {
    display: flex;
    gap: 8px;
}

.xp-progress-card, .badges-collection-card, .domains-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
}

.xp-progress-card {
    margin-bottom: 1rem;
}

.xp-progress-track {
    height: 12px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.xp-progress-fill-modern {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--accent-color), #7c3aed);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.activity-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stats-card .quick-stats-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-stat-item {
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}



/* Responsive */
@media (max-width: 880px) {
    .page-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .profile-avatar-xl { width: 88px; height: 88px; font-size: 2.2rem; }
}

/* small polish for badges and lists */
.badges-showcase .badge-item, .domains-grid-modern .domain-item {
    background: rgba(0,0,0,0.04);
    padding: 8px 10px;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* End Profile Page styles */

.btn-text:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quiz Section */
/* Quiz Popup Modal */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.quiz-modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.quiz-modal.active .quiz-modal-content {
    transform: translateY(0);
}

.quiz-section {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 24px;
    padding: 2rem;
}

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

.quiz-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.quiz-modal-close:hover {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-main);
}

.quiz-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.quiz-excerpt {
    background: var(--skeleton-base);
    padding: 1rem;
    border-radius: 12px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quiz-option {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.quiz-option.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.quiz-option.selected {
    outline: 2px dashed rgba(59,130,246,0.25);
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.quiz-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.quiz-result.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.quiz-result.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
    border-color: var(--accent-color);
}

.history-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background-color: var(--skeleton-base);
    flex-shrink: 0;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.history-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    font-style: italic;
}

.flash-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border-left: 3px solid var(--accent-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 12px 0;
    color: var(--text-main);
}

.flash-summary i {
    color: var(--accent-color);
    margin-right: 8px;
}

.shuffle-counter {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-domain-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 10px;
}

/* Statistiques Utilisateur */
.stats-section {
    width: 100%;
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Notification toast */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}


/* Modal de sélection des domaines */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Instruction panel inside domain modal (shown on first visit) */
.domain-instructions {
    padding: 1rem 0 0.5rem 0;
    text-align: left;
}

.domain-instructions h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    text-align: center;
}
.domain-instructions .modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}
.domain-instructions .intro-features {
    list-style: none;
    margin: 0.8rem 0 1rem 0;
    padding-left: 0;
}
.domain-instructions .intro-features li {
    margin: 0.4rem 0;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.domain-instructions .modal-footer { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.8rem; }

.modal .domain-instructions { display: none; }
.modal.instructions-active .domain-instructions {
    display: block;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
}
.modal.instructions-active .domain-grid,
.modal.instructions-active #save-domains-btn {
    display: none !important;
}

/* Hide the modal header when showing the instructions slide */
.modal.instructions-active .modal-header {
    display: none !important;
}

.modal-header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.modal-header i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.domain-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-gradient-1);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.domain-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.domain-item.selected {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.domain-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.8rem;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.domain-item.selected .domain-icon {
    color: white;
}

.domain-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.domain-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.domain-item.selected .domain-name {
    color: white;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

.modal-footer .btn {
    min-width: 200px;
}


/* ========================================
   NOUVELLES FONCTIONNALITÉS
   ======================================== */

/* Profil Utilisateur */
.user-profile-card {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

.profile-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.level-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.xp-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.profile-streak {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.xp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: white;
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* Modes de Jeu */
.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.mode-btn i {
    font-size: 2rem;
    color: var(--accent-color);
}

.mode-btn span {
    font-weight: 600;
    font-size: 1.1rem;
}

.mode-btn small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modal Authentification */
.auth-modal-content {
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--card-border);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 1rem;
    border: 2px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.auth-message {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.auth-message.error {
    color: #ef4444;
}

.auth-message.success {
    color: #10b981;
}

/* Modal Classement */
.leaderboard-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-container {
    margin-top: 1.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.current-user {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.top-1 { color: #fbbf24; }
.leaderboard-rank.top-2 { color: #d1d5db; }
.leaderboard-rank.top-3 { color: #cd7f32; }

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.leaderboard-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.leaderboard-xp {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Modal Badges */
.badges-modal-content {
    max-width: 700px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.badge-item.earned {
    border-color: #fbbf24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.badge-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.badge-earned-date {
    font-size: 0.7rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
}

/* Modal Mode Défi */
.challenge-modal-content {
    max-width: 600px;
}

.difficulty-selector {
    margin-bottom: 2rem;
}

.difficulty-selector h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
}

.difficulty-btn.active {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.difficulty-icon {
    font-size: 2rem;
}

.difficulty-name {
    font-weight: 600;
    font-size: 1rem;
}

.difficulty-xp {
    font-size: 0.8rem;
    color: var(--accent-color);
}

/* (Multiplayer styles removed) */

/* Menu Utilisateur */
.user-menu-content {
    max-width: 300px;
}

.user-menu-header {
    text-align: center;
    padding: 1rem 0 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.user-menu-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.user-menu-header h3 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.user-menu-options {
    padding: 1rem 0;
}

.user-menu-btn {
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-menu-btn:hover {
    background: var(--skeleton-base);
}

.user-menu-btn.danger {
    color: #ef4444;
}

.user-menu-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .game-modes {
        grid-template-columns: 1fr;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
    }

    .leaderboard-modal-content,
    .badges-modal-content,
    .challenge-modal-content {
        max-width: 95%;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}


/* ========================================
   DESIGN AMÉLIORÉ - PAGES MULTIPLES
   ======================================== */

/* Logo avec lien */
.logo a {
    color: inherit;
    text-decoration: none;
}

/* Container pour les pages */
.page-container {
    max-width: 1200px;
    padding-top: 2rem;
}

/* En-tête de Page */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.page-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ========================================
   PAGE PROFIL
   ======================================== */

.profile-main-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease;
}

.profile-banner {
    height: 150px;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 50px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    border: 5px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent-color);
}

.profile-details {
    text-align: center;
    padding: 1rem 2rem 2rem;
}

.profile-details h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    margin: 0.5rem 0;
}

.profile-username {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.profile-badges-preview {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.level-badge-large {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
}

.streak-badge-large {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
}

/* Carte XP */
.xp-card {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.xp-info {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
}

.xp-current, .xp-next {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.xp-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-color);
}

.xp-progress-bar-large {
    height: 12px;
    background: var(--skeleton-base);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.xp-remaining {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Grille de Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.articles {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.quizzes {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.rank {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    margin: 0;
}

/* Recent Badges */
.recent-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Domains Chart */
.domains-chart {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.domain-stat {
    background: var(--skeleton-base);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.domain-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.domain-stat-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.domain-stat-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn.danger {
    background: #ef4444;
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
}

/* ========================================
   PAGE CLASSEMENT
   ======================================== */

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease;
}

@media (max-width: 768px) {
    .podium {
        flex-direction: column;
        align-items: center;
    }
}

.podium-place {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid var(--card-border);
}

.podium-place:hover {
    transform: translateY(-10px);
}

.podium-place.first {
    order: 2;
    padding: 2rem 1.5rem;
    border-color: #fbbf24;
}

.podium-place.second {
    order: 1;
    border-color: #d1d5db;
}

.podium-place.third {
    order: 3;
    border-color: #cd7f32;
}

.podium-crown {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #fbbf24;
    animation: bounce 2s infinite;
}

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

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.podium-place.first .podium-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.podium-rank {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 0.5rem;
}

.podium-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.podium-xp {
    color: var(--accent-color);
    font-weight: 700;
}

/* Filtres */
.leaderboard-filters,
.badges-filters {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Liste Classement */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Votre Rang */
.your-rank-card {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease;
}

.your-rank-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.your-rank-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.your-rank-number {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.your-rank-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ========================================
   PAGE BADGES
   ======================================== */

.badges-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}



.badge-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeInUp 0.6s ease;
}

.badge-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.badge-stat-icon.earned {
    background: linear-gradient(135deg, #10b981, #059669);
}

.badge-stat-icon.total {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.badge-stat-icon.progress {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.badge-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.badge-stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.badge-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Grille Badges Page */
.badges-grid-page {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}



/* ========================================
   PAGE MODE DÉFI
   ======================================== */

.challenge-header {
    position: relative;
}

.challenge-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.difficulty-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.difficulty-card:hover {
    transform: translateY(-5px);
}

.difficulty-card.active {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.difficulty-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.difficulty-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.difficulty-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.challenge-login-notice {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-reward {
    background: var(--skeleton-base);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    color: var(--accent-color);
    display: inline-block;
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.challenge-actions-row {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .challenge-actions-row {
        flex-direction: column;
    }
}

.challenge-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.challenge-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.challenge-stat-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.challenge-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 0.25rem;
}

.challenge-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.challenge-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.challenge-difficulty-badge {
    background: var(--skeleton-base);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
}

.challenge-timer {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 700;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-place {
        width: 100%;
        max-width: 300px;
    }

    .podium-place.first,
    .podium-place.second,
    .podium-place.third {
        order: initial;
    }

    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    .badges-grid-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .badges-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .badge-stat-card {
        width: 435px;
    }
    .profile-main-info {
        display: grid;
    }
}

/* ========================================
   PROFIL STYLE RÉSEAU SOCIAL MODERNE
   ======================================== */

.social-profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.profile-cover {
    height: 120px;
    background: var(--accent-color);
    position: relative;
}

.profile-cover-gradient {
    display: none;
}

.profile-main-info {
    padding: 0 2rem 2rem;
    position: relative;
}

.profile-avatar-container {
    position: relative;
    margin-top: -60px;
    margin-bottom: 1rem;
}

.profile-avatar-xl {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    border: 5px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #667eea;
}

.profile-level-badge {
    position: absolute;
    bottom: 0;
    right: -10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 6px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-identity {
    margin-bottom: 1.5rem;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.profile-name-row h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    margin: 0;
}

.profile-badges-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-inline {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
}

.badge-inline:hover {
    transform: translateY(-2px);
}

.badge-inline.developer {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.badge-inline.verified {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.badge-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 4px;
}

.badge-inline:hover .badge-tooltip {
    opacity: 1;
}

.profile-username-social {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.profile-stats-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-stat-item .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-main);
}

.profile-stat-item .stat-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.streak-stat {
    position: relative;
}

.streak-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
}

.streak-icon.active {
    color: #ef4444;
    animation: flameFlicker 1.5s infinite;
}

.streak-icon.inactive {
    color: #9ca3af;
}

@keyframes flameFlicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.profile-actions-top {
    position: absolute;
    top: 1rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
}

.btn-profile {
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-profile.secondary {
    background: var(--skeleton-base);
    color: var(--text-main);
}

.btn-profile.secondary:hover {
    background: var(--accent-color);
    color: white;
}

/* XP Progress Moderne */
.xp-progress-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    height: 100%;
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.xp-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.xp-current-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.xp-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-color);
}

.xp-label-small {
    font-size: 1rem;
    color: var(--text-secondary);
}

.xp-progress-visual {
    margin-bottom: 1.5rem;
}

.xp-progress-track {
    height: 8px;
    background: var(--skeleton-base);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.xp-progress-fill-modern {
    height: 100%;
    background: var(--accent-color);
    border-radius: 100px;
    transition: width 0.8s ease;
}

.xp-milestones {
    display: flex;
    justify-content: space-between;
}

.xp-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.milestone-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
}

.milestone-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.xp-remaining-modern {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Activité et Série */
.activity-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    height: 100%;
}

.streak-calendar-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
}

.streak-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.streak-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.streak-title i {
    color: #ef4444;
    font-size: 1.5rem;
}

.streak-count-large {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.streak-count-large span:first-child {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-color);
}

.streak-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.streak-calendar {
    margin-bottom: 1.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    transform: scale(1.1);
}

.calendar-day.active {
    background: #ef4444;
    color: white;
}


.calendar-day.inactive {
    opacity: 0.3;
}

.streak-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.streak-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.streak-stat-item i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.quick-stats-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
}

.quick-stats-card h3 {
    margin-bottom: 1.5rem;
}

.quick-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--skeleton-base);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.quick-stat-item:hover {
    transform: translateX(5px);
}

.quick-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.quick-stat-icon.articles {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.quick-stat-icon.quizzes {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.quick-stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.quick-stat-icon.xp {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.quick-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quick-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.quick-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Badges Collection */
.badges-collection-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    height: 100%;
}

.badges-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.badge-showcase-item {
    background: var(--skeleton-base);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-showcase-item:hover {
    transform: translateY(-5px);
}

.badge-showcase-item.earned {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border: 2px solid #fbbf24;
}

.badge-showcase-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-showcase-name {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Domaines */
.domains-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    height: 100%;
}

.domains-card h3 {
    margin-bottom: 1.5rem;
}

.domains-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.domain-card-modern {
    background: var(--skeleton-base);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.domain-card-modern:hover {
    transform: translateY(-5px);
}

.domain-icon-modern {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.domain-name-modern {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.domain-count-modern {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.profile-footer-actions {
    text-align: center;
    padding: 2rem 0;
    /* height: 100%; */
}

/* Responsive */
@media (max-width: 968px) {
    .activity-section {
        grid-template-columns: 1fr;
    }

    .profile-stats-row {
        gap: 1rem;
    }

    .profile-actions-top {
        position: static;
        margin-top: 1rem;
    }
}



.streak-page {
    max-width: 960px;
}

.streak-lock-card {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    background: linear-gradient(120deg, rgba(59,130,246,0.08), rgba(59,130,246,0.02));
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.lock-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(59,130,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.lock-copy h2 {
    margin: 0 0 0.4rem;
}

.lock-copy p {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
}

.streak-dashboard {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.streak-hero {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.page-kicker {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.35rem;
}

.streak-hero-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.streak-icon-large {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.streak-icon-large i {
    color: #ef4444;
}

.streak-icon-large.active i {
    animation: flameFlicker 1.5s infinite;
}

.streak-icon-large.inactive i {
    color: #9ca3af;
}



.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.streak-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.streak-summary-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.streak-calendar-full {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
}

.streak-calendar-full h3 {
    margin-bottom: 1.5rem;
}

.calendar-months {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.calendar-month {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-month-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}

.calendar-day-full {
    aspect-ratio: 1;
    border-radius: 6px;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.calendar-day-full:hover {
    transform: scale(1.05);
}

.calendar-day-full.active {
    background: #ef4444;
    color: white;
}


.calendar-day-full.inactive {
    opacity: 0.3;
}

.streak-tips {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
}

.streak-tips h3 {
    margin-bottom: 1.5rem;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0;
}

.tips-list li {
    position: relative;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tips-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
}

.streak-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.streak-calendar-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
    background: var(--card-border);
}

.legend-dot.active {
    background: #ef4444;
}

.legend-dot.upcoming {
    background: var(--card-border);
}

.streak-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.tip-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.tip-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .streak-hero {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        grid-template-columns: 1fr;
    }

    .streak-current-number {
        font-size: 3.5rem;
    }

    .calendar-days-grid {
        gap: 0.25rem;
    }
}

/* Calendar Header with Navigation */
.calendar-header-with-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
    position: relative;
    z-index: 1;
}

.calendar-month-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    text-align: center;
    flex: 1;
}

.nav-arrow {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-arrow:hover {
    background: var(--skeleton-base);
    color: var(--text-main);
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 0.5rem 0;
}

/* Enhanced Calendar Day Styles */
.calendar-day-full {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--skeleton-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    min-height: 40px;
}

.calendar-day-full:hover {
    transform: scale(1.1);
    z-index: 2;
}

.calendar-day-full.active {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.calendar-day-full.today {
    border: 2px solid var(--accent-color);
    font-weight: 700;
}

.calendar-day-full.today.active {
    border-color: white;
}

.calendar-day-full.inactive {
    opacity: 0.4;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.active {
    background: #ef4444;
}

.legend-dot.inactive {
    background: var(--skeleton-base);
}

.legend-dot.today {
    background: var(--accent-color);
}

.legend-dot.upcoming {
    background: #f3f4f6;
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .calendar-days-grid {
        gap: 0.5rem;
    }
    
    .calendar-day-full {
        font-size: 0.85rem;
        min-height: 35px;
    }
    
    .calendar-header-with-nav {
        flex-direction: row;
        gap: 1rem;
    }
    
    .calendar-month-name {
        order: 0;
        flex: 1;
    }
    
    .calendar-legend {
        gap: 1rem;
        font-size: 0.8rem;
    }
}

/* (Multiplayer UI styles removed) */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-links {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        gap: 1rem;
    }
}

/* Contact Form Styles */
.contact-form {
    margin-top: 2rem;
    max-width: 600px;
}

/* ========================================
   Intro Modal Styles
   ======================================== */
.intro-modal-content {
    max-width: 700px;
    padding: 1.5rem 1.75rem;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(2,6,23,0.35);
}

.intro-modal-content .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem;
}

.intro-modal-content .modal-subtitle {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.intro-features {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 0.75rem;
}
.intro-features li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: var(--text-main);
}
.intro-features i { color: var(--accent-color); min-width:20px; }

/* Make modal center and backdrop (use shared .modal/.modal.hidden rules) */
/* Positioning reuse of modal classes */
.modal#intro-modal {
    z-index: 1200; /* ensure it's above other overlays when active */
}
.modal#intro-modal .modal-content {
    margin: 6vh auto;
}

/* When a modal is open we temporarily dim/hide underlying content to avoid flicker */
body.modal-open #content-card,
body.modal-open #article-content,
body.modal-open .skeleton-loader {
    opacity: 0.02;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
body.modal-open .controls-area { pointer-events: none; opacity: 0.3; }

/* Emergency: force intro modal to be on top and clearly visible */
#intro-modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.6) !important;
    z-index: 999999 !important;
    top: 0; left: 0; right: 0; bottom: 0; position: fixed !important;
}

#intro-modal .modal-content.intro-modal-content {
    max-width: 760px !important;
    width: calc(100% - 32px) !important;
    padding: 1.25rem !important;
    border-radius: 12px !important;
    box-shadow: 0 24px 60px rgba(2,6,23,0.5) !important;
    background: #ffffff !important;
    color: #0f172a !important;
    transform: translateY(0) !important;
}

/* Ensure .modal.hidden still hides reliably */
.modal.hidden { display: none !important; opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 480px) {
    .intro-modal-content { padding: 1rem; margin: 0 1rem; }
    .intro-features { gap: 0.6rem; }
}

/* ========================================
   Challenge page tweaks (icons & layout)
   ======================================== */
.challenge-page .challenge-header {
    /* display: flex; */
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.challenge-page .challenge-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(99,102,241,0.02));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
}
.difficulty-grid { display:flex; gap:1rem; flex-wrap:wrap; }
.difficulty-card { flex:1 1 28%; padding:1rem; border-radius:12px; background:var(--card-bg); border:1px solid var(--card-border); box-shadow: 0 8px 20px rgba(2,6,23,0.03); }
.difficulty-card .difficulty-icon-large { font-size:1.6rem; margin-bottom:0.6rem; }
.difficulty-card.active { border-color: rgba(99,102,241,0.35); transform: translateY(-4px); }
.difficulty-reward { display:block; margin-top:0.8rem; font-weight:700; color:var(--text-secondary); }
.recommended-badge { background: linear-gradient(90deg,#fbbf24,#f59e0b); color:white; padding:4px 8px; border-radius:999px; font-weight:700; font-size:0.8rem; }

@media (max-width: 768px) {
    .difficulty-card { flex:1 1 48%; }
}

@media (max-width: 480px) {
    .difficulty-card { flex:1 1 100%; }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.form-message i {
    margin-right: 0.5rem;
}

/* Simple Multiplayer specific styles (small, focused) */
/* Multiplayer styles removed */

