/* General Styling (consistent with main site) */
body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); /* Using hero section gradient for variety */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.game-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
}

.game-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #f5576c; /* Matching gradient end color */
    margin-bottom: 1rem;
}

.game-description {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Game Screens */
.game-screen {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.game-screen.active {
    display: block;
}

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

.screen-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* Difficulty Selection */
.difficulty-options {
    display: flex;
    flex-direction: column; /* Changed to column for better mobile stacking */
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-button, .game-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); /* Matching body gradient */
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.difficulty-button:hover, .game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
}

.high-score {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.back-to-hub {
    display: inline-block;
    margin-top: 1.5rem;
    color: #f5576c; /* Matching theme color */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.back-to-hub:hover {
    color: #f093fb; /* Matching theme color */
}

/* Game Play Screen */
.game-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
    background: #fff0f5; /* Lighter pink background */
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid #ffccdd; /* Lighter pink border */
}

.game-stat {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #374151;
}

.game-stat span:first-child {
    font-weight: 500;
    color: #6b7280;
    margin-right: 0.5rem;
}

.problem-area {
    margin-bottom: 2rem;
}

.speak-button {
    background: linear-gradient(135deg, #4c51bf 0%, #7c3aed 100%); /* Purple gradient from main site */
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(76, 81, 191, 0.3);
}

.speak-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 81, 191, 0.5);
}

.answer-input {
    width: 80%;
    max-width: 350px;
    padding: 0.8rem 1.2rem;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 1.5rem;
    text-align: center;
}

.answer-input:focus {
    outline: none;
    border-color: #f5576c; /* Matching theme color */
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.2);
}

.hints-area {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.hint-button {
    background: transparent;
    color: #4b5563;
    border: 2px solid #a7a7a7;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.hint-button:hover:not(:disabled) {
    background: #e2e8f0;
    color: #1f2937;
}

.hint-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback {
    min-height: 24px; /* Ensure space for feedback */
    margin-top: 1rem;
    font-weight: 600;
}

.feedback.correct {
    color: #10b981;
}

.feedback.incorrect {
    color: #ef4444;
}

.game-button.hidden {
    display: none;
}

/* End Screen */
.final-score {
    font-family: 'Nunito', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.new-high-score {
    font-size: 1.3rem;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .game-container {
        padding: 1.5rem;
    }
    .game-title {
        font-size: 2rem;
    }
    .game-description {
        font-size: 1rem;
    }
    .screen-title {
        font-size: 1.8rem;
    }
    .difficulty-options {
        flex-direction: column; /* Ensure vertical stacking for small screens */
        align-items: stretch;
    }
    .difficulty-button, .game-button, .speak-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    .game-header {
        flex-direction: column;
        gap: 0.8rem;
    }
    .answer-input {
        font-size: 1.2rem;
    }
    .hints-area {
        flex-direction: column;
        align-items: center;
    }
    .hint-button {
        width: 80%; /* Make hint buttons take more width */
    }
}