/* Minesweeper Game Styles */

.game-header .score {
    display: none;
}

.game-header .timer {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-left: 15px;
}

.minesweeper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.minesweeper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: fit-content;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.minesweeper-grid {
    display: grid;
    gap: 1px;
    background: #444;
    border: 3px solid #666;
    padding: 2px;
    background: linear-gradient(135deg, #444 0%, #333 100%);
    width: fit-content;
}

.minesweeper-grid.easy {
    grid-template-columns: repeat(9, 28px);
}

.minesweeper-grid.medium {
    grid-template-columns: repeat(16, 28px);
}

.minesweeper-grid.hard {
    grid-template-columns: repeat(30, 24px);
}

.mine-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    border: none;
    user-select: none;
    transition: background 0.1s;
    font-family: sans-serif;
}

.mine-cell:hover:not(.revealed) {
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
}

.mine-cell.revealed {
    background: #888;
    cursor: default;
    border: 1px solid #666;
}

.mine-cell.flagged {
    cursor: pointer;
}

.mine-cell.flagged::after {
    content: none;
}

.mine-cell.flagged {
    color: #f44336;
    font-size: 16px;
}

.mine-cell.mine {
    background: #e53935;
}

.mine-cell.mine::after {
    content: none;
}

.mine-cell.wrong-flag {
    background: #ff9800;
}

.mine-cell.wrong-flag::after {
    content: '✕';
    position: absolute;
    font-size: 20px;
    color: #f44336;
    font-weight: bold;
}

.mine-cell.wrong-flag {
    position: relative;
}

.mine-cell[data-count="1"] { color: #2196f3; }
.mine-cell[data-count="2"] { color: #4caf50; }
.mine-cell[data-count="3"] { color: #f44336; }
.mine-cell[data-count="4"] { color: #9c27b0; }
.mine-cell[data-count="5"] { color: #ff9800; }
.mine-cell[data-count="6"] { color: #00bcd4; }
.mine-cell[data-count="7"] { color: #333; }
.mine-cell[data-count="8"] { color: #888; }

.win-overlay .final-time {
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
}

.win-message h2 {
    color: var(--accent-gold);
}

@media (max-width: 768px) {
    .game-board {
        padding: 10px;
        overflow-x: auto;
    }

    .minesweeper-container {
        padding: 10px;
    }

    .mine-cell {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .minesweeper-grid.easy {
        grid-template-columns: repeat(9, 22px);
    }
    
    .minesweeper-grid.medium {
        grid-template-columns: repeat(16, 20px);
    }
    
    .minesweeper-grid.hard {
        grid-template-columns: repeat(30, 18px);
    }
    
    .mine-cell.wrong-flag::after {
        font-size: 16px;
    }
}

@media (max-width: 500px) {
    .game-board {
        padding: 5px;
        border-radius: 8px;
        overflow-x: auto;
    }

    .minesweeper-container {
        padding: 5px;
        gap: 10px;
    }

    .mine-cell {
        width: min(9vw, 34px);
        height: min(9vw, 34px);
        font-size: min(3.5vw, 12px);
    }
    
    .minesweeper-grid.easy {
        grid-template-columns: repeat(9, min(9vw, 34px));
    }
    
    .minesweeper-grid.medium {
        grid-template-columns: repeat(16, min(5.5vw, 26px));
    }
    
    .minesweeper-grid.hard {
        grid-template-columns: repeat(30, min(3vw, 20px));
    }
    
    .mine-cell.wrong-flag::after {
        font-size: min(5vw, 18px);
    }
}
