/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;800&display=swap');

:root {
    --bg-color: #f0f4f8;
    --main-color: #386641;
    --accent-color: #6a994e;
    --highlight-color: #a7c957;
    --text-color: #2c3e50;
    --white-color: #ffffff;
    --gray-color: #bdc3c7;
    --correct-color: #4caf50;
    --incorrect-color: #f44336;
    --font-family: 'M PLUS Rounded 1c', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    user-select: none;
}

#game-container {
    width: 100%;
    max-width: 800px;
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px 40px;
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
}

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

h1 {
    font-size: 2.5rem;
    color: var(--main-color);
    margin-bottom: 10px;
    font-weight: 800;
}

h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 600px;
}

.btn {
    background-image: linear-gradient(45deg, var(--accent-color) 0%, var(--highlight-color) 100%);
    color: var(--white-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 20px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: none;
}

/* --- Name Entry Screen --- */
#name-entry-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

#name-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid var(--gray-color);
    border-radius: 8px;
    box-sizing: border-box;
}

#name-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* --- Quiz Screen --- */
#quiz-progress {
    font-size: 1rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 15px;
}

#question {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    min-height: 80px;
}

#options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.option-btn {
    background-color: var(--white-color);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: var(--white-color);
    transform: scale(1.03);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
    animation: pulse 0.5s;
}

.option-btn.incorrect {
    background-color: var(--incorrect-color);
    border-color: var(--incorrect-color);
    color: white;
}

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

/* --- Answer Screen --- */
#answer-result {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

#answer-result.correct {
    color: var(--correct-color);
}

#answer-result.incorrect {
    color: var(--incorrect-color);
}

#correct-answer-text {
    font-size: 1.2rem;
    font-weight: bold;
}

#commentary {
    background-color: #f9f9f9;
    border-left: 5px solid var(--highlight-color);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    border-radius: 0 8px 8px 0;
}

/* --- Ending Screen --- */
#ending-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

#player-name-display {
    color: var(--main-color);
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    #game-container {
        padding: 20px;
    }
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    #options-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    .option-btn {
        padding: 15px;
    }
}