/* A cell's state is painted inside its full-size pointer target. */
.table-game .gt-board > :is(button,span) { position:relative; }
.table-game .gt-board > button:focus-visible { z-index:2; outline:3px solid #e6812b; outline-offset:-3px; }
.table-game .gt-board > [aria-disabled=true] { cursor:default; }
.pz-die { display:inline-grid; grid-template:repeat(3,1fr)/repeat(3,1fr); gap:3px; width:3.3rem; height:3.3rem; padding:.48rem; box-sizing:border-box; justify-self:center; border-radius:10px; background:#fffcf2; border:1px solid #9f9680; box-shadow:inset 0 -4px #dfd6c3,0 2px 5px #20190033; }
.pz-pip { border-radius:50%; background:#282526; }
.pz-race { display:grid; gap:.6rem; }
.pz-race > div { display:grid; grid-template-columns:minmax(4.5rem,1fr) 2fr; align-items:center; gap:.75rem; font-weight:650; overflow-wrap:anywhere; }
.pz-race progress { width:100%; accent-color:#438977; }
.pz-scale { height:1.35rem; border-radius:.4rem; position:relative; overflow:hidden; background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 2px),var(--control-line) calc(10% - 2px) 10%),var(--bg); border:1px solid var(--control-line); }
.pz-scale > span { position:absolute; inset-block:0; background:repeating-linear-gradient(90deg,#438977 0 calc(10% - 1px),#80b39b calc(10% - 1px) 10%); border-inline:2px solid #224f44; }
[data-game=auctions] .gt-feature,[data-game=twentyfour] .gt-feature { justify-self:center; min-width:9rem; border:5px double #b88440; background:#fff3d7; color:#573717; box-shadow:2px 3px #c3ad86; }
:is([data-game=auctions],[data-game=twentyfour]) .gt-actions:has(>button:nth-child(3)) button { border-radius:5px; padding:.7rem; min-width:2.85rem; border-bottom-width:4px; }
[data-game=shutbox] .gt-actions:has(>button:nth-child(9)) { background:#554134; padding:.65rem; border-radius:8px; }
[data-game=shutbox] .gt-actions:has(>button:nth-child(9)) button { background:linear-gradient(100deg,#ffe5ab,#d6af75); color:#48331e; border:0; border-top:5px double #8b6c46; border-radius:4px; min-width:2.75rem; }
[data-game=shutbox] .gt-actions:has(>button:nth-child(9)) .gt-primary { box-shadow:inset 0 0 0 3px #16735e; }
[data-game=shutbox] .gt-actions:has(>button:nth-child(9)) :disabled { text-decoration:line-through; background:#685b4d; color:#eee1c8; opacity:1; }
.pz-digits { display:flex; justify-content:center; gap:.45rem; padding:1.25rem; border:4px double #c4ba80; border-radius:.6rem; background:#173b30; }
.pz-digits b { display:grid; place-items:center; width:2.75rem; height:3.5rem; font:700 2.4rem monospace; background:#14241f; color:#ffe19a; border:1px solid #758079; }
[data-game=solitaire] .pz-tableau { background:#174d40; padding:clamp(.45rem,2vw,1rem); border-radius:10px; gap:.4rem; }
[data-game=solitaire] .pz-tableau .gt-actions { gap:.35rem; padding:.4rem; border-bottom:1px solid #ffffff36; }
.pz-tableau strong { color:#fff4d6; }
.pz-back { color:white; padding:.5rem; border-radius:4px; font-size:.75rem; background:repeating-linear-gradient(45deg,#334d73 0 3px,#48648b 3px 5px); border:2px solid #ede4d4; }
[data-game=solitaire] .pz-tableau button[data-suit] { min-width:2.8rem; min-height:3.4rem; border-radius:5px; background:#fff8e9; color:#222933; border:2px solid #e5d5b8; box-shadow:0 2px 2px #102d26; padding:.2rem .4rem; font:700 1.12rem Georgia,serif; }
[data-game=solitaire] .pz-tableau button[data-red=true] { color:#a32c41; }
[data-game=solitaire] .pz-tableau button[data-suit].gt-primary { border-color:#eaa33b; background:#fff1b8; transform:translateY(-2px); }
[data-game=solitaire] .pz-foundations button { border:2px dashed var(--control-line); }
.pz-tableau .gt-actions button:last-child { margin-left:auto; }
.pz-pieces button { display:inline-flex; align-items:center; gap:.4rem; }
.pz-pieces svg { width:1.8rem; height:1.8rem; }
[data-game=tangram] .gt-diagram,[data-game=euler] .gt-diagram { border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.table-game .stone-winner { box-shadow:inset 0 0 0 3px #ffcc45; }

.table-game:is([data-game=dots],[data-game=loop]) .gt-board { gap:0; padding:.9rem; background:#f7f1df; border:2px solid #bca77e; border-radius:12px; }
.table-game:is([data-game=dots],[data-game=loop]) .gt-board > button:is(:enabled,:hover) { background:transparent; border-radius:0; color:#4b4338; }
.table-game:is([data-game=dots],[data-game=loop]) .gt-board [data-part=dot] { font-size:0; }
:is([data-game=dots],[data-game=loop]) [data-part=dot]::before { content:""; width:25%; aspect-ratio:1; border-radius:50%; background:#493c31; }
.table-game:is([data-game=dots],[data-game=loop]) .gt-board :is([data-part=horizontal],[data-part=vertical]) { font-size:0; --edge:#4b827e; }
:is([data-game=dots],[data-game=loop]) :is([data-part=horizontal],[data-part=vertical])::before { content:""; position:absolute; background:var(--edge); border-radius:6px; }
:is([data-game=dots],[data-game=loop]) [data-part=horizontal]::before { height:12%; width:175%; }
:is([data-game=dots],[data-game=loop]) [data-part=vertical]::before { width:12%; height:175%; }
.table-game:is([data-game=dots],[data-game=loop]) .gt-board [data-owner="0"]::before { --edge:#b8ac94; opacity:.65; scale:.7; }
.table-game[data-game=dots] .gt-board [data-owner="2"]::before { --edge:#ae5337; }
.table-game[data-game=dots] .gt-board [data-part=box][data-owner="1"] { background:#cee4d7; }
.table-game[data-game=dots] .gt-board [data-part=box][data-owner="2"] { background:#f4d4bb; }

.table-game[data-game=sudoku] .gt-board { background:#6c6559; gap:1px; border:3px solid #665a4f; border-radius:5px; padding:0; }
.table-game[data-game=sudoku] .gt-board button { border-radius:0; font-variant-numeric:tabular-nums; }
.table-game[data-game=sudoku] .gt-board [data-fixed=true] { color:var(--ink); background:var(--bg); }
.table-game[data-game=sudoku] .gt-board [data-peer=true]:not(.gt-mark) { background:color-mix(in srgb,var(--accent) 13%,var(--paper)); }
.table-game[data-game=nonogram] .gt-board { gap:1px; border:4px solid #697766; padding:0; border-radius:4px; }
.table-game[data-game=nonogram] .gt-board [data-clue] { background:#d7dfc8; color:#28372a; font-size:clamp(.68rem,2.2vw,1rem); }
.table-game[data-game=nonogram] .gt-board button:not([data-clue]) { border-radius:0; }
.table-game[data-game=nonogram] .gt-board button.gt-solid { background:#234c3c; color:#234c3c; }
.table-game[data-game=mines] .gt-board { background:#92998a; border:4px solid #798377; border-radius:.45rem; gap:1px; }
.table-game[data-game=mines] .gt-board [data-opened=false].gt-tint { color:#475748; background:linear-gradient(145deg,#e5e7d7,#aab5a2); border:2px outset #e5e9d8; }
.table-game[data-game=mines] .gt-board [data-flag=true].gt-tint { color:#8c2635; }
.table-game[data-game=mines] .gt-board [data-opened=true] { background:#dde1d3; color:#1c568b; }
.table-game[data-game=mines] .gt-board [data-count="2"] { color:#2c6a38; }
.table-game[data-game=mines] .gt-board :is([data-count="3"],[data-count="4"]) { color:#943923; }
.table-game[data-game=sliding] .gt-board { background:#4e3829; border:8px solid #7e5940; border-radius:14px; padding:5px; gap:5px; }
.table-game[data-game=sliding] .gt-board .gt-tint { font:700 clamp(1.5rem,8vw,3rem) Georgia,serif; color:#4a301e; background:linear-gradient(120deg,#f8e0b6,#d7ad78); border-radius:8px; box-shadow:inset 0 -5px #b88a57; }
.table-game[data-game=sliding] .gt-board .gt-faint { background:#503d30; box-shadow:inset 2px 3px 4px #31251f; }
.table-game[data-game=sliding] .gt-board [data-movable=true] { outline:2px solid #f9efcd; outline-offset:-6px; }
.table-game[data-game=tiles] .gt-board { background:#887465; padding:7px; gap:6px; border-radius:12px; }
.table-game[data-game=tiles] .gt-board [data-power] { border-radius:8px; color:#422c1e; background:#d4c4b3; font-size:clamp(1rem,6vw,2.5rem); }
.table-game[data-game=tiles] .gt-board [data-power="1"] { background:#f9ecda; }
.table-game[data-game=tiles] .gt-board [data-power="2"] { background:#f3d5a3; }
.table-game[data-game=tiles] .gt-board [data-power="3"] { background:#eead74; }
.table-game[data-game=tiles] .gt-board [data-power="4"] { background:#e99668; }
.table-game[data-game=tiles] .gt-board [data-power="5"] { background:#dc7159; }
.table-game[data-game=tiles] .gt-board [data-power="6"] { background:#9d4139; color:#fff; }
.table-game[data-game=tiles] .gt-board [data-power="7"] { background:#805d20; color:#fff; }
.table-game[data-game=ships] .gt-board { background:#4c8597; border:5px solid #326476; gap:1px; padding:0; }
.table-game[data-game=ships] .gt-board .gt-faint { background:repeating-linear-gradient(166deg,#cee7e7 0 12px,#c6e2e2 13px 14px); color:#346a79; }
.table-game[data-game=ships] .gt-board .gt-solid { background:#3a5669; color:#d6e0dd; }
.table-game[data-game=ships] .gt-board .gt-mark { background:#f5bf73; color:#702d20; }
.table-game[data-game=sokoban] .gt-board { background:#635342; gap:1px; border:4px solid #665744; }
.table-game[data-game=sokoban] .gt-board [data-object] { background:#e0cda7; color:#8e7e5c; }
.table-game[data-game=sokoban] .gt-board [data-object=wall] { background:repeating-linear-gradient(0deg,transparent 0 43%,#5d5b50 44% 49%,transparent 50%),repeating-linear-gradient(90deg,#858378 0 45%,#69695e 45% 49%,#918e80 50%); }
.table-game[data-game=sokoban] .gt-board :is([data-object=crate],[data-object=stored]) { color:#57331b; background:linear-gradient(44deg,transparent 42%,#80512d 43% 49%,transparent 50%),#c58e51; border:4px ridge #bc8d58; }
.table-game[data-game=sokoban] .gt-board [data-object=stored] { color:#fff; background:#398661; }
.table-game[data-game=sokoban] .gt-board [data-object=goal] { color:#a24329; background:#f8da9b; }
.table-game[data-game=sokoban] .gt-board [data-object=worker] { color:#123b53; background:radial-gradient(circle,#90d0da 43%,transparent 45%),#e0cda7; }
.table-game[data-game=ice] .gt-board { background:#87b4c5; border:5px solid #5e8698; gap:1px; }
.table-game[data-game=ice] .gt-board [data-ice] { background:linear-gradient(130deg,#c8ecef 44%,#e9ffff 45% 48%,#d7f0f2 49%); color:#7caaaf; }
.table-game[data-game=ice] .gt-board [data-ice=rock] { background:linear-gradient(140deg,#8eacb7,#4c6b7b); color:#587889; }
.table-game[data-game=ice] .gt-board [data-ice=exit] { background:radial-gradient(circle,#fff 15%,#b6e8dc 16% 38%,#218377 39% 43%,#c2e8df 44%); color:#255e56; }
.table-game[data-game=ice] .gt-board [data-ice=skater] { color:#a44428; background:radial-gradient(circle,#ffc394 0 35%,#e37b4d 36% 44%,#c8ecef 45%); }
.table-game[data-game=flood] .gt-board { gap:0; padding:5px; border-radius:7px; background:#233d39; }
.table-game[data-game=flood] .gt-board span { border-radius:0; opacity:.85; }
.table-game[data-game=flood] .gt-board [data-connected=true] { opacity:1; box-shadow:inset 0 0 0 2px #ffffffe0; }
[data-game=flood] .gt-actions button { border-radius:50%; min-width:3rem; }
.table-game[data-game=pipes] .gt-board,[data-game=mirror] .gt-board { gap:1px; background:#617777; border:5px solid #465f60; }
.table-game:is([data-game=pipes],[data-game=mirror]) .gt-board [data-ports] {
  --wire:#859190; --n:transparent; --e:transparent; --s:transparent; --w:transparent;
  background:linear-gradient(var(--n),var(--n)) center top/var(--thickness) 51% no-repeat,
    linear-gradient(var(--s),var(--s)) center bottom/var(--thickness) 51% no-repeat,
    linear-gradient(var(--e),var(--e)) right center/51% var(--thickness) no-repeat,
    linear-gradient(var(--w),var(--w)) left center/51% var(--thickness) no-repeat,var(--tile);
}
.table-game:is([data-game=pipes],[data-game=mirror]) .gt-board [data-ports~=n] { --n:var(--wire); }
.table-game:is([data-game=pipes],[data-game=mirror]) .gt-board [data-ports~=e] { --e:var(--wire); }
.table-game:is([data-game=pipes],[data-game=mirror]) .gt-board [data-ports~=s] { --s:var(--wire); }
.table-game:is([data-game=pipes],[data-game=mirror]) .gt-board [data-ports~=w] { --w:var(--wire); }
.table-game[data-game=pipes] .gt-board [data-ports] { --thickness:22%; --tile:#ede6cf; font-size:0; }
.table-game[data-game=pipes] .gt-board [data-water=true] { --wire:#177b91; --tile:#d7ede8; }
[data-game=pipes] [data-ports]::after { content:""; position:absolute; left:50%; top:50%; translate:-50% -50%; border-radius:50%; width:25%; height:25%; background:var(--wire); border:2px solid #354f4f; }
.table-game[data-game=pipes] .gt-board button:first-child::after { background:#b7ffff; }
.table-game[data-game=mirror] .gt-board [data-ports] { --wire:#ffcf69; --thickness:5%; --tile:#263347; color:#d5e4fa; border-radius:0; }
.table-game[data-game=mirror] .gt-board .gt-solid { font:700 clamp(1.5rem,7vw,3rem) monospace; }
.table-game[data-game=mirror] .gt-board [data-target]:not([data-target=""])::after { content:attr(data-target); position:absolute; right:2px; top:1px; color:#ffe38b; font-size:clamp(.65rem,2.5vw,.9rem); }
.table-game[data-game=lights] .gt-board { background:#75684b; border:4px solid #554933; }
.table-game[data-game=lights] .gt-board .gt-solid { background:#3a3c3c; color:white; }
.table-game[data-game=lights] .gt-board .gt-tint { background:#f8e5a6; color:#9a761a; }
.table-game[data-game=lights] .gt-board [data-lamp=true] { background:radial-gradient(circle,#fffbd7 16%,#ffdb72 35%,#dfac43 55%,#f5dfae 75%); color:#785318; }
.table-game[data-game=lights] .gt-board [data-clash=true] { color:#a12432; outline:3px solid #c04c49; outline-offset:-3px; }
.table-game[data-game=rectangles] .gt-board { gap:0; }
.table-game[data-game=rectangles] .gt-board [data-region] { border:1px solid var(--line); border-radius:0; }
.table-game[data-game=rectangles] .gt-board [data-region]:not([data-region="0"]) { color:#2c3535; }
.table-game[data-game=rectangles] .gt-board [data-region="1"] { background:#ecdcb7; }
.table-game[data-game=rectangles] .gt-board [data-region="2"] { background:#b9dcd0; }
.table-game[data-game=rectangles] .gt-board [data-region="3"] { background:#d6cce4; }
.table-game[data-game=rectangles] .gt-board [data-region="4"] { background:#f2cebf; }
.table-game[data-game=rectangles] .gt-board [data-region="5"] { background:#bdd5df; }
.table-game[data-game=rectangles] .gt-board [data-borders~=n] { border-top:3px solid #495958; }
.table-game[data-game=rectangles] .gt-board [data-borders~=s] { border-bottom:3px solid #495958; }
.table-game[data-game=rectangles] .gt-board [data-borders~=w] { border-left:3px solid #495958; }
.table-game[data-game=rectangles] .gt-board [data-borders~=e] { border-right:3px solid #495958; }
.table-game[data-game=bridges] .gt-board { border:4px solid #6d9aa3; gap:0; padding:5px; background:#c9e8e5; }
.table-game[data-game=bridges] .gt-board button { background:transparent; border-radius:0; color:#759ca3; }
.table-game[data-game=bridges] .gt-board [data-island] { border:2px solid #776744; background:#fde3af; color:#4d452c; border-radius:50%; }
.table-game[data-game=bridges] .gt-board [data-complete=true] { background:#b1d9b4; }
.table-game[data-game=bridges] .gt-board [data-island].gt-mark { background:#f7b15a; outline:2px solid #583e29; }
.table-game[data-game=bridges] .gt-board .gt-tint { color:#634f34; }
.table-game[data-game=crossword] .gt-board { border:4px double #7d796b; padding:3px; background:#7d796b; }
.table-game[data-game=crossword] .gt-board [data-clue]::before { content:attr(data-clue); position:absolute; left:4px; top:2px; font:600 .65rem sans-serif; }
.table-game[data-game=crossword] .gt-board .gt-solid { background:repeating-linear-gradient(45deg,#59594f 0 4px,#53534a 4px 5px); }
.table-game[data-game=wordsearch] .gt-board { background:#f1ecd8; border:4px double #9c957a; gap:1px; padding:.4rem; }
.table-game[data-game=wordsearch] .gt-board .gt-faint { color:#383e36; background:transparent; }
.table-game[data-game=wordsearch] .gt-board .gt-solid { background:#c6e1bf; color:#21482e; border-radius:40%; }
.table-game[data-game=crossmath] .gt-board { width:min(100%,23rem); gap:clamp(1.5rem,5vw,2.4rem); padding:.25rem clamp(2.8rem,9vw,3.6rem) 2rem .25rem; background:transparent; box-sizing:border-box; }
.table-game[data-game=crossmath] .gt-board button { border:1px solid var(--control-line); border-bottom-width:3px; }
.table-game[data-game=crossmath] .gt-board button::after,[data-game=crossmath] .gt-board button::before { position:absolute; color:var(--ink); font-size:clamp(.75rem,3vw,1rem); white-space:nowrap; pointer-events:none; }
.table-game[data-game=crossmath] .gt-board button::after { content:attr(data-right); left:calc(100% + .3rem); top:50%; translate:0 -50%; }
.table-game[data-game=crossmath] .gt-board button::before { content:attr(data-down); top:calc(100% + .3rem); left:50%; translate:-50% 0; }

@media (prefers-reduced-motion:no-preference) {
  .stone-reversi .stone-flipped::before { animation:pz-turn-stone .32s ease-out; }
  @keyframes pz-turn-stone { 0% { transform:rotateY(90deg); } 100% { transform:rotateY(0); } }
}
[data-game=twentyfour] .pz-operands button { display:grid; place-content:center; padding:.7rem .95rem; min-width:3.2rem; font:700 1.3rem Georgia,serif; }
.pz-operands small { font:500 .72rem sans-serif; }
[data-game=solitaire] .pz-tableau { grid-template-columns:repeat(var(--stacks),minmax(0,1fr)); align-items:start; }
[data-game=solitaire] .pz-tableau .gt-actions { display:grid; grid-template-columns:minmax(0,1fr); align-content:start; justify-items:stretch; padding:.2rem; border:0; gap:3px; }
.pz-tableau strong { justify-self:center; font-size:.8rem; }
.pz-tableau .pz-back { text-align:center; padding:.4rem .1rem; }
[data-game=solitaire] .pz-tableau button[data-suit] { min-width:0; min-height:2.75rem; }
[data-game=solitaire] .pz-tableau .gt-actions button:last-child { margin:0; min-width:0; font-size:.8rem; padding:.25rem; border:1px dashed #cbe1cc; background:#285d4e; color:white; }
@media (max-width:44rem) { [data-game=solitaire] .pz-tableau { grid-template-columns:repeat(4,minmax(0,1fr)); row-gap:1rem; } }

@media (hover:hover) { .table-game .gt-board button:not([aria-disabled=true]):hover { filter:brightness(.95); } }
