/* Card table kit (games/card-kit/table.js): the felt, the seats around it, the middle, your hand. Shared by Bidstar
   Spades, Moonshot Hearts and Dragonrun Tiến Lên. The felt and card backs come from the card kit's looks (kit.css). */
.ct-felt { position: relative; height: var(--ct-h, 380px); border-radius: 22px; overflow: visible; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), inset 0 10px 60px rgba(0,0,0,0.35), 0 10px 30px rgba(0,0,0,0.35); }
.ct-felt::after { content: ''; position: absolute; inset: 9px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.07); pointer-events: none; }
.ct-mid { position: absolute; inset: 62px 0 42px; pointer-events: none; }
.ct-narrow .ct-mid { inset: 64px 0 44px; }
.ct-short .ct-mid { inset: 40px 0 30px; }
.ct-mid .ck-card, .ct-fly { position: absolute; left: 0; top: 0; transition: transform .26s cubic-bezier(.2,.8,.3,1); box-shadow: 0 0 0 0.6px rgba(0,0,0,0.38), 0 6px 14px rgba(0,0,0,0.35); }
.ct-fly { width: 40px; height: 56px; border-radius: 4px; transition: none; z-index: 30; }
.ct-mid .ck-card.win { box-shadow: 0 0 0 2px #ffd166, 0 0 18px 4px rgba(255,209,102,0.45); }
.ct-play { position: absolute; left: 0; top: 0; transition: transform .3s cubic-bezier(.2,.8,.3,1), opacity .3s, filter .3s; transform-origin: 50% 50%; }
.ct-play .ck-card { position: absolute; left: 0; top: 0; transition: none; }
.ct-play.old { opacity: 0.5; filter: saturate(0.6) brightness(0.8); }

/* ---- the other seats ---- */
.ct-seat { position: absolute; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(5,10,24,0.55); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 4px 14px rgba(0,0,0,0.25); max-width: 46%; transition: box-shadow .25s, border-color .25s, background .25s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ct-seat[hidden] { display: none !important; }
.ct-at-top { top: 10px; left: 50%; transform: translateX(-50%); }
.ct-at-left { left: 10px; top: 44%; transform: translateY(-50%); }
.ct-at-right { right: 10px; top: 44%; transform: translateY(-50%); flex-direction: row-reverse; padding: 6px 6px 6px 10px; }
.ct-at-right .ct-info { text-align: right; }
.ct-seat.cur { border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166, 0 0 22px rgba(255,209,102,0.35); background: rgba(30,24,8,0.6); }
.ct-seat.partner .ct-av { background: linear-gradient(160deg, #2a9d6e, #146048); }
.ct-seat.out { opacity: 0.6; }
.ct-av { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(160deg, #3a5fb0, #22397a); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18); }
.ct-seat.cur .ct-av { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 0 0 2px #ffd166; animation: ct-glow 1.6s ease-in-out infinite; }
.ct-dealer { position: absolute; right: -5px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; background: #ffd166; color: #1a1200; font-size: 10.5px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.ct-info { min-width: 0; line-height: 1.2; }
.ct-who { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.ct-nm { font-weight: 800; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.ct-who em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #8aa3c4; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ct-seat.partner .ct-who em { color: #6fe0b0; }
.ct-sub { font-size: 12px; color: #cfe0ff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-sub b { color: #ffd166; }
.ct-backs { position: relative; flex: none; width: 46px; height: 34px; }
.ct-backs i { position: absolute; left: 50%; bottom: 0; width: 20px; height: 28px; margin-left: -10px; border-radius: 3px; background: var(--ck-back); box-shadow: 0 0 0 0.6px rgba(0,0,0,0.5), inset 0 0 0 1.5px #f3f2ec; transform-origin: 50% 120%; transform: rotate(calc(var(--i) * 5deg)); }
.ct-backs.none { opacity: 0.35; }
.ct-cnt { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #0b1328; border: 1px solid #2a3d63; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; z-index: 2; }
.ct-dots { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); display: inline-flex; gap: 3px; padding: 3px 6px; border-radius: 999px; background: #0b1328; border: 1px solid #2a3d63; }
.ct-dots i, .ct-st-dots i { width: 5px; height: 5px; border-radius: 50%; background: #ffd166; animation: ct-dot 1s ease-in-out infinite; }
.ct-dots i:nth-child(2), .ct-st-dots i:nth-child(2) { animation-delay: .15s; }
.ct-dots i:nth-child(3), .ct-st-dots i:nth-child(3) { animation-delay: .3s; }
.ct-lead { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 999px; background: #55d6ff; color: #04121c; font-size: 9.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }

/* ---- you ---- */
.ct-me { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(5,10,24,0.6); border: 1px solid rgba(255,255,255,0.08); white-space: nowrap; font-size: 12.5px; transition: box-shadow .25s, border-color .25s; }
.ct-me .ct-nm { font-size: 13px; }
.ct-me.cur { border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166, 0 0 18px rgba(255,209,102,0.35); }
.ct-me .ct-dealer { position: static; }
.ct-me .ct-lead { position: static; transform: none; }

/* ---- your hand ---- */
.ct-hand { position: relative; width: 100%; height: 140px; margin: 0; touch-action: none; flex: none; }
.ct-hc { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); padding: 0; margin: 0; border: 0; background: none; border-radius: calc(var(--cw) * 0.1); cursor: pointer; transform-origin: 50% 100%; transition: transform .24s cubic-bezier(.2,.8,.3,1); -webkit-tap-highlight-color: transparent; outline: none; }
.ct-hc .ck-card { box-shadow: 0 0 0 0.6px rgba(0,0,0,0.4), -2px 2px 6px rgba(0,0,0,0.3); transition: transform .14s, filter .2s, box-shadow .2s; }
.ct-hc.no .ck-card { filter: brightness(0.58) saturate(0.6); }
.ct-hc.can { cursor: pointer; }
.ct-hc.no { cursor: default; }
@media (hover: hover) { .ct-hc.can:hover .ck-card, .ct-hand.pick .ct-hc:not(.no):hover .ck-card { transform: translateY(-8px); } }
.ct-hc.sel .ck-card { box-shadow: 0 0 0 2.5px #ffd166, 0 8px 18px rgba(0,0,0,0.45); }
.ct-hc.hint .ck-card { animation: ck-pulse 1.1s ease-in-out infinite; }
.ct-hc.got .ck-card::before { content: ''; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; border-radius: 50%; background: #55d6ff; box-shadow: 0 0 0 2px #fff; z-index: 3; }
.ct-hc:focus-visible .ck-card { box-shadow: 0 0 0 3px #55d6ff, 0 8px 18px rgba(0,0,0,0.45); }
.ct-hand.lift .ct-hc .ck-card { transition: transform .1s; }

/* ---- bubbles ---- */
.ct-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.ct-bubble { position: absolute; padding: 5px 11px; border-radius: 12px; background: #f4f7fb; color: #0b1328; font-weight: 800; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,0.4); white-space: nowrap; animation: ct-pop .25s cubic-bezier(.2,1.3,.4,1); transition: opacity .35s, transform .35s; }
.ct-bubble.go { opacity: 0; transform: translateY(-8px); }
.ct-bubble.gold { background: #ffd166; color: #1a1200; }
.ct-bubble.red { background: #ff6b81; color: #fff; }
.ct-bubble.at-top { top: 64px; left: 50%; margin-left: -40px; }
.ct-bubble.at-left { left: 14px; top: calc(44% + 44px); }
.ct-bubble.at-right { right: 14px; top: calc(44% + 44px); }
.ct-bubble.at-bottom { bottom: 46px; left: 50%; margin-left: -40px; }

/* ---- narrow (phones) ---- */
.ct-narrow .ct-seat { flex-direction: column; gap: 3px; padding: 6px 6px 7px; max-width: 30%; text-align: center; }
.ct-narrow .ct-at-top { flex-direction: row; text-align: left; padding: 5px 9px 5px 5px; max-width: 70%; top: 8px; }
.ct-narrow .ct-at-left { left: 6px; }
.ct-narrow .ct-at-right { right: 6px; }
.ct-narrow .ct-at-right .ct-info { text-align: center; }
.ct-narrow .ct-seat .ct-who { justify-content: center; flex-wrap: wrap; row-gap: 0; }
.ct-narrow .ct-at-top .ct-who { justify-content: flex-start; }
.ct-narrow .ct-nm { max-width: 84px; font-size: 12.5px; }
.ct-narrow .ct-sub { font-size: 11.5px; }
.ct-narrow .ct-av { width: 30px; height: 30px; font-size: 13px; }
.ct-narrow .ct-backs { width: 40px; height: 28px; }
.ct-narrow .ct-backs i { width: 17px; height: 24px; margin-left: -8.5px; }
.ct-narrow .ct-bubble.at-top { top: 54px; }
.ct-narrow .ct-bubble.at-left { left: 6px; top: calc(44% + 64px); }
.ct-narrow .ct-bubble.at-right { right: 6px; top: calc(44% + 64px); }
.ct-short .ct-seat { padding: 4px 8px 4px 4px; }
.ct-short .ct-at-left, .ct-short .ct-at-right { top: 40%; }

@keyframes ct-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes ct-glow { 50% { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 0 0 4px rgba(255,209,102,0.45); } }
@keyframes ct-pop { from { opacity: 0; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .ct-hc, .ct-mid .ck-card, .ct-play { transition: none; } .ct-seat.cur .ct-av, .ct-hc.hint .ck-card { animation: none; } }

/* ---- the game shell (games/card-kit/cardgame.js) ---- */
.cg { position: relative; width: 100%; max-width: 1000px; margin: 0 auto; color: #dfe9ff; font-family: inherit; box-sizing: border-box; }
.ct-narrow .cg-sc small { display: none; }
.cg-top { display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; }
.cg-top .rg-modes { width: 100%; max-width: 460px; }
.cg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cg-sel { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cg-sel label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #8aa3c4; }
.cg-sel label[hidden] { display: none; }
.cg-sel select { min-height: 38px; background: #0b1328; color: #dfe9ff; border: 1px solid #1c2b4a; border-radius: 9px; padding: 0 8px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cg-sel select:disabled { opacity: 0.5; cursor: default; }
.cg-sel select:focus-visible { outline: 2px solid #55d6ff; outline-offset: 1px; }
.cg-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cg-tools .ck-btn { display: inline-flex; align-items: center; gap: 6px; }
.cg-tools .ck-btn svg { width: 18px; height: 18px; flex: none; }
.cg-tools .ck-btn-icon svg { width: 19px; height: 19px; }
.cg-tools #bs-sound .off, .cg-tools #mh-sound .off, .cg-tools #tl-sound .off { display: none; }
.cg-tools .muted .on { display: none; } .cg-tools .muted .off { display: inline; }
.cg-tools [hidden] { display: none !important; }
.cg-daily.on { border-color: #ffd166; color: #ffd166; }
.cg-dline { margin: 0 0 8px; padding: 7px 12px; border-radius: 11px; background: rgba(255,209,102,0.1); border: 1px solid rgba(255,209,102,0.35); font-size: 13px; color: #ffe6a8; }
.cg-dline b { color: #ffd166; }
.cg-dline [data-rg-daily] { color: #dfe9ff; }
.cg-score { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cg-sc { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 11px; background: #0b1328; border: 1px solid #1c2b4a; transition: border-color .2s; }
.cg-sc.me { border-color: rgba(85,214,255,0.55); }
.cg-sc.cur { box-shadow: inset 0 -2px 0 #ffd166; }
.cg-sc .n { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b9c9e4; }
.cg-sc b { margin-left: auto; color: #fff; font-size: 16px; }
.cg-sc small { color: #8aa3c4; font-size: 11.5px; white-space: nowrap; }
.cg-sc .bar { display: block; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); margin-top: 3px; overflow: hidden; }
.cg-sc .bar i { display: block; height: 100%; background: linear-gradient(90deg, #55d6ff, #ffd166); }
.cg-status { min-height: 1.5em; margin: 8px 2px 4px; font-size: 14px; font-weight: 700; color: #b9c9e4; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cg-status.hot { color: #ffd166; }
.ct-st-dots { display: inline-flex; gap: 3px; }
.cg-actions { min-height: 0; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.cg-actions:empty { margin: 0; }
.cg-actions .ck-btn { min-height: 42px; }
.cg-combo { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: #0b1328; border: 1px solid #1c2b4a; color: #8aa3c4; }
.cg-combo.ok { color: #6fe0b0; border-color: rgba(111,224,176,0.5); }
.cg-combo.bad { color: #ff8fa1; border-color: rgba(255,107,129,0.45); }
.cg-hidden { opacity: 0.25; }
.cg-panel { margin-top: 6px; }
.cg-record { margin: 6px 2px 0; font-size: 12.5px; color: #8aa3c4; text-align: center; }
.cg-record b { color: #dfe9ff; }
.cg-clock { position: absolute; right: 10px; bottom: 140px; z-index: 50; padding: 4px 10px; border-radius: 999px; background: #ff6b81; color: #fff; font-weight: 800; font-size: 13px; }
.cg-curtain { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4,8,20,0.94); border-radius: 18px; }
.cg-curtain[hidden] { display: none; }
.cg-curtain-in { text-align: center; padding: 20px; }
.cg-curtain-in p { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 16px; }
.cg-rules p { margin: 0 0 10px !important; color: #cfe0ff !important; font-size: 14px !important; line-height: 1.55 !important; }
.cg-rules b { color: #fff; }
.cg-statline { font-size: 13px !important; }
.cg-statline b { color: #fff; }
.cg-wait { color: #8aa3c4; font-size: 13.5px; margin: 0 !important; align-self: center; }
.cg-res { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.cg-res th { text-align: right; font-size: 11.5px; color: #8aa3c4; font-weight: 700; padding: 4px 6px; text-transform: uppercase; letter-spacing: .04em; }
.cg-res th:first-child, .cg-res td:first-child { text-align: left; }
.cg-res td { text-align: right; padding: 7px 6px; border-top: 1px solid #16213a; color: #dfe9ff; }
.cg-res tr.me td { color: #fff; font-weight: 800; }
.cg-res tr.win td:first-child::after { content: ' ★'; color: #ffd166; }
.cg-res td.big { font-size: 17px; font-weight: 800; color: #fff; }
.cg-res .neg { color: #ff8fa1; } .cg-res .pos { color: #6fe0b0; }
.cg-cards { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.cg-mini { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #f4f2ea; color: #181a20; font-weight: 800; font-size: 12px; line-height: 1.4; }
.cg-mini.red { color: #cf1d31; }
.cg-bidgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 460px; }
.cg-bidgrid .ck-btn { min-height: 42px; padding: 0; font-size: 15px; }
.cg-bidgrid .nil { grid-column: span 2; }
.cg-bidbox { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cg-bidnote { font-size: 12.5px; color: #8aa3c4; text-align: center; margin: 0; }
.cg-fit { height: 100%; display: flex; flex-direction: column; }
.cg-fit .cg-panel { display: none; }
.ct-short .cg-top { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; margin-bottom: 4px; }
.ct-short .cg-top .rg-modes { max-width: 330px; flex: 1 1 300px; }
.ct-short .cg-row { flex: 0 0 auto; }
.ct-short .cg-sel, .ct-short .cg-score, .ct-short .cg-dline { display: none; }
.ct-short .cg-tools .ck-btn { min-height: 34px; padding: 0 8px; }
.ct-short .cg-tools .ck-btn > span:not(.ck-count) { display: none; }
.ct-short .ct-seat { padding: 3px 8px 3px 3px; gap: 6px; }
.ct-short .ct-at-top { top: 5px; }
.ct-short .ct-av { width: 26px; height: 26px; font-size: 12px; }
.ct-short .ct-backs { width: 34px; height: 24px; }
.ct-short .ct-backs i { width: 15px; height: 21px; margin-left: -7.5px; }
.ct-short .ct-me { bottom: 4px; padding: 2px 10px; }
.ct-short .ct-felt::after { inset: 5px; }
.ct-short .cg-score { margin-bottom: 4px; }
.ct-short .cg-status { margin: 3px 0 2px; font-size: 13px; }
.ct-short .cg-sc { padding: 3px 8px; }
@media (max-width: 560px) {
  .cg-sel select { min-height: 36px; font-size: 12.5px; padding: 0 5px; }
  .cg-sel label > span { display: none; }
  .cg-tools .ck-btn { padding: 0 9px; }
  .cg-tools .ck-btn > span:not(.ck-count) { display: none; }
  .cg-tools #bs-new > span, .cg-tools #mh-new > span, .cg-tools #tl-new > span { display: inline; }
  .cg-sc { padding: 5px 8px; gap: 5px; }
  .cg-sc b { font-size: 15px; }
  .cg-score { gap: 4px; }
  .cg-bidgrid { gap: 4px; }
}
.cg-bidgrid .ck-btn.hint { border-color: #55d6ff; animation: ck-pulse 1.1s ease-in-out infinite; }
.ct-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(92%, 470px); padding: 12px; border-radius: 16px; background: rgba(5,10,24,0.82); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 14px 40px rgba(0,0,0,0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: ct-pop .25s cubic-bezier(.2,1.3,.4,1); }
.ct-center[hidden] { display: none; }
.ct-center .cg-bidnote { color: #cfe0ff; }
.ct-narrow .ct-center { width: calc(100% - 12px); padding: 8px; top: auto; bottom: 6px; transform: translateX(-50%); }
.ct-narrow .ct-center .cg-bidgrid .ck-btn { min-height: 36px; font-size: 14px; }
.ct-narrow .ct-center .cg-bidnote { font-size: 12px; }
.ct-felt:has(.ct-center:not([hidden])) .ct-me { opacity: 0; }
.ct-narrow .ct-at-left, .ct-narrow .ct-at-right { top: 38%; }
.ct-hand:focus { outline: none; }
.ct-short .ct-center { top: auto; bottom: 5px; transform: translateX(-50%); width: min(97%, 660px); padding: 6px 8px; }
.ct-short .ct-center .cg-bidgrid { grid-template-columns: repeat(14, minmax(0, 1fr)); max-width: none; gap: 4px; }
.ct-short .ct-center .cg-bidgrid .ck-btn { min-height: 32px; font-size: 13px; }
.ct-short .ct-center .cg-bidnote { font-size: 11.5px; }
.ct-short .ct-center .cg-bidbox { gap: 4px; }
