:root {
    --bs-primary: #b83a2f;
    --bs-primary-rgb: 184, 58, 47;
    --bs-body-font-family: 'Noto Serif SC', serif;
}

.rule-board {
    display: inline-grid;
    grid-template-columns: repeat(7, 22px);
    gap: 0;
    background: var(--board-wood);
    padding: 6px;
    border-radius: 4px;
    margin: 8px 0 4px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.25);
    position: relative;
}

.rule-board::after {
    content: '';
    position: absolute;
    inset: 6px;
    background-image:
        linear-gradient(rgba(60,40,10,0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(60,40,10,0.15) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    border-radius: 2px;
}

.rule-cell {
    width: 22px;
    height: 22px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.rule-cell.b::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #555, #111);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.rule-cell.w::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #d8d0c4);
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.rule-cell.m::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--cinnabar);
    box-shadow: 0 0 6px rgba(184,58,47,0.4);
}

.rule-diagrams > div {
    margin-bottom: 16px;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.rule-diagrams strong {
    color: var(--cinnabar);
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}
