body {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    text-align: center;
    background-color: lightgray;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Container for better layout */
.container {
    width: 100%;
    height: 100%;
    min-width: 1500px;  /* Ensure container is wide enough */
    margin: 0 auto;
    padding: 5px;
    overflow: hidden;
}

#top-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3px auto 8px auto;  /* Reduced margins */
    max-width: 1440px;  /* Match new board width */
    font-size: 18px;  /* Slightly smaller */
    font-weight: bold;
}

/* Timer styling in the middle */
#timer {
    font-size: 22px;  /* Slightly smaller */
    font-weight: bold;
    padding: 4px 16px;  /* Smaller padding */
    background-color: #333;
    color: white;
    border-radius: 5px;
}

/* Board with complete border - Resized to fit screen */
#board {
    width: 1440px;   /* 30 columns × 48px each */
    height: 576px;   /* 24 rows × 24px each */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(30, 48px);  /* 30 fixed 48px columns */
    grid-template-rows: repeat(24, 24px);     /* 24 fixed 24px rows */
    background-color: darkgray;
    gap: 0px;
    padding: 0px;
    border: 8px solid darkgray;  /* Slightly smaller border */
    box-sizing: content-box;
    justify-content: center;
    align-content: center;
}

/* Individual tiles - Optimized size to fit screen */
.tile {
    width: 48px !important;   /* Wider tiles */
    height: 24px !important;  /* Shorter tiles */
    min-width: 48px;
    max-width: 48px;
    min-height: 24px;
    max-height: 24px;
    background-color: lightgray;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid whitesmoke;
    box-sizing: border-box;
    flex: none;
    overflow: hidden;
}

.tile-clicked {
    background-color: darkgrey !important;  /* Added !important */
}

.mine-hit {
    background-color: #ffaaaa !important;
}

.x1 { color: blue; }
.x2 { color: green; }
.x3 { color: red; }
.x4 { color: navy; }
.x5 { color: brown; }
.x6 { color: teal; }
.x7 { color: black; }
.x8 { color: gray; }

/* Remove the old game stats */
#game-stats {
    display: none !important;
}

#flag-button {
    width: 100px;  /* Smaller button */
    height: 35px;
    font-size: 16px;
    background-color: lightgray;
    border: 1px solid #999;
    cursor: pointer;
    margin: 3px auto;  /* Reduced margin */
    display: flex;
    justify-content: center;
    align-items: center;
}

#submit-button {
    width: 140px;  /* Smaller button */
    height: 35px;
    margin: 3px auto;  /* Reduced margin */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    display: none;
}

#submit-button:hover {
    background-color: #45a049;
}

/* Flash for timer when mine is hit */
@keyframes flash-red {
    0% { background-color: rgba(255, 0, 0, 0.6); }
    50% { background-color: #ff0000; }
    100% { background-color: #333; }
}

.flash-red {
    animation: flash-red 0.6s ease-in-out;
}