/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f0f2f5;
}

.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
}

/* Language Selection Screen */
#languageScreen {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.language-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.language-btn {
    padding: 1.5rem 3rem;
    border: none;
    border-radius: 0.5rem;
    background: #7579E7;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: 700;
}

.language-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(117, 121, 231, 0.3);
}

/* Selection Screen */
#selectionScreen {
    /* Removed display: none from here */
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.selection-title {
    margin-bottom: 2rem;
    color: #333;
}

.selection-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.selection-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.selection-btn:hover {
    transform: translateY(-2px);
}

/* Game Screen */
#gameScreen {
    display: none;
}

.flashcard {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.card-emoji {
    font-size: 100px;
    height: 200px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
}

.input-container {
    position: relative;
    margin: 2rem 0;
}

.answer-input {
    width: 100%;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 2px solid #ccc;
    outline: none;
    font-size: 1.2rem;
    text-align: center;
    background: transparent;
}

.answer-input:focus {
    border-bottom-color: #4CAF50;
}

.timer {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.progress {
    color: #666;
    margin-bottom: 1rem;
}

/* Results Screen */
#resultsScreen {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-title {
    margin-bottom: 1rem;
    color: #333;
}

.results-stats {
    margin-bottom: 2rem;
}

.word-list {
    text-align: left;
    margin: 1rem 0;
}

.word-list h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.correct-words {
    color: #4CAF50;
}

.incorrect-words {
    color: #f44336;
}

.restart-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.restart-btn:hover {
    transform: translateY(-2px);
}

/* Animations */
@keyframes correct {
    0% { transform: translateY(0); }
    25% { transform: translateY(-6px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

@keyframes incorrect {
    0% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

.correct-animation {
    animation: correct 0.4s ease-in-out;
}

.incorrect-animation {
    animation: incorrect 0.4s ease-in-out;
}

/* Screen Transitions */
.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Fireworks */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFD6E8;
    animation: explode 0.5s ease-out forwards;
}

.particle {
    position: absolute;
    width: 20x;
    height: 20px;
    border-radius: 50%;
    background: #FFD6E8;
    animation: particle 0.5s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

@keyframes particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Background */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
}

.background-shapes svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}