.domino-flips, .domino-flips * { box-sizing: border-box; }
.domino-flips[hidden], .domino-flips [hidden] { display: none; }
.domino-flips {
    --flip-accent: #087b7f;
    border: 1px solid #c6cecb;
    border-radius: 5px;
    padding: 22px;
    background: #fff;
}
.domino-flips .game-settings { gap: 12px 24px; }
.domino-flips .game-settings label { gap: 8px; }
.domino-flips select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23505b59' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
.domino-flips .flip-instruction { margin: 18px 0 12px; font-size: 16px; color: #4c5956; }
.domino-flips .game-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0 22px;
    padding: 10px 0;
}
.domino-flips .game-stats dd { font-variant-numeric: tabular-nums; line-height: 1.2; }
.domino-flips .flip-board {
    position: relative;
    width: min(100%, var(--board-width), 480px);
    aspect-ratio: var(--cols) / var(--rows);
    margin-inline: auto;
    background: #fff;
    border-radius: 4px;
    touch-action: manipulation;
}
.domino-flips .flip-board > svg { display: block; width: 100%; height: 100%; }
.domino-flips .flip-black { fill: #687373; }
.domino-flips .flip-white { fill: #fafcfb; }
.domino-flips .flip-tile-fill { fill: #b6dee0; fill-opacity: 0.8; stroke: none; }
.domino-flips .flip-tile-outline { fill: none; stroke: #fff; stroke-opacity: 1; stroke-width: 5; }
.domino-flips .flip-tile-edge { fill: none; stroke: #111; stroke-opacity: 1; stroke-width: 2; }
.domino-flips .flip-highlight { fill: #16a9a9; fill-opacity: 0.12; stroke: #087b7f; stroke-width: 3; pointer-events: none; }
.domino-flips button.flip-choice {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, calc(72% / var(--cols)), 44px);
    aspect-ratio: 1;
    height: auto;
    min-height: 0;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 2px solid var(--flip-accent);
    border-radius: 50%;
    color: #fff;
    background: var(--flip-accent);
    box-shadow: 0 0 0 3px #fff;
    touch-action: manipulation;
}
.domino-flips button.flip-choice:not(:disabled):hover { background: #055e61; }
.domino-flips button.flip-choice:focus-visible { outline: 3px solid #ca8a20; outline-offset: 4px; z-index: 2; }
.domino-flips .flip-choice svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.domino-flips .flip-status { min-height: 1.65em; margin: 16px 0 12px; text-align: center; font-size: 16px; }
.domino-flips .flip-status[data-state="complete"] { color: #076a6e; font-weight: bold; }
.domino-flips .game-actions { gap: 10px; }
.domino-flips .flip-auto { margin-right: auto; min-width: 110px; }
.domino-flips .flip-auto:not(:disabled) { background: var(--flip-accent); border-color: var(--flip-accent); color: #fff; }
.domino-flips .flip-auto:not(:disabled):hover { background: #055e61; }
.domino-flips .flip-new { margin-top: 12px; }
@media (max-width: 520px) {
    .domino-flips { padding: 14px 10px; }
    .domino-flips .game-settings { gap: 10px; }
    .domino-flips .game-settings label { font-size: 16px; gap: 6px; }
    .domino-flips .game-stats { margin-bottom: 16px; }
    .domino-flips .game-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .domino-flips .flip-auto { grid-column: 1 / -1; margin: 0; }
    .domino-flips .flip-new { width: 100%; }
}
