/* Basic Reset & Font Imports */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(to right, #4facfe, #00f2fe); /* Gradient background */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.game-container {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 100%;
    max-width: 450px; /* Max width for mobile-like experience on larger screens */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h1 {
    font-family: 'Pacifico', cursive;
    color: #e91e63;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.score-timer {
    display: flex;
    justify-content: space-around;
    font-size: 1.1em;
    font-weight: bold;
    color: #4CAF50;
    background-color: #e8f5e9;
    padding: 8px;
    border-radius: 10px;
}

.main-word-area {
    background-color: #ffe0b2;
    padding: 15px;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.main-word-area .label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #ff9800;
}

.word-card {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    margin: 8px auto; /* Centering for individual cards */
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.word-card:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.main-word {
    font-size: 2.2em;
    color: #ff5722;
    background-color: #fff3e0;
    border-color: #ff9800;
    padding: 15px 20px;
}

.drop-zones {
    display: flex;
    flex-direction: column; /* Stack vertically on small screens */
    gap: 15px;
    margin-top: 15px;
}

.drop-zone {
    flex: 1;
    background-color: #e0f7fa;
    border: 3px dashed #00bcd4;
    border-radius: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.drop-zone h2 {
    color: #00838f;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.drop-zone.hovered {
    background-color: #c5e1ee;
    border-color: #00796b;
}

.word-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Responsive grid for choices */
    gap: 10px;
    margin-top: 20px;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none; /* CHANGED: Hidden by default. JavaScript will show it. */
    position: fixed; /* Stay in place */
    z-index: 100; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    display: flex; /* Kept flex here to center content when visible */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    max-width: 90%;
    animation: fadeIn 0.5s;
}

.modal-content h2 {
    color: #e91e63;
    font-family: 'Pacifico', cursive;
    font-size: 2em;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 25px;
}

#closeModalButton {
    background-color: #f44336;
}

#closeModalButton:hover {
    background-color: #da190b;
}

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

/* Media Queries for larger screens (e.g., tablets and desktops) */
@media (min-width: 768px) {
    .game-container {
        max-width: 700px; /* Wider for tablets */
        padding: 30px;
    }

    h1 {
        font-size: 2.5em;
    }

    .score-timer {
        font-size: 1.3em;
        padding: 12px;
    }

    .main-word {
        font-size: 3em;
    }

    .drop-zones {
        flex-direction: row; /* Side-by-side on larger screens */
    }

    .drop-zone {
        min-height: 150px;
        padding: 20px;
    }

    .drop-zone h2 {
        font-size: 1.8em;
    }

    .word-choices {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .word-card {
        font-size: 1.5em;
        padding: 15px;
    }

    button {
        padding: 15px 30px;
        font-size: 1.2em;
    }
}

.main-word-area.correct-feedback {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 15px #4CAF50;
    animation: pulseGreen 0.5s ease-out;
}

.main-word-area.incorrect-feedback {
    border: 3px solid #f44336;
    box-shadow: 0 0 15px #f44336;
    animation: pulseRed 0.5s ease-out;
}

@keyframes pulseGreen {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { transform: scale(1.02); box-shadow: 0 0 15px rgba(76, 175, 80, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes pulseRed {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(244, 67, 54, 0.7); }
    50% { transform: scale(1.02); box-shadow: 0 0 15px rgba(244, 67, 54, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(244, 67, 54, 0); }
}
