/* ---------- cowrie race boards (pachisi, ashta chamma) ---------- */
.rc-board { position: relative; display: grid; grid-template: repeat(var(--n), 1fr) / repeat(var(--n), 1fr); aspect-ratio: 1; width: 100%; margin: 6px 0 12px; }
.rc-sq { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 1px; min-width: 0; }
.rc-sq.castle::before { content: ''; position: absolute; inset: 14%; pointer-events: none; opacity: .55;
                        background: linear-gradient(45deg, transparent 45%, var(--x, #7a1530) 45% 55%, transparent 55%),
                                    linear-gradient(-45deg, transparent 45%, var(--x, #7a1530) 45% 55%, transparent 55%); }
.rc-board .tok { flex: none; }

/* pachisi: a cloth cross on a deep maroon ground */
.rc-pachisi { gap: 1px; padding: 5px; border-radius: 18px; background: radial-gradient(circle at 50% 50%, #8f1d3a, #4d0b1d 75%), #5d0f24;
              box-shadow: 0 0 0 4px #1c1540, 0 0 0 5px #ffb6275e, 0 0 0 10px #120d2c, 0 24px 44px -8px #000d; }
.rc-pachisi::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--noise); mix-blend-mode: overlay; }
.rc-pachisi .rc-sq { border-radius: 2px; background: #fff1d6; box-shadow: inset 0 0 0 .5px #4d0b1d33; }
.rc-pachisi .rc-sq.lane { background: color-mix(in srgb, var(--c) 34%, #fff1d6); }
.rc-pachisi .rc-sq.spot, .rc-pachisi .rc-sq.homeslot { background: none; box-shadow: none; }
.rc-pachisi .rc-sq.spot::after { content: ''; position: absolute; inset: 12%; border-radius: 50%; background: var(--c); opacity: .22; box-shadow: inset 0 2px 3px #0006; z-index: -1; }
.rc-yard { margin: 9%; border-radius: 16px; background: linear-gradient(150deg, var(--c), var(--c2)); box-shadow: inset 0 0 0 4px #ffffff40, 0 6px 14px #0007; }
.rc-yard.unused { filter: grayscale(.85) brightness(.55); }
.rc-centre { border-radius: 4px; background: radial-gradient(circle, #ffe28a 0 22%, transparent 23%), repeating-conic-gradient(#ffb627 0 22.5deg, #e08a00 22.5deg 45deg);
             box-shadow: inset 0 0 0 2px #fff1d6, 0 0 12px #ffb62766; }
.rc-pachisi .tok { width: 86%; border-width: 1.5px; font-size: .42rem; }
.rc-pachisi .rc-sq:has(.tok + .tok) .tok { width: 50%; border-width: 1px; font-size: 0; }
.rc-pachisi .rc-sq.spot .tok { width: 62%; font-size: .55rem; }

/* ashta chamma: a chalk square on a terracotta floor */
.rc-ashta { gap: 4px; padding: 8px; border-radius: 18px; background: linear-gradient(150deg, #b5653a, #7a3a1a);
            box-shadow: 0 0 0 4px #1c1540, 0 0 0 5px #ffb6275e, 0 0 0 10px #120d2c, 0 24px 44px -8px #000d; }
.rc-ashta::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--noise); mix-blend-mode: overlay; }
.rc-ashta .rc-sq { --x: #fff5df; border-radius: 6px; background: #d79a69; box-shadow: inset 0 0 0 2px #fff5dfaa, inset 0 2px 8px #0003; }
.rc-ashta .rc-sq.inner { background: #c5845a; }
.rc-ashta .rc-sq.start { background: color-mix(in srgb, var(--c) 45%, #d79a69); }
.rc-ashta .rc-sq.centre { background: radial-gradient(circle, #ffe28a, #e0a040); }
.rc-ashta .rc-sq.castle::before { inset: 8%; opacity: .7; }
.rc-ashta .tok { width: 40%; font-size: .66rem; }
.rc-ashta .rc-sq:has(.tok:nth-child(5)) .tok { width: 28%; font-size: 0; border-width: 1px; }

.rc-ctl { gap: 12px; }
.rc-cws { display: inline-flex; align-items: center; gap: 5px; min-height: 58px; padding: 8px 14px; border-radius: 99px; background: #070a22;
          box-shadow: inset 0 4px 12px #000c, inset 0 0 0 1px var(--hair); }
.rc-cws.idle { opacity: .55; }
.rc-cw { position: relative; flex: none; width: 19px; height: 27px; border-radius: 50%; transform: rotate(var(--r));
         background: radial-gradient(circle at 34% 28%, #fffdf4, #ecd9b0 55%, #b4935c); box-shadow: 0 2px 0 #0007, inset 0 -2px 3px #0003; }
.rc-cw:not(.up)::after { content: ''; position: absolute; inset: 22% 26%; border-radius: 50%; background: radial-gradient(circle, #a6763c55 0 30%, transparent 32%) 0 0 / 5px 5px; }
.rc-cw.up { background: radial-gradient(circle at 50% 50%, #fffaf0, #e3cc9c 70%, #a8864f); }
.rc-cw.up::after { content: ''; position: absolute; left: 50%; top: 14%; bottom: 14%; width: 5px; margin-left: -2.5px; border-radius: 3px;
                   background: linear-gradient(90deg, transparent 1px, #2b1d0b 1px 4px, transparent 4px), repeating-linear-gradient(#fffdf4 0 1.5px, #8f6c38 1.5px 3px); }
.rc-cws.fresh .rc-cw { animation: rc-toss .55s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes rc-toss { from { transform: translateY(-26px) rotate(calc(var(--r) + 300deg)) scale(.6); opacity: 0 } }
.rc-val { display: grid; justify-items: center; margin-left: 6px; line-height: 1; }
.rc-val b { font: 800 1.7rem/1 var(--display); color: var(--marigold); font-variant-numeric: tabular-nums; }
.rc-val small { font: 800 .66rem var(--display); color: var(--paper); letter-spacing: .04em; white-space: nowrap; }
.rc-art { display: block; width: 62px; aspect-ratio: 1; filter: drop-shadow(0 6px 8px #0007); transform: rotate(-5deg); }
.rc-art svg { width: 100%; height: 100%; display: block; }

/* ---------- tambola ---------- */
.tb-call { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; padding: 14px; border-radius: 20px; background: #ffffff0a; border: 1px solid var(--hair); }
.tb-call > div { display: grid; gap: 6px; min-width: 0; }
.tb-call b { font: 800 1.35rem/1.15 var(--display); color: var(--paper); }
.tb-call > div > span { font: 700 .9rem var(--display); color: var(--muted); }
.tb-ball { --h: 230; flex: none; display: inline-grid; place-items: center; width: 30px; aspect-ratio: 1; border-radius: 50%; font: 800 .8rem/1 var(--display); color: var(--ink);
           background: radial-gradient(circle at 50% 50%, #fff 0 46%, transparent 47%), radial-gradient(circle at 35% 30%, hsl(var(--h) 90% 72%), hsl(var(--h) 75% 42%));
           box-shadow: inset 0 -3px 6px #0004, 0 3px 6px #0006; font-variant-numeric: tabular-nums; }
.tb-ball.big { width: 92px; font-size: 2.5rem; box-shadow: inset 0 -6px 12px #0005, 0 8px 18px #000a, 0 0 30px hsl(var(--h) 90% 60% / .35); }
.tb-ball.xs { width: 26px; font-size: .7rem; }
.tb-ball.idle { color: #1a143366; background: radial-gradient(circle, #fff 0 46%, transparent 47%), radial-gradient(circle at 35% 30%, #8d94bd, #3a4170); }
.tb-recent { display: flex; flex-wrap: wrap; gap: 4px; min-height: 26px; }
.tb-buy { display: grid; justify-items: center; gap: 8px; margin: 0 0 14px; }
.tb-buy .btn { min-width: 220px; }
.tb-tks { display: grid; gap: 12px; }
.tb-tk { padding: 8px 8px 9px; border-radius: 14px; color: var(--ink); background: linear-gradient(var(--paper), #f1e0b4); box-shadow: 0 4px 0 #b9a67a, 0 12px 20px -6px #000b; }
.tb-tkhead { display: flex; justify-content: space-between; padding: 0 4px 5px; font: 800 .7rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: #75663f; }
.tb-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.tb-n, .tb-x { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.05; border-radius: 5px; }
.tb-n { background: #fffdf6; box-shadow: inset 0 0 0 1px #1a14331f; font: 800 1.02rem/1 var(--display); font-variant-numeric: tabular-nums; }
.tb-x { background: repeating-linear-gradient(135deg, #e5d3a6 0 3px, #f1e0b4 3px 7px); }
.tb-n.dab::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff5aa5cc, #e5197acc 60%, #b3125fcc); }
.tb-n.dab { color: #fff; }
.tb-n { isolation: isolate; } .tb-n::before { z-index: -1; }
.tb-n.new { box-shadow: 0 0 0 2px var(--marigold), 0 0 12px #ffb627aa; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.tb-none { padding: 18px; border-radius: 16px; border: 1px dashed var(--hair-2); text-align: center; color: var(--muted); }
.tb-prizes { display: grid; gap: 1px; margin-top: 16px; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--hair); background: var(--hair); }
.tb-prize { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 10px 14px; background: var(--s1); }
.tb-prize b { font: 800 1rem var(--display); color: var(--paper); }
.tb-prize .amt { font: 800 1rem var(--display); color: var(--marigold); font-variant-numeric: tabular-nums; }
.tb-prize small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-prize.won small { color: var(--pos); font-weight: 700; }
.tb-prize.won b::after { content: ' ✓'; color: var(--pos); }
.tb-prize.tb-mine { background: #2a2468; box-shadow: inset 3px 0 0 var(--marigold); }
.tb-board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 16px; padding: 10px; border-radius: 18px; background: #070a22; box-shadow: inset 0 3px 10px #000a; }
.tb-board span { display: grid; place-items: center; height: 26px; border-radius: 6px; font: 800 .74rem/1 var(--display); color: #ffffff38; font-variant-numeric: tabular-nums; }
.tb-board span.on { background: #ffffff1c; color: var(--paper); }
.tb-board span.last { background: var(--magenta); color: #fff; box-shadow: 0 0 10px #e5197a99; }

@media (prefers-reduced-motion: reduce) {
  .rc-cws.fresh .rc-cw, .tb-n.new, .tb-ball.pop { animation: none !important; }
}
