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

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

.grid-game button:disabled {
    color: #666;
    border-color: #ccc;
    background: #eee;
    cursor: default;
}

.grid-game .game-actions button:not(:disabled):hover {
    background: #eaf4f4;
}

.grid-game :focus-visible {
    outline: 2px solid #087b7f;
    outline-offset: 3px;
}

.grid-black-stat dd {
    font-weight: bold;
    color: #087b7f;
}

.coloring-scroll {
    overflow-x: auto;
    padding: 5px;
}

.coloring-board {
    display: grid;
    grid-template-columns: 24px repeat(var(--grid-size), minmax(0, 1fr));
    grid-template-rows: 24px repeat(var(--grid-size), minmax(0, 1fr));
    width: 100%;
    max-width: 504px;
    min-width: calc(24px + var(--grid-size) * 28px);
    margin: 0 auto;
    isolation: isolate;
}

.grid-game .grid-cell {
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    border: 0;
    box-shadow: inset 0 0 0 0.5px #888;
    background: #fff;
    touch-action: manipulation;
}

.grid-game .grid-cell[aria-pressed="true"] {
    background: #333;
}

.grid-game .grid-cell:focus-visible {
    outline-offset: -4px;
    outline-color: #0f9fa5;
    z-index: 2;
}

.grid-coordinate {
    align-self: center;
    justify-self: center;
    font-size: 13px;
    line-height: 20px;
    min-width: 20px;
    text-align: center;
}

.grid-coordinate.grid-error {
    color: #923d27;
    outline: 1px solid currentColor;
    border-radius: 50%;
}

.grid-square-error {
    place-self: center;
    z-index: 1;
    width: 16px;
    height: 16px;
    line-height: 16px;
    font: bold 16px/16px sans-serif;
    text-align: center;
    border: 1px solid #923d27;
    border-radius: 50%;
    color: #923d27;
    background: #fff5ef;
    pointer-events: none;
}

.grid-error-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-left: auto;
    cursor: pointer;
}

.grid-error-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #087b7f;
}

.grid-summary {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 520px) {
    .grid-game {
        padding: 14px;
    }
}
