/* ========================================
   CORRECTIONS ET AJOUTS V4 FIXED
   ======================================== */

/* S'assurer que les écrans sont bien cachés par défaut */
.screen {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-dark, #1a1a2e);
}

.screen.active {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

/* Amélioration de la carte flashcard */
.flashcard-wrapper {
    width: 100%;
    max-width: 600px;
    height: 400px;
    perspective: 1000px;
    margin: 2rem auto;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(233, 30, 99, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(155, 89, 182, 0.2));
}

.flashcard-question-text,
.flashcard-answer-text {
    font-size: 1.5rem;
    font-weight: 500;
    color: #fff;
    text-align: center;
    line-height: 1.6;
}

/* Navigation des flashcards */
.flashcard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.btn-nav {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.card-rating {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-rating {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-rating.easy {
    background: #4ade80;
    color: #000;
}

.btn-rating.medium {
    background: #fbbf24;
    color: #000;
}

.btn-rating.hard {
    background: #f87171;
    color: #fff;
}

.btn-rating:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* En-tête du jeu */
.game-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.flashcard-info,
.review-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.flashcard-controls,
.review-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-icon.active {
    background: #9b59b6;
}

/* Badge et compteur */
.badge {
    background: linear-gradient(135deg, #9b59b6, #e91e63);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Barre de progression */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #9b59b6, #e91e63);
    transition: width 0.3s ease;
}

/* Mode révision */
.review-question-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
}

.review-question-text {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.review-answer-input input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    margin-bottom: 1rem;
}

.review-answer-input input:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}

.review-feedback {
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-size: 1rem;
}

.review-feedback.correct {
    background: rgba(74, 222, 128, 0.2);
    border: 2px solid #4ade80;
    color: #4ade80;
}

.review-feedback.incorrect {
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid #f87171;
    color: #f87171;
}

.review-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.stat-value.correct {
    color: #4ade80;
}

.stat-value.incorrect {
    color: #f87171;
}

/* Aide clavier */
.keyboard-help {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: monospace;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.flashcard {
    animation: fadeInScale 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .flashcard-wrapper {
        height: 300px;
    }
    
    .flashcard-navigation {
        flex-direction: column;
    }
    
    .card-rating {
        width: 100%;
        justify-content: center;
    }
    
    .btn-nav {
        width: 100%;
        justify-content: center;
    }
    
    .keyboard-help {
        display: none;
    }
}
