/**
 * SEPTIMOT - Styles CSS
 * Version: 1.5 (Refactorisée)
 * 
 * Organisation:
 * 1. Variables CSS (Custom Properties)
 * 2. Classes utilitaires (NOUVEAU - pour réduire les doublons)
 * 3. Reset & Base
 * 4. Layout & Containers
 * 5. Header & Navigation
 * 6. Cards & Sections
 * 7. Forms & Inputs
 * 8. Buttons
 * 9. Mini-jeux (Anagramme, Pendu, Motus)
 * 10. Trophées
 * 11. Leaderboard
 * 12. Modals
 * 13. Notifications & Toasts
 * 14. Animations
 * 15. Media Queries (regroupées à la fin)
 */

/* ============================================
   1. VARIABLES CSS
   ============================================ */
:root {
    /* Couleurs principales */
    --primary: #4C9EE1;
    --primary-dark: #4C9EE1;
    --secondary: #113F64;
    --accent: #475569;
    --success: #31C950;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Couleurs neutres */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Effets glass */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50px;
}

/* ============================================
   2. CLASSES UTILITAIRES (Réduisent les doublons)
   ============================================ */

/* ============================================
   STICKY HEADER
   ============================================ */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0c2d47 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.sticky-header-inner {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.sticky-header-title {
    color: white;
    -webkit-text-fill-color: white;
    background: none;
    margin: 0;
    font-size: 1.6rem;
    font-family: "Luckiest Guy", cursive;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: none;
}

/* Effet Glass - remplace 15+ occurrences de backdrop-filter */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Texte gradient - remplace 20+ occurrences */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gradient de fond principal */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}
.hover-lift:hover {
    transform: translateY(-2px);
}

/* Card de base */
.card-base {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   3. RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4C9EE1 0%, #1e293b 50%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(30, 58, 138, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(51, 65, 85, 0.4) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   4. LAYOUT & CONTAINERS
   ============================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 60px;
    position: relative;
    z-index: 1;
}

.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 50px 45px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    font-size: 3.5em;
    font-family: "Luckiest Guy", cursive;
    font-weight: 350;
    letter-spacing: 2px;
}

.login-container p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.1em;
    line-height: 1.6;
}

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px 20px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--glass-border) inset;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-smooth);
    overflow: hidden;
}

.header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--glass-border) inset, 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Bandeau supérieur semi-transparent */
.header-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -25px 35px -20px;
    padding: 12px 16px;
}

.header-topbar-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-topbar-buttons.left {
    justify-content: flex-start;
    min-width: 90px;
}

.header-topbar-buttons.right {
    justify-content: flex-end;
    min-width: 90px;
}

/* Titre dans le bandeau */
.topbar-title {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 2.5em;
    font-family: "Luckiest Guy", cursive;
    font-weight: 350;
    font-style: normal;
    letter-spacing: 2px;
    text-shadow: none;
    animation: titleGlow 3s ease-in-out infinite alternate;
    flex-shrink: 0;
}

/* Boutons du bandeau */
.topbar-btn {
    width: 40px;
    height: 40px;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: 0 3px 10px rgba(76, 158, 225, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.topbar-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(76, 158, 225, 0.5);
}

.topbar-btn:active {
    transform: scale(0.95);
}

.topbar-btn-icon {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* Ancien h1 pour rétrocompatibilité si utilisé ailleurs */
h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 3.8em;
    font-family: "Luckiest Guy", cursive;
    font-weight: 350;
    font-style: normal;
    letter-spacing: 2px;
    text-shadow: 0 2px 2px rgba(99, 102, 241, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.date {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin: 10px 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.description {
    display: block;
    color: var(--text-secondary);
    font-size: 1em;
    margin-top: 10px;
    font-weight: 400;
    line-height: 1.6;
}

.timer {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 1em;
    margin-top: 10px;
    margin-bottom: 15px;
    transition: all var(--transition-smooth);
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.5);
}

.timer.refresh {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    animation: blink 1s infinite, pulse 2s ease-in-out infinite;
}

/* Texte d'introduction */
.intro-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin: 0 0 20px 0;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Bouton CTA vers les défis */
.cta-challenges {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: inherit;
    margin: 0 auto;
    gap: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    margin-bottom: 15px;
    min-width: 220px;
}

.cta-challenges:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(30, 58, 138, 0.5);
}

.cta-challenges:active {
    transform: translateY(-1px);
}

.cta-main {
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cta-arrow {
    font-size: 1.2em;
    animation: bounceArrow 1.5s ease-in-out infinite;
}

.cta-timer {
    font-size: 1em;
    font-weight: 500;
    opacity: 0.9;
}

/* Animation de la flèche */
@keyframes bounceArrow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

/* État quand tous les défis sont disponibles */
.cta-challenges.all-available {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    animation: pulse 2s ease-in-out infinite;
}

/* État quand des mini-jeux sont disponibles à jouer */
.cta-challenges.games-available {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    animation: ctaPulse 1.8s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.cta-challenges.games-available:hover {
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.6);
}

@keyframes ctaPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
    }
}

/* Anciens boutons header - Remplacés par .topbar-btn */
/* Ces styles sont conservés pour rétrocompatibilité si utilisés ailleurs */
.help-btn,
.leaderboard-btn {
    display: none; /* Masqués - remplacés par topbar-btn */
}

/* ============================================
   6. CARDS & SECTIONS
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 10px;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 2.4em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1em;
    margin-top: 8px;
    font-weight: 500;
}

.word-display {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.found-hints {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 24px;
    border-radius: var(--radius-xl);
    margin-top: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.found-hints h3 {
    color: var(--primary);
    margin-bottom: 18px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.found-hints h3:hover {
    opacity: 0.8;
}

.hints-toggle-icon {
    font-size: 0.8em;
    transition: transform var(--transition-normal);
}

.hints-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.hints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.hints-grid.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.hint-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.hint-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hint-badge.locked {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #9ca3af;
}

.reveal-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px 24px;
    border-radius: var(--radius-xl);
    margin-top: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--warning);
    box-shadow: var(--shadow-sm);
}

.reveal-section h3 {
    color: #92400e;
    margin-bottom: 15px;
    font-weight: 600;
}

.reveal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Word letters */
.word-letters {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.letter-box {
    width: 40px;
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.letter-box.revealed {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: var(--primary);
    animation: reveal 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.5);
}

/* ============================================
   7. FORMS & INPUTS
   ============================================ */
.username-input,
.guess-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.2em;
    border: 2px solid rgba(30, 58, 138, 0.3);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 15px;
    transition: all var(--transition-smooth);
    background: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.username-input:focus,
.guess-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
    transform: scale(1.02);
}

.guess-input {
    text-transform: uppercase;
    margin-bottom: 24px;
}

.add-friend-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    font-family: 'Poppins', sans-serif;
    transition: all var(--transition-normal);
}

.add-friend-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   8. BUTTONS
   ============================================ */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: var(--radius-lg);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    width: 100%;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.5);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.btn:disabled {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: white;
}

.btn.warning:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.btn.small {
    padding: 12px 24px;
    font-size: 0.95em;
    width: auto;
}

.start-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.4em;
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
    position: relative;
    letter-spacing: 0.5px;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.6);
}

.start-button:active {
    transform: translateY(0);
}

.start-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loader dans le bouton */
.button-loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

/* ============================================
   9. CHALLENGES & MINI-JEUX
   ============================================ */
.challenges {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.challenge-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-smooth);
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.challenge-time {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2em;
}

.challenge-status {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.status-locked {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.status-available {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    animation: pulse 2s infinite, glow 2s ease-in-out infinite;
}

.status-completed {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.mini-game {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-top: 20px;
    border: 2px solid #e2e8f0;
}

.mini-game h4 {
    color: var(--text-primary);
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.2em;
}

.game-timer {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1.35em;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    animation: timerPulse 2s ease-in-out infinite;
}

.game-timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-abandon {
    background: none;
    border: 1.5px solid rgba(150, 150, 150, 0.4);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn-abandon:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Anagramme */
.anagram-letters {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.anagram-letter {
    width: 48px;
    min-width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
    transition: all var(--transition-smooth);
}

.anagram-letter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.5);
}

/* Pendu */
.hangman-display {
    text-align: center;
    margin: 24px 0;
}

.hangman-word {
    font-size: 1.6em;
    letter-spacing: 10px;
    margin: 24px 0;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hangman-lives {
    font-size: 1.3em;
    color: var(--danger);
    margin-bottom: 18px;
    font-weight: 700;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.key-btn {
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 1em;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.key-btn:active {
    transform: translateY(0);
}

.key-btn:disabled {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #9ca3af;
}

.key-btn.wrong {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

/* Motus */
.motus-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px auto;
    max-width: fit-content;
}

.motus-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.motus-cell {
    width: 44px;
    height: 44px;
    border: 3px solid #e2e8f0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    font-weight: 800;
    background: white;
    text-transform: uppercase;
    transition: all var(--transition-normal);
}

.motus-cell.correct {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-color: var(--success);
    color: white;
    animation: flipIn 0.3s ease;
}

.motus-cell.misplaced {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    border-color: var(--warning);
    color: white;
    animation: flipIn 0.3s ease;
}

.motus-cell.wrong {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-color: #6b7280;
    color: white;
    animation: flipIn 0.3s ease;
}

.motus-cell.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
}

.motus-input-row {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    justify-content: center;
}

/* ============================================
   10. TROPHÉES
   ============================================ */
.trophies-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.trophies-section h2 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 700;
}

.trophies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.trophy-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 24px;
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all var(--transition-smooth);
    border: 2px solid #cbd5e1;
    position: relative;
    overflow: hidden;
}

.trophy-card.unlocked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.trophy-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.trophy-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px auto;
    display: block;
}

.trophy-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trophy-card.locked .trophy-icon img {
    filter: grayscale(100%);
    opacity: 0.3;
}

.trophy-name {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.trophy-card.locked .trophy-name {
    color: var(--text-muted);
}

.trophy-description {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.trophy-card.locked .trophy-description {
    color: #9F9FA9;
}

.trophy-progress {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
}

.trophy-card.unlocked .trophy-progress {
    color: #059669;
}

.trophy-date {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

.new-trophy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--text-primary);
    padding: 24px 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(245, 158, 11, 0.4);
    z-index: 1000;
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1), shake 0.5s ease 0.5s;
    max-width: 320px;
    border: 2px solid #f59e0b;
}

.new-trophy-notification h3 {
    margin-bottom: 12px;
    font-size: 1.4em;
    font-weight: 700;
}

.new-trophy-notification .trophy-icon {
    width: 56px;
    height: 56px;
    margin: 12px auto;
}

.new-trophy-notification .trophy-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   11. LEADERBOARD
   ============================================ */

/* Modal classement - Style archives */
.modal-content.leaderboard-modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

/* En-tête bleu style archives */
.leaderboard-modal-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0c2d47 100%);
    padding: 20px 24px;
    position: relative;
    flex-shrink: 0;
}

.leaderboard-modal-header h2 {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background: none;
    background-clip: unset;
    -webkit-background-clip: unset;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.leaderboard-modal-header h2 svg {
    width: 26px;
    height: 26px;
    fill: white;
    flex-shrink: 0;
}

/* Croix de fermeture dans l'en-tête */
.leaderboard-modal-header .modal-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    font-size: 1.5em;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    box-shadow: none;
    margin: 0;
}

.leaderboard-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) rotate(90deg);
    color: white;
}

.leaderboard-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.leaderboard-container {
    height: 350px;
    min-height: 350px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 5px 0 0;
    margin: 0 auto;
    width: 100%;
}

.leaderboard-container::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.leaderboard-container {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.leaderboard-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-bottom: 3px solid transparent;
    font-family: 'Poppins', sans-serif;
}

.leaderboard-tab:hover {
    color: #667eea;
}

.leaderboard-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: left;
    gap: 5px;
    padding: 10px 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: slideInLeaderboard 0.5s ease-out backwards;
}

.leaderboard-item:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.25s; }

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* Podium - 1ère place (Or) */
.leaderboard-item:nth-child(1) {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 3px solid #ffd700;
}

.leaderboard-item:nth-child(1) .leaderboard-rank,
.leaderboard-item:nth-child(1) .leaderboard-name,
.leaderboard-item:nth-child(1) .leaderboard-score {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Podium - 2ème place (Argent) */
.leaderboard-item:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border: 3px solid #c0c0c0;
}

.leaderboard-item:nth-child(2) .leaderboard-rank,
.leaderboard-item:nth-child(2) .leaderboard-name,
.leaderboard-item:nth-child(2) .leaderboard-score {
    color: #fff;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

/* Podium - 3ème place (Bronze) */
.leaderboard-item:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 100%);
    border: 3px solid #cd7f32;
}

.leaderboard-item:nth-child(3) .leaderboard-rank,
.leaderboard-item:nth-child(3) .leaderboard-name,
.leaderboard-item:nth-child(3) .leaderboard-score {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.leaderboard-item.current-user {
    border: 3px solid #764ba2;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
}

.leaderboard-rank {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    min-width: 25px;
    text-align: left;
    flex-shrink: 0;
}

.leaderboard-rank.top3 {
    font-size: 1.2em;
    padding-right: 2px;
}

.leaderboard-player-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1em;
    word-wrap: break-word;
    margin-bottom: 0px;
}

.leaderboard-score {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
    text-align: right;
    margin-right: 5px;
    min-width: 90px;
    flex-shrink: 0;
}

.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
}

.loading-spinner::after {
    content: '...';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

/* Section d'ajout d'amis */
.add-friend-section {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
}

.add-friend-trigger {
    padding: 12px 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.add-friend-trigger:hover {
    background: #e9ecef;
}

.add-friend-icon {
    font-size: 1.2em;
    color: #667eea;
    transition: transform var(--transition-normal);
}

.add-friend-trigger:hover .add-friend-icon {
    transform: scale(1.1);
}

.add-friend-text {
    font-size: 1em;
    font-weight: 500;
    color: #495057;
}

.add-friend-form {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border-top: 2px solid #e9ecef;
}

.add-friend-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.add-friend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.add-friend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.add-friend-cancel {
    padding: 10px 14px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-friend-cancel:hover {
    background: #dee2e6;
}

.remove-friend-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.6em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.remove-friend-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.empty-friends {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-friends-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.empty-friends-text {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.empty-friends-hint {
    font-size: 0.9em;
    color: #bbb;
}

/* Container pour les bandeaux doubles */
.weekly-banners-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Bandeau unique vainqueur (quand pas d'amis) */
.weekly-winner-banner {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    padding: 14px 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 1em;
    color: #333;
    margin-top: 20px;
    margin-bottom: 20px;
}

.weekly-winner-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.weekly-winner-banner:active {
    transform: translateY(0);
}

.weekly-banner-half {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 12px 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 0.95em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekly-banner-half.general {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.weekly-banner-half.friends {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.weekly-banner-half:hover {
    transform: translateY(-2px);
}

.weekly-banner-half.general:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.weekly-banner-half.friends:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Tablettes - ajuster les bandeaux */
@media (max-width: 768px) and (min-width: 501px) {
    .weekly-winner-banner {
        padding: 12px 18px;
        font-size: 0.95em;
    }
    
    .weekly-banners-container {
        gap: 8px;
    }
    
    .weekly-banner-half {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 0.88em;
    }
}

@media (max-width: 500px) {
    .weekly-winner-banner {
        padding: 12px 16px;
        font-size: 0.9em;
        border-radius: 10px;
    }
    
    .weekly-banners-container {
        flex-direction: column;
        gap: 8px;
    }
            
    .weekly-banner-half {
        min-width: 100%;
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

/* Podium */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    min-height: 280px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all var(--transition-normal);
}

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

.podium-rank {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.podium-player {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    min-width: 140px;
}

.podium-player-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #667eea;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.podium-player-score {
    font-size: 1.2em;
    color: var(--success);
    font-weight: bold;
}

.podium-stand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5em;
    margin-top: 10px;
    width: 100%;
}

.podium-place.first .podium-stand {
    height: 120px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.podium-place.second .podium-stand {
    height: 90px;
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.podium-place.third .podium-stand {
    height: 70px;
    background: linear-gradient(135deg, #cd7f32 0%, #d4a574 100%);
    color: #333;
}

.podium-place.first { order: 2; }
.podium-place.second { order: 1; }
.podium-place.third { order: 3; }

.podium-place.current-user-podium .podium-player {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.3);
}

/* Styles pour la fonctionnalité de partage */
        .share-container {
            margin-top: 20px;
            text-align: center;
        }

        .share-button {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 12px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .share-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }

        .share-button:active {
            transform: translateY(0);
        }





/* Partage leaderboard */
.leaderboard-share-fixed {
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    background: white;
    margin-top: 15px;
}

.leaderboard-share-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    margin-bottom: 12px;
}

.leaderboard-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.leaderboard-share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 6px;
}

.leaderboard-share-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbb 100%);
    color: white;
}

.leaderboard-share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.leaderboard-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   12. MODALS
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: var(--radius-2xl);
    width: 700px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 10px;
    transition: all var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: white;
    color: var(--primary);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.modal-content h2 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-align: center;
    font-weight: 700;
}

.modal-content h3 {
    color: var(--primary);
    font-size: 1.15em;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.modal-content ul {
    margin: 15px 0;
    padding-left: 20px;
    line-height: 1.8;
}

.modal-content ul li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-content ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

/* Boutons sociaux dans le modal d'aide */
.social-follow-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.social-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-follow-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbb 100%);
    color: white;
}

.social-follow-btn.facebook:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4);
}

.social-follow-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.social-follow-btn.whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 36px;
    border-radius: var(--radius-2xl);
    max-width: 540px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.share-modal-header h3 {
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 26px;
    font-weight: 700;
}

.close-modal {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.close-modal:hover {
    background: white;
    color: var(--primary);
    transform: rotate(90deg);
}

.share-text-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    font-family: monospace;
    font-size: 0.95em;
    line-height: 1.8;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    color: var(--text-primary);
}

.copy-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
    margin-bottom: 20px;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(30, 58, 138, 0.5);
}

.copy-button.copied {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
    color: white;
}

.social-button.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbb 100%);
}

.social-button.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   13. NOTIFICATIONS & TOASTS
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: all var(--transition-smooth);
    z-index: 10000;
    font-weight: 500;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.points-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    min-width: 280px;
    border: 3px solid var(--primary);
}

.points-notification.failure {
    border-color: var(--danger);
}

.points-notification-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.points-notification-title {
    font-weight: 700;
    font-size: 1.3em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.points-notification-word {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--primary);
    margin: 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.points-notification-points {
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 10px;
}

.points-notification-points.positive {
    color: var(--success);
}

.points-notification-points.negative {
    color: var(--danger);
}

.points-notification-points.neutral {
    color: #666;
}

/* Message de succès */
.success-message {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 36px;
    border-radius: var(--radius-2xl);
    text-align: center;
    margin-top: 25px;
    margin-bottom: 25px;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-message h2 {
    font-size: 2.2em;
    margin-bottom: 16px;
    font-weight: 800;
    color: white;
    -webkit-text-fill-color: white;
    background: none;
}

.success-message p {
    font-size: 1.3em;
    margin: 12px 0;
    font-weight: 500;
}

/* Cookie Consent */
#cookieConsent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px 30px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookieConsent.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cookie-text {
    flex: 1;
    color: #334155;
    font-size: 0.95em;
    line-height: 1.6;
}

.cookie-text strong {
    color: var(--primary);
    font-weight: 600;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition-smooth);
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.cookie-btn-decline {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    border: 2px solid #e2e8f0;
}

.cookie-btn-decline:hover {
    background: white;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Global Loader */
#globalLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 50%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#globalLoader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-logo {
    font-size: 4.5em;
    font-family: 'Luckiest Guy', cursive;
    margin-bottom: 30px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: pulse-logo 2s ease-in-out infinite;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-size: 1.2em;
    font-weight: 500;
    opacity: 0.9;
}

/* ============================================
   14. ANIMATIONS
   ============================================ */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 10px rgba(30, 58, 138, 0.4)); }
    to { filter: drop-shadow(0 0 20px rgba(51, 65, 85, 0.6)); }
}

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

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
}

@keyframes reveal {
    0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
    50% { transform: rotateY(45deg) scale(1.1); }
    100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeaderboard {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes shine {
    0%, 100% { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); transform: translateY(0); }
    50% { box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5); transform: translateY(-4px); }
}

@keyframes flipIn {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@keyframes pointingFinger {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

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

/* ============================================
   15. MEDIA QUERIES (REGROUPÉES)
   ============================================ */

/* Tablettes et petits écrans */
@media (max-width: 900px) {
    .letter-box {
        width: 34px;
        min-width: 34px;
        height: 34px;
        font-size: 1.3em;
    }
    
    .anagram-letter {
        width: 32px;
        min-width: 32px;
        height: 32px;
        font-size: 1.2em;
    }
    
    .hangman-word {
        font-size: 1.2em;
        letter-spacing: 5px;
    }
    
    .motus-cell {
        width: 38px;
        height: 38px;
        font-size: 1.1em;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    .header {
        padding: 0 15px 15px 15px;
        margin-bottom: 10px;
    }

    /* Bandeau responsive */
    .header-topbar {
        margin: 0 -15px 20px -15px;
        padding: 10px 12px;
    }

    .header-topbar-buttons.left,
    .header-topbar-buttons.right {
        min-width: 70px;
    }

    .topbar-title {
        font-size: 1.8em;
        letter-spacing: 1px;
    }

    .topbar-btn {
        width: 34px;
        height: 34px;
        font-size: 1em;
        border-radius: 8px;
    }

    .topbar-btn-icon {
        width: 16px;
        height: 16px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 8px;
    }

    .date {
        font-size: 0.95em;
        margin: 8px 0;
    }

    .intro-text {
        font-size: 0.9em;
        margin: 15px 0 15px 0;
    }

    .timer {
        font-size: 0.9em;
        padding: 6px 30px;
    }

    .cta-challenges {
        padding: 12px 12px;
        min-width: 200px;
    }

    .cta-main {
        font-size: 1.2em;
    }

    .cta-timer {
        font-size: 1em;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 10px;
    }

    .stat-card {
        padding: 5px 5px;
    }

    .stat-value {
        font-size: 1.6em;
    }

    .stat-label {
        font-size: 0.9em;
    }

    .word-display,
    .challenge-card,
    .trophies-section {
        padding: 20px 15px;
        margin-bottom: 10px;
    }

    .word-display h2 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }

    .found-hints {
        padding: 15px;
        margin-bottom: 10px;
    }

    .found-hints h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }

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

    .hint-badge {
        padding: 8px 10px;
        font-size: 1em;
    }

    .reveal-section {
        padding: 12px 15px;
        margin-bottom: 10px;
    }

    .reveal-section h3 {
        font-size: 1em;
        margin-bottom: 12px;
    }

    .reveal-info {
        flex-direction: column;
        gap: 10px;
    }

    .reveal-info span {
        text-align: center;
        width: 100%;
    }

    .guess-input {
        padding: 12px;
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    .btn.small {
        padding: 10px 20px;
        font-size: 0.9em;
        width: 100%;
    }

    .challenge-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .challenge-time {
        font-size: 1em;
    }

    .challenge-status {
        font-size: 0.85em;
        padding: 4px 12px;
    }

    .mini-game {
        padding: 15px;
    }

    .mini-game h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .game-timer {
        font-size: 1.15em;
        padding: 7px 14px;
    }

    .game-timer-row {
        gap: 8px;
        margin-bottom: 12px;
    }

    .btn-abandon {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .hangman-lives {
        font-size: 1.1em;
    }

    .keyboard {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-top: 12px;
    }

    .key-btn {
        padding: 10px 5px;
        font-size: 0.9em;
    }

    .trophies-section h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .trophies-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .trophy-card {
        padding: 15px;
    }

    .trophy-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }

    .trophy-name {
        font-size: 1em;
    }

    .trophy-description {
        font-size: 0.8em;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 15px;
        max-width: 95%;
    }

    .leaderboard-container {
        height: 280px;
        min-height: 280px;
        max-height: 280px;
    }

    .modal-content h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .modal-content h3 {
        font-size: 1.2em;
        margin-top: 20px;
        margin-bottom: 12px;
    }

    .modal-content p,
    .modal-content li {
        font-size: 0.95em;
        line-height: 1.5;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.8em;
    }

    .leaderboard-item {
        margin-bottom: 8px;
    }

    .leaderboard-rank {
        font-size: 1em;
        min-width: 35px;
    }

    .leaderboard-name {
        font-size: 0.8em;
        margin-left: 2px;
    }

    .leaderboard-score {
        font-size: 1em;
    }

    .success-message {
        padding: 20px 15px;
    }

    .success-message h2 {
        font-size: 1.5em;
        margin-bottom: 12px;
    }

    .success-message p {
        font-size: 1em;
        margin: 8px 0;
    }

    .new-trophy-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 15px 20px;
    }

    .new-trophy-notification h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .new-trophy-notification .trophy-icon {
        width: 44px;
        height: 44px;
        margin: 8px auto;
    }

    .login-container {
        padding: 30px 20px;
        max-width: 95%;
    }

    .login-container h1 {
        font-size: 2.5em;
        margin-bottom: 12px;
        font-family: "Luckiest Guy", cursive;
        font-weight: 250;
        font-style: normal;
    }

    .login-container p {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .username-input {
        padding: 12px 20px;
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .start-button {
        padding: 12px 30px;
        font-size: 1.2em;
    }

    /* Améliorations tactiles pour tous les mobiles */
    .btn,
    .key-btn,
    .topbar-btn,
    .modal-close,
    .start-button {
        -webkit-tap-highlight-color: transparent;
    }

    #cookieConsent {
        padding: 20px;
    }

    .cookie-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .cookie-text {
        font-size: 0.9em;
    }
}

@media (max-width: 700px) {
    .letter-box {
        width: 30px;
        min-width: 30px;
        height: 30px;
        font-size: 1.2em;
    }
    
    .word-letters {
        gap: 5px;
    }
    
    .anagram-letter {
        width: 28px;
        min-width: 28px;
        height: 28px;
        font-size: 1.1em;
    }
    
    .anagram-letters {
        gap: 6px;
    }
    
    .hangman-word {
        font-size: 1em;
        letter-spacing: 4px;
    }
    
    .motus-cell {
        width: 34px;
        height: 34px;
        font-size: 1em;
    }
}

/* Responsive ajout amis */
@media (max-width: 600px) {
    .add-friend-trigger {
        padding: 14px 16px;
    }

    .add-friend-text {
        font-size: 0.95em;
    }

    .add-friend-form {
        padding: 14px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .add-friend-input {
        width: 100%;
        font-size: 0.9em;
        padding: 9px 12px;
    }

    .add-friend-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .add-friend-cancel {
        width: 100%;
        padding: 10px 12px;
        font-size: 1em;
    }
    
    .podium-container {
        gap: 10px;
    }

    .podium-player {
        min-width: 100px;
        padding: 10px;
    }

    .podium-player-name {
        font-size: 0.9em;
    }

    .podium-rank {
        font-size: 2em;
    }

    .podium-place.first .podium-stand {
        height: 100px;
    }

    .podium-place.second .podium-stand {
        height: 75px;
    }

    .podium-place.third .podium-stand {
        height: 60px;
    }
}

@media (max-width: 500px) {
    .letter-box {
        width: 24px;
        min-width: 24px;
        height: 24px;
        font-size: 1.1em;
    }
    
    .word-letters {
        gap: 4px;
    }
    
    .anagram-letter {
        width: 25px;
        min-width: 25px;
        height: 25px;
        font-size: 1em;
    }
    
    .anagram-letters {
        gap: 4px;
    }
    
    .hangman-word {
        font-size: 1em;
        letter-spacing: 3px;
    }
    
    .motus-cell {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }
    
    .weekly-winner-banner {
        padding: 12px 16px;
        font-size: 0.9em;
        border-radius: 10px;
    }
    
    .weekly-banners-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .weekly-banner-half {
        min-width: 100%;
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

/* Petits mobiles */
@media (max-width: 400px) {
    h1 {
        font-size: 2em;
    }

    .header {
        padding: 0 10px 12px 10px;
    }

    /* Bandeau pour petits écrans */
    .header-topbar {
        margin: 0 -10px 15px -10px;
        padding: 8px 10px;
        gap: 6px;
    }

    .header-topbar-buttons.left,
    .header-topbar-buttons.right {
        min-width: 60px;
        gap: 6px;
    }

    .topbar-title {
        font-size: 1.6em;
        letter-spacing: 0.5px;
    }

    .topbar-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
        border-radius: 6px;
    }

    .topbar-btn-icon {
        width: 14px;
        height: 14px;
    }

    .stats {
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 1.6em;
    }

    .stat-label {
        font-size: 0.9em;
    }

    .letter-box {
        width: 24px;
        min-width: 24px;
        height: 24px;
        font-size: 1em;
    }
    
    .word-letters {
        gap: 3px;
    }
    
    .anagram-letter {
        width: 22px;
        min-width: 22px;
        height: 22px;
        font-size: 0.8em;
    }
    
    .anagram-letters {
        gap: 3px;
    }
    
    .hangman-word {
        font-size: 0.8em;
        letter-spacing: 2px;
    }
    
    .motus-cell {
        width: 26px;
        height: 26px;
        font-size: 0.8em;
    }

    .hints-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }

    .hint-badge {
        padding: 6px 8px;
        font-size: 0.6em;
    }

    .trophies-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .keyboard {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
    }

    .key-btn {
        padding: 8px 3px;
        font-size: 0.85em;
    }

    .modal-content {
        padding: 25px 15px;
        margin: 10px;
        max-height: 90vh;
    }

    .login-container h1 {
        font-size: 2em;
    }

    .new-trophy-notification {
        padding: 12px 15px;
    }

    .add-friend-trigger {
        padding: 12px 14px;
    }

    .add-friend-icon {
        font-size: 1.1em;
    }

    .add-friend-text {
        font-size: 0.9em;
    }

    .add-friend-form {
        padding: 12px 14px;
        flex-direction: column;
        gap: 8px;
    }

    .add-friend-input {
        width: 100%;
        font-size: 0.85em;
        padding: 8px 10px;
    }

    .add-friend-btn {
        width: 100%;
        font-size: 0.85em;
        padding: 9px 14px;
    }

    .add-friend-cancel {
        width: 100%;
        padding: 9px 10px;
        font-size: 0.95em;
    }

    #cookieConsent {
        padding: 16px;
    }

    .cookie-text {
        font-size: 0.85em;
    }

    .cookie-btn {
        padding: 12px 20px;
        font-size: 0.9em;
    }
}

/* Mode paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 15px;
    }

    .stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .word-display,
    .challenge-card,
    .trophies-section {
        padding: 20px;
    }

    .modal-content {
        max-height: 90vh;
    }
}

/* ============================================
   SYSTÈME DE PSEUDO DIFFÉRÉ (NOUVEAU)
   ============================================ */

/* Pop-up de création de pseudo */
.pseudo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

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

.pseudo-popup {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: 36px 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease-out;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pseudo-popup-overlay.active .pseudo-popup {
    transform: scale(1) translateY(0);
}

.pseudo-popup-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: bounce 0.6s ease-out;
}

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

.pseudo-popup h3 {
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.pseudo-popup p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.pseudo-popup-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pseudo-popup-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(76, 158, 225, 0.15);
}

.pseudo-popup-input::placeholder {
    color: #aaa;
}

.pseudo-popup-btn-primary {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pseudo-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 201, 80, 0.4);
}

.pseudo-popup-btn-secondary {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.2s;
}

.pseudo-popup-btn-secondary:hover {
    color: var(--text-primary);
}

/* ========== POP-UP JEU ALTERNATIF (indices bloqués) ========== */
.altgame-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

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

.altgame-popup {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: 36px 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease-out;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.altgame-popup-overlay.active .altgame-popup {
    transform: scale(1) translateY(0);
}

.altgame-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.altgame-popup-close:hover {
    color: var(--text-primary);
}

.altgame-popup-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: altgame-float 2s ease-in-out infinite;
}

@keyframes altgame-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.altgame-popup h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.altgame-popup p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 22px;
    line-height: 1.5;
}

.altgame-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(76, 158, 225, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid rgba(76, 158, 225, 0.25);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.altgame-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(76, 158, 225, 0.2);
}

.altgame-card:active {
    transform: translateY(0);
}

.altgame-card-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.altgame-card-info {
    flex: 1;
    text-align: left;
}

.altgame-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.altgame-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.altgame-card-arrow {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.altgame-card:hover .altgame-card-arrow {
    transform: translateX(4px);
}

.altgame-popup-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.2s;
}

.altgame-popup-dismiss:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .altgame-popup {
        padding: 28px 22px 22px;
    }
    .altgame-popup-emoji {
        font-size: 2.5rem;
    }
    .altgame-popup h3 {
        font-size: 1.2rem;
    }
}

/* Encart de pseudo dans le message de succès */
.success-pseudo-cta {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.4);
}

.success-pseudo-cta-text {
    font-size: 0.9rem;
    color: white;
    text-align: left;
    line-height: 1.4;
}

.success-pseudo-cta-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.success-pseudo-cta-btn {
    background: white;
    color: var(--success);
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.success-pseudo-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Footer du classement pour joueurs anonymes */
.leaderboard-footer-anonymous {
    padding: 18px 20px;
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border-top: 2px dashed #ffd700;
    margin-top: 15px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.leaderboard-footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.leaderboard-footer-form {
    display: flex;
    gap: 10px;
}

.leaderboard-pseudo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.leaderboard-pseudo-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 158, 225, 0.15);
}

.leaderboard-pseudo-input::placeholder {
    color: #aaa;
}

.leaderboard-pseudo-btn {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.leaderboard-pseudo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49, 201, 80, 0.4);
}

/* Responsive pour le système de pseudo */
@media (max-width: 600px) {
    .pseudo-popup {
        padding: 28px 24px;
        margin: 15px;
    }

    .pseudo-popup-emoji {
        font-size: 2.8rem;
    }

    .pseudo-popup h3 {
        font-size: 1.4rem;
    }

    .pseudo-popup p {
        font-size: 0.95rem;
    }

    .success-pseudo-cta {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .success-pseudo-cta-text {
        text-align: center;
    }

    .success-pseudo-cta-btn {
        width: 100%;
    }

    .leaderboard-footer-form {
        flex-direction: column;
        gap: 10px;
    }

    .leaderboard-pseudo-input {
        width: 100%;
    }

    .leaderboard-pseudo-btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .pseudo-popup {
        padding: 24px 20px;
    }

    .pseudo-popup-emoji {
        font-size: 2.5rem;
    }

    .pseudo-popup h3 {
        font-size: 1.2rem;
    }

    .pseudo-popup-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .pseudo-popup-btn-primary {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* ============================================
   MODAL STATISTIQUES PERSONNELLES
   Version 2 - Corrigée
   ============================================ */

/* Ancien bouton stats - Remplacé par .topbar-btn dans le bandeau */
.stats-btn {
    display: none; /* Masqué - remplacé par topbar-btn */
}

.stats-btn-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

/* Modal statistiques - Style archives */
.stats-modal-content {
    max-width: 520px;
    width: 100%;
    padding: 0;
    position: relative;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* En-tête bleu style archives */
.stats-modal-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0c2d47 100%);
    padding: 20px 24px;
    position: relative;
    flex-shrink: 0;
}

.stats-modal-header h2 {
    color: white;
    -webkit-text-fill-color: white;
    background: none;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.stats-modal-header h2 svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

/* Croix de fermeture dans l'en-tête */
.stats-modal-header .modal-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    font-size: 1.5em;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    box-shadow: none;
    margin: 0;
}

.stats-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) rotate(90deg);
    color: white;
}

.stats-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Grille des stats principales */
.stats-main-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.stats-card {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    transition: all var(--transition-smooth);
    border: 1px solid #e2e8f0;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.stats-card.highlight .stats-card-value {
    color: white;
}

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

.stats-card.highlight .stats-card-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Section titre - PLUS DE CONTRASTE */
.stats-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-section-title .section-icon {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

/* Séries */
.stats-streaks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.streak-card {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.streak-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
}

.streak-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Histogramme distribution */
.stats-histogram {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.histogram-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.histogram-row:last-child {
    margin-bottom: 0;
}

.histogram-label {
    width: 28px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
}

.histogram-bar-bg {
    flex: 1;
    height: 26px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.histogram-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    min-width: fit-content;
}

.histogram-bar.index-1 { background: linear-gradient(90deg, #22c55e, #4ade80); }
.histogram-bar.index-2 { background: linear-gradient(90deg, #84cc16, #a3e635); }
.histogram-bar.index-3 { background: linear-gradient(90deg, #eab308, #facc15); }
.histogram-bar.index-4 { background: linear-gradient(90deg, #f97316, #fb923c); }
.histogram-bar.index-5 { background: linear-gradient(90deg, #ef4444, #f87171); }
.histogram-bar.index-6 { background: linear-gradient(90deg, #ec4899, #f472b6); }
.histogram-bar.index-7 { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.histogram-bar.index-x { background: linear-gradient(90deg, #64748b, #94a3b8); }

/* Section mini-jeux avec bordure */
.stats-minigames-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

/* Mini-jeux stats */
.stats-minigames {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.minigame-stat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
}

.minigame-stat-icon {
    width: 32px;
    height: 32px;
}

.minigame-stat-info {
    flex: 1;
}

.minigame-stat-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.minigame-stat-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.minigame-stat-rate {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
}

/* Comparaison */
.stats-comparison {
    background: linear-gradient(135deg, rgba(76, 158, 225, 0.15), rgba(17, 63, 100, 0.15));
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    margin-bottom: 24px;
}

.stats-comparison-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.stats-comparison-highlight {
    color: var(--success);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Bouton partage stats */
.stats-share-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.stats-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 158, 225, 0.4);
}

.stats-share-btn .btn-icon {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

/* ============================================
   BOUTON PARTAGER STATS
   ============================================ */

.share-stats-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(76, 158, 225, 0.3);
}

.share-stats-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 158, 225, 0.4);
}

.share-stats-btn:active {
    transform: translateY(0);
}

.share-stats-icon {
    width: 20px;
    height: 20px;
}

/* ============================================
   ENCART INVITATION AMIS - SIMPLIFIÉ
   ============================================ */

.invite-friends-card {
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border: 2px dashed #ffc107;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.invite-friends-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
}

.invite-friends-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.invite-friends-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Boutons d'invitation - SANS CHAMP URL */
.invite-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.invite-share-btn {
    flex: 1;
    max-width: 180px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.invite-share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.invite-share-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5bbb 100%);
    color: white;
}

.invite-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.invite-share-btn .btn-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Responsive stats modal */
@media (max-width: 600px) {
    .stats-modal-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: var(--radius-xl);
    }

    .stats-modal-header {
        padding: 16px 20px;
    }

    .stats-modal-header h2 {
        font-size: 1.25rem;
    }

    .stats-modal-body {
        padding: 16px 18px 20px;
    }

    /* Responsive leaderboard modal */
    .leaderboard-modal-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: var(--radius-xl);
    }

    .leaderboard-modal-header {
        padding: 16px 20px;
    }

    .leaderboard-modal-header h2 {
        font-size: 1.25rem;
    }

    .leaderboard-modal-body {
        padding: 16px 18px 20px;
    }

    .stats-main-grid {
        gap: 10px;
    }

    .stats-card {
        padding: 14px 10px;
    }

    .stats-card-value {
        font-size: 1.6rem;
    }

    .invite-share-buttons {
        flex-direction: column;
    }

    .invite-share-btn {
        max-width: 100%;
    }
}

/* ============================================
   MODAL ARCHIVES
   ============================================ */

.archives-modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.archives-modal-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0c2d47 100%);
    padding: 20px 24px;
    position: relative;
    flex-shrink: 0;
}

.archives-modal-header h2 {
    color: white;
    -webkit-text-fill-color: white;
    background: none;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.archives-modal-header h2 svg {
    width: 28px;
    height: 28px;
}

.archives-modal-header .modal-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    margin: 0;
}

.archives-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) rotate(90deg);
}

.archives-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Loading state */
.archives-loading {
    text-align: center;
    padding: 60px 20px;
}

.archives-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(76, 158, 225, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.archives-loading p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Security badge */
.archives-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(49, 201, 80, 0.1), rgba(34, 160, 69, 0.1));
    border: 1px solid rgba(49, 201, 80, 0.3);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    margin-bottom: 16px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.archives-security-badge svg {
    width: 14px;
    height: 14px;
}

/* Intro */
.archives-intro {
    background: linear-gradient(135deg, rgba(76, 158, 225, 0.1), rgba(17, 63, 100, 0.1));
    border: 1px solid rgba(76, 158, 225, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: center;
}

.archives-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.archives-intro strong {
    color: var(--primary);
}

/* Archive Cards */
.archive-card {
    background: #f8fafc;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.archive-card:hover {
    box-shadow: var(--shadow-md);
}

.archive-card-header {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    gap: 14px;
    transition: background var(--transition-fast);
}

.archive-card-header:hover {
    background: rgba(76, 158, 225, 0.05);
}

.archive-day-badge {
    min-width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.archive-day-badge .day-name {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.archive-day-badge .day-number {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.archive-info {
    flex: 1;
    min-width: 0;
}

.archive-word {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.archive-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.archive-date .days-ago {
    color: var(--text-muted);
    font-style: italic;
}

.archive-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-smooth);
    flex-shrink: 0;
}

.archive-card.expanded .archive-toggle {
    transform: rotate(180deg);
}

.archive-toggle svg {
    width: 20px;
    height: 20px;
}

/* Hints Panel */
.archive-hints {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-card.expanded .archive-hints {
    max-height: 500px;
}

.archive-hints-inner {
    padding: 0 18px 18px;
    border-top: 1px solid #e2e8f0;
}

.archive-hints-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-hints-title svg {
    width: 14px;
    height: 14px;
    color: var(--warning);
}

.archive-hints-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.archive-hint-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

.archive-hint-number {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.archive-hint-word {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.archive-hint-type {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
}

.archive-hint-type.anagram {
    background: rgba(168, 85, 247, 0.15);
    color: #7c3aed;
}

.archive-hint-type.pendu {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.archive-hint-type.motus {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

/* Error state */
.archives-error {
    text-align: center;
    padding: 40px 20px;
}

.archives-error svg {
    width: 56px;
    height: 56px;
    color: var(--danger);
    margin-bottom: 16px;
}

.archives-error h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.archives-error p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.archives-retry-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.archives-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 158, 225, 0.4);
}

/* Responsive Archives */
@media (max-width: 600px) {
    .archives-modal-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: var(--radius-xl);
    }

    .archives-modal-header {
        padding: 16px 20px;
    }

    .archives-modal-header h2 {
        font-size: 1.25rem;
    }

    .archives-modal-body {
        padding: 16px 18px 20px;
    }

    .archive-card-header {
        padding: 14px 16px;
        gap: 12px;
    }

    .archive-day-badge {
        min-width: 46px;
        height: 46px;
    }

    .archive-day-badge .day-number {
        font-size: 1.15rem;
    }

    .archive-word {
        font-size: 1.1rem;
    }

    .archive-hints-inner {
        padding: 0 16px 16px;
    }
}

/* ============================================
   NEW LAYOUT: Compact Stats, Word, Timeline
   ============================================ */

/* --- Points compacts en ligne --- */
.stats-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-inline-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
}

.stat-inline-value {
    font-size: 1.4em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-inline-label {
    font-size: 0.78em;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-inline-sep {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
}

/* --- Word display compact --- */
.word-display-compact {
    padding: 22px 20px 18px !important;
    margin-bottom: 14px !important;
}

.word-display-title {
    text-align: center;
    margin-bottom: 12px !important;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* --- Guess section inline --- */
.guess-section-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}

.guess-input-compact {
    margin-bottom: 0 !important;
    padding: 12px 16px !important;
    font-size: 1em !important;
    flex: 1;
}

.btn-validate-compact {
    width: auto !important;
    padding: 12px 24px !important;
    font-size: 1em !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Reveal compact --- */
.reveal-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.reveal-compact-btn {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.reveal-compact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.reveal-compact-btn:disabled {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.reveal-cost {
    opacity: 0.85;
    font-weight: 500;
}

.reveal-remaining {
    font-size: 0.72em;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* --- Timeline Section --- */
.timeline-section {
    margin-bottom: 20px;
}

.timeline-header {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.75em;
    text-align: center;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
    padding-left: 4px;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Vertical connector line */
.timeline-list::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
    z-index: 0;
}

/* --- Timeline Item --- */
.tl-wrapper {
    position: relative;
    z-index: 1;
}

.tl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    position: relative;
    z-index: 1;
    cursor: default;
}

.tl-item.tl-available {
    border-color: rgba(76, 158, 225, 0.35);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(76, 158, 225, 0.1);
    cursor: pointer;
}

.tl-item.tl-available:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(76, 158, 225, 0.15);
}

.tl-item.tl-available:active {
    transform: scale(0.98);
}

/* Done and failed: clear, not greyed */
.tl-item.tl-done {
    opacity: 1;
}

.tl-item.tl-failed {
    opacity: 1;
}

/* Locked: greyed out */
.tl-item.tl-locked {
    opacity: 0.38;
}

/* Number circle */
.tl-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8em;
    flex-shrink: 0;
}

.tl-num-done {
    background: linear-gradient(135deg, rgba(49, 201, 80, 0.12), rgba(49, 201, 80, 0.2));
    color: var(--success);
}

.tl-num-available {
    background: linear-gradient(135deg, rgba(76, 158, 225, 0.15), rgba(76, 158, 225, 0.25));
    color: var(--primary);
}

.tl-num-locked {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
}

.tl-num-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Info block */
.tl-info {
    flex: 1;
    min-width: 0;
}

.tl-name {
    font-weight: 700;
    font-size: 0.92em;
    color: var(--text-primary);
    line-height: 1.2;
}

.tl-sub {
    font-size: 0.78em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right-side badge */
.tl-right {
    flex-shrink: 0;
    text-align: right;
}

.tl-badge {
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.tl-badge-done {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.tl-badge-play {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    animation: pulse 2s infinite;
}

.tl-badge-lock {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.tl-badge-fail {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.tl-time {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Chevron indicator for expandable items */
.tl-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
    margin-left: 4px;
}

.tl-chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.25s ease;
}

.tl-chevron.open::before {
    transform: translate(-50%, -35%) rotate(-135deg);
}

/* --- Expanded challenge game inside timeline --- */
.tl-expanded {
    margin-top: 4px;
    margin-bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 20px 24px 24px;
    border: 2px solid rgba(76, 158, 225, 0.25);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.25s ease, padding 0.35s ease, margin 0.35s ease;
}

.tl-expanded.tl-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border-width: 0;
}

/* Play button inside timeline item */
.tl-play-btn {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.3px;
    transition: all var(--transition-smooth);
    white-space: nowrap;
    margin-right: 2px;
}

.tl-play-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(49, 201, 80, 0.4);
}

.tl-play-btn:active {
    transform: scale(0.95);
}

/* Emphasis for completed hint word */
.tl-sub-done {
    font-size: 0.88em;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-sub-done .tl-hint-word {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1em;
}

.tl-sub-done .tl-hint-pts {
    color: var(--success);
    font-weight: 600;
}

/* --- Mobile adjustments --- */
@media (max-width: 480px) {
    .stats-inline {
        padding: 8px 12px;
    }
    .stat-inline-item {
        padding: 0 10px;
    }
    .stat-inline-value {
        font-size: 1.2em;
    }
    .word-display-compact {
        padding: 18px 16px 14px !important;
    }
    .word-letters {
        gap: 4px;
    }
    .letter-box {
        width: 24px;
        min-width: 24px;
        height: 24px;
        font-size: 1em;
    }
    .guess-section-inline {
        flex-direction: column;
    }
    .btn-validate-compact {
        width: 100% !important;
    }
    .guess-input-compact {
        width: 100%;
    }
    .tl-item {
        padding: 10px 12px;
        gap: 10px;
    }
}

/* ========== INDICATEUR DE SCROLL ========== */
.scroll-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scrollBounce 1.8s ease-in-out infinite;
    cursor: pointer;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.scroll-indicator svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

@media (max-width: 480px) {
    .scroll-indicator {
        width: 36px;
        height: 36px;
        bottom: 18px;
    }
    .scroll-indicator svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   PWA INSTALL CARD
   ============================================ */
.pwa-install-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass-bg);
    border: 1.5px solid rgba(76, 158, 225, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.pwa-install-card:hover {
    box-shadow: var(--shadow-md);
}

.pwa-install-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.pwa-install-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pwa-install-btn {
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.pwa-install-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

/* ---- Modale iOS ---- */
.pwa-ios-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.pwa-ios-modal-overlay.active {
    display: flex;
}

.pwa-ios-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease;
}

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

.pwa-ios-modal h3 {
    text-align: center;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.pwa-ios-step-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.pwa-ios-inline-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -3px;
}

.pwa-ios-ok-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pwa-ios-ok-btn:hover {
    filter: brightness(1.1);
}

/* Responsive */
@media (max-width: 400px) {
    .pwa-install-card {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 10px;
        padding: 16px 14px;
    }
    .pwa-install-btn {
        width: 100%;
    }
}
