/* Main Game Container */
#erika-games-container {
    font-family: Arial, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 2em;
    background-color: #f9f9f9;
}

.game-wrapper {
    margin-bottom: 30px;
}

.game-wrapper h3 {
    text-align: center;
}
.game-wrapper p {
    text-align: center;
    font-style: italic;
    color: #555;
}

/* NEW: Horizontal Row Styling */
.matching-row {
    display: flex;
    flex-wrap: wrap; /* This makes items wrap to the next line */
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.match-item {
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #fff;
    text-align: center;
    
    /* NEW: This creates the 5-per-row layout */
    flex-basis: calc(20% - 10px); /* 20% = 5 items per row, -10px for gap */
    min-width: 120px; /* Don't let them get too small */
}

.match-item:hover {
    border-color: #0073aa;
    transform: scale(1.03);
}

/* Word Card Styling */
.match-item.word-card {
    font-size: 1.3em;
    font-weight: bold;
    padding: 20px 10px;
}

/* Image Card Styling */
#mg-images img.match-item {
    padding: 5px;
    width: 100%; /* Make image fill the flex-basis */
    height: 150px; /* Give all image cards a uniform height */
    object-fit: contain; /* Make sure image fits, doesn't stretch */
}

/* Visual Feedback Styles */
.match-item.selected {
    border-color: #005A9C; /* Blue */
    background-color: #eaf5ff;
}

.match-item.matched {
    border-color: #4CAF50; /* Green */
    background-color: #f0fff0;
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.game-feedback {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    min-height: 25px;
}

.game-button {
    display: block;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
	color: #333;
}
.game-button:hover {
    background-color: #e0e0e0;
}

/* Sound Button Styling */
.sound-button {
    font-size: 3em; /* Make the speaker icon large */
    padding: 10px 0;
}

/* --- Game 3: Quiz Styles --- */
.quiz-question {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin: 20px 0;
}

.quiz-answers {
    display: flex;
    flex-direction: column; /* NEW: Stack buttons vertically */
    gap: 10px;
    margin-top: 15px;
    
    /* NEW: Constrain the width */
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-answer-btn {
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.2s ease;
    width: 100%; /* NEW: Make buttons fill the container */
	color: #333;
}

.quiz-answer-btn:hover:not(:disabled) {
    border-color: #0073aa;
    background-color: #f7f7f7;
}

.quiz-answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.quiz-answer-btn.correct {
    background-color: #4CAF50; /* Green */
    border-color: #4CAF50;
    color: white;
}

.quiz-answer-btn.incorrect {
    background-color: #f44336; /* Red */
    border-color: #f44336;
    color: white;
}