/* 自定义样式 - 补充Tailwind CSS无法实现的效果 */

/* 格子基础样式 */
.cell {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 2px solid #cbd5e0;
    background: linear-gradient(145deg, #f7fafc, #e2e8f0);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 未揭开格子的悬停效果 */
.cell.covered:hover {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e0);
    transform: translateY(-2px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

/* 已揭开的格子 */
.cell.revealed {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
    cursor: default;
    animation: revealCell 0.3s ease;
}

/* 揭开动画 */
@keyframes revealCell {
    0% {
        transform: scale(0.8) rotateY(90deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotateY(45deg);
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

/* 标记旗帜 */
.cell.flagged {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

/* 标记问号 */
.cell.questioned {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe);
    border-color: #3b82f6;
}

/* 地雷格子 */
.cell.mine {
    background: linear-gradient(145deg, #fee2e2, #fecaca);
    border-color: #ef4444;
}

/* 触发的地雷（游戏失败时） */
.cell.mine.triggered {
    background: linear-gradient(145deg, #dc2626, #ef4444);
    animation: explode 0.5s ease;
}

/* 爆炸动画 */
@keyframes explode {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.2);
    }
}

/* 错误标记的旗帜 */
.cell.wrong-flag {
    background: linear-gradient(145deg, #fca5a5, #f87171);
    border-color: #dc2626;
}

/* 数字颜色 */
.cell[data-number="1"] {
    color: #3b82f6; /* 蓝色 */
}

.cell[data-number="2"] {
    color: #10b981; /* 绿色 */
}

.cell[data-number="3"] {
    color: #ef4444; /* 红色 */
}

.cell[data-number="4"] {
    color: #8b5cf6; /* 紫色 */
}

.cell[data-number="5"] {
    color: #f59e0b; /* 橙色 */
}

.cell[data-number="6"] {
    color: #06b6d4; /* 青色 */
}

.cell[data-number="7"] {
    color: #000000; /* 黑色 */
}

.cell[data-number="8"] {
    color: #6b7280; /* 灰色 */
}

/* 游戏棋盘网格布局 */
#game-board {
    display: inline-grid;
    gap: 1px;
    background-color: #94a3b8;
    padding: 4px;
}

/* 禁用交互状态 */
.cell.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* 胜利动画 */
@keyframes victory {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    50% {
        transform: scale(1.2) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.victory-animation {
    animation: victory 0.6s ease infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* 难度按钮激活状态 */
.difficulty-btn.active {
    ring: 2px;
    ring-offset: 2px;
    ring-color: currentColor;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}