.game-player {
    box-sizing: border-box;
    max-width: 40rem;
    margin: 1.5rem auto;
    padding: clamp(.8rem, 3vw, 1.35rem);
    background: #fff;
    color: #122531;
    border: 1px solid #adc5d1;
    border-radius: .85rem;
    box-shadow: 0 .5rem 1.5rem #102a3812;
}
.game-player-header, .game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.game-player-header { justify-content: space-between; }
.game-scores { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; }
.game-scores div { min-width: 3rem; padding: .25rem .5rem; background: #e4f1f6; border-radius: .35rem; }
.game-scores dt { font-size: .85rem; }
.game-scores dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.game-player button {
    font: inherit;
    font-weight: 650;
    min-height: 2.75rem;
    padding: .35rem .65rem;
    color: #065675;
    background: #fff;
    border: 1px solid #83a8b8;
    border-radius: .45rem;
    cursor: pointer;
}
.game-player button:disabled { opacity: .55; cursor: default; }
.game-player button:is(.game-primary, [aria-pressed="true"]) { color: #fff; background: #065675; }
.game-toolbar button:not(:disabled):is(:hover, :focus-visible) { color: #fff6e5; background: #963506; border-color: #963506; }
.game-player .game-toolbar .game-primary { background: #086357; border-color: #086357; }
.game-player :focus-visible { outline: 3px solid #065675; outline-offset: 3px; }
.game-status { margin: .55rem 0; font-size: .92rem; }
.game-toolbar { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .85rem; }
.game-toolbar button { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .35rem; border-radius: .6rem; line-height: 1.25; }
.game-toolbar button span { overflow-wrap: anywhere; }
.game-toolbar svg { flex: 0 0 1.15rem; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-icon-pause, .game-icon-audible, [data-state="pause"] .game-icon-play, [aria-pressed="true"] .game-icon-muted { display: none; }
[data-state="pause"] .game-icon-pause, [aria-pressed="true"] .game-icon-audible { display: inline; }
@media (max-width: 36rem) { .game-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.game-stage:empty { display: none; }
.game-player.is-paused .merge-grid { opacity: .55; }
.game-player:is(.is-expanded, :fullscreen) {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: auto;
    border: 0;
    border-radius: 0;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.game-player.is-expanded { position: fixed; inset: 0; z-index: 20; }
.game-player:is(.is-expanded, :fullscreen) > * { max-width: 38rem; margin-inline: auto; }

.merge-garden { max-width: 28rem; margin-inline: auto; }
.merge-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(.2rem, 1vw, .5rem);
    background: #e4f1f6;
    padding: clamp(.3rem, 1.25vw, .65rem);
    border-radius: .7rem;
    touch-action: none;
    user-select: none;
}
.merge-grid span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: .35rem;
    background: #ccdfe8;
    color: #122531;
    font-weight: 760;
    font-size: clamp(.85rem, 4vw, 1.6rem);
    font-variant-numeric: tabular-nums;
}
.merge-grid [data-tile="2"] { background: #f4fafc; }
.merge-grid [data-tile="4"] { background: #aee1dd; }
.merge-grid [data-tile="8"] { background: #76c4ba; }
.merge-grid [data-tile="16"] { background: #ebd798; }
.merge-grid [data-tile="32"] { background: #f3b78b; }
.merge-grid [data-tile="64"] { background: #efa88a; }
.merge-grid :is([data-tile="128"], [data-tile="256"]) { color: #fff; background: #17687a; }
.merge-grid :is([data-tile="512"], [data-tile="1024"], [data-tile="2048"]) { color: #fff; background: #243f63; }
.merge-directions { display: flex; justify-content: center; gap: .4rem; margin-top: .65rem; }
.merge-directions button { min-width: 2.75rem; font-size: 1.2rem; }

.puzzle-stage { max-width: 32rem; margin-inline: auto; }
.puzzle-stage:focus-visible { border-radius: .55rem; }
.puzzle-area {
    --puzzle-gap: clamp(.12rem, .65vw, .32rem);
    --puzzle-pad: clamp(.15rem, .8vw, .4rem);
    width: 100%;
}
.puzzle-grid, .puzzle-column-clues {
    --cols: 5;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--puzzle-gap);
    min-width: 0;
    box-sizing: border-box;
}
.puzzle-area [data-cols="3"] { --cols: 3; }
.puzzle-area [data-cols="4"] { --cols: 4; }
.puzzle-area [data-cols="6"] { --cols: 6; }
.puzzle-area [data-cols="7"] { --cols: 7; }
.puzzle-area [data-cols="8"] { --cols: 8; }
.puzzle-area [data-cols="9"] { --cols: 9; }
.puzzle-area [data-cols="11"] { --cols: 11; }
.puzzle-grid[data-kind="stones"] { --puzzle-gap: .08rem; }
.puzzle-grid[data-kind="stones"] [data-group="last"] { outline: 2px solid #065675; outline-offset: -2px; }
.puzzle-grid {
    background: #e4f1f6;
    border-radius: .55rem;
    padding: var(--puzzle-pad);
    user-select: none;
}
.puzzle-drag { touch-action: none; }
.game-player .puzzle-cell {
    position: relative;
    min-width: 0;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    display: grid;
    place-items: center;
    color: #16343f;
    background: #fff;
    border: 1px solid #a2bcc8;
    border-radius: clamp(.15rem, 1vw, .4rem);
    line-height: 1;
    font-size: clamp(.78rem, 4vw, 1.45rem);
    font-variant-numeric: tabular-nums;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.puzzle-drag .puzzle-cell { touch-action: none; }
.game-player .puzzle-cell:focus-visible { z-index: 1; outline-offset: 0; }
.game-player .puzzle-cell[data-tone="covered"] { background: #daeaf0; }
.game-player .puzzle-cell[data-tone="wall"] { color: #f2f9fa; background: #315866; border-color: #315866; }
.game-player .puzzle-cell[data-tone="fixed-queen"] { color: #432421; background: #f6ca9f; border-color: #bb7856; }
.game-player .puzzle-cell[data-tone="compact"] { padding: .1rem; font-size: clamp(.68rem, 2.6vw, 1rem); overflow-wrap: anywhere; line-height: 1.1; }
.puzzle-grid[data-kind="hex-span"] .puzzle-cell { border-radius: .95rem .25rem; }
.puzzle-grid[data-kind="magnet-pairs"] .puzzle-cell:nth-child(odd) { border-top-right-radius: .08rem; border-bottom-right-radius: .08rem; }
.puzzle-grid[data-kind="magnet-pairs"] .puzzle-cell:nth-child(even) { border-top-left-radius: .08rem; border-bottom-left-radius: .08rem; }
.puzzle-grid:is([data-kind="edge-parade"], [data-kind="trail-edges"]) { --puzzle-gap: .1rem; }
.puzzle-grid[data-kind="symbol-sets"] .puzzle-cell { aspect-ratio: 1.8; }
.puzzle-grid:is([data-kind="measuring-jugs"], [data-kind="balance-coins"]) .puzzle-cell { aspect-ratio: 1.65; }
.puzzle-grid:is([data-kind="lantern-maze"], [data-kind="mirror-quilt"]) { --puzzle-gap: .12rem; }
.puzzle-grid[data-kind="island-bridges"] .puzzle-cell { font-variant-numeric: tabular-nums; }
.puzzle-grid[data-kind="island-bridges"] .puzzle-cell:is([data-tone="covered"], [data-tone="filled"], [data-tone="danger"], [data-tone="selected"]) { border-radius: 50%; }
.game-player .puzzle-cell:is([data-tone="fixed"], [data-tone="open"]) { background: #eef5f8; }
.game-player .puzzle-cell[data-tone="marked"] { background: #f6e6ae; }
.game-player .puzzle-cell[data-tone="danger"] { color: #821f2b; background: #f9dce0; }
.game-player .puzzle-cell[data-tone="blank"] { background: #c3d9e3; border-style: dashed; }
.game-player .puzzle-cell[data-tone="placed"] { background: #c9eee2; }
.game-player .puzzle-cell[data-tone="light-on"] { background: #f8dd89; }
.game-player .puzzle-cell[data-tone="light-off"] { background: #d9e8ee; }
.game-player .puzzle-cell[data-tone="filled"] { color: #fff; background: #065675; }
.game-player .puzzle-cell[data-tone="crossed"] { background: #edf5f8; }
.puzzle-grid[data-kind="sudoku"] .puzzle-cell[data-group="1"]:not([data-tone="danger"]) { background: #d5e8ef; }
.puzzle-tools { display: flex; flex-wrap: wrap; gap: .38rem; margin-top: .6rem; }
.game-player .puzzle-tools button { min-width: 2.75rem; touch-action: manipulation; }
.game-player.is-paused .puzzle-area { opacity: .62; }

.puzzle-clued {
    display: grid;
    grid-template-columns: clamp(2rem, 13vw, 4rem) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: .2rem;
}
.puzzle-clued .puzzle-column-clues { grid-column: 2; padding-inline: var(--puzzle-pad); align-items: end; }
.puzzle-column-clues div { display: grid; text-align: center; }
.puzzle-column-clues, .puzzle-row-clues { font-size: clamp(.72rem, 2.8vw, 1rem); font-weight: 650; line-height: 1.2; }
.puzzle-row-clues {
    display: grid;
    grid-auto-rows: 1fr;
    gap: var(--puzzle-gap);
    align-items: center;
    text-align: end;
    padding-block: var(--puzzle-pad);
}

.puzzle-grid[data-kind="pipes"] .puzzle-cell { background: #f7fbfd; }
.puzzle-pipe, .puzzle-pipe-center { position: absolute; background: #065675; pointer-events: none; }
.puzzle-pipe-center { width: 27%; height: 27%; top: 36.5%; left: 36.5%; border-radius: 40%; }
.puzzle-pipe-n, .puzzle-pipe-s { width: 18%; left: 41%; height: 51%; }
.puzzle-pipe-n { top: 0; }
.puzzle-pipe-s { bottom: 0; }
.puzzle-pipe-e, .puzzle-pipe-w { height: 18%; top: 41%; width: 51%; }
.puzzle-pipe-e { right: 0; }
.puzzle-pipe-w { left: 0; }

.game-player .puzzle-grid[data-kind="vials"] .puzzle-cell {
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    width: min(100%, 4.5rem);
    justify-self: center;
    aspect-ratio: 1 / 1.6;
    padding: .16rem;
    overflow: hidden;
    border-radius: .3rem .3rem .85rem .85rem;
}
.puzzle-layer { align-self: stretch; justify-self: stretch; display: grid; place-items: center; min-width: 0; }
.game-player .puzzle-cell[data-tone="selected"] { outline: 3px solid #065675; outline-offset: 0; }
.game-player .puzzle-cell[data-tone="placeholder"] { visibility: hidden; }
.puzzle-grid[data-kind="paths"] .puzzle-cell[data-group="endpoint"] {
    border-width: 2px;
    border-color: #264756;
    font-weight: 850;
}
.puzzle-area [data-tone="color1"] { background: #9ad9e0; }
.puzzle-area [data-tone="color2"] { background: #f5bcaa; }
.puzzle-area [data-tone="color3"] { background: #f2df9d; }
.puzzle-area [data-tone="color4"] { background: #b7d9a5; }
.puzzle-area [data-tone="color5"] { background: #d9c5ef; }
.puzzle-area [data-tone="color6"] { background: #f4bfda; }
.puzzle-area [data-tone="color7"] { background: #b9cffa; }
