@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-error: #ef4444;
    --accent-warning: #f59e0b;
    --border-primary: #2a2a2a;
    --border-secondary: #333333;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    margin: 0;
    font-size: 16px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

.custom-box {
    max-width: 800px;
    background: var(--bg-card);
    margin: 40px auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.custom-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.custom-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(10px, -10px) rotate(2deg); }
    66% { transform: translate(-5px, 5px) rotate(-1deg); }
}

@keyframes fadeInUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-box.hide {
    display: none;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Custom selection styles */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

.home-box h3 {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.3;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-box p {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.home-box p::before {
    content: '•';
    color: var(--accent-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.home-box p span {
    font-weight: 600;
    color: var(--text-primary);
}

.home-box .btn {
    margin-top: 32px;
}

.option:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 16px 32px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

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

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

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

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.exit-btn {
    background: linear-gradient(135deg, var(--accent-error), #dc2626);
    float: right;
}

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

.next-btn:hover,
.go-home-btn:hover,
.try-again-btn:hover,
.start-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quiz-box .question-number,
.quiz-box .question-text,
.quiz-box .option-container,
.quiz-box .answers-indicator {
    width: 100%;
    float: left;
}

.quiz-box .next-question-btn,
.quiz-box .question-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-primary);
    padding-bottom: 16px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-primary);
}

.quiz-box .question-number {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 24px;
    font-weight: 600;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.quiz-box .question-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-success), var(--accent-warning), var(--accent-error));
}

.quiz-box .question-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 24px 0;
    margin: 0;
    text-align: center;
}


.quiz-box .question-text img {
    max-width: 100%;
    display: block;
    margin: 24px auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.quiz-box .option-container .option {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-transform: none;
    opacity: 0;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.quiz-box .option-container .option:nth-child(1) { animation-delay: 0.1s; }
.quiz-box .option-container .option:nth-child(2) { animation-delay: 0.2s; }
.quiz-box .option-container .option:nth-child(3) { animation-delay: 0.3s; }
.quiz-box .option-container .option:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-box .option-container .option.correct::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, var(--accent-success), #059669);
    z-index: -1;
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.quiz-box .option-container .option.wrong::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, var(--accent-error), #dc2626);
    z-index: -1;
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0%);
    }
}

.quiz-box .option-container .option.correct {
    color: var(--text-primary);
    border-color: var(--accent-success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.quiz-box .option-container .option.wrong {
    color: var(--text-primary);
    border-color: var(--accent-error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.quiz-box .option-container .option.already-answered {
    pointer-events: none;
    opacity: 0.6;
}

.quiz-box .btn {
    margin: 32px 0;
}

.quiz-box .answers-indicator {
    border-top: 1px solid var(--border-primary);
    padding-top: 24px;
    margin-top: 24px;
}

.quiz-box .answers-indicator div {
    height: 48px;
    width: 48px;
    display: inline-block;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    margin: 8px 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.quiz-box .answers-indicator div.correct {
    background: var(--accent-success);
    border-color: var(--accent-success);
    background-image: url("../img/correct.png");
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.quiz-box .answers-indicator div.wrong {
    background: var(--accent-error);
    border-color: var(--accent-error);
    background-image: url("../img/wrong.png");
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.result-box {
    text-align: center;
}

.result-box.hide {
    display: none;
}

.result-box h1 {
    font-size: 32px;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
    font-weight: 700;
}

.result-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.result-box table td {
    border: 1px solid var(--border-primary);
    padding: 16px 24px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    font-size: 16px;
    transition: background 0.2s ease;
}

.result-box table tr:nth-child(even) td {
    background: var(--bg-card);
}

.result-box table tr:hover td {
    background: var(--bg-card-hover);
}

.result-box table td:first-child {
    color: var(--text-secondary);
    font-weight: 600;
}

.result-box table td:last-child {
    color: var(--accent-primary);
    font-weight: 700;
}

.result-box .btn {
    margin: 0 12px 16px 0;
}

/* Multiple choice styles */
.quiz-box .option-container .multiple-choice-instruction {
    font-size: 14px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-secondary);
}

.quiz-box .option-container .option.selected {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.quiz-box .option-container .option.selected:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.4);
}

.quiz-box .option-container .submit-answers-btn {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    color: var(--text-primary);
    border: none;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.quiz-box .option-container .submit-answers-btn:hover {
    background: linear-gradient(135deg, #059669, var(--accent-success));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quiz-box .option-container .submit-answers-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Statistics styles */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.secondary-btn {
    background: linear-gradient(135deg, var(--text-muted), #4b5563);
}

.secondary-btn:hover {
    background: linear-gradient(135deg, #4b5563, var(--text-muted));
}

.danger-btn {
    background: linear-gradient(135deg, var(--accent-error), #dc2626);
}

.danger-btn:hover {
    background: linear-gradient(135deg, #dc2626, var(--accent-error));
}

.statistics-box h2 {
    text-align: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 700;
}

.general-stats {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.stat-item {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

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

.failed-questions-section {
    margin-bottom: 40px;
}

.failed-questions-section h3 {
    color: var(--accent-error);
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
}

.failed-questions-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.failed-questions-list::-webkit-scrollbar {
    width: 6px;
}

.failed-questions-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.failed-questions-list::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

.failed-questions-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.failed-question-item {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.failed-question-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--accent-error), var(--accent-warning));
}

.failed-question-item:hover {
    transform: translateX(8px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.rank {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-error);
    margin-right: 20px;
    min-width: 40px;
    text-align: center;
}

.question-info {
    flex: 1;
}

.question-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    font-size: 16px;
}

.question-stats {
    font-size: 13px;
    color: var(--text-secondary);
}

.error-rate {
    font-weight: 600;
    color: var(--accent-error);
    margin-right: 12px;
}

.stats-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group,
    .stats-actions {
        flex-direction: column;
    }
    
    .failed-question-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rank {
        margin-bottom: 8px;
    }
}

/* Progress display styles */
.quiz-box .question-number {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 24px;
    font-weight: 600;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

/* Success and error feedback */
.feedback-message {
    text-align: center;
    padding: 16px;
    margin: 16px 0;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1px solid;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: var(--accent-success);
    border-color: var(--accent-success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.feedback-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: var(--accent-error);
    border-color: var(--accent-error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Retry section styles */
.retry-section {
    margin-top: 24px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
}

.retry-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.retry-failed-btn {
    background: linear-gradient(135deg, var(--accent-warning), #ff8c00);
    color: var(--text-primary);
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.retry-failed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #ff8c00, var(--accent-warning));
}

.retry-failed-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

@media(max-width: 767px) {
    body {
        padding: 16px;
    }
    
    .custom-box {
        margin: 20px auto;
        padding: 24px;
    }
    
    .home-box .btn {
        margin-top: 24px;
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .result-box .btn {
        width: 100%;
        margin-bottom: 16px;
    }
    
    .result-box table {
        margin: 24px 0;
        font-size: 14px;
    }
    
    .result-box table td {
        padding: 12px 16px;
    }
    
    .quiz-box .question-text {
        font-size: 18px;
        padding: 20px 0;
    }
    
    .quiz-box .option-container .option {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .quiz-box .answers-indicator div {
        height: 40px;
        width: 40px;
        margin: 6px 4px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-item {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

/* ===== STYLES FLASHCARDS ===== */

.flashcards-box {
    max-width: 900px;
}

/* Classes de visibilité générale */
.hide {
    display: none !important;
}

/* Classes de visibilité pour les sections flashcards */
.flashcard-session.hide {
    display: none;
}

.flashcard-results.hide {
    display: none;
}

.theme-selection.hide {
    display: none;
}

.flashcard-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
}

.flashcard-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
}

/* Grille des thèmes */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.theme-card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.theme-card:hover::before {
    left: 100%;
}

.theme-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Style spécial pour la carte globale */
.theme-card.global-theme {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a237e 100%);
    border: 2px solid var(--accent-primary);
    position: relative;
}

.theme-card.global-theme::after {
    content: '⭐';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    color: #ffd700;
}

.theme-card.global-theme:hover {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border-color: var(--accent-secondary);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
}

.theme-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.theme-card h4 {
    color: var(--text-primary);
    margin: 12px 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.theme-card p {
    color: var(--text-secondary);
    margin: 8px 0 16px 0;
    font-size: 14px;
}

.card-count {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Session de flashcards */
.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.back-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 14px;
}

.back-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.session-info {
    text-align: right;
}

.current-theme {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.progress-stats {
    color: var(--text-secondary);
    font-size: 14px;
}

.progress-info {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

/* Container de la flashcard */
.flashcard-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    perspective: 1000px;
}

.flashcard {
    width: 100%;
    max-width: 600px;
    height: 350px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

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

.flashcard.understood {
    animation: flashcardSuccess 0.5s ease;
}

.flashcard.difficult {
    animation: flashcardDifficult 0.5s ease;
}

@keyframes flashcardSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px var(--accent-success); }
}

@keyframes flashcardDifficult {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.flashcard-content {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
}

.flashcard-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.flashcard-side.front {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border-color: var(--accent-primary);
}

.flashcard-side.back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
    border-color: var(--accent-secondary);
}

.card-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-weight: 500;
}

.card-text {
    font-size: 20px;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    opacity: 0.7;
}

/* Contrôles des flashcards */
.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    transition: opacity 0.3s ease;
}

.difficulty-btn {
    min-width: 120px;
    padding: 12px 24px;
    font-weight: 500;
}

.difficulty-btn.difficult {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%);
    border: none;
    color: white;
}

.difficulty-btn.difficult:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.difficulty-btn.easy {
    background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
    border: none;
    color: white;
}

.difficulty-btn.easy:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

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

.flip-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}

.flip-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Actions de session */
.session-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

/* Résultats des flashcards */
.flashcard-results {
    text-align: center;
}

.results-content h3 {
    color: var(--accent-success);
    font-size: 32px;
    margin-bottom: 30px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Responsive pour les flashcards */
@media (max-width: 768px) {
    .themes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .session-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .session-info {
        text-align: center;
    }
    
    .progress-info {
        justify-content: center;
    }
    
    .flashcard {
        height: 300px;
        margin: 0 16px;
    }
    
    .flashcard-side {
        padding: 24px;
    }
    
    .card-text {
        font-size: 18px;
    }
    
    .flashcard-controls {
        flex-direction: column;
        gap: 12px;
        margin: 0 16px;
    }
    
    .session-actions {
        flex-direction: column;
        gap: 12px;
        margin: 0 16px;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 12px;
        margin: 0 16px;
    }
}

/* ===== STYLES METEOR DEFENSE ===== */

.meteor-game-box {
    max-width: 1200px;
}

.meteor-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.meteor-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
}

/* Sélection des niveaux */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.level-card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.level-card:hover::before {
    left: 100%;
}

.level-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.level-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.level-card h4 {
    color: var(--text-primary);
    margin: 12px 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.level-card p {
    color: var(--text-secondary);
    margin: 8px 0 16px 0;
    font-size: 14px;
}

.level-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.meteors-count {
    background: var(--accent-secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Interface de jeu */
.game-ui {
    margin-bottom: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    margin-bottom: 20px;
}

.mission-info {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.mission-title {
    color: var(--accent-secondary);
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.mission-objective {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.game-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    text-align: right;
}

.health-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.health-container {
    width: 100px;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-secondary);
}

.health-fill {
    height: 100%;
    background: var(--accent-success);
    transition: all 0.3s ease;
    border-radius: 3px;
}

.score, .found-count {
    color: var(--text-primary);
    font-weight: 500;
}

/* Zone de jeu */
.game-area {
    position: relative;
    height: 500px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-primary);
    overflow: hidden;
    margin-bottom: 20px;
}

.building {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.building-body {
    font-size: 64px;
    display: block;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.building.building-hit .building-body {
    animation: buildingShake 0.5s ease;
}

@keyframes buildingShake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-55%) translateY(-5px); }
    75% { transform: translateX(-45%) translateY(-5px); }
}

.building-status {
    font-weight: bold;
    font-size: 14px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    border: 1px solid var(--border-secondary);
}

.meteors-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.meteor {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    z-index: 5;
}

.meteor-body {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 50%;
    padding: 12px 16px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    position: relative;
    min-width: 120px;
}

.meteor-body::before {
    content: '☄️';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 20px;
}

.meteor-body:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.meteor-text {
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.explosions-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.explosion {
    position: absolute;
    font-size: 32px;
    animation: explode 1s ease-out forwards;
    pointer-events: none;
}

.explosion.success {
    color: #10b981;
    text-shadow: 0 0 10px #10b981;
}

.explosion.error {
    color: #ef4444;
    text-shadow: 0 0 10px #ef4444;
}

@keyframes explode {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Contrôles de jeu */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.instructions {
    color: var(--text-secondary);
    font-style: italic;
    flex: 1;
    text-align: center;
}

/* Résultats de mission */
.meteor-results {
    text-align: center;
    padding: 40px;
}

.mission-complete {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 2px solid var(--border-primary);
}

.mission-complete.victory {
    border-color: var(--accent-success);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.mission-complete.defeat {
    border-color: var(--accent-error);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.mission-complete h3 {
    font-size: 32px;
    margin-bottom: 30px;
}

.mission-complete.victory h3 {
    color: var(--accent-success);
}

.mission-complete.defeat h3 {
    color: var(--accent-error);
}

.mission-summary {
    margin: 30px 0;
}

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

.result-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
}

.victory-message, .defeat-message {
    margin: 20px 0;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.victory-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

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

.mission-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

/* Responsive pour Meteor Defense */
@media (max-width: 768px) {
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0 16px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .mission-info {
        margin: 0;
    }
    
    .game-stats {
        align-items: center;
        text-align: center;
    }
    
    .game-area {
        height: 400px;
        margin: 0 16px 20px 16px;
    }
    
    .building-body {
        font-size: 48px;
    }
    
    .meteor-body {
        min-width: 100px;
        padding: 8px 12px;
    }
    
    .meteor-text {
        font-size: 11px;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 12px;
        margin: 0 16px;
    }
    
    .mission-actions {
        flex-direction: column;
        gap: 12px;
    }
}