/* ===== VARIABLES ===== */
:root {
    --primary-purple: #764ba2;
    --primary-pink: #f093fb;
    --primary-blue: #667eea;
    --green-start: #84fab0;
    --green-end: #8fd3f4;
    --turquoise-start: #11998e;
    --turquoise-end: #38ef7d;
    --orange-start: #f6d365;
    --orange-end: #fda085;
    --red: #e74c3c;
    --green: #27ae60;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Thèmes de fond */
body.theme-maths {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

body.theme-francais {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 50%, #a8edea 100%);
}

body.theme-home {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #f093fb 60%, #38ef7d 100%);
}

/* ===== CONTAINER ===== */
.container {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

/* ===== TITRES ===== */
h1 {
    color: #764ba2;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

h1.francais {
    color: #11998e;
}

.welcome-name {
    color: #f093fb;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.nickname {
    color: #f5576c;
    font-weight: bold;
}

/* ===== MASCOTTE ===== */
.mascot {
    font-size: 5em;
    margin: 20px 0;
    animation: float 3s ease-in-out infinite;
}

/* ===== BOUTONS ===== */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(118, 75, 162, 0.4);
    margin: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover, .btn:active {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(118, 75, 162, 0.6);
}

.btn-start {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    font-size: 1.5em;
    padding: 20px 50px;
}

.btn-home {
    background: linear-gradient(135deg, #a8a8a8 0%, #888 100%);
}

.btn-francais {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

.btn-francais:hover {
    box-shadow: 0 8px 30px rgba(17, 153, 142, 0.6);
}

/* ===== CARTES DE MATIÈRES ===== */
.subject-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.subject-card {
    width: 140px;
    height: 140px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.subject-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.subject-card .icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.subject-card.maths {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.subject-card.francais {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.subject-card.anglais {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.subject-card.sciences {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

/* ===== MENU DE JEUX ===== */
.game-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.game-card {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.game-card .icon {
    font-size: 2.5em;
}

.game-card .info {
    text-align: left;
}

.game-card .title {
    font-size: 1.3em;
    font-weight: bold;
    color: #764ba2;
}

.game-card.francais .title {
    color: #11998e;
}

.game-card .description {
    font-size: 0.9em;
    color: #666;
}

/* ===== SCORE BOARD ===== */
.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.score-item {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.streak-fire {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* ===== QUESTION BOX ===== */
.question-box {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 30px;
    border-radius: 25px;
    margin: 20px 0;
    position: relative;
}

.question {
    font-size: 2.5em;
    color: #333;
    font-weight: bold;
}

/* ===== PHRASE BOX (pour le français) ===== */
.phrase-box {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 25px;
    margin: 20px 0;
    font-size: 1.5em;
    line-height: 2;
}

.word {
    display: inline-block;
    padding: 5px 12px;
    margin: 3px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    border: 3px solid transparent;
}

.word:hover {
    transform: scale(1.1);
    border-color: #764ba2;
}

.word.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.word.correct {
    background: linear-gradient(135deg, #84fab0 0%, #27ae60 100%);
    color: white;
    border-color: #27ae60;
}

.word.wrong {
    background: linear-gradient(135deg, #f093fb 0%, #e74c3c 100%);
    color: white;
    border-color: #e74c3c;
}

/* ===== DRAG & DROP ===== */
.drop-zone {
    min-height: 80px;
    border: 4px dashed #764ba2;
    border-radius: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #764ba2;
    transition: all 0.3s;
}

.drop-zone.francais {
    border-color: #11998e;
    color: #11998e;
}

.drop-zone.drag-over {
    background: rgba(118, 75, 162, 0.1);
    border-style: solid;
}

.drop-zone.has-word {
    border-style: solid;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.draggable {
    cursor: grab;
    user-select: none;
}

.draggable:active {
    cursor: grabbing;
}

.draggable.dragging {
    opacity: 0.5;
}

/* ===== FEEDBACK ===== */
.feedback {
    font-size: 1.5em;
    margin: 20px 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feedback-icon {
    font-size: 4em;
    animation: bounce 0.5s ease;
}

.feedback-text {
    margin-top: 10px;
    font-weight: bold;
}

.correct {
    color: #27ae60;
}

.wrong {
    color: #e74c3c;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #84fab0 0%, #8fd3f4 50%, #a8edea 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ===== LEVEL BADGE ===== */
.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
    color: #8b4513;
    margin: 10px 0;
}

/* ===== TROPHIES ===== */
.trophy-case {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 15px;
    border-radius: 20px;
    margin: 15px 0;
}

.trophy-title {
    font-size: 1.2em;
    color: #8b4513;
    margin-bottom: 10px;
}

.trophies {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.trophy {
    font-size: 2em;
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.3s;
}

.trophy.earned {
    filter: none;
    opacity: 1;
    animation: trophyPop 0.5s ease;
}

/* ===== ASTUCE ===== */
.tip-box {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 15px 20px;
    border-radius: 20px;
    margin: 15px 0;
    font-size: 1em;
    color: #8b4513;
}

.tip-box .tip-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

/* ===== ÉTOILES ===== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.star {
    position: absolute;
    font-size: 2em;
    animation: fall 2s ease-out forwards;
}

/* ===== MODE SELECTOR ===== */
.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: 3px solid #764ba2;
    background: white;
    color: #764ba2;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.francais {
    border-color: #11998e;
    color: #11998e;
}

.mode-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mode-btn.francais.selected {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* ===== ANIMATIONS ===== */
@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

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

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

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

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

@keyframes confettiFall {
    0% {
        top: -50px;
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.potato {
    animation: shake 0.5s ease;
}

.confetti {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    animation: confettiFall 3s ease-out forwards;
    z-index: 1001;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.5em;
    }
    .question {
        font-size: 2em;
    }
    .phrase-box {
        font-size: 1.2em;
    }
    .subject-card {
        width: 120px;
        height: 120px;
    }
}
