/* Basic styling for the body and wrapper */
body {
    font-family: "Inter", sans-serif; /* Using Inter font */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Use min-height to allow content to expand */
    margin: 0;
    background-color: #e2e8f0; /* Light slate background */
    color: #333;
    padding: 20px; /* Add some padding for smaller screens */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8fafc; /* Lighter background for the main content area */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Softer shadow */
    max-width: 1200px; /* Max width for larger screens */
    width: 100%; /* Full width on smaller screens */
    margin: 20px; /* Margin around the wrapper */
}

/* Game board styling */
#game-board {
    display: grid;
    /* Updated for 5x5 grid */
    grid-template-columns: repeat(5, minmax(70px, 90px)); /* Responsive tile size */
    grid-template-rows: repeat(5, minmax(70px, 90px));
    gap: 8px; /* Increased gap */
    border: 6px solid #4a5568; /* Darker border */
    background-color: #718096; /* Matching background for blank tile area */
    padding: 8px;
    border-radius: 8px; /* Rounded corners for the board */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2); /* Inner shadow for depth */
    width: fit-content; /* Fit content to tiles */
}

/* Tile styling */
.tile {
    width: 100%; /* Make tiles fill their grid cell */
    height: 100%;
    background-color: #ffffff;
    color: #2d3748; /* Darker text color */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.0em; /* Slightly adjusted for 5x5 */
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px; /* Rounded corners for tiles */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Softer tile shadow */
    transition: all 0.2s ease-in-out; /* Smooth transitions for hover/movement */
    user-select: none;
    text-transform: uppercase; /* Ensure letters are uppercase */
}

.tile:not(.blank):hover {
    background-color: #f0f4f8; /* Lighter hover effect */
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.blank {
    background-color: #718096; /* Blank tile matches board background */
    cursor: default;
    box-shadow: none;
    transform: none; /* No lift for blank tile */
}

/* Info Panel and Word List styling */
#info-panel {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 350px; /* Max width for info panel */
    width: 100%;
}

#word-list {
    list-style-type: none; /* Remove default bullet points */
    padding: 0;
}

#word-list li {
    font-size: 1.1em;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0; /* Subtle separator */
    color: #4a5568;
}

#word-list li:last-child {
    border-bottom: none;
}

.word-found {
    color: #22c55e; /* Green for found words */
    text-decoration: line-through;
    font-weight: bold;
    animation: found-animation 0.5s ease-out forwards; /* Animation for found words */
}

@keyframes found-animation {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

#message {
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    min-height: 1.5em; /* Prevent layout shift */
}

/* Reset Button Styling */
#reset-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(145deg, #4299e1, #3182ce); /* Blue gradient */
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#reset-button:hover {
    background: linear-gradient(145deg, #3182ce, #4299e1); /* Reverse gradient on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

#reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-wrapper {
        padding: 20px;
    }

    #game-board {
        grid-template-columns: repeat(5, minmax(50px, 70px)); /* Adjusted for 5x5 on mobile */
        grid-template-rows: repeat(5, minmax(50px, 70px));
        gap: 6px;
        padding: 6px;
    }

    .tile {
        font-size: 1.6em; /* Adjusted for 5x5 on mobile */
    }

    h1 {
        font-size: 2.5em;
    }

    #info-panel {
        padding: 20px;
    }
    
    #game-container {
        flex-direction: column;
    }
}
