:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --background-color: #f0f4f8;
    --text-color: #333;
    --light-text-color: #fff;
    --correct-color: #2ecc71;
    --incorrect-color: #e74c3c;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

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

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

#game-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h1 {
    color: var(--primary-color);
}

.instructions {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1rem;
    padding: 0 1rem;
}

#level-display {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    align-self: center;
    font-size: 0.9rem;
}

#answers-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.answer-word {
    display: flex;
    gap: 5px;
    background-color: #e9ecef;
    padding: 8px;
    border-radius: 8px;
    height: 45px;
    align-items: center;
}

.answer-letter {
    width: 30px;
    height: 30px;
    background-color: var(--card-bg);
    border: 2px solid #ced4da;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.answer-letter.found {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border-color: var(--secondary-color);
    transform: scale(1.1);
}

#current-word-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#current-word {
    flex-grow: 1;
    height: 50px;
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--primary-color);
    padding: 0 1rem;
    min-width: 150px;
}

#syllables-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.syllable-btn, .action-btn {
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.syllable-btn {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    min-width: 80px;
}

.syllable-btn:active {
    transform: scale(0.95);
}

.syllable-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.action-btn {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
}

#clear-button {
    background-color: #f39c12;
    color: var(--light-text-color);
}

#submit-button {
    background-color: var(--correct-color);
    color: var(--light-text-color);
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#message-area {
    min-height: 24px;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

#message-area.correct {
    color: var(--correct-color);
}

#message-area.incorrect {
    color: var(--incorrect-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-content p {
    margin-bottom: 1.5rem;
}

.modal-content #next-level-button {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    width: 100%;
}

#win-image {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
}