/* ============================================
   HUD (Heads-Up Display) & SCORING
   ============================================ */

/* ============================================
   GAME HUD - Stat Boxes
   ============================================ */
.game-hud {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat-box {
    background: linear-gradient(135deg, var(--teal-light), var(--white));
    border: 2px solid var(--teal-mid);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

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

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--teal-dark);
}

.stat-box:hover::before {
    left: 100%;
}

.stat-box .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-box .value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal-mid), var(--teal-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Syne', sans-serif;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-box .value.updated {
    animation: scoreFlip 0.4s ease-out;
}

/* ============================================
   PROGRESS BAR (Paires trouvées)
   ============================================ */
.progress-container {
    background: var(--teal-light);
    border-radius: 12px;
    overflow: hidden;
    height: 12px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-mid), var(--teal-dark));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-container.pulse .progress-bar {
    animation: progressPulse 0.6s ease-out;
}

/* ============================================
   GAME CONTROLS
   ============================================ */
.game-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   VICTORY MODAL
   ============================================ */
.victory-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeInBlur 0.3s ease;
    padding: 20px;
}

.victory-modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, var(--white), var(--teal-light));
    border-radius: 24px;
    padding: 48px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid var(--teal-mid);
    box-shadow: 0 32px 64px rgba(15, 110, 86, 0.3);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '🎉 🏆 ⭐ 🎮 🌟';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: block;
    font-size: 32px;
    letter-spacing: 12px;
    animation: float 1.5s ease-in-out infinite;
}

.modal-content h2 {
    font-family: 'Syne', sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: var(--teal);
    margin: 32px 0 12px;
    position: relative;
    z-index: 1;
}

.modal-content .score-display {
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal-mid), var(--teal-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 24px 0;
    font-family: 'Syne', sans-serif;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.stats-summary .stat {
    background: var(--teal-light);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--teal-mid);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stats-summary .stat:nth-child(1) { animation-delay: 0.4s; }
.stats-summary .stat:nth-child(2) { animation-delay: 0.5s; }
.stats-summary .stat:nth-child(3) { animation-delay: 0.6s; }
.stats-summary .stat:nth-child(4) { animation-delay: 0.7s; }

.stats-summary .stat-value {
    font-weight: 700;
    color: var(--teal-dark);
    font-size: 16px;
    font-family: 'Syne', sans-serif;
}

.stats-summary .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */
.achievements-list {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement {
    background: linear-gradient(135deg, var(--accent), rgba(255, 215, 0, 0.2));
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    animation: achievementUnlock 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    gap: 12px;
    align-items: center;
}

.achievement-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.achievement-text {
    flex: 1;
}

.achievement-name {
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
}

.achievement-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   MODAL ACTIONS
   ============================================ */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* ============================================
   PAUSE MODAL
   ============================================ */
.pause-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1999;
    backdrop-filter: blur(5px);
}

.pause-content {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 2px solid var(--teal-mid);
    animation: slideUp 0.4s ease-out;
}

.pause-content h2 {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    color: var(--teal);
    margin-bottom: 24px;
}

.pause-content .pause-timer {
    font-size: 48px;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: 24px;
    animation: timerTick 0.5s ease-out;
}

.pause-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .game-hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-box {
        padding: 16px;
    }
    
    .stat-box .value {
        font-size: 24px;
    }
    
    .modal-content {
        padding: 32px;
        border-radius: 16px;
    }
    
    .modal-content h2 {
        font-size: 32px;
    }
    
    .modal-content .score-display {
        font-size: 48px;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .game-controls .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-box {
        padding: 12px;
    }
    
    .stat-box .label {
        font-size: 10px;
    }
    
    .stat-box .value {
        font-size: 20px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .modal-content::before {
        font-size: 24px;
        letter-spacing: 8px;
    }
    
    .modal-content h2 {
        font-size: 24px;
        margin: 24px 0 8px;
    }
    
    .modal-content .score-display {
        font-size: 40px;
        margin: 16px 0;
    }
    
    .stats-summary {
        gap: 8px;
    }
    
    .stats-summary .stat {
        padding: 10px;
    }
    
    .stats-summary .stat-value {
        font-size: 14px;
    }
}
