/* ---------- strategy games: point-and-line boards (bagh, aadu, sholo, morris, tinguti) and the pallanguzhi pit board ---------- */
.pb { position: relative; width: 100%; margin: 6px auto 12px; border-radius: 18px;
      background: radial-gradient(120% 90% at 30% 10%, #f9e8c2, #e7c58a 70%, #d8ae6c);
      box-shadow: 0 0 0 5px #1c1540, 0 0 0 6px #ffb6275e, 0 0 0 11px #120d2c, 0 24px 44px -8px #000d, inset 0 0 0 1px #0002; }
.pb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--noise); mix-blend-mode: multiply; opacity: .6; }
.pb-lines, .pb-lines svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb-lines polyline { fill: none; stroke: #6b4320; stroke-width: .045; stroke-linecap: round; stroke-linejoin: round; }
.pb-sholo { width: min(100%, calc(60vh * 5 / 9)); }
.pb-sholo .pb-lines polyline { stroke-width: .04; }
.pb-morris .pb-lines polyline { stroke-width: .06; }
.pb { --pt: 14%; }
.pb-sholo { --pt: 15%; }
.pb-morris { --pt: 11.5%; }
/* the mountain is 13 units wide, the 3×3 grid 3: strokes are in board units, points in % of the width */
.pb-aadu { --pt: 10.5%; }
.pb-aadu .pb-lines polyline { stroke-width: .13; }
.pb-aadu .pc.tiger, .pb-aadu .pc.goat { font-size: clamp(.9rem, 4.6vw, 1.35rem); }
.pb-tinguti { width: min(100%, 340px); --pt: 22%; }
.pb-tinguti .pb-lines polyline { stroke-width: .03; }

/* every point is a button: a small dot when empty, the piece when not */
.pb .pt { position: absolute; z-index: 1; width: var(--pt); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none;
          transform: translate(-50%, -50%); display: grid; place-items: center; }
.pb .pt::before { content: ''; position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #6b4320; }
.pb .pt:disabled { cursor: default; }
.pb .pt.last::before { width: 34%; background: #e5197a88; box-shadow: 0 0 0 3px #e5197a33; }
.pb .pt.to::after { content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 3px solid var(--teal); background: #14b8a62e;
                    animation: pb-aim 1s ease-in-out infinite; }
.pb .pt.take::after { border-color: var(--sindoor); background: #e2334a33; inset: 0; }
@keyframes pb-aim { 50% { transform: scale(1.12); } }

.pc { position: relative; z-index: 1; display: grid; place-items: center; width: 86%; aspect-ratio: 1; border-radius: 50%; line-height: 1;
      box-shadow: 0 3px 0 #0006, 0 4px 8px #0005; }
.pc.tiger { background: radial-gradient(circle at 35% 28%, #ffd58a, #e07a10 60%, #9b4a05); font-size: clamp(1rem, 6vw, 1.7rem); }
.pc.goat { background: radial-gradient(circle at 35% 28%, #ffffff, #efe5d0 60%, #c8b894); font-size: clamp(.9rem, 5.2vw, 1.45rem); }
.pc.bead { width: 74%; }
.pc.bead.red { background: radial-gradient(circle at 34% 28%, #fff9 0 12%, transparent 13%), radial-gradient(circle at 50% 55%, #ff5d6b, #e63946 55%, #8f1621); }
.pc.bead.blue { background: radial-gradient(circle at 34% 28%, #fff9 0 12%, transparent 13%), radial-gradient(circle at 50% 55%, #6aa8ff, #2f80ed 55%, #14447f); }
.pc.man { width: 92%; border: 2px solid #0003; }
.pc.man.light { background: radial-gradient(circle at 50% 50%, transparent 0 34%, #0001 35% 40%, transparent 41%), radial-gradient(circle at 35% 28%, #fffdf6, #f3e3c3 60%, #cbb48a); }
.pc.man.dark { background: radial-gradient(circle at 50% 50%, transparent 0 34%, #fff1 35% 40%, transparent 41%), radial-gradient(circle at 35% 28%, #5a5378, #2a2440 60%, #120f22); }
.pb .pt.can .pc { box-shadow: 0 0 0 3px #ffffffcc, 0 3px 0 #0006, 0 4px 10px #0005; }
.pb .pt.sel .pc { transform: scale(1.12); box-shadow: 0 0 0 3px var(--marigold), 0 0 18px #ffb627cc, 0 3px 0 #0006; }
.pb .pt.take .pc { animation: pb-shake .6s ease-in-out infinite; }
@keyframes pb-shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.pc.gone { position: absolute; z-index: 2; animation: pb-gone .9s ease-in forwards; }
@keyframes pb-gone { 30% { transform: scale(1.15); opacity: 1; } to { transform: scale(.2); opacity: 0; } }
.pc.drop { animation: pb-drop .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pb-drop { from { transform: translateY(-14px) scale(1.4); opacity: 0; } }

.sg-role { margin: -4px 0 4px; color: var(--muted); font: 700 .88rem var(--display); }
.sg-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 8px; }
.sg-stats span { padding: 4px 12px 2px; border-radius: 99px; background: #ffffff0d; border: 1px solid var(--hair); font: 700 .85rem var(--display); color: var(--muted); }
.sg-stats b { color: var(--paper); font-variant-numeric: tabular-nums; }
.sg-quiet { margin: 0 0 8px; text-align: center; font: 700 .82rem var(--display); color: var(--marigold); }
.sg-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sg-hand { display: grid; gap: 4px; min-width: 0; padding: 8px 10px; border-radius: 14px; background: #ffffff0a; border: 1px solid var(--hair); }
.sg-hand.me { border-color: #ffb62755; }
.sg-hand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 .68rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sg-hand span { display: flex; flex-wrap: wrap; gap: 3px; min-height: 16px; }
.sg-hand .pc { width: 15px; border-width: 1px; box-shadow: 0 1px 0 #0006; }

/* ---------- pallanguzhi ---------- */
.pz-board { position: relative; display: grid; gap: 6px; margin: 8px 0; padding: 12px 8px; border-radius: 26px;
            background: repeating-linear-gradient(92deg, #ffffff08 0 3px, transparent 3px 11px), linear-gradient(160deg, #a2622a, #6e3d16 60%, #4d2a0e);
            box-shadow: inset 0 2px 0 #ffffff33, inset 0 -4px 0 #0004, 0 0 0 4px #2a1606, 0 22px 40px -10px #000d; }
.pz-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.pz-mid { display: flex; justify-content: space-between; padding: 0 8px; font: 700 .7rem var(--display); color: #f1e2bc88; }
.pz-pit { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; color: var(--paper);
          background: radial-gradient(circle at 50% 40%, #3a1f08, #26140a 70%); box-shadow: inset 0 4px 8px #000b, 0 1px 0 #ffffff26; }
.pz-pit b { position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); min-width: 20px; padding: 1px 5px 0; border-radius: 99px;
            background: #1a0e04e6; font: 800 .72rem/1.3 var(--display); font-variant-numeric: tabular-nums; }
.pz-seeds i { position: absolute; width: 18%; aspect-ratio: 1; margin: -9% 0 0 -9%; border-radius: 50%;
              background: radial-gradient(circle at 35% 30%, #fff8e8, #e9d5a6 60%, #b99a5b); box-shadow: 0 1px 1px #0008; }
button.pz-pit.can { box-shadow: inset 0 4px 8px #000b, 0 0 0 2px var(--marigold), 0 0 14px #ffb62788; }
button.pz-pit.can:active { transform: scale(.94); }
.pz-pit.last { box-shadow: inset 0 4px 8px #000b, 0 0 0 2px #e5197a; }
.pz-pit.hot { animation: pz-hot .3s ease-out; }
.pz-pit.pasu, .pz-pit.cap { animation: pz-take .7s ease-out; }
@keyframes pz-hot { from { box-shadow: inset 0 4px 8px #000b, 0 0 0 3px var(--paper), 0 0 16px #fff5df; } }
@keyframes pz-take { from { box-shadow: inset 0 4px 8px #000b, 0 0 0 4px var(--marigold), 0 0 26px var(--marigold); } }
.pz-store { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0; padding: 8px 14px; border-radius: 14px;
            background: #ffffff0a; border: 1px solid var(--hair); }
.pz-store.me { border-color: #ffb62766; }
.pz-store small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 .74rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pz-store b { font: 800 1.35rem/1 var(--display); color: var(--marigold); font-variant-numeric: tabular-nums; }
.pz-hand { min-height: 1.4em; text-align: center; font: 700 .9rem var(--display); color: var(--marigold); }

/* ---------- tile art ---------- */
.sg-mini { position: relative; display: block; width: 62px; aspect-ratio: 1; border-radius: 12px; transform: rotate(-6deg); box-shadow: 0 0 0 3px var(--paper), 0 6px 12px 3px #0006; }
.sg-mini.wood { background: radial-gradient(120% 90% at 30% 10%, #f9e8c2, #e2bd7e); }
.sg-mini.pz { background: linear-gradient(160deg, #a2622a, #5a3010); }
.sg-mini.flat { position: absolute; inset: 0; transform: none; box-shadow: none; }
.sg-mini svg { width: 100%; height: 100%; display: block; }
.sg-mini i { position: absolute; font-style: normal; font-size: 1.25rem; line-height: 1; filter: drop-shadow(0 2px 2px #0006); }
.sg-mini .m1 { left: -6px; top: -6px; }
.sg-mini .m2 { right: -6px; bottom: -6px; }

/* tic tac toe: the wood board, its grid lines showing between the squares */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(100%, 330px); aspect-ratio: 1; margin: 10px auto 18px; padding: 6px;
       border-radius: 18px; background: #6b4320; box-shadow: 0 0 0 5px #1c1540, 0 0 0 6px #ffb6275e, 0 0 0 11px #120d2c, 0 24px 44px -8px #000d; }
.ttt-sq { display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
          background: radial-gradient(120% 90% at 30% 10%, #f9e8c2, #e7c58a 70%, #d8ae6c); font: 800 clamp(2.6rem, 17vw, 4.2rem)/1 var(--display); }
.ttt-sq:disabled { cursor: default; }
.ttt-sq:not(:disabled):hover { filter: brightness(1.06); }
.ttt-sq:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.ttt-sq.mX { color: #e63946; } .ttt-sq.mO { color: #2f80ed; }
.ttt-sq.win { background: #ffd58a; box-shadow: inset 0 0 0 4px var(--marigold); }
.ttt-sq.drop { animation: pb-drop .35s cubic-bezier(.3, 1.6, .5, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .pb .pt.to::after, .pb .pt.take .pc, .pc.gone, .pc.drop, .ttt-sq.drop, .pz-pit.hot, .pz-pit.pasu, .pz-pit.cap { animation: none !important; }
  .pc.gone { display: none; }
}
