/* ---------- bluff, rummy, badam saat, gulam chor, dhumbal (g-cards.js) ---------- */
.cg-count { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 1px 4px; border-radius: 99px; background: #0a0d29cc; border: 1px solid var(--hair);
            font: 800 .74rem/1.2 var(--display); color: var(--paper); font-variant-numeric: tabular-nums; }
.cg-count .card-p { --w: 13px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--paper); }
.cg-count .card-p .idx { display: none; }
.cg-dock { padding-top: 0; }
.cg-dock .hint { margin-top: 6px; }
.cg-dock .moves { margin-top: 4px; }

/* bluff */
.bl-center { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; max-width: 92%; text-align: center; }
.bl-round { font: 800 .7rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: #bdf5ee; }
.bl-pile { position: relative; width: 70px; height: 66px; }
.bl-pile .card-p { position: absolute; left: 18px; top: 6px; }
.bl-pile .bl-b0 { transform: rotate(-14deg) translateX(-8px); }
.bl-pile .bl-b1 { transform: rotate(9deg) translateX(6px); }
.bl-pile .bl-b2 { transform: rotate(-4deg) translateY(-2px); }
.bl-pile .bl-b3 { transform: rotate(16deg) translate(4px, 2px); }
.bl-pile .bl-b4 { transform: rotate(-9deg) translate(-3px, -3px); }
.bl-empty { position: absolute; left: 18px; top: 6px; width: 34px; aspect-ratio: 5 / 7; border-radius: 5px; border: 2px dashed #fff5df55; }
.bl-n { position: absolute; z-index: 1; right: -4px; bottom: -2px; min-width: 24px; padding: 2px 6px 0; border-radius: 99px; background: var(--marigold); color: var(--ink);
        font: 800 .8rem/1.3 var(--display); text-align: center; box-shadow: 0 2px 6px #0008; }
.bl-last { padding: 3px 10px 1px; border-radius: 99px; background: #00000040; font: 800 .9rem/1.3 var(--display); color: var(--paper); white-space: nowrap; }
.bl-reveal { display: grid; justify-items: center; gap: 6px; }
.bl-cards { display: flex; }
.bl-cards .card-p + .card-p { margin-left: -10px; }
.bl-reveal b { padding: 3px 10px 1px; border-radius: 99px; font: 800 .88rem/1.3 var(--display); }
.bl-reveal.lie b { background: var(--magenta); color: #fff; }
.bl-reveal.true b { background: var(--teal); color: #03211d; }
.bl-ranks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.bl-rank { min-height: 40px; padding: 2px 0 0; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--s2); color: var(--paper); font: 800 1rem var(--display); }
.bl-rank.on { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }

/* rummy */
.rm-center { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; }
.rm-piles { display: flex; gap: 16px; }
.rm-pile { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--paper); border-radius: 10px; }
.rm-pile:disabled { cursor: default; }
.rm-pile small { font: 800 .7rem var(--display); color: #d6fffa; }
.rm-pile:not(:disabled) > :first-child { border-radius: 6px; animation: rm-glow 1.3s ease-in-out infinite; }
@keyframes rm-glow { 50% { box-shadow: 0 0 0 3px var(--marigold), 0 0 18px #ffb627aa; } }
.rm-stack { position: relative; display: block; }
.rm-stack .rm-top { position: absolute; left: 3px; top: -3px; }
.rm-slot { display: block; width: 44px; aspect-ratio: 5 / 7; border-radius: 6px; border: 2px dashed #fff5df55; }
.rm-joker { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; background: #00000040; font: 700 .78rem var(--display); color: #d6fffa; }
.rm-joker b { color: var(--marigold); }
.handx .hc { position: relative; }
.handx .hc.rm-gap { margin-left: calc(var(--w) * var(--lap) + 10px); }
.handx .hc.rm-wild::after { content: '★'; position: absolute; left: 3px; bottom: 4px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center;
                            background: #7c3aed; color: #fff; font: 800 .6rem/1 var(--display); box-shadow: 0 1px 3px #0008; }
.handx .hc.rm-new .card-p { box-shadow: 0 0 0 2px var(--teal), 0 0 14px #14b8a6aa, 0 6px 12px #0006; }
.handx .hc.rm-new.on .card-p { box-shadow: 0 0 0 3px var(--marigold), 0 8px 16px #0008; }
.rm-trail { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin: 2px -16px 6px; padding: 4px 16px; scrollbar-width: none; }
.rm-trail::-webkit-scrollbar { display: none; }
.rm-trail small { flex: none; font: 800 .66rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rm-d { flex: none; display: grid; justify-items: center; gap: 2px; }
.rm-d i { max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 .62rem var(--body); font-style: normal; color: var(--muted); }
.rm-show { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.rm-group { display: flex; padding: 6px 8px; border-radius: 12px; background: #ffffff0d; border: 1px solid var(--hair); }
.rm-group .card-p + .card-p { margin-left: -14px; }

/* badam saat: each suit row starts at its low card, so every 7 sits in one column */
.bd-center { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; }
.bd-rows { display: grid; gap: 3px; width: 162px; }
.bd-row { display: flex; padding-left: calc(var(--lo) * 11px); }
.bd-row .card-p + .card-p { margin-left: -19px; }
.bd-slot { display: grid; place-items: center; width: 30px; aspect-ratio: 5 / 7; border-radius: 4px; border: 2px dashed #fff5df55; font: 800 .66rem var(--display); color: #fff5df99; }

/* gulam chor */
.gc-center { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; max-width: 92%; text-align: center; }
.gc-fan { display: flex; justify-content: center; padding-top: 8px; }
.gc-back { flex: none; padding: 0; border: 0; background: none; border-radius: 5px; transition: transform .15s; }
.gc-back + .gc-back { margin-left: -22px; }
.gc-back:disabled { cursor: default; }
.gc-back:not(:disabled):is(:hover, :focus-visible) { transform: translateY(-8px); }
.gc-back:not(:disabled) .card-p { box-shadow: 0 0 0 2px var(--marigold); }
.gc-pair { display: grid; justify-items: center; gap: 6px; }

/* dhumbal */
.dh-center { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; }
.dh-piles { display: flex; align-items: flex-end; gap: 14px; }
.dh-throw { display: grid; justify-items: center; gap: 4px; }
.dh-throw small { font: 800 .7rem var(--display); color: #d6fffa; }
.dh-cards { display: flex; }
.dh-cards > * + * { margin-left: -14px; }
.dh-take { padding: 0; border: 0; background: none; border-radius: 6px; }
.dh-take:disabled { cursor: default; }
.dh-take:not(:disabled) .card-p { animation: rm-glow 1.3s ease-in-out infinite; }
.dh-total { margin: 2px 0 0; text-align: center; font: 700 .86rem var(--display); color: var(--muted); }
.dh-total b { color: var(--paper); }
.dh-show { display: grid; gap: 6px; margin: 8px 0 4px; }
.dh-hand { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #ffffff0d; border: 1px solid var(--hair); }
.dh-hand > span { width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 .84rem var(--display); }
.dh-hand .dh-cards > * + * { margin-left: -10px; }
.dh-hand b { margin-left: auto; font: 800 1.05rem var(--display); }
.dh-hand.won { border-color: var(--marigold); }
.dh-hand.won b { color: var(--marigold); }

/* tile art */
.cg-art { position: relative; }
.cg-q { position: absolute; right: -6px; top: -8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: #7c3aed;
        font: 800 1.05rem/1 var(--display); box-shadow: 0 3px 8px #0007; }
.cg-run .card-p:nth-child(n) { transform: rotate(calc(-12deg + var(--k, 0) * 8deg)); }
.cg-run .card-p:nth-child(2) { --k: 1; } .cg-run .card-p:nth-child(3) { --k: 2; } .cg-run .card-p:nth-child(4) { --k: 3; }

@media (prefers-reduced-motion: reduce) {
  .rm-pile:not(:disabled) > :first-child, .dh-take:not(:disabled) .card-p { animation: none; box-shadow: 0 0 0 3px var(--marigold); }
  .gc-back { transition: none; }
}
