/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
}

#game-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-bottom: 5px;
}

/* NEW: Styles for the stats container */
#game-stats {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 600;
    margin-bottom: 15px;
}

#instructions {
    color: #7f8c8d;
    margin-bottom: 30px;
}

#sentence-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    line-height: 2.5rem;
    margin-bottom: 30px;
    min-height: 80px;
}

/* NEW: Styles for final score display */
#sentence-container h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
}
#sentence-container p.final-score {
    font-size: 1.2rem;
    color: #34495e;
}

.word {
    padding: 8px 12px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.3s, border-color 0.3s, transform 0.2s;
}

.word:hover {
    background-color: #ecf0f1;
    border-color: #bdc3c7;
    transform: translateY(-2px);
}

/* State Classes */
.word.correct {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    cursor: default;
}

.word.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: default;
}

.word.solution {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    cursor: default;
}

#feedback-container {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    transition: opacity 0.5s;
}

/* CHANGED: Specific styles for feedback types */
#feedback-container.feedback-correct {
    background-color: #d4edda;
    color: #155724;
}
#feedback-container.feedback-incorrect {
    background-color: #f8d7da;
    color: #721c24;
}

#feedback-container p {
    margin: 0 0 10px 0;
}

#feedback-container strong {
    color: inherit;
}

#feedback-container em {
    opacity: 0.8;
}

#next-button {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#next-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.hidden {
    display: none;
}

#score-breakdown {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.score-item .category-name {
    color: #495057;
}

.score-item .score-value {
    font-weight: 600;
    color: #0056b3;
}

/* Loader styles */
#loader {
    margin: 20px 0;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    margin: 0 auto 15px;
}

/* Animation for the spinner */
#loader:not(.hidden) .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}