.level-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 auto 20px;
    max-width: 720px;
    padding: 0 20px;
}

.level-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: 2px solid var(--light-quaternary);
    background: white;
    color: var(--gray-dark);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
}

.level-btn small { font-size: 0.75rem; color: var(--gray); }
.level-btn:hover { border-color: var(--primary); color: var(--primary); }
.level-btn.active { border-color: var(--primary); background: var(--primary); color: white; }
.level-btn.active small { color: rgba(255,255,255,0.8); }

.ms-board {
    display: inline-grid;
    gap: 2px;
    background: var(--light-tertiary);
    border: 2px solid var(--light-quaternary);
    border-radius: 12px;
    padding: 10px;
    user-select: none;
    touch-action: none;
}

.ms-cell {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--light-secondary);
    border: 1px solid var(--light-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.1s ease, transform 0.1s ease;
    font-family: 'JetBrains Mono', monospace;
}

.ms-cell:hover:not(.revealed) {
    background: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.ms-cell.revealed {
    background: white;
    border-color: rgba(0,0,0,0.06);
    cursor: default;
}

.ms-cell.flagged {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    font-size: 1rem;
}

.ms-cell.mine { background: #fee2e2; border-color: #fca5a5; font-size: 1rem; }
.ms-cell.hit  { background: #ef4444; border-color: #dc2626; animation: hitFlash 0.4s ease; }
.ms-cell.wrong-flag { background: #fee2e2; }

@keyframes hitFlash {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

.ms-cell.n1 { color: #2563eb; }
.ms-cell.n2 { color: #16a34a; }
.ms-cell.n3 { color: #dc2626; }
.ms-cell.n4 { color: #1e40af; }
.ms-cell.n5 { color: #991b1b; }
.ms-cell.n6 { color: #0e7490; }
.ms-cell.n7 { color: #1f2937; }
.ms-cell.n8 { color: #6b7280; }

/* Large boards need smaller cells */
@media (max-width: 600px) {
    .ms-cell { width: 26px; height: 26px; font-size: 0.72rem; border-radius: 4px; }
    .ms-board { gap: 1px; padding: 6px; }
}
