body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #f4f4f4;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-container {
    display: flex;
    width: 100%;
    height: 100%;
}


@keyframes shake {
    0% { transform: translate(1px, 1px); }
    20% { transform: translate(-1px, -2px); }
    40% { transform: translate(-3px, 0px); }
    60% { transform: translate(3px, 2px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0, 0); }
}

@keyframes gridFlash {
    0%, 100% { background-color: #ff3d00; }
    50% { background-color: #d50000; }
}

.grid-item.losing {
    animation: gridFlash 0.5s alternate 3;
}

.screen-shake {
    animation: shake 0.5s;
}

@keyframes textGlowRed {
    0% { text-shadow: 0 0 5px #ff1744, 0 0 10px #ff1744, 0 0 15px #ff1744; }
    50% { text-shadow: 0 0 10px #ff1744, 0 0 20px #ff1744, 0 0 30px #ff1744; }
    100% { text-shadow: 0 0 5px #ff1744, 0 0 10px #ff1744, 0 0 15px #ff1744; }
}

.message.losing {
    animation: textGlowRed 1.5s infinite alternate;
    color: #ff1744;
}

@keyframes gridFlashGreen {
    0% { background-color: #00c853; }
    50% { background-color: #76ff03; }
    100% { background-color: #00c853; }
}

.grid-item.winning {
    animation: gridFlashGreen 0.5s alternate 3;
}

.screen-shake {
    animation: shake 0.5s;
}

@keyframes textGlow {
    0% { text-shadow: 0 0 5px #00c853, 0 0 10px #00c853, 0 0 15px #00c853; }
    50% { text-shadow: 0 0 10px #00c853, 0 0 20px #00c853, 0 0 30px #00c853; }
    100% { text-shadow: 0 0 5px #00c853, 0 0 10px #00c853, 0 0 15px #00c853; }
}

.message.winning {
    animation: textGlow 2s infinite alternate;
    color: #00e676;
}

.options-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('option.webp');
    background-size: cover;
    background-position: center;
    width: 30%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

#user-id {
    margin: 10px 0;
}

#userID {
    width: 225px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #555;
    background-color: #333;
    color: #f4f4f4;
}

#instructions {
    text-align: center;
    margin-bottom: 20px;
}


#instructions h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

#instructions ul {
    font-size: 16px;
    line-height: 1.5;
    text-align: justify; /* Justify the instructions text */
    list-style-type: disc;
    margin-left: 20px; /* Add some left margin to position the bullet points */
}

.options-section select,
#start-button button {
    width: 250px; /* Set a fixed width for both dropdowns and button */
    padding: 12px; /* Adjust padding for better readability */
    margin: 10px 0;
    background: #333333;
    color: #f4f4f4;
    border: 1px solid #555555;
    border-radius: 5px;
    text-align: center;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding and border are included in the width */
}

/* Text styling for better visibility */
#instructions h1 {
    font-size: 36px; /* Increase font size */
    font-weight: bold; /* Make the title bold */
    color: #ffffff; /* White color for better contrast */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Add a subtle black shadow */
    text-align: center;
}

#instructions h2 {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff; /* White color for better contrast */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Add a subtle black shadow */
    text-align: center;
}

#instructions ul {
    font-size: 18px;
    line-height: 1.5;
    color: #f4f4f4; /* Light gray/white text */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* Add a subtle black shadow */
    text-align: justify; /* Justify the instructions text */
}

#start-button button {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff; /* White color for the button text */
    background: linear-gradient(145deg, #ff7e5f, #feb47b); /* Keep the gradient background */
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* Add a subtle black shadow */
    cursor: pointer;
    padding: 12px 24px; /* Adjust padding for better readability */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#start-button button:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); /* Enhance shadow on hover */
}

.label {
    position: absolute;
    font-size: 16px;
    font-weight: bold;
    color: #f4f4f4;
    z-index: 10;
}

#start-label {
    top: 10px;
    left: 10px;
    color: #00e676; /* Green for the start label */
}

#end-label {
    bottom: 10px;
    right: 10px;
    color: #ff1744; /* Red for the end label */
}

.game-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('game.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Add a semi-transparent overlay for the game section */

h1 {
    margin-top: 20px;
    text-align: center;
    color: #f4f4f4; /* Light gray/white title */
}

.message {
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #f4f4f4; /* Light gray/white message */
    text-align: center;
    width: 100%;
}

#grid-container {
    display: none; /* Initially hidden */
    grid-template-columns: repeat(auto-fill, 50px); /* Grid item size */
    gap: 15px; /* Space between grid items */
    justify-content: center; /* Center the grid horizontally */
    margin-top: 30px;
    margin-bottom: 15px;
}

.grid-item {
    width: 50px;
    height: 50px;
    background-color: #333333; /* Dark gray for non-mine tiles */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #555555; /* Medium gray border */
    font-size: 24px;
    font-weight: bold;
    color: #f4f4f4; /* Light gray/white text */
    transition: background-color 0.3s ease;
}

.grid-item:hover {
    background-color: #888888; /* Light gray on hover */
}


button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #555555; /* Medium gray button background */
    color: #f4f4f4; /* Light gray/white text */
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #888888; /* Light gray on hover */
}

table {
    margin: 20px auto;
    border-collapse: collapse;
    width: 60%;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

th {
    background-color: #FF8C42;
    color: white;
}

td {
    background-color: rgba(255, 255, 255, 0.1);
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.2);
}

.instructions-container {
    position: relative;
    display: inline-block;
}

.instructions-popup {
    display: none;
    position: fixed;
    background-color: #333;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: left;
    width: 300px;
    z-index: 1000;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

.instructions-button:hover + .instructions-popup {
    display: block;
}

h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

.tries-container {
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 15px;
    width: 100%; /* Full width to center */
}

.round-label {
    font-size: 18px;
    margin-right: 10px;
    color: white;
}

#tries-box {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff8c42; /* Orange background */
    border-radius: 5px;
    font-size: 18px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 60px;
    text-align: center;
}
