/* ============================================================
   Minesweeper — Game Styles
   ============================================================ */

.ms-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    width: 100%;
    max-width: 480px;
}

.ms-info {
    display: flex;
    gap: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gold);
    background: var(--color-surface);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-surface-2);
}

.ms-difficulty {
    display: flex;
    gap: var(--space-sm);
}

.diff-btn {
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}
.diff-btn.active {
    opacity: 1;
    background: var(--color-primary);
    color: var(--color-bg);
    border-color: var(--color-primary);
}

/* ---- Board ---- */
.ms-board {
    display: grid;
    gap: 1px;
    background: var(--color-surface-2);
    padding: 2px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-surface-2);
    max-width: 95vw;
    overflow: hidden;
    touch-action: manipulation;
}

.ms-cell {
    aspect-ratio: 1;
    min-width: 28px;
    min-height: 28px;
    background: var(--color-surface);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 80ms ease;
}

.ms-cell:hover:not(.revealed):not(.flagged) {
    background: var(--color-surface-3);
}

.ms-cell:active:not(.revealed):not(.flagged) {
    background: var(--color-primary-dim);
}

.ms-cell.revealed {
    background: var(--color-bg);
    cursor: default;
}

.ms-cell.flagged {
    background: var(--color-surface);
}

.ms-cell.mine-exploded {
    background: #f44336;
    animation: explode 300ms ease;
}

.ms-cell.mine-revealed {
    background: var(--color-surface-2);
}

/* Number colors */
.ms-num-1 { color: #00d4ff; }
.ms-num-2 { color: #4caf50; }
.ms-num-3 { color: #f44336; }
.ms-num-4 { color: #7c4dff; }
.ms-num-5 { color: #ff6d00; }
.ms-num-6 { color: #00bfa5; }
.ms-num-7 { color: #e040fb; }
.ms-num-8 { color: #ff1744; }

@keyframes explode {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); background: #ff6b6b; }
    100% { transform: scale(1); background: #f44336; }
}

/* Responsive */
@media (max-width: 480px) {
    .ms-cell {
        min-width: 24px;
        min-height: 24px;
        font-size: 0.75rem;
    }
}
