/* Custom styles for Minesweeper game */
.cell {
    width: 2rem;
    height: 2rem;
    border: 1px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 150ms ease;
    user-select: none;
}

.cell.unopened {
    background: #334155;
}

.cell.unopened:hover {
    background: #475569;
    transform: scale(1.05);
}

.cell.opened {
    background: #1e293b;
    border-color: #334155;
    cursor: default;
}

.cell.mine {
    background: #dc2626;
}

.cell.flagged {
    background: #ca8a04;
}

.cell.flagged::after {
    content: '🚩';
}

.cell.mine.revealed::after {
    content: '💣';
}

.cell.number-1 { color: #60a5fa; }
.cell.number-2 { color: #4ade80; }
.cell.number-3 { color: #f87171; }
.cell.number-4 { color: #c084fc; }
.cell.number-5 { color: #facc15; }
.cell.number-6 { color: #f472b6; }
.cell.number-7 { color: #94a3b8; }
.cell.number-8 { color: #0f172a; }

/* Animations */
@keyframes reveal {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.cell.revealing {
    animation: reveal 0.3s ease-out;
}

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); background-color: #ef4444; }
    100% { transform: scale(1); }
}

.cell.exploding {
    animation: explode 0.5s ease-out;
}

@keyframes flag {
    0% { transform: scale(0.8) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.cell.flagging {
    animation: flag 0.3s ease-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .cell {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.75rem;
    }
}

/* Game board container */
#gameBoard {
    display: inline-block;
    background: #1e293b;
    padding: 8px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Modal animations */
#gameModal {
    transition: opacity 0.3s ease-out;
}

#gameModal.show {
    display: flex;
    opacity: 1;
}

#gameModal.hide {
    opacity: 0;
}

/* Button hover effects */
.difficulty-btn {
    transition: all 0.2s ease;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-btn.active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Timer and mine counter styling */
.font-mono {
    font-family: 'Courier New', monospace;
}

/* Pause overlay */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.pause-overlay h3 {
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

/* Win celebration */
@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
}

.celebrating {
    animation: celebrate 0.5s ease-in-out 3;
}
