.black-cell-pairs {
    margin-top: 24px;
    padding: 22px;
    border: 1px solid #ccc;
    line-height: 1.65;
}

.black-cell-pairs .pairs-settings,
.black-cell-pairs .pairs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.black-cell-pairs .pairs-settings {
    justify-content: space-between;
}

.black-cell-pairs label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.black-cell-pairs button,
.black-cell-pairs select {
    font: inherit;
    color: inherit;
    border: 1px solid #888;
    border-radius: 3px;
    background: #fcfcfc;
    min-height: 44px;
    padding: 6px 12px;
    cursor: pointer;
}

.black-cell-pairs button:disabled {
    color: #666;
    border-color: #ccc;
    background: #eee;
    cursor: default;
}

.black-cell-pairs .pairs-actions button:not(:disabled):hover {
    background: #eaf4f4;
}

.black-cell-pairs :focus-visible {
    outline: 2px solid #087b7f;
    outline-offset: 3px;
}

.black-cell-pairs .pairs-instruction {
    margin: 18px 0 12px;
    font-size: 15px;
}

.black-cell-pairs .pairs-stats {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: baseline;
    margin: 12px 0 20px;
    padding: 10px 0;
    border-block: 1px solid #ddd;
}

.black-cell-pairs .pairs-stats dd {
    margin: 0;
    font-size: 26px;
    color: #087b7f;
}

.black-cell-pairs .pairs-board {
    display: grid;
    grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
    width: min(100%, calc(var(--grid-size) * 64px));
    margin: 0 auto;
    outline: 1px solid #777;
}

.black-cell-pairs .pairs-cell {
    aspect-ratio: 1;
    padding: 0;
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: inset 0 0 0 0.5px #888;
    background: #fff;
    font: 18px/1.1 "Computer Modern", serif;
    touch-action: manipulation;
}

.black-cell-pairs .pairs-cell[aria-pressed="true"] {
    background: #292929;
    color: #fff;
}

.black-cell-pairs .pairs-cell.is-duplicate {
    box-shadow: inset 0 0 0 4px #efc300;
}

.black-cell-pairs .pairs-cell:focus-visible {
    outline: 2px solid #169ea3;
    outline-offset: -7px;
    z-index: 1;
}

.black-cell-pairs .pairs-status {
    min-height: 1.65em;
    margin: 20px 0 16px;
    overflow-wrap: anywhere;
}

.black-cell-pairs .pairs-status[data-state="valid"] {
    color: #08666a;
}

@media (max-width: 520px) {
    .black-cell-pairs {
        padding: 14px;
    }
    .black-cell-pairs .pairs-cell {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .black-cell-pairs {
        padding: 14px 4px;
    }
}
