/* Minesweeper Specific Styles */
.feature-button {
    background-color: #f3f1f5;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 60px;
    position: absolute;
    top: 20px;
    left: 20px;
    box-sizing: border-box;
}

/* Game Container */
#main-content {
    justify-content: center;
    align-items: center;
    
    width: 1200px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #004d66;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Underwater Background Animation */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(to bottom, #00aaff, #005577);
    overflow: hidden;
}


#game-controls {
    float: left;
    /* display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0; */
}

#flag-mode {
    display: inline-block;
    padding: 5px 10px;
    font-size: 40px;
    margin-right: 10px;
    cursor: pointer;
}

#flags-left-display {
    font-size: 32px;
}

#game-board {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(4, 60px); /* Default, will be updated dynamically */
    grid-template-rows: repeat(4, 60px);
    gap: 10px;
    margin: 0 auto;
}

.tile {
    width: 60px;
    height: 60px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    user-select: none;
    position: relative;
    transition: background-color 0.3s;
}

.tile.revealed {
    background-color: #fff;
    cursor: default;
}

.tile.mine {
    background-color: rgba(130, 4, 4, 0.865);
    color: white;
}

.tile.flagged {
    background-color: #ffe58a;
    color: black;
}

.tile.number {
    font-weight: bold;
}

#info {
    float: left;
}
#status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
        margin-top: 10px;
}

#timer, #current-level, #current-score, #high-score {
    display: inline-block;
    font-size: 30px;
}

#message {
    display: inline-block;
    margin-top: 10px;
    font-size: 40px;
    color: green;
}

.hidden {
    display: none;
}

#next-game {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 600px) {
    #status-bar {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    #game-controls {
        flex-direction: column;
        width: 100%;
    }
    
    #game-board {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        grid-template-rows: repeat(auto-fill, minmax(40px, 1fr));
        gap: 5px;
    }
    
    .tile {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Active Toggle Button Styling */
#flag-mode.active {
    background-color: #ff5722; /* Vibrant Orange */
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

/* Flag Mode Button Hover Effect */
#flag-mode:hover {
    background-color: #0056b3; /* Darker Blue for non-active state */
}

/* Animation for Flag Placement */
.animate-flag {
    animation: flagPlacement 0.5s ease-in-out forwards;
}

/* Keyframes for Flag Placement Animation */
@keyframes flagPlacement {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

/* Animation for Flag Mode Toggle */
#flag-mode.active::after {
    content: '🚩';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: toggleIcon 0.5s forwards;
}

/* Keyframes for Toggle Icon Animation */
@keyframes toggleIcon {
    0% {
        opacity: 0;
        transform: translateX(20px) translateY(-50%);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

#next-game {
    transition: background-color 0.3s, transform 0.3s;
}

#next-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* pulse animation for flag mode button */
#flag-mode.active {
    animation: buttonPulse 1s infinite;
}

.hidden {
    display: none;
}

/* Button Styling */
.btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff; /* Default Blue */
    color: #fff;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
    margin: 5px;
}

.btn:hover {
    background-color: #0056b3;
}

#new-game {
    background-color: #28a745; /* Green */
}

#new-game:hover {
    background-color: #218838;
}

/* auto next toggle */
#auto-next {
    background-color: #218838
}