/* Shared palette, geometric pieces and square touch targets; no font glyph pieces. */
.cover-hex{background:#dad0ee}.cover-kalah{background:#f0d5a3}.cover-mills{background:#cbdcbd}.cover-maze{background:#bddbd9}
.four-wrap{width:100%;margin:auto;display:flex;flex-direction:column;align-items:center;gap:10px;--four-purple:#7756a1;--four-green:#4f7039;color:#2e3d31}
.four-wrap .owner-0{--piece:#7756a1;--piece-light:#ebe3f3;color:#7756a1}.four-wrap .owner-1{--piece:#4f7039;--piece-light:#e2edcc;color:#4f7039}
.four-key{display:flex;justify-content:space-between;gap:12px;width:100%;font-size:12px;line-height:1.4}.four-key>span{min-width:0;overflow-wrap:anywhere}.four-key b{display:block;font-size:11px;font-weight:500}
.four-wrap button{touch-action:manipulation;-webkit-tap-highlight-color:transparent;appearance:none;-webkit-appearance:none;font:inherit;cursor:pointer}.four-wrap button:disabled{cursor:default;opacity:1}.four-wrap button:focus-visible{outline:3px solid #d19d38;outline-offset:2px;z-index:5}
.four-wrap .strategy-actions{margin:0;gap:12px}.four-controls{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center}.four-wrap .strategy-actions .text-button{margin:0}.four-wrap .button.small{min-height:36px;padding:7px 13px;font-size:12px}
.hex-wrap{max-width:520px}.hex-frame{position:relative;width:100%;padding:6% 0}.hex-board{width:100%;padding-left:1%;padding-right:29%;box-sizing:border-box}.hex-row{display:flex;width:100%;margin-top:-1.8%;gap:1%}.hex-row:first-child{margin-top:0}.hex-row:nth-child(2){transform:translateX(5.55%)}.hex-row:nth-child(3){transform:translateX(11.1%)}.hex-row:nth-child(4){transform:translateX(16.65%)}.hex-row:nth-child(5){transform:translateX(22.2%)}.hex-row:nth-child(6){transform:translateX(27.75%)}.hex-row:nth-child(7){transform:translateX(33.3%)}.hex-row:nth-child(8){transform:translateX(38.85%)}.hex-row:nth-child(9){transform:translateX(44.4%)}
.hex-cell{position:relative;flex:1 1 0;min-width:0;aspect-ratio:1.12;display:grid;place-items:center;padding:0;border:0;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);background:#d9dfce;line-height:1;color:white}.hex-cell.empty:hover{background:#c2ceac}.hex-cell.owner-0,.hex-cell.owner-1{background:var(--piece);color:white}.hex-cell.winning{box-shadow:inset 0 0 0 4px #f7d879;background:color-mix(in srgb,var(--piece) 75%,#f7d879)}.hex-cell span{font-size:18px;line-height:1}.hex-edge{position:absolute;display:block;background:var(--piece);border-radius:10px;opacity:.65;pointer-events:none}.hex-top{top:2%;left:3%;width:65%;height:3px}.hex-bottom{bottom:2%;right:2%;width:65%;height:3px}.hex-left{left:14%;top:10%;height:80%;width:3px;transform:rotate(-27deg)}.hex-right{right:14%;top:10%;height:80%;width:3px;transform:rotate(-27deg)}
.kalah-wrap{max-width:760px}.kalah-direction{font-size:12px;align-self:flex-start}.kalah-direction:last-of-type{align-self:flex-end}.kalah-board{width:100%;display:grid;grid-template-columns:minmax(38px,.8fr) minmax(0,6fr) minmax(38px,.8fr);grid-template-rows:1fr 1fr;gap:12px 8px;background:#e6dac5;border:1px solid #c7b99e;border-radius:28px;padding:18px 10px}.kalah-store{grid-row:1/3;grid-column:1;background:var(--piece-light);border:1px solid var(--piece);border-radius:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:0;padding:8px 4px;gap:6px}.kalah-store.owner-0{grid-column:3}.kalah-store span{font-size:10px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kalah-store strong{font-size:30px;line-height:1}.kalah-store small{font-size:8px;letter-spacing:.06em}.kalah-row{grid-column:2;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}.kalah-top{grid-row:1}.kalah-bottom{grid-row:2}.kalah-pit{position:relative;min-width:0;width:100%;aspect-ratio:1;display:grid;place-items:center;border-radius:50%;border:1px solid #b5a78b;background:#d5c6a9;padding:0}.kalah-pit:enabled{background:var(--piece-light);border:2px solid var(--piece);box-shadow:0 0 0 2px #f8f6ed}.kalah-pit b{position:relative;font-size:clamp(15px,3vw,25px);line-height:1;color:#2e3d31;z-index:1;text-shadow:0 1px 3px #fff;background:#fff9;border-radius:20px;padding:2px 4px}.kalah-pit.last{outline:2px solid #c58f35;outline-offset:2px}.pit-stones{position:absolute;inset:6%;display:grid;grid-template-columns:repeat(3,1fr);gap:1px;align-content:center;justify-items:center;pointer-events:none}.seed{width:70%;aspect-ratio:1;border-radius:45% 60% 40% 55%;background:#bc8549;border:1px solid #9e703f}.seed:nth-child(3n){background:#f3ddab}.seed:nth-child(3n+1){background:#8e728d}
.mills-wrap{max-width:500px}.mills-board{position:relative;aspect-ratio:1;width:100%;background:#eeeadd;border:1px solid #c9ccb6;border-radius:22px}.mills-board>svg{position:absolute;width:100%;height:100%;inset:0;stroke:#a2ad91;stroke-width:.035;fill:none}.mills-point{position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);width:10%;aspect-ratio:1;border-radius:50%;border:0;background:transparent;display:grid;place-items:center;padding:0}.mills-point.empty:before{content:'';width:24%;height:24%;border-radius:50%;background:#9ca68d}.mills-point.empty.legal:before{width:38%;height:38%;background:#a5ba7b;box-shadow:0 0 0 5px #dfe8cb}.four-piece{display:block;width:84%;height:84%;border:2px solid #fff8;border-radius:50%;background:var(--piece);box-shadow:0 2px 3px #263c2026}.mills-point.selected{outline:3px solid #d3aa51;outline-offset:-1px}.mills-point.capture .four-piece{outline:3px dashed #bd765e;outline-offset:2px}
.maze-wrap{max-width:500px}.maze-board{position:relative;display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;aspect-ratio:1;width:100%;padding:0;background:#c9d3bb;border:1px solid #b4c2a1;border-radius:12px;--pitch:calc((100% + 4px)/9);overflow:visible}.maze-cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;aspect-ratio:1;border:0;border-radius:5px;background:#e9eddf;padding:0}.maze-cell.goal-0{box-shadow:inset 0 3px #7756a18c}.maze-cell.goal-1{box-shadow:inset 0 -3px #4f70398c}.maze-cell.legal:after{content:'';width:20%;height:20%;border-radius:50%;background:#91a26b;opacity:.7}.maze-cell.selected{outline:2px solid #d09e35;outline-offset:-2px;background:#f0e5c9}.maze-pawn{width:62%;height:62%;border-radius:45% 45% 35% 35%;background:var(--piece);border:2px solid #fff9;box-shadow:0 2px 3px #253b2026}.maze-wall{position:absolute;pointer-events:none;display:block;z-index:3;background:var(--piece,#a7763e);border:1px solid #fff9;border-radius:4px}.maze-wall.wall-h{height:7px;width:calc(var(--pitch)*2 - 3px);left:calc(var(--pitch)*var(--c) - 1px);top:calc(var(--pitch)*(var(--r) + 1) - 6px)}.maze-wall.wall-v{width:7px;height:calc(var(--pitch)*2 - 3px);top:calc(var(--pitch)*var(--r) - 1px);left:calc(var(--pitch)*(var(--c) + 1) - 6px)}.maze-wall.wall-preview{background:#daaa43;border:2px dashed #8f5e18;box-shadow:0 0 0 2px #ffe9a5;z-index:4}.maze-tools{display:flex;gap:6px;width:100%;justify-content:center}.four-mode{border:1px solid #c1ccb2;padding:7px 10px;border-radius:10px;background:#f7f7f0;font-size:12px!important;min-height:36px;color:#4b6240}.four-mode.selected{border-color:#718747;background:#dce8c3}.four-mode:disabled{color:#9ea797}.wall-confirm{display:flex;align-items:center;gap:10px;width:100%;font-size:11px;line-height:1.3;min-height:38px}.wall-confirm>span{flex:1}.wall-confirm>.button{flex-shrink:0}
.is-playing .four-wrap{gap:7px}.is-playing .hex-wrap{width:min(100%,calc(var(--available-play-height,65dvh)*1.15));max-width:620px}.is-playing .mills-wrap{width:min(100%,calc(var(--available-play-height,65dvh) - 70px))}.is-playing .maze-wrap{width:min(100%,calc(var(--available-play-height,65dvh) - 120px))}.is-playing .kalah-wrap{width:min(100%,calc(var(--available-play-height,65dvh)*2.5));max-width:850px}.is-playing .four-wrap .strategy-actions{min-height:25px}.is-playing .four-wrap .text-button{font-size:11px}.is-playing .four-wrap .strategy-actions .button{min-height:28px;padding:4px 10px}.is-playing .four-key{font-size:11px}.is-playing .four-key b{font-size:10px}
@media(max-width:420px){.kalah-board{gap:10px 4px;padding:12px 5px;border-radius:18px;grid-template-columns:32px minmax(0,1fr) 32px}.kalah-row{gap:3px}.kalah-store{padding:5px 1px}.kalah-store span{font-size:8px}.kalah-store strong{font-size:24px}.kalah-store small{font-size:6px}.kalah-pit b{font-size:14px;padding:1px 2px}.four-key{font-size:11px}}
@media(max-height:500px) and (min-width:550px){.is-playing .four-wrap{gap:4px}.is-playing .four-key{font-size:10px}.is-playing .four-key b{display:inline;font-size:9px;margin-left:4px}.is-playing .maze-wrap{width:min(100%,calc(var(--available-play-height,70dvh) - 94px))}.is-playing .mills-wrap{width:min(100%,calc(var(--available-play-height,70dvh) - 48px))}.is-playing .hex-wrap{width:min(100%,calc(var(--available-play-height,70dvh)*1.12))}.is-playing .four-mode{min-height:26px;padding:3px 7px;font-size:10px!important}.is-playing .maze-tools{gap:4px}.is-playing .wall-confirm{position:absolute;bottom:4px;right:4px;max-width:210px;padding:7px;border:1px solid #c4cdb6;border-radius:10px;background:#f6f5ef;z-index:5}.is-playing .wall-confirm>span{font-size:9px}.is-playing .four-wrap .strategy-actions{min-height:23px}.is-playing .kalah-board{padding:10px;gap:8px}.is-playing .kalah-pit{max-height:90px;aspect-ratio:1.1}.is-playing .kalah-direction{font-size:10px}.is-playing .kalah-store strong{font-size:25px}}

/* Point-up hexagons tile edge-to-edge; reserve the full half-row offset. */
.four-piece{position:absolute;left:8%;top:8%;width:84%;height:auto;aspect-ratio:1}
.maze-pawn{position:absolute;left:19%;top:19%;width:62%;height:auto;aspect-ratio:1}
.is-playing .maze-wrap{width:min(100%,calc(var(--available-play-height,65dvh) - 150px))}
@media(max-height:500px) and (min-width:550px){.is-playing .maze-wrap{width:min(100%,calc(var(--available-play-height,70dvh) - 104px))}}
.hex-board{padding-right:32%;padding-left:1%}
.hex-row{margin-top:-3.1%;gap:1%}
.hex-cell{aspect-ratio:.866;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%)}
/* Generated board positions. */
.mills-point[data-four-at="0"]{--x:7.142857142857142%;--y:7.142857142857142%}
.mills-point[data-four-at="1"]{--x:50%;--y:7.142857142857142%}
.mills-point[data-four-at="2"]{--x:92.85714285714286%;--y:7.142857142857142%}
.mills-point[data-four-at="3"]{--x:92.85714285714286%;--y:50%}
.mills-point[data-four-at="4"]{--x:92.85714285714286%;--y:92.85714285714286%}
.mills-point[data-four-at="5"]{--x:50%;--y:92.85714285714286%}
.mills-point[data-four-at="6"]{--x:7.142857142857142%;--y:92.85714285714286%}
.mills-point[data-four-at="7"]{--x:7.142857142857142%;--y:50%}
.mills-point[data-four-at="8"]{--x:21.428571428571427%;--y:21.428571428571427%}
.mills-point[data-four-at="9"]{--x:50%;--y:21.428571428571427%}
.mills-point[data-four-at="10"]{--x:78.57142857142857%;--y:21.428571428571427%}
.mills-point[data-four-at="11"]{--x:78.57142857142857%;--y:50%}
.mills-point[data-four-at="12"]{--x:78.57142857142857%;--y:78.57142857142857%}
.mills-point[data-four-at="13"]{--x:50%;--y:78.57142857142857%}
.mills-point[data-four-at="14"]{--x:21.428571428571427%;--y:78.57142857142857%}
.mills-point[data-four-at="15"]{--x:21.428571428571427%;--y:50%}
.mills-point[data-four-at="16"]{--x:35.714285714285715%;--y:35.714285714285715%}
.mills-point[data-four-at="17"]{--x:50%;--y:35.714285714285715%}
.mills-point[data-four-at="18"]{--x:64.28571428571429%;--y:35.714285714285715%}
.mills-point[data-four-at="19"]{--x:64.28571428571429%;--y:50%}
.mills-point[data-four-at="20"]{--x:64.28571428571429%;--y:64.28571428571429%}
.mills-point[data-four-at="21"]{--x:50%;--y:64.28571428571429%}
.mills-point[data-four-at="22"]{--x:35.714285714285715%;--y:64.28571428571429%}
.mills-point[data-four-at="23"]{--x:35.714285714285715%;--y:50%}
.maze-wall[data-r="0"]{--r:0}.maze-wall[data-c="0"]{--c:0}
.maze-wall[data-r="1"]{--r:1}.maze-wall[data-c="1"]{--c:1}
.maze-wall[data-r="2"]{--r:2}.maze-wall[data-c="2"]{--c:2}
.maze-wall[data-r="3"]{--r:3}.maze-wall[data-c="3"]{--c:3}
.maze-wall[data-r="4"]{--r:4}.maze-wall[data-c="4"]{--c:4}
.maze-wall[data-r="5"]{--r:5}.maze-wall[data-c="5"]{--c:5}
.maze-wall[data-r="6"]{--r:6}.maze-wall[data-c="6"]{--c:6}
.maze-wall[data-r="7"]{--r:7}.maze-wall[data-c="7"]{--c:7}
