/* Apply box-sizing globally for easier layout */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; /* Reset default margins */
    padding: 0; /* Reset default padding */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; /* System font stack */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    padding: 15px; /* Add padding around the body for small screens */
    text-align: center;
}

.game-container {
    background-color: #ffffff;
    padding: 25px; /* Default padding */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Make container fluid but limit max size */
    width: 100%; /* Take available width */
    max-width: 700px; /* Max width on larger screens */
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.6rem; /* Use rem for scalable font size */
    line-height: 1.3; /* Improve readability */
}

.extension-name {
    font-size: 1.7rem; /* Slightly larger base size, adjust in media query */
    font-weight: bold;
    color: #0056b3;
    margin: 25px 0;
    padding: 20px 15px; /* More vertical padding */
    background-color: #e9ecef;
    border-radius: 5px;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    word-break: break-word; /* Prevent long names from overflowing */
    line-height: 1.4;
}

.button-container {
    margin: 25px 0;
    /* Prepare for potential flex layout */
    display: flex;
    justify-content: center; /* Center buttons horizontally by default */
    gap: 15px; /* Space between buttons when side-by-side */
    flex-wrap: wrap; /* Allow wrapping if needed, though stacking is preferred on mobile */
}

button {
    padding: 12px 20px; /* Adjust padding */
    font-size: 1rem; /* Use rem */
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
    transition: background-color 0.3s ease, transform 0.1s ease;
    flex-grow: 1; /* Allow buttons to grow if space allows */
    flex-basis: 120px; /* Minimum base width before growing/shrinking */
    text-align: center;
}

button:active {
    transform: scale(0.98);
}

#is-extension-btn {
    background-color: #28a745;
}

#is-extension-btn:hover {
    background-color: #218838;
}

#is-not-extension-btn {
    background-color: #dc3545;
}

#is-not-extension-btn:hover {
    background-color: #c82333;
}

.feedback {
    margin-top: 20px;
    font-size: 1.1rem; /* Use rem */
    font-weight: bold;
    min-height: 30px;
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
    line-height: 1.5;
    word-wrap: break-word; /* Ensure long feedback wraps */
}
/* Ensure links within feedback are styled appropriately */
.feedback a {
    color: #0056b3;
    text-decoration: underline;
}
.feedback a:hover {
    color: #003d80;
}


.feedback.correct {
    color: #28a745;
}

.feedback.incorrect {
    color: #dc3545;
}

.feedback.hidden {
    opacity: 0;
}

.score-container {
    margin-top: 25px;
    font-size: 1.1rem; /* Use rem */
    color: #555;
}

.credits {
    margin-top: 25px;
    color: #888;
}


.image {
    display: block; /* Makes the image a block element for centering */
    max-width: 80%; /* Limit the maximum width (adjust as needed) */
    /* You could use a fixed width instead: width: 120px; */
    height: auto;     /* Maintain aspect ratio automatically */
    margin-left: auto;  /* Center the image horizontally */
    margin-right: auto; /* Center the image horizontally */
    margin-bottom: 20px; 
}

#score {
    font-weight: bold;
}


/* --- Media Query for Mobile Devices --- */
/* Adjustments for screens smaller than 600px */
@media (max-width: 600px) {
    body {
        padding: 10px; /* Slightly less body padding */
        /* Ensure content starts near the top on mobile */
        align-items: flex-start;
        padding-top: 20px;
    }

    .game-container {
        padding: 20px; /* Less padding inside container */
        /* Remove max-width effectively, as body padding handles spacing */
        /* max-width: none; */ /* Let it fill the width given by body padding */
    }

    h1 {
        font-size: 1.4rem; /* Smaller heading */
    }

    .extension-name {
        font-size: 1.2rem; /* Smaller font for extension name */
        padding: 15px 10px;
        min-height: 50px;
        margin: 20px 0;
    }

    .button-container {
        flex-direction: column; /* Stack buttons vertically */
        gap: 12px; /* Adjust gap for vertical stacking */
    }

    button {
        width: 100%; /* Make buttons full width */
        padding: 15px 10px; /* Taller buttons for easier tapping */
        font-size: 1rem; /* Ensure font size is tappable */
        /* Reset flex properties set for larger screens */
        flex-grow: 0;
        flex-basis: auto;
    }

    .feedback {
        font-size: 1rem; /* Slightly smaller feedback text */
    }

    .score-container {
        font-size: 1rem; /* Slightly smaller score text */
    }

    .image {
        max-width: 80%;
        margin-bottom: 15px;
    }

}
