/* Game Board player app. Brand: Dhaka enamel colours on deep navy, refined with hairlines, glows and grain. */
@font-face { font-family: 'Baloo Da 2'; font-weight: 600 800; font-display: swap; src: url(/fonts/baloo-da-2-latin.woff2) format('woff2');
             unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 1; }
:root {
  --bg: #0c1030; --s1: #141a45; --s2: #1b2356; --s3: #252f6a; --hair: #ffffff12; --hair-2: #ffffff22;
  --text: #f4f2ff; --muted: #9ea7d6; --faint: #6f78a8;
  --marigold: #ffb627; --magenta: #e5197a; --teal: #14b8a6; --sindoor: #e2334a; --paper: #fff5df; --ink: #1a1433;
  --pos: #5eead4; --neg: #ff8fb8;
  --r: 16px; --r-lg: 22px;
  --display: 'Baloo Da 2', 'Noto Sans Bengali', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Bengali', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* classes that set display would otherwise beat the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; color: var(--text); font: 15px/1.45 var(--body); background: var(--bg); overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
               background: radial-gradient(120% 45% at 50% -8%, #2d32927a, transparent 62%),
                           radial-gradient(80% 40% at 110% 105%, #6a1a6040, transparent 60%), var(--noise); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(button, a, input, summary):focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
summary { cursor: pointer; font: 700 1rem var(--display); color: var(--paper); }
.icon { display: inline-grid; place-items: center; }
.icon svg { width: 22px; height: 22px; display: block; }

/* ---------- shell ---------- */
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto;
          height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; }
.appbar::before { content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: #0c1030d9;
                  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--hair); }
.appbar-title { flex: 1; min-width: 0; font: 800 1.25rem/1 var(--display); color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title.brand { font-size: 1.35rem; text-shadow: 0 2px 0 var(--magenta), 0 4px 0 #0008; }
.playing .appbar { gap: 8px; padding-inline: 12px; } /* game screens add the talk button: leave the game's name room to fit */
.playing .appbar-title { font-size: 1.08rem; }
@media (max-width: 380px) {
  .playing .appbar { gap: 6px; }
  .playing .appbar .iconbtn { width: 36px; height: 36px; }
  .playing .appbar-title { font-size: 1rem; }
  .playing .purse { padding-right: 10px; font-size: .95rem; }
  .playing .purse .coin { width: 20px; }
}
.iconbtn { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 1px solid var(--hair-2); background: var(--s2);
           color: var(--paper); display: grid; place-items: center; }
.iconbtn svg { width: 20px; height: 20px; }
.purse { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 99px;
         background: #070a22; border: 1px solid #ffb62799; text-decoration: none; font: 800 1.02rem/1 var(--display); color: var(--marigold);
         font-variant-numeric: tabular-nums; box-shadow: 0 0 18px #ffb62722; }
.coin { width: 24px; aspect-ratio: 1; border-radius: 50%; flex: none;
        background: radial-gradient(circle, var(--marigold) 0 42%, #b86f00 43% 50%, transparent 51%),
                    repeating-conic-gradient(var(--marigold) 0 30deg, var(--paper) 30deg 45deg); box-shadow: 0 1px 0 #0007; }
.coin.lg { width: 36px; }
.gain { position: absolute; right: 10px; top: calc(100% + 6px); font: 800 1.05rem/1 var(--display); color: var(--marigold);
        text-shadow: 0 2px 0 #0008; pointer-events: none; animation: gain 1.2s ease-out forwards; }
@keyframes gain { from { transform: translateY(0); opacity: 1 } to { transform: translateY(28px); opacity: 0 } }
.banner { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 9; background: var(--marigold); color: var(--ink); text-align: center; padding: 6px;
          font: 800 .95rem var(--display); }
main.page { max-width: 560px; margin: 0 auto; padding: 6px 16px calc(104px + env(safe-area-inset-bottom)); }
main.page.play { padding-bottom: 0; }
.enter { animation: enter .24s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px) } }
.splash { display: grid; place-items: center; min-height: 70vh; font: 800 2.4rem var(--display); color: var(--paper); text-shadow: 0 3px 0 var(--magenta); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr);
          padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); border-radius: 22px 22px 0 0;
          background: #0c1030e8; backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 4px 0; text-decoration: none; color: var(--faint); font: 700 .74rem var(--display); }
.tab .icon { width: 52px; height: 30px; border-radius: 99px; transition: background .2s, color .2s; }
.tab[aria-current=page] { color: var(--paper); }
.tab[aria-current=page] .icon { background: #ffb62724; color: var(--marigold); }
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20; transform: translate(-50%, 12px);
         max-width: 90vw; padding: 11px 16px; border-radius: 14px; background: var(--paper); color: var(--ink); font: 700 .95rem/1.3 var(--display);
         box-shadow: 0 10px 30px #000a; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; pointer-events: none; }
#toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#chat { position: relative; }
#chat .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--magenta);
               color: #fff; font: 800 .7rem/19px var(--display); text-align: center; box-shadow: 0 0 0 2px var(--bg); }

/* ---------- building blocks ---------- */
.large-title { margin: 10px 2px 2px; font: 800 2rem/1.1 var(--display); color: var(--paper); }
.subtitle { margin: 0 2px 18px; color: var(--muted); }
.section { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; }
.section h2 { font: 800 1.15rem/1 var(--display); color: var(--paper); }
.linkbtn { padding: 0; border: 0; background: none; text-decoration: none; font: 700 .9rem var(--display); color: var(--marigold); }
.card { position: relative; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--hair);
        background: linear-gradient(180deg, var(--s2), var(--s1)); box-shadow: inset 0 1px 0 #ffffff0d, 0 8px 22px #0006; }
.card + .card { margin-top: 12px; }
.btn { --top: #ffd35c; --mid: var(--marigold); --edge: #b9770a; --fg: var(--ink);
       display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 2px 18px 0; border: 0; border-radius: 14px;
       font: 800 1.02rem/1 var(--display); color: var(--fg); text-align: center; text-decoration: none; white-space: nowrap;
       background: linear-gradient(var(--top), var(--mid) 70%); box-shadow: inset 0 1px 0 #ffffff99, 0 3px 0 var(--edge), 0 8px 18px #0006;
       transition: transform .08s, box-shadow .08s, filter .2s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 #ffffff99, 0 1px 0 var(--edge), 0 3px 8px #0006; }
.btn:disabled { filter: saturate(.25) brightness(.65); cursor: default; }
.btn.teal { --top: #48dccb; --mid: var(--teal); --edge: #0a6e64; --fg: #03211d; }
.btn.pink { --top: #ff5aa5; --mid: var(--magenta); --edge: #8e0c4a; --fg: #fff; }
.btn.red { --top: #f15b6e; --mid: var(--sindoor); --edge: #861424; --fg: #fff; }
.btn.plain { --top: var(--s3); --mid: var(--s2); --edge: #070a22; --fg: var(--paper); box-shadow: inset 0 1px 0 #ffffff1c, inset 0 0 0 1px var(--hair), 0 3px 0 var(--edge), 0 8px 18px #0005; }
.btn.glass { --top: #ffffff2e; --mid: #ffffff1a; --edge: #00000040; --fg: var(--paper); box-shadow: inset 0 1px 0 #ffffff40, inset 0 0 0 1px #ffffff26, 0 3px 0 var(--edge); }
.btn.small { min-height: 40px; padding: 2px 14px 0; font-size: .94rem; border-radius: 12px; }
.btn.wide { width: 100%; }
input { font: 600 1rem var(--body); width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--hair-2);
        background: #080b26; color: var(--text); box-shadow: inset 0 2px 6px #0006; }
input:focus { border-color: var(--marigold); }
label { display: grid; gap: 6px; margin-bottom: 14px; font: 700 .9rem var(--display); color: var(--muted); }
.error { min-height: 1.3em; margin-top: 8px; color: #ff9aa8; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 2px; border-radius: 99px; font: 700 .78rem var(--display);
        background: #ffffff14; border: 1px solid var(--hair); color: var(--paper); white-space: nowrap; }
.tag { display: inline-block; padding: 3px 7px 1px; border-radius: 99px; font: 800 .62rem/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase;
       background: #2a3270; color: var(--muted); white-space: nowrap; }
.tag.seen { background: #0d5c55; color: #9ff6ea; }
.tag.blind { background: #6f0a3b; color: #ffb3d5; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { min-width: 0; padding: 12px; border-radius: var(--r); border: 1px solid var(--hair); background: #10163d; }
.stat small { display: block; font: 700 .66rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; margin-top: 3px; font: 800 1.35rem/1.15 var(--display); color: var(--paper); font-variant-numeric: tabular-nums;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b.txt { font-size: 1.02rem; line-height: 1.2; white-space: normal; }
.list { display: grid; gap: 1px; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--hair); background: var(--hair); }
.item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: var(--s1); color: inherit; text-align: left; text-decoration: none; }
button.item:active { background: var(--s2); }
.item .main { flex: 1; min-width: 0; display: grid; }
.item .main b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .main small { color: var(--muted); font-size: .8rem; }
.item .val { font: 800 1.05rem var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); background: var(--s1); }
.gicon { --c: var(--magenta); --c2: #6f0a3b; flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
         background: linear-gradient(150deg, var(--c), var(--c2)); box-shadow: inset 0 1px 0 #ffffff4d, 0 4px 10px #0005; }
.gicon svg { width: 22px; height: 22px; }
.bar { height: 6px; border-radius: 99px; background: #ffffff14; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--marigold)); }
.switch { position: relative; flex: none; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 99px; background: #ffffff26; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0006;
                 transition: transform .2s; }
.switch[aria-checked=true] { background: var(--teal); }
.switch[aria-checked=true]::after { transform: translateX(20px); }
.skel { border-radius: 14px; background: linear-gradient(90deg, #ffffff08 0%, #ffffff14 50%, #ffffff08 100%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0 } }
.av { width: 48px; aspect-ratio: 1; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 1.3rem/1 var(--display); color: #fff;
      background: radial-gradient(circle at 30% 25%, #ffffff55, transparent 45%), hsl(var(--h) 60% 42%); border: 3px solid var(--bg); }
.av.sm { width: 36px; font-size: 1rem; border-width: 2px; }
.av.xs { width: 30px; font-size: .85rem; border-width: 2px; }
.av.xl { width: 92px; font-size: 2.5rem; border: 0; box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--marigold), 0 14px 30px #0009; }
.ring { position: relative; display: inline-grid; padding: 3px; border-radius: 50%; background: #ffffff14; }
.ring.on { background: conic-gradient(var(--marigold) calc(var(--p) * 1turn), #ffffff1f 0);
           animation-name: ring; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes ring { from { --p: 1 } to { --p: 0 } }

/* game colours, shared by cards, icons and list rows */
[data-game=tp] { --c: #d6156f; --c2: #6f0a3b; }
[data-game=ab] { --c: #0f9284; --c2: #074841; }
[data-game=jm] { --c: #d9640b; --c2: #6e2d03; }
[data-game=dl] { --c: #c81e36; --c2: #640c19; }
[data-game=ludo] { --c: #2f5be0; --c2: #172c78; }
[data-game=snakes] { --c: #3a9d23; --c2: #17500d; }
[data-game=tambola] { --c: #c026d3; --c2: #5b0f64; }
[data-game=pachisi] { --c: #9d174d; --c2: #4a0a24; }
[data-game=ashta] { --c: #c2410c; --c2: #5c1d05; }
[data-game=bagh] { --c: #d97706; --c2: #6b3a03; }
[data-game=sholo] { --c: #0891b2; --c2: #063f4f; }
[data-game=morris] { --c: #4f46e5; --c2: #211c6e; }
[data-game=pallan] { --c: #92400e; --c2: #3f1c06; }
[data-game=chess] { --c: #475569; --c2: #1a2130; }
[data-game=business] { --c: #059669; --c2: #023f2c; }
[data-game=carrom] { --c: #a16207; --c2: #4a2d03; }
[data-game=callbreak] { --c: #1d4ed8; --c2: #0b2066; }
[data-game=t29] { --c: #be123c; --c2: #57051a; }
[data-game=gadha] { --c: #65a30d; --c2: #2b4705; }
[data-game=bluff] { --c: #7c3aed; --c2: #33137a; }
[data-game=rummy] { --c: #0f766e; --c2: #053b37; }
[data-game=court] { --c: #b45309; --c2: #4d2304; }
[data-game=mendi] { --c: #dc2626; --c2: #5e0f0f; }
[data-game=kachu] { --c: #0369a1; --c2: #032f48; }
[data-game=dtp] { --c: #6d28d9; --c2: #2e1065; }
[data-game=badam] { --c: #e11d48; --c2: #5f0a1f; }
[data-game=gulam] { --c: #78716c; --c2: #2c2926; }
[data-game=dhumbal] { --c: #0d9488; --c2: #053f3a; }
[data-game=seep] { --c: #ca8a04; --c2: #4f3602; }
[data-game=tinguti] { --c: #2563eb; --c2: #0f2a66; }
[data-game=aadu] { --c: #ea580c; --c2: #5a2205; }
[data-game=raja] { --c: #a21caf; --c2: #45094b; }
[data-game=cricket] { --c: #16a34a; --c2: #0a4520; }
[data-game=ttt] { --c: #db2777; --c2: #5c0f33; }

/* ---------- sign-up ---------- */
.intro { display: grid; justify-items: center; gap: 14px; padding: 26px 0 22px; text-align: center; }
.logo { font: 800 3.2rem/.9 var(--display); color: var(--paper); text-shadow: 0 3px 0 var(--magenta), 0 8px 0 var(--ink); }
.intro p { max-width: 34ch; color: var(--muted); }

/* ---------- home ---------- */
.wallet { position: relative; overflow: hidden; padding: 20px; border-radius: 26px; color: var(--paper);
          background: radial-gradient(110% 90% at 0% 0%, #ff4f9d 0%, transparent 55%), radial-gradient(100% 100% at 100% 100%, #3d62ff 0%, transparent 62%),
                      linear-gradient(140deg, #b3125f, #33207f);
          box-shadow: inset 0 1px 0 #ffffff4d, inset 0 0 0 1px #ffffff1f, 0 22px 44px -14px #e5197a99, 0 12px 26px #0008; }
.wallet::after { content: ''; position: absolute; right: -54px; top: -54px; width: 200px; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
                 background: repeating-conic-gradient(#ffffff1c 0 15deg, transparent 15deg 30deg);
                 -webkit-mask: radial-gradient(circle, transparent 0 36%, #000 37% 70%, transparent 71%); mask: radial-gradient(circle, transparent 0 36%, #000 37% 70%, transparent 71%); }
.wallet small { font: 700 .74rem var(--display); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.wallet .amount { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font: 800 2.9rem/1 var(--display); font-variant-numeric: tabular-nums;
                  text-shadow: 0 3px 0 #0004; }
.wallet .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.wallet .pill { background: #00000033; border-color: #ffffff2e; }
.wallet .actions { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 12px;
        scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.minicard { scroll-snap-align: start; display: grid; align-content: space-between; height: 158px; padding: 14px; border: 0; border-radius: 22px;
            text-align: left; color: var(--paper); overflow: hidden;
            background: radial-gradient(100% 80% at 0% 0%, #ffffff38, transparent 55%), linear-gradient(150deg, var(--c), var(--c2));
            box-shadow: inset 0 1px 0 #ffffff55, inset 0 0 0 1px #ffffff26, 0 12px 24px -10px var(--c), 0 8px 16px #0006; }
.minicard b { font: 800 1.15rem/1.05 var(--display); text-shadow: 0 2px 0 #0004; }
.minicard small { font: 700 .74rem var(--display); opacity: .85; }
.minicard .art { justify-self: end; transform: scale(.85); transform-origin: right top; }

/* ---------- games ---------- */
.joincard { display: grid; gap: 10px; }
.joincard .row { display: flex; gap: 10px; }
.joincard input { font: 800 1.35rem var(--display); letter-spacing: .3em; text-align: center; }
.cats { display: flex; gap: 8px; overflow-x: auto; margin: 22px -16px 12px; padding: 2px 16px 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 2px 14px 0; border: 1px solid var(--hair-2); border-radius: 99px;
       background: var(--s1); color: var(--muted); font: 800 .92rem var(--display); white-space: nowrap; transition: background .15s, color .15s; }
.cat span { min-width: 22px; padding: 1px 6px 0; border-radius: 99px; background: #ffffff14; font-size: .74rem; }
.cat[aria-pressed=true] { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }
.cat[aria-pressed=true] span { background: #1a143326; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 500px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: grid; grid-template-rows: 1fr auto auto auto; justify-items: start; gap: 2px; min-height: 168px; padding: 12px 12px 12px 14px;
        border: 0; border-radius: 22px; overflow: hidden; text-align: left; color: var(--paper);
        background: radial-gradient(100% 80% at 0% 0%, #ffffff38, transparent 55%), linear-gradient(150deg, var(--c), var(--c2));
        box-shadow: inset 0 1px 0 #ffffff55, inset 0 0 0 1px #ffffff26, 0 12px 24px -12px var(--c), 0 8px 16px #0006; transition: transform .12s; }
.tile::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--noise); mix-blend-mode: overlay; }
.tile:active { transform: scale(.97); }
.tile .art { justify-self: end; align-self: start; min-width: 0; transform: scale(.82); transform-origin: right top; }
.tile b { font: 800 1.12rem/1.05 var(--display); text-shadow: 0 2px 0 #0004; }
.tile small { font: 700 .74rem var(--display); opacity: .85; }
.newb { position: absolute; z-index: 1; top: 10px; left: 10px; padding: 3px 8px 1px; border-radius: 99px; background: var(--paper); color: var(--ink);
        font: 800 .62rem/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 2px 6px #0006; }
.live { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 2px 8px 1px; border-radius: 99px; background: #00000038;
        font: 800 .68rem/1.3 var(--display); color: #d9fff9; white-space: nowrap; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 6px var(--pos); }
.minicard .live { margin-top: 3px; }
.gsheet { gap: 10px; }
.ghero { position: relative; display: grid; place-items: center; height: 150px; margin: 0 -16px; border-radius: 0 0 26px 26px; overflow: hidden;
         background: radial-gradient(90% 90% at 20% 0%, #ffffff40, transparent 60%), linear-gradient(150deg, var(--c), var(--c2)); }
.ghero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--noise); mix-blend-mode: overlay; }
.ghero .art { transform: scale(1.35); }
.ghero .iconbtn { position: absolute; top: 12px; right: 12px; background: #00000040; border-color: #ffffff33; }
.gsheet h2 { margin-top: 4px; font: 800 1.8rem/1.05 var(--display); color: var(--paper); }
.gsheet .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gsheet .meta .live { margin: 0; background: #14b8a626; color: var(--pos); }
.gabout { font: 700 1.02rem/1.35 var(--display); color: var(--paper); }
.grules { color: var(--muted); font-size: .93rem; }
.gsheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.gsheet .hint { margin-top: 0; }
.art { display: flex; align-items: center; justify-content: center; min-width: 90px; }
.dice2 { display: flex; gap: 6px; }
.dice2 .jdie { width: 36px; font-size: 1.15rem; }
.dice2 .jdie:first-child { transform: rotate(-12deg); }
.dice2 .jdie:last-child { transform: rotate(9deg) translateY(6px); }
.stubmini { position: relative; display: grid; place-items: center; width: 48px; height: 62px; border-radius: 8px; transform: rotate(-8deg);
            font: 800 2rem/1 var(--display); color: var(--sindoor); background: linear-gradient(var(--paper), #f1e0b4); box-shadow: 0 4px 10px #0006; }
.stubmini::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 12px; border-top: 2px dashed #1a143355; }
.ludomini { width: 58px; aspect-ratio: 1; border-radius: 10px; transform: rotate(6deg); box-shadow: 0 0 0 3px var(--paper), 0 6px 12px 3px #0006;
            background: conic-gradient(from 225deg, #e63946 0 25%, #2ba84a 0 50%, #ffc300 0 75%, #2f80ed 0); }

/* ---------- ranks ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin: 6px 0 18px; }
.step { display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; }
.step .nm { max-width: 100%; font-weight: 700; }
.step .won { font: 800 .95rem var(--display); color: var(--marigold); }
.step .block { width: 100%; display: grid; place-items: center; border-radius: 16px 16px 8px 8px; font: 800 1.8rem var(--display);
               box-shadow: inset 0 1px 0 #ffffff66, 0 10px 20px #0007; }
.step.p1 .block { height: 104px; background: linear-gradient(#ffd86b, #c88a06); color: #5a3a00; }
.step.p2 .block { height: 78px; background: linear-gradient(#eef1f8, #9aa3b8); color: #3a4152; }
.step.p3 .block { height: 62px; background: linear-gradient(#f3c39a, #a8622d); color: #4d2a0e; }
.step.empty { opacity: .35; }
.crown { font-size: 1.4rem; line-height: 1; margin-bottom: -6px; }
.rankno { flex: none; width: 28px; font: 800 1rem var(--display); color: var(--muted); text-align: center; }
.item.me { background: #2a2468; box-shadow: inset 3px 0 0 var(--marigold); }

/* ---------- profile ---------- */
.profile-card { display: grid; justify-items: center; gap: 8px; padding: 26px 16px 20px; text-align: center; }
.profile-card h2 { font: 800 1.7rem/1.1 var(--display); color: var(--paper); }
.profile-card .pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stub { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px;
        background: linear-gradient(var(--paper), #f1e2bc); color: var(--ink); box-shadow: 0 4px 0 #b9a67a; }
.stub b { font: 800 1.7rem/1 var(--display); letter-spacing: .14em; color: var(--sindoor); }
.stub small, .boardcode small { display: block; font: 800 .66rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: #75663f; }
.key { display: block; margin: 10px 0; padding: 10px; border-radius: 10px; background: #080b26; font-size: .85rem; word-break: break-all; }

/* ---------- game screen: shared ---------- */
.boardcode { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; padding: 8px 8px 8px 14px; border-radius: 14px;
             background: linear-gradient(var(--paper), #f1e2bc); color: var(--ink); box-shadow: 0 3px 0 #b9a67a; }
.boardcode b { font: 800 1.35rem/1 var(--display); letter-spacing: .16em; color: var(--sindoor); }
.status { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; margin: 2px 0 8px; }
.status b { font: 800 1.3rem/1.1 var(--display); color: var(--paper); }
.status .side { display: inline-flex; align-items: center; gap: 10px; }
.here { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 1px; border-radius: 99px; border: 1px solid var(--hair); background: #ffffff0d;
        font: 700 .74rem var(--display); color: var(--muted); white-space: nowrap; }
.here i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 8px var(--pos); }
.timer { font: 800 1.15rem/1 var(--display); color: var(--marigold); font-variant-numeric: tabular-nums; }
.fuse { height: 5px; margin-bottom: 12px; border-radius: 99px; background: #ffffff16; overflow: hidden; }
.fuse i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--magenta), var(--marigold)); transform-origin: left;
          animation-name: fuse; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes fuse { from { transform: scaleX(1) } to { transform: scaleX(0) } }
.felt { background: radial-gradient(ellipse at 50% 30%, #1f9d8f 0%, #0e5f57 52%, #083b37 100%);
        box-shadow: 0 0 0 9px #1c1540, 0 0 0 10px #ffb6275e, 0 0 0 16px #120d2c, 0 28px 50px -8px #000d, inset 0 12px 40px #000a; }
.felt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--noise); mix-blend-mode: overlay; }
.dock { position: sticky; bottom: 0; z-index: 4; margin: 0 -16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
        background: linear-gradient(#0c103000, #0c1030f0 28%); }
.chipbar { display: flex; justify-content: center; gap: 14px; }
.pchip { --c: var(--teal); width: 56px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
         font: 800 1rem/1 var(--display); color: #fff; text-shadow: 0 1px 0 #0008;
         background: radial-gradient(circle, var(--c) 0 50%, #ffffffdd 51% 55%, transparent 56%), repeating-conic-gradient(var(--c) 0 20deg, #fff 20deg 30deg);
         box-shadow: 0 4px 0 #0009, inset 0 0 0 2px #0003; transition: transform .12s; }
.pchip.on { transform: translateY(-6px) scale(1.06); box-shadow: 0 0 0 3px var(--paper), 0 10px 0 #0007, 0 0 20px #fff5df66; }
.hint { margin-top: 8px; text-align: center; font: 700 .82rem var(--display); color: var(--muted); }
.note { min-height: 1.7rem; margin: 2px 0 4px; text-align: center; font: 800 1.3rem/1.25 var(--display); color: var(--marigold); }
.note.dim { font-size: 1rem; color: var(--muted); }
details.how { margin: 14px 0 18px; padding: 12px 16px; border-radius: 16px; background: #ffffff0a; border: 1px solid var(--hair); }
details.how summary { cursor: pointer; font: 700 .95rem var(--display); color: var(--muted); }
details.how p { margin-top: 8px; font-size: .9rem; color: var(--muted); }

/* playing cards */
.card-p { --w: 58px; position: relative; display: inline-block; flex: none; width: var(--w); aspect-ratio: 5 / 7; border-radius: calc(var(--w) * .12);
          background: linear-gradient(160deg, #fffdf6, var(--paper)); color: var(--ink); font-family: var(--display);
          box-shadow: inset 0 0 0 1px #0000001a, 0 2px 0 #0003, 0 6px 12px #0006; }
.card-p.red { color: #d7263d; }
.card-p .idx { position: absolute; top: 5%; left: 9%; font-weight: 800; font-size: calc(var(--w) * .26); line-height: .92; text-align: center; }
.card-p .idx.b { top: auto; left: auto; bottom: 5%; right: 9%; transform: rotate(180deg); }
.card-p .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .5); line-height: 1; }
.card-p.court .pip { inset: 22% 20%; border: 2px solid currentColor; border-radius: calc(var(--w) * .08); font-weight: 800; font-size: calc(var(--w) * .36);
                     background: repeating-linear-gradient(135deg, transparent 0 4px, #0000000a 4px 6px); }
.card-p.xs { --w: 30px; } .card-p.xs .idx { font-size: 11px; left: 12%; } .card-p.xs :is(.pip, .idx.b) { display: none; }
.card-p.sm { --w: 34px; } .card-p.sm .idx.b { display: none; } .card-p.sm .pip { top: 22%; font-size: calc(var(--w) * .42); }
.card-p.sm.court .pip { inset: 40% 14% 10%; border-width: 1px; font-size: calc(var(--w) * .32); }
.card-p.md { --w: 44px; } .card-p.lg { --w: 78px; } .card-p.xl { --w: 92px; }
.card-p.back { background: linear-gradient(45deg, #a30f59 25%, transparent 25% 75%, #a30f59 75%) 0 0 / 10px 10px,
                           linear-gradient(-45deg, #a30f59 25%, transparent 25% 75%, #a30f59 75%) 0 0 / 10px 10px, var(--magenta);
               box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px #a30f59, 0 2px 0 #0003, 0 6px 12px #0006; }
.fan { display: flex; justify-content: center; }
.fan .card-p + .card-p { margin-left: calc(var(--w) * -.45); }
.fan .card-p:nth-child(1) { transform: rotate(-9deg) translateY(3px); }
.fan .card-p:nth-child(3) { transform: rotate(9deg) translateY(3px); }
.flip-in { animation: flip .45s ease both; animation-delay: calc(var(--i, 0) * 110ms); }
@keyframes flip { from { transform: rotateY(90deg) } }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) var(--reveal, 0ms) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0 } }

/* ---------- teen patti ---------- */
.tp-table { position: relative; height: clamp(300px, 44vh, 420px); margin: 6px -6px 4px; }
.tp-table .felt { position: absolute; inset: 15% 17% 7%; border-radius: 50%; display: grid; place-items: center; }
.tp-table .felt::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; border: 1.5px dashed #ffffff26; }
.pot { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; max-width: 70%; text-align: center; }
.pot .stack { display: flex; margin-bottom: 2px; }
.pot .stack .coin + .coin { margin-left: -12px; }
.pot small { font: 800 .7rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: #bdf5ee; }
.pot b { font: 800 2.3rem/1 var(--display); color: var(--paper); text-shadow: 0 3px 0 #0007; font-variant-numeric: tabular-nums; }
.pot b.say { max-width: 100%; font-size: 1.35rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pot span { font: 700 .82rem var(--display); color: #d6fffa; }
.seat { position: absolute; z-index: 2; display: flex; align-items: center; gap: 4px; }
.seat.t { transform: translate(-50%, 0); flex-direction: column; }
.seat.l { transform: translate(0, -50%); }
.seat.r { transform: translate(-100%, -50%); flex-direction: row-reverse; }
.seat.out { opacity: .5; filter: grayscale(.6); }
.seat .who { display: grid; justify-items: center; gap: 5px; width: 78px; }
.avw { position: relative; display: inline-grid; }
.seat .who .tag { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); }
/* each player's latest move, pinned by their avatar until the next hand */
.seat .act { position: absolute; z-index: 1; top: -8px; left: 56%; padding: 3px 7px 1px; border-radius: 99px; font: 800 .64rem/1.2 var(--display);
             letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: #fff; background: #2a3270; box-shadow: 0 2px 6px #0008; }
.seat.r .act { left: auto; right: 56%; }
.act.chaal { background: var(--teal); color: #03211d; }
.act.raise { background: var(--magenta); }
.act.show { background: var(--marigold); color: var(--ink); }
.act.pack { background: #3a3f63; color: #c9cdea; }
.seat.won .ring, .mine.won .me .ring { background: var(--marigold); box-shadow: 0 0 22px 2px #ffb627aa; }
.seat .who .nm { max-width: 78px; padding: 2px 8px 1px; border-radius: 99px; background: #0a0d29e6; border: 1px solid var(--hair-2); font: 700 .74rem/1.35 var(--body); }
.seat .minis { display: flex; }
.seat .minis .card-p + .card-p { margin-left: -16px; }
.mine { display: grid; justify-items: center; gap: 8px; margin-bottom: 4px; }
.mine .hand { display: flex; align-items: center; min-height: 112px; }
.mine .hand .card-p + .card-p { margin-left: -14px; }
.mine .hand .card-p:nth-child(1) { transform: rotate(-7deg) translateY(4px); }
.mine .hand .card-p:nth-child(3) { transform: rotate(7deg) translateY(4px); }
.mine .me { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.moves { display: grid; gap: 10px; }
.moves .minor { display: flex; gap: 10px; }
.moves .minor .btn { flex: 1; min-height: 44px; font-size: .98rem; }
.moves .major { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.moves .major.one { grid-template-columns: 1fr; }
.moves .major .btn { min-height: 54px; font-size: 1.12rem; }

/* ---------- andar bahar ---------- */
.ab-table { position: relative; margin: 14px 10px 8px; padding: 16px 12px 14px; border-radius: 30px; }
.joker { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; margin-bottom: 14px; }
.joker small { font: 800 .7rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: #bdf5ee; }
.zones { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zone { position: relative; display: grid; align-content: start; gap: 4px; min-height: 176px; padding: 12px 10px; border: 2px dashed #fff5df5c; border-radius: 18px;
        background: #00000030; color: var(--paper); text-align: left; transition: background .15s; }
.zone:not(:disabled):active { background: #00000050; }
.zone:disabled { cursor: default; }
.zone .zn { font: 800 1.45rem/1 var(--display); }
.zone .zt { font: 800 .95rem var(--display); color: #fff5dfcc; font-variant-numeric: tabular-nums; }
.zone .mybet { position: absolute; top: 10px; right: 10px; padding: 3px 8px 1px; border-radius: 99px; font: 800 .74rem var(--display);
               background: var(--marigold); color: var(--ink); }
.zone .pile { display: flex; flex-wrap: wrap; padding: 4px 10px 12px 0; }
.zone .pile .card-p { margin: 0 -10px -14px 0; }
.zone.andar { box-shadow: inset 0 0 40px #14b8a61f; }
.zone.bahar { box-shadow: inset 0 0 40px #e5197a24; }
.zone.win { border-style: solid; border-color: var(--marigold); background: #ffb62721; box-shadow: 0 0 26px #ffb62770, inset 0 0 24px #ffb62726;
            animation: zone-win .35s ease-out var(--reveal, 0ms) both; }
@keyframes zone-win { from { border-style: dashed; border-color: #fff5df5c; background: #00000030; box-shadow: none } }

/* ---------- dice ---------- */
.tray { position: relative; display: flex; justify-content: center; gap: 8px; margin: 4px 0 10px; padding: 14px 10px; border-radius: 20px; background: #070a22;
        box-shadow: inset 0 4px 14px #000c, inset 0 0 0 1px var(--hair); }
.jdie { width: 44px; aspect-ratio: 1; border-radius: 11px; display: grid; place-items: center; font-size: 1.45rem; line-height: 1;
        background: linear-gradient(145deg, #fff, #e9e2cf); color: var(--ink); box-shadow: inset 0 -3px 0 #0002, 0 4px 0 #a89f86, 0 6px 10px #0006; }
.jdie.red { color: #d7263d; }
.jdie.blank { color: #1a143340; font: 800 1.2rem var(--display); }
.jdie.win { box-shadow: 0 0 0 3px var(--marigold), 0 4px 0 #a89f86, 0 0 18px var(--marigold); animation: die-win .3s ease-out var(--reveal, 0ms) both; }
@keyframes die-win { from { box-shadow: inset 0 -3px 0 #0002, 0 4px 0 #a89f86, 0 6px 10px #0006 } }
.jmat { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border-radius: 24px;
        background: repeating-linear-gradient(90deg, #ffffff0a 0 2px, transparent 2px 7px), linear-gradient(160deg, #c81e36, #5e0a17);
        box-shadow: inset 0 1px 0 #ffffff40, inset 0 0 0 1px #ffffff26, 0 18px 30px -12px #c81e36, 0 10px 20px #0008; }
.jcell { aspect-ratio: 1; padding: 6px; border: 0; border-radius: 16px; display: grid; place-items: center; align-content: center; gap: 2px;
         background: linear-gradient(var(--paper), #f1e2bc); color: var(--ink); box-shadow: 0 4px 0 #3d0710, 0 8px 12px #0005; }
.jcell:disabled { cursor: default; }
.jcell .sym { font-size: 2.1rem; line-height: 1; }
.jcell .sym.red { color: #d7263d; }
.jcell .tot { font: 800 .95rem/1 var(--display); font-variant-numeric: tabular-nums; }
.jcell .my { font: 800 .72rem/1 var(--display); color: #0a7a6e; }
.jcell.win { box-shadow: 0 0 0 4px var(--marigold), 0 0 22px #ffb627cc, 0 4px 0 #3d0710; animation: cell-win .3s ease-out var(--reveal, 0ms) both; }
@keyframes cell-win { from { box-shadow: 0 4px 0 #3d0710, 0 8px 12px #0005 } }

/* pip dice */
.die { display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); flex: none; width: 56px; aspect-ratio: 1; padding: 7px; border-radius: 13px;
       background: linear-gradient(145deg, #fff, #e9e2cf); box-shadow: inset 0 -3px 0 #0002, 0 4px 0 #a89f86, 0 8px 14px #0006; }
.die i { border-radius: 50%; margin: 17%; }
.die i.on { background: radial-gradient(circle at 35% 30%, #555, #111); }
.die.ace i.on { margin: 6%; background: radial-gradient(circle at 35% 30%, #ff6b7d, #d7263d); }
.die.big { width: 72px; padding: 9px; border-radius: 16px; }
.die.idle { opacity: .4; }
.rolling { animation: roll .7s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes roll { 0% { transform: translateY(-40px) rotate(-420deg) scale(.4); opacity: 0 } 60% { opacity: 1 } 100% { transform: none } }

/* ---------- lottery ---------- */
.soldbar { display: inline-flex; align-items: center; gap: 4px; font: 800 1rem var(--display); color: var(--muted); }
.soldbar i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff22; }
.soldbar i.on { background: var(--marigold); box-shadow: 0 0 8px #ffb627aa; }
.draw { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 16px; padding: 14px; border-radius: 20px; background: #ffffff0a; }
.draw b { display: block; font: 800 1.55rem/1.1 var(--display); color: var(--paper); }
.draw span { font: 700 1rem var(--display); color: var(--marigold); }
.tickets { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; margin-top: 8px; }
.ticket { position: relative; aspect-ratio: 3 / 4; padding: 10px 6px; border: 0; border-radius: 14px; overflow: hidden;
          display: grid; grid-template-rows: 1fr auto; place-items: center; color: var(--ink);
          background: radial-gradient(circle at 0 64%, var(--bg) 0 8px, transparent 9px), radial-gradient(circle at 100% 64%, var(--bg) 0 8px, transparent 9px),
                      linear-gradient(var(--paper), #f1e0b4);
          box-shadow: 0 4px 0 #b9a67a, 0 12px 20px -6px #000b; transition: transform .15s; }
.ticket::after { content: ''; position: absolute; left: 12px; right: 12px; top: 64%; border-top: 2px dashed #1a143340; }
.ticket > b { font: 800 2.8rem/1 var(--display); color: #d7263d; }
.ticket .price { position: relative; z-index: 1; padding-bottom: 2px; font: 800 .85rem var(--display); color: #6b5d3a; }
button.ticket:not(:disabled):active { transform: translateY(3px); }
button.ticket:disabled { filter: saturate(.4) brightness(.75); cursor: default; }
.ticket.hot { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--paper), 0 0 24px #fff5dfaa, 0 4px 0 #b9a67a; }
.ticket.win { transform: translateY(-5px); box-shadow: 0 0 0 4px var(--marigold), 0 0 30px #ffb627cc, 0 4px 0 #b9a67a; }
.stamp { position: relative; z-index: 1; max-width: 100%; margin-bottom: 2px; padding: 3px 6px 2px; border: 3px solid var(--magenta); border-radius: 8px;
         transform: rotate(-12deg); color: var(--magenta); font: 800 .8rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em;
         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #fff5df66; }
.stamp.mine { border-color: #0a8a7c; color: #0a8a7c; }
.stamp.new { animation: stamp .35s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes stamp { from { transform: rotate(-12deg) scale(2.2); opacity: 0 } }

/* ---------- ludo ---------- */
.ludo { position: relative; --red: #e63946; --green: #2ba84a; --yellow: #ffc300; --blue: #2f80ed;
        display: grid; grid-template: repeat(15, 1fr) / repeat(15, 1fr); aspect-ratio: 1; width: 100%; margin: 6px 0 16px; padding: 6px; border-radius: 20px;
        background: #fffaf0; box-shadow: 0 0 0 5px #1c1540, 0 0 0 6px #ffb6275e, 0 0 0 11px #120d2c, 0 24px 44px -8px #000d; }
.ludo .cell { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 1px; }
.ludo .sq { background: #fffaf0; box-shadow: inset 0 0 0 .5px #1a143340; }
.ludo .star::before { content: '★'; position: absolute; color: #1a143366; font-size: .8em; }
.ludo .base { border-radius: 12px; display: grid; place-items: center; background: linear-gradient(150deg, var(--c), var(--c2)); }
.ludo .base div { width: 74%; height: 74%; border-radius: 16px; background: #fffaf0; box-shadow: inset 0 2px 8px #0003; }
.ludo .spot::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: var(--c); opacity: .25; box-shadow: inset 0 2px 3px #0006; }
.ludo .center { background: conic-gradient(from 225deg, var(--red) 0 25%, var(--green) 0 50%, var(--yellow) 0 75%, var(--blue) 0); }
.ludo .home::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: #fffaf0; box-shadow: 0 0 0 2px #0002; }
.tok { position: relative; z-index: 1; width: 80%; aspect-ratio: 1; min-height: 0; padding: 0; border: 2px solid #fff; border-radius: 50%;
       display: grid; place-items: center; color: #fff; font: 800 .55rem/1 var(--display);
       background: radial-gradient(circle at 35% 28%, #ffffffb5 0 14%, transparent 15%), radial-gradient(circle at 50% 55%, var(--c) 0 55%, var(--c2) 100%);
       box-shadow: 0 2px 0 #0007, 0 3px 6px #0005; }
.tok.dark { color: var(--ink); }
.ludo :is(.sq, .home):has(.tok + .tok) .tok { width: 48%; border-width: 1px; }
.tok.legal { z-index: 2; outline: 3px solid var(--ink); outline-offset: 1px; animation: bob .9s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) scale(1.14) } }
.lctl { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; min-height: 72px; }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.player { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 12px 6px 6px; border-radius: 99px; background: #ffffff0d; border: 1px solid var(--hair); }
.player .nm { font-size: .86rem; font-weight: 600; }
.player small { margin-left: auto; color: var(--muted); font: 700 .74rem var(--display); white-space: nowrap; }
.player.out { opacity: .45; text-decoration: line-through; }

/* ---------- turn-based tables (table.js): waiting room, players, result, hands, seats ---------- */
.lobby { position: relative; display: grid; gap: 14px; margin: 6px 0 14px; padding: 18px 16px 16px; border-radius: var(--r-lg); border: 1px solid var(--hair);
         background: radial-gradient(90% 70% at 50% 0%, #ffffff12, transparent 70%), linear-gradient(180deg, var(--s2), var(--s1)); box-shadow: 0 8px 22px #0006; }
.wseats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 12px 8px; }
.wseat { position: relative; display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; animation: enter .3s ease-out both; }
.wseat .nm { max-width: 100%; font: 700 .82rem var(--body); }
.wseat.open { color: var(--faint); animation: none; }
.av.ghost { background: transparent; border: 2px dashed var(--hair-2); color: var(--faint); font-size: 1.4rem; }
.av.bot { background: radial-gradient(circle at 30% 25%, #ffffff55, transparent 45%), #3a4370; font-size: 1.5rem; }
.av.bot.sm { font-size: 1.15rem; } .av.bot.xs { font-size: .95rem; }
.lobby-line { text-align: center; font: 800 1.12rem/1.2 var(--display); color: var(--marigold); }
.botpick { display: flex; align-items: center; justify-content: center; gap: 14px; font: 800 1.05rem var(--display); color: var(--paper); }
.botpick .iconbtn { font: 800 1.3rem/1 var(--display); }
.botpick .iconbtn:disabled { opacity: .35; cursor: default; }
.lobby .hint { margin: 0; }
.pbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pl { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 12px 5px 5px; border-radius: 99px; background: #ffffff0d;
      border: 1px solid var(--hair); transition: background .2s, border-color .2s; }
.pl .nm { font-size: .86rem; font-weight: 600; }
.pl small { flex-shrink: 3; min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 700 .74rem var(--display); white-space: nowrap; } /* the info gives way before the name does */
.pl.on { background: #ffb6271a; border-color: #ffb62788; }
.pl.won { background: #ffb62730; border-color: var(--marigold); box-shadow: 0 0 18px #ffb62755; }
.pl.out { opacity: .45; }
.pl.out .nm { text-decoration: line-through; }
.resultx { display: grid; justify-items: center; gap: 4px; margin: 14px 0 4px; padding: 16px; border-radius: var(--r-lg); text-align: center;
           background: #ffffff0d; border: 1px solid var(--hair); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.resultx.mine { background: radial-gradient(90% 90% at 50% 0%, #ffb62740, transparent 70%), #ffffff0d; border-color: #ffb62788; box-shadow: 0 0 30px #ffb62733; }
.resultx .big { font-size: 2.4rem; line-height: 1; }
.resultx b { font: 800 1.45rem/1.15 var(--display); color: var(--paper); }
.resultx > span:not(.big) { font: 700 .95rem var(--display); color: var(--muted); }
.resultx small { color: var(--muted); font-weight: 600; }
.resultx small .timer { font-size: .95rem; }
.handx { --lap: -.42; display: flex; justify-content: safe center; align-items: flex-end; overflow-x: auto; min-height: 96px; margin: 0 -16px; padding: 18px 16px 6px;
         scrollbar-width: none; }
.handx::-webkit-scrollbar { display: none; }
.handx .hc { flex: none; display: block; padding: 0; border: 0; background: none; border-radius: 8px; transition: transform .15s, filter .15s; }
.handx .hc + .hc { margin-left: calc(var(--w, 44px) * var(--lap)); }
.handx.md { --w: 44px; } .handx.lg { --w: 78px; } .handx.sm { --w: 34px; }
.handx .hc.on { transform: translateY(-16px); }
.handx .hc.on .card-p { box-shadow: 0 0 0 3px var(--marigold), 0 8px 16px #0008; }
.handx .hc.no { filter: brightness(.55) saturate(.6); cursor: default; }
.handx button.hc:not(.no):active { transform: translateY(-6px); }
.around { position: relative; height: clamp(270px, 42vh, 400px); margin: 6px -6px 4px; }
.around > .felt { position: absolute; inset: 17% 19% 6%; border-radius: 44%; display: grid; place-items: center; }
.around > .felt::before { content: ''; position: absolute; inset: 9%; border-radius: inherit; border: 1.5px dashed #ffffff26; pointer-events: none; }
.sbox { display: grid; justify-items: center; gap: 4px; width: 84px; }
.sbox > .nm { max-width: 84px; padding: 2px 8px 1px; border-radius: 99px; background: #0a0d29e6; border: 1px solid var(--hair-2); font: 700 .74rem/1.35 var(--body); }
.sbox.on .ring { box-shadow: 0 0 16px #ffb62788; }
.sbox.won .ring { background: var(--marigold); box-shadow: 0 0 22px 2px #ffb627aa; }
.sbox.out { opacity: .45; filter: grayscale(.6); }
.card-p.joker { color: #7c3aed; background: radial-gradient(circle at 50% 55%, #fff 0 30%, transparent 31%), conic-gradient(#ffd35c, #ff5aa5, #7c3aed, #14b8a6, #ffd35c); }
.card-p.joker .pip { font-size: calc(var(--w) * .46); }

/* ---------- motion layer: coins in flight and floating amounts, above the page ---------- */
#fx { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
#fx .coin { position: absolute; width: 22px; margin: -11px 0 0 -11px; }
.rise { position: absolute; font: 800 1.05rem/1 var(--display); color: var(--marigold); text-shadow: 0 2px 0 #000a; white-space: nowrap; animation: rise 1.1s ease-out both; }
@keyframes rise { from { transform: translate(-50%, -20%) scale(.7); opacity: 0 } 20% { transform: translate(-50%, -80%) scale(1.1); opacity: 1 }
                  to { transform: translate(-50%, -260%); opacity: 0 } }

/* dice are shaken under a brass cup that lifts away */
.cup { position: absolute; z-index: 1; inset: -4px 3%; border-radius: 46% 46% 18px 18px / 64% 64% 18px 18px;
       background: linear-gradient(transparent 60%, #0000002e 60% 65%, transparent 65%),
                   radial-gradient(90% 75% at 50% 15%, #ffd58a 0%, #d08a2a 32%, #8a4d0f 72%, #4d2706 100%);
       box-shadow: inset 0 -7px 0 #3a1d04, inset 0 2px 0 #ffe3ad88, 0 12px 22px #000b; animation: cup 1.15s ease-in both; }
@keyframes cup { 0% { transform: translateY(-6px) } 8%, 24%, 40%, 56% { transform: translateX(-6px) rotate(-2.5deg) }
                 16%, 32%, 48%, 64% { transform: translateX(6px) rotate(2.5deg) } 72% { transform: none; opacity: 1 }
                 to { transform: translateY(-90px) rotate(-6deg); opacity: 0 } }

/* ---------- table talk on the board: bubbles by seats, a feed in the corner, floating reactions ---------- */
.bubble { position: absolute; z-index: 6; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 150px; pointer-events: none; }
.bubble .say { position: relative; display: block; padding: 6px 10px 5px; border-radius: 14px; background: var(--paper); color: var(--ink);
               box-shadow: 0 6px 16px #000a; transform-origin: 50% 100%; animation: say 6s ease-out both; }
.bubble .say::after { content: ''; position: absolute; left: calc(50% - 6px); bottom: -5px; width: 12px; height: 12px; border-radius: 2px; background: inherit; transform: rotate(45deg); }
.bubble .t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font: 700 .82rem/1.3 var(--body); }
.seat.l > .bubble { left: 2px; transform: none; }
.seat.l > .bubble .say { transform-origin: 16px 100%; }
.seat.l > .bubble .say::after { left: 16px; }
.seat.r > .bubble { left: auto; right: 2px; transform: none; }
.seat.r > .bubble .say { transform-origin: calc(100% - 16px) 100%; }
.seat.r > .bubble .say::after { left: auto; right: 16px; }
.seat.t > .bubble { bottom: auto; top: 10px; left: calc(100% + 10px); transform: none; max-width: min(120px, calc(50vw - 70px)); }
.seat.t > .bubble .say { transform-origin: 0 16px; }
.seat.t > .bubble .say::after { left: -5px; top: 12px; bottom: auto; }
@keyframes say { 0% { opacity: 0; transform: translateY(6px) scale(.6) } 5% { opacity: 1; transform: none } 90% { opacity: 1 } to { opacity: 0 } }
.feed { position: absolute; z-index: 6; left: 8px; bottom: 8px; display: grid; justify-items: start; gap: 4px; max-width: min(72%, 280px); pointer-events: none; }
.feed p { padding: 4px 10px 3px; border-radius: 12px; border: 1px solid var(--hair-2); background: #0a0d29e6; box-shadow: 0 4px 12px #0007;
          font: 600 .8rem/1.3 var(--body); color: var(--text); overflow-wrap: anywhere; transform-origin: 0 100%; animation: say 6s ease-out both; }
.feed p b { margin-right: 6px; font-weight: 800; color: var(--marigold); }
.float { position: absolute; z-index: 7; left: 50%; bottom: 45%; font-size: 2.2rem; line-height: 1; pointer-events: none; text-shadow: 0 4px 10px #000a;
         animation: float 2s ease-out both; }
.feed .float { bottom: 0; }
@keyframes float { 0% { opacity: 0; transform: translate(-50%, 0) scale(.3) } 15% { opacity: 1; transform: translate(-50%, -16px) scale(1.3) }
                   30% { transform: translate(-50%, -22px) scale(1) } 70% { opacity: 1 } to { opacity: 0; transform: translate(-50%, -96px) } }

/* ---------- table talk sheet ---------- */
dialog.sheet { inset: auto 0 0; width: 100%; max-width: 560px; max-height: 88dvh; margin: 0 auto; padding: 0; border: 0; border-radius: 24px 24px 0 0; overflow-y: auto;
               color: var(--text); background: linear-gradient(180deg, var(--s2), var(--bg) 70%); box-shadow: 0 -16px 40px #000b, inset 0 1px 0 #ffffff1f; }
dialog.sheet::backdrop { background: #04061a99; }
dialog.sheet[open] { animation: sheet .24s ease-out; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0 } }
.sheet-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); }
.sheet-in::before { content: ''; justify-self: center; width: 40px; height: 4px; border-radius: 99px; background: var(--hair-2); }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head b { font: 800 1.25rem var(--display); color: var(--paper); }
.sheet-head .muted { flex: 1; }
.talklog { display: grid; align-content: start; gap: 12px; height: min(34dvh, 280px); overflow-y: auto; padding: 12px; border-radius: 16px;
           border: 1px solid var(--hair); background: #080b26; }
.line { display: flex; align-items: flex-start; gap: 9px; }
.line .body { min-width: 0; }
.line .who, .line b { display: block; padding: 0; border: 0; background: none; font: 800 .8rem/1.3 var(--display); color: var(--marigold); }
.line b { color: var(--pos); }
.line p { font-size: .94rem; overflow-wrap: anywhere; }
.reacts { display: flex; justify-content: space-between; gap: 4px; }
.react { flex: 0 1 46px; min-width: 0; height: 46px; padding: 0; border: 1px solid var(--hair); border-radius: 14px; background: #ffffff0d; font-size: 1.45rem; line-height: 1; transition: transform .1s; }
.react:active { transform: scale(.86); }
.phrases { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.phrases::-webkit-scrollbar { display: none; }
.phrase { flex: none; min-height: 38px; padding: 0 14px; border: 1px solid var(--hair-2); border-radius: 99px; background: var(--s3); color: var(--paper);
          font: 700 .9rem var(--body); white-space: nowrap; }
.phrase:active { background: var(--s2); }
.talkform { display: flex; gap: 8px; }
.talkform input, .talkform .btn { min-height: 46px; }
.sheet .error { min-height: 0; margin: -6px 0 0; }
.sheet .error:empty { display: none; }
.sheet .hint { margin: -4px 0 0; font-weight: 600; }

/* ---------- voice and everyone's switches ---------- */
#mic.on { background: var(--teal); border-color: transparent; color: #03211d; }
#mic.dim { opacity: .5; }
#mic.talking, [data-who].talking .av, .vp.talking .av { box-shadow: 0 0 0 2px var(--teal), 0 0 14px 3px #14b8a6b3; transition: box-shadow .12s; }
.marks { position: absolute; z-index: 5; top: -6px; right: -6px; display: flex; gap: 2px; pointer-events: none; }
.marks i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #0a0d29; border: 1px solid var(--hair-2); color: var(--muted); }
.marks i.mic { background: var(--teal); border-color: transparent; color: #03211d; }
.marks svg, .vp .icon svg { width: 11px; height: 11px; }
.vstrip { position: absolute; z-index: 6; top: 8px; right: 8px; display: flex; gap: 6px; pointer-events: none; }
.vp { position: relative; display: inline-grid; padding: 0; border: 0; background: none; color: inherit; }
.vp .icon { position: absolute; right: -4px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; background: #0a0d29; border: 1px solid var(--hair-2); color: var(--muted); }
.vp .icon.on { background: var(--teal); border-color: transparent; color: #03211d; }
.vp.hush { opacity: .45; }
.talkset { display: grid; gap: 10px; }
.tsws { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tsw { display: grid; justify-items: center; gap: 3px; min-height: 58px; padding: 8px 4px 6px; border: 1px solid var(--hair-2); border-radius: 14px;
       background: #ffffff0d; color: var(--muted); font: 700 .78rem var(--display); }
.tsw[aria-checked=true] { background: #14b8a626; border-color: #14b8a688; color: var(--pos); }
.vrow { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.vrow small { flex: none; color: var(--muted); font: 700 .8rem var(--display); }
.vpeople { display: flex; flex-wrap: wrap; gap: 10px; }
.chatoff { padding: 18px 14px; border-radius: 16px; border: 1px dashed var(--hair-2); text-align: center; color: var(--muted); font-weight: 600; }
.livenow i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 8px var(--pos); vertical-align: 1px; }
.livenow:has(+ .subtitle) { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .enter, .flip-in, .pop, .rolling, .stamp.new, .tok.legal, .gain, .skel, .rise, .zone.win, .jdie.win, .jcell.win, dialog.sheet[open], .resultx, .wseat { animation: none !important; }
  .bubble .say, .feed p, .float { animation-name: fade-late !important; }
  .float { transform: translate(-50%, -20px); }
  .btn, .pchip, .ticket, .switch, .switch::after, .tab .icon, #toast, .react, .cat, .tile, .pl, .handx .hc { transition: none; }
}
@keyframes fade-late { 0%, 90% { opacity: 1 } to { opacity: 0 } }
