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

:root {
    --primary-color: #ff8a65;
    --secondary-color: #4fc3f7;
    --accent-color: #b39ddb;
    --background-color: #f5f5f5;
    --success-color: #81c784;
    --button-color: #ffeb3b;
    --button-hover: #ffd54f;
    --text-color: #37474f;
    --error-color: #ef5350;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
}

.screen.active {
    display: flex;
}

#start-screen {
    text-align: center;
}

.welcome-text {
    margin-bottom: 2rem;
}

.welcome-text h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.welcome-text p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.language-selection {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 400px;
}

.language-selection h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.select-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    background-color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    pointer-events: none;
}

.test-voice {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bounce-button {
    background-color: var(--button-color);
    color: var(--text-color);
    border: none;
    border-radius: 25px;
    padding: 1rem 2rem;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    animation: bounce 1s infinite alternate;
}

.bounce-button:hover {
    background-color: var(--button-hover);
    transform: translateY(-3px);
}

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

.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
}

.home-button {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s;
}

.home-button:hover {
    transform: scale(1.2);
}

.theme-selector {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

.sentence-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.current-sentence {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-align: center;
    padding: 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    background-color: rgba(179, 157, 219, 0.1);
    width: 100%;
    max-width: 700px;
    line-height: 1.6;
}

.sentence-emoji {
    font-size: 2rem;
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

.clickable-word {
    display: inline-block;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.2s;
    position: relative;
}

.clickable-word:hover {
    background-color: rgba(79, 195, 247, 0.2);
    transform: scale(1.05);
}

.sentence-input-container {
    width: 100%;
    max-width: 700px;
    margin-bottom: 1rem;
}

.sentence-input {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
}

.sentence-input.correct {
    border-color: var(--success-color);
    background-color: rgba(129, 199, 132, 0.1);
}

.sentence-input.incorrect {
    border-color: var(--error-color);
    background-color: rgba(239, 83, 80, 0.1);
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.control-button:hover {
    background-color: #29b6f6;
    transform: scale(1.05);
}

.control-button.listening {
    background-color: var(--error-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.letter-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-button:hover {
    background-color: #ff5722;
    transform: scale(1.1);
}

.letter-button.active {
    background-color: var(--success-color);
}

.spelled-word {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    min-height: 80px;
}

.spelled-letter {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--accent-color);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emoji {
    display: inline-block;
    transition: transform 0.3s;
}

.emoji:hover {
    transform: scale(1.2);
}

.progress-container {
    width: 100%;
    max-width: 700px;
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .letter-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .current-sentence {
        font-size: 1.5rem;
    }
}