/* =========================================================================
   ২৯ (Twenty-Nine) — visual system
   Palette:
     --felt-deep   #0E4034   table felt, page background
     --felt-light  #17614F   felt radial highlight
     --wood-dark   #2A1810   rail / panel background
     --wood-mid    #3B2417   rail gradient edge
     --brass       #CBA135   accents, active states, trump marker
     --brass-soft  #E4C468   hover / highlight brass
     --ivory       #F6EFDD   card faces, primary text on dark
     --team-a      #8C2F39   maroon — team A
     --team-b      #253A66   indigo — team B
     --ink          #241A12  body text on ivory
     --danger      #C1443B
   Type:
     display -> 'Tiro Bangla' (serif, Bengali)
     ui/body -> 'Hind Siliguri'
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Bangla:ital@0;1&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --felt-deep: #0E4034;
  --felt-light: #17614F;
  --wood-dark: #2A1810;
  --wood-mid: #3B2417;
  --brass: #CBA135;
  --brass-soft: #E4C468;
  --ivory: #F6EFDD;
  --team-a: #8C2F39;
  --team-b: #253A66;
  --ink: #241A12;
  --danger: #C1443B;
  --danger-bg: #3a1414;
  --suit-red: #A5333A;
  --suit-black: #22201C;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Hind Siliguri', sans-serif;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 50% 20%, var(--felt-light) 0%, var(--felt-deep) 62%),
    var(--felt-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Tiro Bangla', serif;
  font-weight: 400;
  letter-spacing: .01em;
}

button {
  font-family: 'Hind Siliguri', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
}
button:disabled { cursor: not-allowed; opacity: .5; }

input {
  font-family: 'Hind Siliguri', sans-serif;
}

::selection { background: var(--brass); color: var(--ink); }

.hidden { display: none !important; }

/* -------------------------------------------------------------------
   Shared: brass button
   ------------------------------------------------------------------- */
.btn {
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(180deg, var(--brass-soft), var(--brass));
  color: #2A1B04;
  box-shadow: 0 3px 0 #8a6c1e, 0 6px 14px rgba(0,0,0,.35);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #8a6c1e, 0 3px 8px rgba(0,0,0,.35); }

.btn-ghost {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  background: rgba(246,239,221,.08);
  border: 1px solid rgba(246,239,221,.28);
  color: var(--ivory);
}
.btn-ghost:hover:not(:disabled) { background: rgba(246,239,221,.16); }

.btn-danger {
  background: linear-gradient(180deg, #d95d52, var(--danger));
  color: #2b0906;
  box-shadow: 0 3px 0 #7c261f, 0 6px 14px rgba(0,0,0,.35);
}

/* =========================================================================
   LOBBY (index.html)
   ========================================================================= */

.lobby-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lobby-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.35);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 32px 30px;
  position: relative;
  overflow: hidden;
}

.lobby-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(203,161,53,.22);
  border-radius: 12px;
  pointer-events: none;
}

.lobby-suits {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 6px;
  letter-spacing: 6px;
}
.lobby-suits span:nth-child(1), .lobby-suits span:nth-child(3) { color: var(--suit-red); }
.lobby-suits span:nth-child(2), .lobby-suits span:nth-child(4) { color: var(--ivory); }

.lobby-title {
  text-align: center;
  font-size: 46px;
  margin: 0 0 2px;
  color: var(--brass-soft);
}
.lobby-sub {
  text-align: center;
  margin: 0 0 28px;
  color: rgba(246,239,221,.65);
  font-size: 15px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--brass-soft);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(246,239,221,.25);
  background: rgba(0,0,0,.25);
  color: var(--ivory);
  font-size: 16px;
}
.field input:focus, .field select:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(203,161,53,.25);
}
.field input::placeholder { color: rgba(246,239,221,.35); }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 4px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: rgba(246,239,221,.6);
  font-weight: 600;
  font-size: 15px;
}
.tab-btn.active {
  background: var(--brass);
  color: #2A1B04;
}

.lobby-actions .btn { width: 100%; }
.lobby-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--danger-bg);
  border: 1px solid rgba(193,68,59,.5);
  color: #f1b6b0;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.code-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: rgba(246,239,221,.5);
}

/* Waiting room */
.waiting-panel {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.35);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
  text-align: center;
}
.room-code-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.3);
  border: 1px dashed var(--brass);
  border-radius: 10px;
  padding: 10px 18px;
  margin: 14px 0 24px;
  font-size: 28px;
  letter-spacing: 6px;
  font-weight: 700;
  color: var(--brass-soft);
}
.copy-btn {
  background: none;
  color: var(--brass-soft);
  font-size: 13px;
  text-decoration: underline;
  padding: 4px;
}
.seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.seat-slot {
  border: 1px solid rgba(246,239,221,.2);
  border-radius: 10px;
  padding: 14px 10px;
  background: rgba(0,0,0,.18);
}
.seat-slot.filled { border-color: rgba(203,161,53,.5); background: rgba(203,161,53,.08); }
.seat-slot .seat-name { font-weight: 600; font-size: 15px; }
.seat-slot .seat-team { font-size: 12px; margin-top: 4px; opacity: .75; }
.seat-slot.team-0 .seat-team { color: #e79aa2; }
.seat-slot.team-1 .seat-team { color: #9db4e6; }
.seat-slot.empty { color: rgba(246,239,221,.35); font-size: 14px; }

/* =========================================================================
   GAME TABLE (game.html)
   ========================================================================= */

.table-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border-bottom: 3px solid var(--brass);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  z-index: 20;
}
.topbar .brand {
  font-family: 'Tiro Bangla', serif;
  font-size: 22px;
  color: var(--brass-soft);
  margin-right: auto;
  white-space: nowrap;
}
.topbar .chip {
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(203,161,53,.35);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.topbar .chip b { color: var(--brass-soft); }
.score-chip .team-a-dot, .score-chip .team-b-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
.team-a-dot { background: var(--team-a); }
.team-b-dot { background: var(--team-b); }

.arena {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 16px 210px;
  overflow: hidden;
}

.felt-oval {
  position: relative;
  width: min(880px, 92vw);
  height: min(520px, 62vh);
  background: radial-gradient(ellipse at 50% 40%, var(--felt-light), var(--felt-deep) 75%);
  border-radius: 50% / 46%;
  border: 12px solid var(--wood-dark);
  outline: 3px solid var(--brass);
  outline-offset: -9px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.55), var(--shadow);
}

/* seat positions around the oval */
.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ivory);
}
.seat-top    { top: -20px; left: 50%; transform: translate(-50%, -50%); }
.seat-left   { left: -18px; top: 50%; transform: translate(-50%, -50%); }
.seat-right  { right: -18px; top: 50%; transform: translate(50%, -50%); }

.seat-badge {
  background: rgba(20,12,6,.82);
  border: 2px solid rgba(203,161,53,.5);
  border-radius: 12px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  min-width: 96px;
  transition: border-color .15s, box-shadow .15s;
}
.seat-badge .nm { display: block; }
.seat-badge .tm { font-size: 11px; opacity: .7; font-weight: 500; }
.seat-badge.turn { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(203,161,53,.3), 0 0 18px rgba(203,161,53,.5); }
.seat-badge.dealer::after { content: ' • ডিলার'; font-size: 10px; opacity: .7; }
.seat-badge.disconnected { opacity: .4; }

.card-back-row { display: flex; }
.mini-card-back {
  width: 26px; height: 38px;
  background: repeating-linear-gradient(45deg, var(--team-b), var(--team-b) 4px, #1a2949 4px, #1a2949 8px);
  border: 1.5px solid var(--ivory);
  border-radius: 5px;
  margin-left: -14px;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.mini-card-back:first-child { margin-left: 0; }

/* center trick area */
.trick-area {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 220px; height: 160px;
}
.trick-slot {
  position: absolute;
  width: 56px; height: 80px;
  transition: all .25s ease;
}
.trick-slot.from-top    { top: 0; left: 50%; transform: translate(-50%, 0); }
.trick-slot.from-left   { left: 0; top: 50%; transform: translate(0, -50%) rotate(-8deg); }
.trick-slot.from-right  { right: 0; top: 50%; transform: translate(0, -50%) rotate(8deg); }
.trick-slot.from-bottom { bottom: 0; left: 50%; transform: translate(-50%, 0); }

.trump-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(20,12,6,.85);
  border: 2px solid var(--brass);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.trump-badge .suit-icon { font-size: 20px; display: block; }

/* playing card */
.card {
  width: 56px; height: 80px;
  border-radius: 7px;
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid rgba(0,0,0,.25);
  box-shadow: 0 3px 6px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 5px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.card.red { color: var(--suit-red); }
.card.black { color: var(--suit-black); }
.card .rank-top { text-align: left; }
.card .suit-mid { text-align: center; font-size: 22px; margin-top: -4px; }
.card .rank-bottom { text-align: right; transform: rotate(180deg); }

/* your hand */
.hand-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 15;
  pointer-events: none;
}
.hand-status {
  background: rgba(20,12,6,.85);
  border: 1px solid rgba(203,161,53,.4);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 14px;
  pointer-events: auto;
}
.hand-status.your-turn { border-color: var(--brass); color: var(--brass-soft); font-weight: 700; }

.hand-row {
  display: flex;
  justify-content: center;
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  padding: 6px 10px 10px;
}
.hand-row .card {
  width: 62px; height: 90px;
  font-size: 17px;
  margin-left: -24px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, margin .12s ease;
}
.hand-row .card:first-child { margin-left: 0; }
.hand-row .card:hover { transform: translateY(-14px); box-shadow: 0 10px 18px rgba(0,0,0,.5); z-index: 2; }
.hand-row .card.playable { outline: 2px solid rgba(203,161,53,.7); }
.hand-row .card.unplayable { opacity: .45; cursor: not-allowed; }
.hand-row .card.unplayable:hover { transform: none; }

/* -------------------------------------------------------------------
   Overlays: bidding / trump selection / round end / match end
   ------------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(6,4,2,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
  padding: 20px;
}
.overlay-card {
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.4);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
  width: 100%; max-width: 420px;
  text-align: center;
}
.overlay-card h2 { margin: 0 0 6px; color: var(--brass-soft); font-size: 26px; }
.overlay-card p { margin: 0 0 18px; font-size: 15px; color: rgba(246,239,221,.8); }

.bid-current {
  font-size: 40px;
  font-weight: 700;
  color: var(--brass-soft);
  margin: 8px 0 18px;
}
.bid-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}
.bid-step-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(246,239,221,.1);
  border: 1px solid rgba(246,239,221,.3);
  color: var(--ivory);
  font-size: 20px;
  font-weight: 700;
}
.bid-value {
  font-size: 28px;
  font-weight: 700;
  min-width: 64px;
}
.overlay-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.bid-log {
  margin-top: 18px;
  text-align: left;
  font-size: 13px;
  max-height: 110px;
  overflow-y: auto;
  border-top: 1px solid rgba(246,239,221,.15);
  padding-top: 10px;
  color: rgba(246,239,221,.7);
}
.bid-log div { padding: 2px 0; }

.suit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.suit-choice {
  padding: 20px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 2px solid rgba(246,239,221,.2);
  font-size: 34px;
}
.suit-choice.red { color: var(--suit-red); }
.suit-choice.black { color: var(--ivory); }
.suit-choice span { display: block; font-size: 13px; margin-top: 6px; color: rgba(246,239,221,.7); }
.suit-choice:hover { border-color: var(--brass); background: rgba(203,161,53,.12); }

.round-summary { text-align: left; margin: 12px 0 20px; font-size: 15px; }
.round-summary .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed rgba(246,239,221,.15); }
.round-summary .row b { color: var(--brass-soft); }
.round-summary .winner-line { text-align: center; font-size: 18px; margin: 14px 0; color: var(--brass-soft); font-weight: 700; }

.rematch-status { font-size: 13px; margin-top: 12px; color: rgba(246,239,221,.6); }

/* -------------------------------------------------------------------
   Chat drawer
   ------------------------------------------------------------------- */
.chat-toggle {
  position: fixed;
  right: 18px;
  bottom: 190px;
  z-index: 30;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brass-soft), var(--brass));
  color: #2A1B04;
  font-size: 22px;
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.chat-toggle .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  min-width: 18px; height: 18px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.chat-drawer {
  position: fixed;
  right: 18px;
  bottom: 190px;
  width: 320px;
  max-width: calc(100vw - 36px);
  max-height: 60vh;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.4);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow: hidden;
}
.chat-drawer-head {
  padding: 10px 14px;
  background: rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px;
}
.chat-drawer-head button { background: none; color: var(--ivory); font-size: 18px; opacity: .7; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.chat-msg { max-width: 88%; }
.chat-msg .who { font-size: 11px; color: var(--brass-soft); margin-bottom: 2px; }
.chat-msg .bubble {
  background: rgba(246,239,221,.1);
  border-radius: 10px;
  padding: 7px 10px;
  display: inline-block;
}
.chat-msg.mine { align-self: flex-end; text-align: right; }
.chat-msg.mine .bubble { background: rgba(203,161,53,.28); }
.chat-msg.emoji .bubble { font-size: 26px; padding: 2px 6px; background: transparent; }
.chat-msg.system { align-self: center; font-size: 12px; color: rgba(246,239,221,.5); }

.emoji-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px 0;
  flex-wrap: wrap;
}
.emoji-row button {
  background: rgba(246,239,221,.08);
  border-radius: 8px;
  font-size: 20px;
  padding: 4px 7px;
}
.emoji-row button:hover { background: rgba(203,161,53,.25); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(246,239,221,.12);
}
.chat-input-row input {
  flex: 1;
  border-radius: 8px;
  border: 1px solid rgba(246,239,221,.25);
  background: rgba(0,0,0,.25);
  color: var(--ivory);
  padding: 8px 10px;
  font-size: 14px;
}
.chat-input-row button {
  background: var(--brass);
  color: #2A1B04;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

/* floating emoji burst on the table */
.float-emoji {
  position: fixed;
  font-size: 34px;
  z-index: 50;
  pointer-events: none;
  animation: floatUp 1.8s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-140px) scale(1); }
}

/* toast */
.toast {
  position: fixed;
  top: 74px; left: 50%;
  transform: translateX(-50%);
  background: rgba(20,12,6,.92);
  border: 1px solid rgba(203,161,53,.5);
  color: var(--ivory);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 60;
  box-shadow: var(--shadow);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* responsive */
@media (max-width: 640px) {
  .felt-oval { width: 94vw; height: 50vh; }
  .card { width: 40px; height: 58px; font-size: 12px; padding: 3px 4px; }
  .card .suit-mid { font-size: 16px; }
  .trick-slot { width: 40px; height: 58px; }
  .hand-row .card { width: 52px; height: 76px; font-size: 14px; margin-left: -22px; }
  .chat-drawer, .chat-toggle { right: 10px; bottom: 176px; }
  .arena { padding-top: 70px; padding-bottom: 190px; }
  .topbar .brand { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .float-emoji { animation: none; opacity: 0; }
  .hand-row .card:hover { transform: none; }
}

/* -------------------------------------------------------------------
   Bidding: keep the player's own hand fully visible (no dimming)
   ------------------------------------------------------------------- */
body.is-bidding .hand-dock { z-index: 45; }          /* above .overlay (40) */
body.is-bidding .hand-row .card { opacity: 1; filter: none; cursor: default; }
#biddingOverlay {
  background: rgba(6,4,2,.35);                       /* lighter backdrop for the table */
  align-items: flex-start;
  padding-bottom: 150px;                             /* leave room for the hand dock */
  overflow-y: auto;
}
#biddingOverlay .overlay-card { padding: 18px 20px; }
#biddingOverlay .bid-current { font-size: 32px; margin: 4px 0 10px; }
.bid-stage {
  font-size: 14px;
  color: var(--ivory);
  background: rgba(246,239,221,.08);
  border: 1px solid rgba(203,161,53,.3);
  border-radius: 10px;
  padding: 6px 10px;
  margin: 6px 0 10px;
}
.bid-stage b { color: var(--brass-soft); }
@media (max-width: 600px) {
  #biddingOverlay { padding: 10px 10px 120px; }
}

/* -------------------------------------------------------------------
   Trump as a real playing card (selection, hidden, revealed)
   ------------------------------------------------------------------- */
.big-suit-card {
  position: relative;
  width: 86px; height: 124px;
  border-radius: 10px;
  background: var(--ivory);
  border: 1px solid rgba(0,0,0,.3);
  box-shadow: 0 6px 14px rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; line-height: 1;
  user-select: none;
}
.big-suit-card.red { color: var(--suit-red); }
.big-suit-card.black { color: var(--suit-black); }
.big-suit-card .bsc-big { font-size: 52px; }
.big-suit-card .bsc-name { font-size: 13px; margin-top: 6px; color: inherit; opacity: .85; }
.big-suit-card .bsc-corner { position: absolute; top: 6px; left: 8px; font-size: 18px; }
.big-suit-card .bsc-corner.bsc-bottom { top: auto; left: auto; bottom: 6px; right: 8px; transform: rotate(180deg); }

.big-card-back {
  width: 86px; height: 124px;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, var(--team-b), var(--team-b) 6px, #1a2949 6px, #1a2949 12px);
  border: 3px solid var(--ivory);
  box-shadow: 0 6px 14px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.big-card-back span {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(20,12,6,.8); color: var(--brass-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}

/* selection overlay: 4 full cards */
.trump-card-grid {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  grid-template-columns: none;
  margin: 6px 0 8px;
}
.suit-choice.big-suit-card {
  padding: 0;
  background: var(--ivory);
  border: 2px solid rgba(0,0,0,.3);
  font-size: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.suit-choice.big-suit-card.red { color: var(--suit-red); }
.suit-choice.big-suit-card.black { color: var(--suit-black); }
.suit-choice.big-suit-card span { display: block; margin: 0; color: inherit; }
.suit-choice.big-suit-card .bsc-name { margin-top: 6px; font-size: 13px; }
.suit-choice.big-suit-card:hover,
.suit-choice.big-suit-card:focus-visible {
  transform: translateY(-8px);
  border-color: var(--brass);
  background: #fffaf0;
  box-shadow: 0 12px 22px rgba(0,0,0,.5), 0 0 0 3px rgba(203,161,53,.55);
}
#trumpOverlay { background: rgba(6,4,2,.35); align-items: flex-start; padding-bottom: 150px; overflow-y: auto; }

/* trump card on the table */
.trump-slot {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 5;
}
.trump-slot .big-suit-card, .trump-slot .big-card-back { width: 68px; height: 98px; }
.trump-slot .big-suit-card .bsc-big { font-size: 40px; }
.trump-slot .big-suit-card .bsc-name { font-size: 11px; }
.trump-slot .big-suit-card .bsc-corner { font-size: 14px; }
.trump-slot-label {
  background: rgba(20,12,6,.88);
  border: 1px solid rgba(203,161,53,.5);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.trump-slot.secret .big-suit-card { outline: 3px dashed rgba(203,161,53,.8); outline-offset: 2px; }
.trump-slot.revealed .big-suit-card { box-shadow: 0 0 0 3px var(--brass), 0 8px 18px rgba(0,0,0,.5); }
.trump-slot.revealed .trump-slot-label { border-color: var(--brass); color: var(--brass-soft); }

.reveal-trump-btn { pointer-events: auto; padding: 8px 18px; font-size: 15px; }
/* "তুরুপ দেখান" — in the trump slot, directly above the chooser's name and the hidden card.
   It floats above the slot, so the name and the card stay exactly where they were. */
.trump-slot-reveal {
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translateX(-50%);
  padding-bottom: 8px;                 /* spacing between the button and the name */
  width: max-content; max-width: 150px;
  display: flex; justify-content: center;
}
.trump-slot-reveal .reveal-trump-btn {
  padding: 8px 14px;
  font-size: 14px; line-height: 1.25;
  white-space: normal; text-align: center;     /* the longer seventh-card text wraps instead of growing sideways */
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
@media (max-width: 600px) {
  .trump-slot-reveal { max-width: 118px; padding-bottom: 6px; }
  .trump-slot-reveal .reveal-trump-btn { padding: 6px 10px; font-size: 13px; }
}

/* popup when the trump is revealed */
.trump-reveal-pop {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,4,2,.45);
  z-index: 55;
  cursor: pointer;
}
.trump-reveal-pop .trp-inner {
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 2px solid var(--brass);
  border-radius: 16px;
  padding: 18px 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  animation: trpIn .35s ease-out;
}
.trump-reveal-pop .big-suit-card { width: 110px; height: 158px; }
.trump-reveal-pop .big-suit-card .bsc-big { font-size: 70px; }
.trump-reveal-pop .big-suit-card .bsc-name { font-size: 16px; }
.trp-title { font-size: 20px; font-weight: 700; color: var(--brass-soft); }
.trp-sub { font-size: 14px; color: rgba(246,239,221,.85); text-align: center; }
@keyframes trpIn { from { transform: scale(.7) rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
  .big-suit-card, .big-card-back { width: 66px; height: 96px; }
  .big-suit-card .bsc-big { font-size: 38px; }
  .trump-card-grid { gap: 8px; }
  .trump-slot { top: 6px; right: 6px; }
  .trump-slot .big-suit-card, .trump-slot .big-card-back { width: 46px; height: 66px; }
  .trump-slot .big-suit-card .bsc-big { font-size: 26px; }
  .trump-slot .big-suit-card .bsc-name { display: none; }
  .trump-slot .big-suit-card .bsc-corner { font-size: 11px; top: 3px; left: 4px; }
  .trump-slot .big-suit-card .bsc-corner.bsc-bottom { bottom: 3px; right: 4px; top: auto; left: auto; }
  .trump-slot .big-card-back span { width: 22px; height: 22px; font-size: 13px; }
  .trump-slot-label { font-size: 10px; padding: 2px 6px; }
  #trumpOverlay { padding: 10px 10px 120px; }
}
@media (prefers-reduced-motion: reduce) { .trump-reveal-pop .trp-inner { animation: none; } }
.trump-card-grid { gap: 10px; flex-wrap: nowrap; }
.trump-card-grid .big-suit-card { width: 80px; height: 116px; }
@media (max-width: 600px) { .trump-card-grid .big-suit-card { width: 66px; height: 96px; } .trump-card-grid { gap: 8px; } }

/* -------------------------------------------------------------------
   Seventh-card option, contract badge, Double / Redouble
   ------------------------------------------------------------------- */
.seventh-option { margin-top: 10px; }
.or-line { display: flex; align-items: center; gap: 10px; color: rgba(246,239,221,.6); font-size: 13px; margin: 6px 0 10px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: rgba(246,239,221,.2); }
.suit-choice.seventh-choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  text-align: left;
  color: var(--ivory);
  cursor: pointer;
}
.seventh-choice .sc-back {
  flex: 0 0 auto;
  width: 44px; height: 62px; border-radius: 7px;
  background: repeating-linear-gradient(45deg, var(--team-b), var(--team-b) 5px, #1a2949 5px, #1a2949 10px);
  border: 2px solid var(--ivory);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--brass-soft);
  margin: 0;
}
.seventh-choice .sc-text { display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--ivory); }
.seventh-choice .sc-text b { font-size: 16px; color: var(--brass-soft); }
.seventh-choice .sc-text small { font-size: 12px; color: rgba(246,239,221,.75); }

.big-suit-card.real .bsc-corner { font-size: 14px; line-height: 1.05; text-align: center; }
.big-suit-card .bsc-corner br { display: block; }

.trump-slot-sub {
  font-size: 11px;
  background: rgba(203,161,53,.2);
  border: 1px solid rgba(203,161,53,.5);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.contract-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 5;
  background: rgba(20,12,6,.9);
  border: 2px solid var(--brass);
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  min-width: 96px;
}
.contract-badge .cb-call { font-size: 13px; }
.contract-badge .cb-call b { font-size: 22px; color: var(--brass-soft); margin-left: 4px; }
.contract-badge .cb-who { font-size: 11px; opacity: .8; margin: 2px 0 4px; white-space: nowrap; }
.cb-mode {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px;
  background: rgba(246,239,221,.14); color: var(--ivory);
}
.cb-mode.mode-2 { background: #b7791f; color: #fff; }
.cb-mode.mode-4 { background: var(--suit-red); color: #fff; }

.contract-line { font-size: 15px; margin: 4px 0 10px; }
.contract-line b { color: var(--brass-soft); font-size: 18px; }
#doubleOverlay { background: rgba(6,4,2,.35); align-items: flex-start; padding-bottom: 150px; overflow-y: auto; }
#doubleOverlay .overlay-card { padding: 18px 20px; }
.decision-list { margin-top: 14px; border-top: 1px solid rgba(246,239,221,.15); padding-top: 8px; font-size: 14px; }
.decision-list div { display: flex; justify-content: space-between; padding: 3px 0; }
.decision-list b { color: rgba(246,239,221,.55); font-weight: 600; }
.decision-list b.done { color: var(--brass-soft); }

@media (max-width: 600px) {
  .contract-badge { top: 6px; left: 6px; padding: 4px 8px; min-width: 0; }
  .contract-badge .cb-call b { font-size: 16px; }
  .contract-badge .cb-who { font-size: 10px; }
  .cb-mode { font-size: 10px; padding: 1px 6px; }
  .trump-slot-sub { font-size: 9px; padding: 1px 5px; }
  .big-suit-card.real .bsc-corner { font-size: 10px; }
  #doubleOverlay { padding: 10px 10px 120px; }
}
.big-suit-card.real .bsc-name { display: none; }
.big-suit-card.real .bsc-big { font-size: 46px; }

/* -------------------------------------------------------------------
   Six red / six black scoreboard — real 6♥ and 6♠ cards
   ------------------------------------------------------------------- */
.score-board { display: flex; gap: 14px; align-items: center; }
.score-team {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(203,161,53,.35);
  border-radius: 14px;
  padding: 4px 10px 4px 8px;
}
.score-team-name { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.score-team-name span { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.score-team-text { font-size: 12px; font-weight: 700; min-width: 44px; white-space: nowrap; }
.score-team-text.red { color: #ff8a8a; }
.score-team-text.black { color: var(--ivory); }
.score-team-text.zero { color: rgba(246,239,221,.6); }

.six-pair { position: relative; display: flex; align-items: center; }
.six-card {
  position: relative;
  width: 38px; height: 54px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,.45);
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.six-card + .six-card { margin-left: -12px; }      /* one card resting on the other */
.six-card.active { z-index: 2; box-shadow: 0 0 0 2px var(--brass), 0 3px 8px rgba(0,0,0,.5); }
.six-card.red { color: #c0272d; }
.six-card.black { color: #111; }
.six-idx { position: absolute; top: 2px; left: 2px; font-size: 7px; text-align: center; }
.six-idx-b { top: auto; left: auto; bottom: 2px; right: 2px; transform: rotate(180deg); }
.six-pips {
  position: absolute; inset: 6px 8px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr);
  place-items: center;
}
.six-pip { font-size: 10px; }
.six-pips .six-pip:nth-child(n+5) { transform: rotate(180deg); }
/* covered pip: hidden under the other card's back */
.six-pip.covered {
  color: transparent;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, var(--team-b), var(--team-b) 2px, #1a2949 2px, #1a2949 4px);
  border-radius: 2px;
}

.score-summary { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.score-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-summary > div > span { font-weight: 700; min-width: 50px; }
.score-summary > div > b { color: var(--brass-soft); min-width: 60px; text-align: right; }
.score-summary .six-card { width: 52px; height: 74px; }
.score-summary .six-card + .six-card { margin-left: -16px; }
.score-summary .six-idx { font-size: 10px; }
.score-summary .six-pip { font-size: 14px; }
.score-summary .six-pips { inset: 9px 11px; }

@media (max-width: 640px) {
  .score-board { gap: 6px; }
  .score-team { padding: 3px 6px; gap: 5px; }
  .score-team-name { font-size: 11px; }
  .score-team-text { font-size: 10px; min-width: 0; }
  .six-card { width: 30px; height: 43px; }
  .six-card + .six-card { margin-left: -9px; }
  .six-pips { inset: 5px 6px; }
  .six-pip { font-size: 8px; }
  .six-idx { font-size: 6px; }
}

/* desktop: keep the chat button clear of the (taller) hand dock */
.chat-toggle, .chat-drawer { bottom: 214px; }

/* ===================================================================
   Own hand: bigger cards, less overlap, swipe row, tap-to-select
   =================================================================== */
.hand-dock { gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.hand-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  pointer-events: auto;
  max-width: 100%;
}
.play-card-btn {
  pointer-events: auto;
  padding: 9px 20px;
  font-size: 16px;
  min-height: 44px;
  min-width: 120px;
}
.reveal-trump-btn { min-height: 44px; }

.hand-row {
  justify-content: flex-start;          /* centred via auto margins below; scrolls when too wide */
  width: 100%;
  padding: 22px 12px 8px;               /* top room for the lifted (selected) card */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
}
.hand-row .card {
  width: 70px; height: 100px;
  font-size: 20px;
  margin-left: -20px;                   /* 50px of every card stays visible */
  padding: 5px 6px;
  -webkit-tap-highlight-color: transparent;
}
.hand-row .card:first-child { margin-left: auto; }
.hand-row .card:last-child { margin-right: auto; }
.hand-row .card .rank-top { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.hand-row .card .corner-suit { font-size: 17px; line-height: 1; }
.hand-row .card .suit-mid { font-size: 30px; }
.card .corner-suit { display: none; }
.hand-row .card .corner-suit { display: block; }

/* hover lift only for real mouse pointers — no sticky "hover" on phones */
.hand-row .card:hover { transform: none; box-shadow: 0 3px 6px rgba(0,0,0,.4); }
@media (hover: hover) and (pointer: fine) {
  .hand-row .card.playable:hover { transform: translateY(-8px); box-shadow: 0 10px 18px rgba(0,0,0,.5); z-index: 2; }
}
.hand-row .card.selected,
.hand-row .card.selected:hover {
  transform: translateY(-18px);
  outline: 3px solid var(--brass-soft);
  outline-offset: 0;
  box-shadow: 0 0 0 5px rgba(203,161,53,.35), 0 12px 20px rgba(0,0,0,.55);
  z-index: 3;
}
.hand-row .card.unplayable { opacity: .5; }

.hand-hint {
  font-size: 11px;
  color: rgba(246,239,221,.7);
  pointer-events: none;
  margin-top: -2px;
}

@media (max-width: 640px) {
  .hand-row .card { width: 62px; height: 90px; font-size: 19px; margin-left: -17px; padding: 4px 5px; } /* 45px visible */
  .hand-row .card .corner-suit { font-size: 16px; }
  .hand-row .card .suit-mid { font-size: 26px; }
  .hand-row { padding: 20px 6px 6px; }
  .hand-status { font-size: 13px; padding: 6px 12px; }
  .play-card-btn { font-size: 15px; padding: 8px 16px; }
  /* chat button above the hand dock so it never covers cards or buttons */
  .chat-toggle { width: 44px; height: 44px; font-size: 19px; right: 8px; bottom: calc(196px + env(safe-area-inset-bottom, 0px)); }
  .chat-drawer { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); }
  .arena { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) {
  .hand-row .card { width: 58px; height: 84px; font-size: 18px; margin-left: -16px; } /* 42px visible */
  .hand-row .card .suit-mid { font-size: 24px; }
}
/* the lifted card keeps its neighbours' corners visible */
.hand-row .card { position: relative; }
.hand-row .card.selected, .hand-row .card.selected:hover { z-index: auto; }
/* not-allowed cards: dimmed but solid, so overlapping cards don't show through */
.hand-row .card.unplayable { opacity: 1; filter: grayscale(.45) brightness(.72); }

/* ===================================================================
   Card motion (synced with sound) + sound controls
   =================================================================== */
/* a played card slides in from its player's side */
.trick-slot .card.enter-bottom { animation: enterBottom .28s cubic-bezier(.2,.7,.3,1) both; }
.trick-slot .card.enter-top    { animation: enterTop .28s cubic-bezier(.2,.7,.3,1) both; }
.trick-slot .card.enter-left   { animation: enterLeft .28s cubic-bezier(.2,.7,.3,1) both; }
.trick-slot .card.enter-right  { animation: enterRight .28s cubic-bezier(.2,.7,.3,1) both; }
@keyframes enterBottom { from { transform: translateY(150px) scale(1.15); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes enterTop    { from { transform: translateY(-130px) scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes enterLeft   { from { transform: translateX(-150px) scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes enterRight  { from { transform: translateX(150px) scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }

/* finished trick is swept toward the winner */
.trick-area.collecting .trick-slot .card { animation: sweepToWinner .45s cubic-bezier(.45,.05,.55,.95) forwards; }
@keyframes sweepToWinner {
  0%   { transform: none; opacity: 1; }
  25%  { transform: translate(calc(var(--cx) * .2), calc(var(--cy) * .2)) scale(.92); opacity: 1; }
  75%  { opacity: .9; }
  100% { transform: translate(var(--cx), var(--cy)) scale(.5); opacity: 0; }
}

/* newly dealt cards drop into the hand, one per deal tick */
.hand-row .card.deal-in { animation: dealIn .26s cubic-bezier(.2,.7,.3,1) both; }
@keyframes dealIn { from { transform: translateY(-120px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .trick-slot .card[class*="enter-"], .trick-area.collecting .trick-slot .card, .hand-row .card.deal-in { animation-duration: .01s; }
}

.sound-toggle {
  position: fixed;
  right: 18px;
  bottom: 274px;
  z-index: 30;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(20,12,6,.9);
  border: 2px solid var(--brass);
  color: var(--ivory);
  font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.sound-toggle.off { opacity: .75; border-color: rgba(246,239,221,.4); }
.sound-panel {
  position: fixed;
  right: 70px;
  bottom: 262px;
  z-index: 31;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.55);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 200px;
  box-shadow: var(--shadow);
}
.sound-onoff {
  min-height: 40px;
  border-radius: 20px;
  background: var(--brass);
  color: #2A1B04;
  font-weight: 700;
  font-size: 15px;
}
.sound-onoff.off { background: rgba(246,239,221,.15); color: var(--ivory); }
.sound-vol { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.sound-vol input { flex: 1; min-width: 90px; accent-color: var(--brass); height: 28px; }
.sound-vol span { min-width: 36px; text-align: right; }
.sound-unlock {
  position: fixed;
  left: 50%; top: 64px;
  transform: translateX(-50%);
  z-index: 58;
  background: var(--brass);
  color: #2A1B04;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 22px;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
  animation: toastIn .3s ease-out;
}
@media (max-width: 640px) {
  .sound-toggle { right: 8px; width: 40px; height: 40px; font-size: 17px; bottom: calc(248px + env(safe-area-inset-bottom, 0px)); }
  .sound-panel { right: 54px; bottom: calc(236px + env(safe-area-inset-bottom, 0px)); min-width: 0; width: min(230px, calc(100vw - 70px)); }
  .sound-unlock { top: auto; bottom: calc(300px + env(safe-area-inset-bottom, 0px)); }
}

/* ===================================================================
   Rejoin / reconnect
   =================================================================== */
.net-banners {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: 70px;
  z-index: 57;
  display: flex; flex-direction: column; gap: 6px;
  width: min(560px, calc(100vw - 24px));
  pointer-events: none;
}
.net-banner {
  background: rgba(60,30,8,.95);
  border: 1px solid #e0a43a;
  color: var(--ivory);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}
.net-banner.own { background: rgba(120,24,24,.95); border-color: #ff9a9a; }
.net-banner b { color: var(--brass-soft); }
.net-banner .wait-note { display: block; font-size: 12px; color: #ffd98a; }
.net-banner div + div { margin-top: 4px; }

.rejoin-card {
  background: rgba(203,161,53,.14);
  border: 2px solid var(--brass);
  border-radius: 14px;
  padding: 14px;
  margin: 4px 0 16px;
  text-align: center;
}
.rejoin-title { font-size: 17px; font-weight: 700; color: var(--brass-soft); margin-bottom: 6px; }
.rejoin-info { font-size: 14px; margin-bottom: 10px; line-height: 1.5; }
.rejoin-info small { opacity: .8; }
.rejoin-btn { width: 100%; min-height: 46px; font-size: 16px; }

@media (max-width: 640px) {
  .net-banners { top: 178px; }
  .net-banner { font-size: 13px; padding: 7px 10px; }
}
/* keep notices clear of the overlays at the top and the buttons on the right */
.net-banners { top: auto; bottom: 232px; }
.sound-unlock { top: auto; left: auto; right: 72px; bottom: 274px; transform: none; }
@media (max-width: 640px) {
  .net-banners { top: auto; left: 10px; transform: none; width: calc(100vw - 66px); bottom: calc(272px + env(safe-area-inset-bottom, 0px)); } /* above the Mic / Speaker buttons */
  .sound-unlock { right: 56px; bottom: calc(248px + env(safe-area-inset-bottom, 0px)); }
}

/* ===================================================================
   Spectator mode
   =================================================================== */
.spect-chip { cursor: pointer; color: var(--ivory); font: inherit; }
.spect-chip:hover { border-color: var(--brass); }
.spect-panel {
  position: fixed;
  top: 64px; right: 14px;
  z-index: 59;
  width: min(320px, calc(100vw - 24px));
  max-height: 60vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.55);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.spect-panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--brass-soft); }
.spect-panel-head button { margin-left: auto; background: none; color: var(--ivory); font-size: 18px; min-width: 36px; min-height: 36px; }
.spect-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed rgba(246,239,221,.15); font-size: 14px; }
.spect-actions { display: flex; gap: 6px; flex-shrink: 0; }
.spect-actions button { font-size: 12px; padding: 6px 8px; min-height: 32px; border-radius: 8px; background: rgba(246,239,221,.14); color: var(--ivory); }
.spect-actions button.danger { background: rgba(165,51,58,.85); }
.spect-empty { font-size: 13px; opacity: .75; }
.muted-tag, .off-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: rgba(165,51,58,.6); }
.off-tag { background: rgba(246,239,221,.18); }
.spect-note { margin: 10px 0; font-size: 15px; color: var(--brass-soft); }

.role-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; vertical-align: middle; }
.role-tag.spect { background: #6b4fa8; color: #fff; }
.role-tag.team-0 { background: var(--team-a); color: #fff; }
.role-tag.team-1 { background: var(--team-b); color: #fff; }

/* spectators have no hand: show all four seats, no action buttons */
.seat-bottom { bottom: -20px; left: 50%; transform: translate(-50%, 50%); }
body.spectating .hand-row,
body.spectating .hand-hint,
body.spectating .play-card-btn,
body.spectating .reveal-trump-btn,
body.spectating #nextRoundBtn { display: none !important; }   /* the rematch button is for spectators too */
body.spectating .hand-status { border-color: #8a6fd1; }

@media (max-width: 640px) {
  .spect-panel { top: auto; bottom: calc(210px + env(safe-area-inset-bottom, 0px)); right: 10px; }
  .spect-chip { padding: 5px 10px; font-size: 12px; }
}
.lobby-actions .btn-ghost { width: 100%; margin-top: 8px; min-height: 44px; }
/* spectators can still reach the top bar and chat while a result is shown */
body.spectating .overlay { pointer-events: none; }
body.spectating .overlay .overlay-card { pointer-events: auto; }

/* update notice */
.net-banner.update { pointer-events: auto; background: rgba(24,52,36,.97); border-color: var(--brass); }
.update-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.update-actions .btn, .update-actions .btn-ghost { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* release test 1790176867244 */
.brand{letter-spacing:.5px}

/* ===================================================================
   Marriage (trump K–Q)
   =================================================================== */
.marriage-btn { pointer-events: auto; min-height: 44px; padding: 8px 16px; font-size: 15px;
  background: linear-gradient(180deg, #f3d27a, #cba135); box-shadow: 0 0 0 3px rgba(243,210,122,.35); }
.contract-badge .cb-target {
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed rgba(203,161,53,.5);
  font-size: 11px; line-height: 1.35;
}
.contract-badge .cb-target b { font-size: 16px; color: var(--brass-soft); }
.marriage-pop {
  position: fixed;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  z-index: 56;
  pointer-events: none;             /* never blocks the cards */
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 2px solid var(--brass);
  border-radius: 14px;
  padding: 12px 18px;
  text-align: center;
  font-size: 15px;
  box-shadow: var(--shadow);
  width: min(360px, calc(100vw - 32px));
  animation: trpIn .35s ease-out;
}
.marriage-pop .mp-cards { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.marriage-pop .mp-cards span {
  background: #fff; color: #111; font-weight: 700; font-size: 20px;
  border-radius: 6px; padding: 8px 10px; box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.marriage-pop .mp-cards span.red { color: #c0272d; }
.marriage-pop .mp-sub { font-size: 13px; margin-top: 6px; color: rgba(246,239,221,.85); }
.marriage-pop .mp-sub b { color: var(--brass-soft); font-size: 15px; }

/* cancelled deal (four jacks / first bidder has no points) → "dealing again" notice (everyone sees it) */
.redeal-pop {
  position: fixed;
  left: 50%; top: 72px;
  transform: translateX(-50%);
  z-index: 61;                      /* above the bidding overlay and toasts */
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 2px solid var(--brass);
  border-radius: 14px;
  padding: 14px 18px 12px;
  text-align: center;
  color: var(--ivory);
  box-shadow: var(--shadow), 0 0 0 4px rgba(0,0,0,.25);
  width: min(400px, calc(100vw - 24px));
  animation: redealIn .3s ease-out;
}
@keyframes redealIn { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.redeal-pop .rp-title { color: var(--brass-soft); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.redeal-pop .rp-title small { font-size: 13px; font-weight: 400; color: rgba(246,239,221,.75); }
.redeal-pop .rp-cards { display: flex; justify-content: center; gap: 6px; margin-bottom: 9px; }
.redeal-pop .rp-cards span {
  background: #fff; color: #111; font-weight: 700; font-size: 17px;
  border-radius: 6px; padding: 6px 8px; box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.redeal-pop .rp-cards span.red { color: #c0272d; }
.redeal-pop .rp-zero {
  display: inline-block; margin-bottom: 9px; padding: 4px 14px;
  border-radius: 999px; border: 1px solid rgba(203,161,53,.6);
  background: rgba(0,0,0,.28); color: var(--brass-soft); font-weight: 700; font-size: 16px;
}
.redeal-pop .rp-text { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.redeal-pop .rp-text b { color: var(--brass-soft); }
.redeal-pop .rp-teams { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 14px; color: rgba(246,239,221,.9); overflow-wrap: anywhere; }
.redeal-pop .rp-me { margin-top: 8px; font-size: 15px; }
.redeal-pop .rp-me b { color: var(--brass-soft); }
/* match end: who is ready for the rematch (first four) */
.rematch-status b { color: var(--brass-soft); }
.rematch-status .rm-names { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.rematch-status .rm-name { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(203,161,53,.45); background: rgba(0,0,0,.22); font-size: 13px; }
.rematch-status .rm-name.me { border-color: var(--brass); background: rgba(203,161,53,.18); }
.rematch-status .rm-name small { opacity: .75; }
.rematch-status .rm-joined { margin-top: 6px; color: var(--brass-soft); font-size: 14px; }
.rematch-status .rm-hint { margin-top: 6px; font-size: 12px; opacity: .75; }
.redeal-pop .rp-ok {
  margin-top: 10px; padding: 6px 18px;
  border-radius: 8px; border: 1px solid rgba(203,161,53,.6);
  background: rgba(203,161,53,.16); color: var(--ivory);
  font: inherit; font-size: 14px; cursor: pointer;
}
.redeal-pop .rp-ok:hover { background: rgba(203,161,53,.3); }

/* ===================================================================
   Single Hand / Single Game
   =================================================================== */
.single-prompt {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  pointer-events: auto;
  background: linear-gradient(90deg, rgba(120,30,10,.95), rgba(160,60,10,.95));
  border: 2px solid #ffb347;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
  max-width: calc(100vw - 20px);
}
.single-prompt .sq { font-weight: 700; font-size: 15px; }
.single-prompt small { font-weight: 400; opacity: .85; }
.single-prompt .btn, .single-prompt .btn-ghost { min-height: 40px; padding: 7px 14px; font-size: 14px; }
.single-yes { background: linear-gradient(180deg, #ffcf6b, #ff8a1f); color: #3a1300; letter-spacing: .5px; }

.single-badge, .sitout-badge {
  display: block; margin-top: 3px;
  font-size: 10px; font-weight: 800; letter-spacing: .6px;
  border-radius: 8px; padding: 1px 6px;
}
.single-badge { background: linear-gradient(90deg, #ff8a1f, #ffcf6b); color: #3a1300; }
.sitout-badge { background: rgba(246,239,221,.18); color: var(--ivory); font-weight: 600; letter-spacing: 0; }
.seat.sitting-out .card-back-row { opacity: .45; filter: grayscale(.6); }

body.single-mode .contract-badge { display: none !important; }
.single-progress {
  position: absolute; top: 10px; left: 10px; z-index: 6;
  background: rgba(20,12,6,.92);
  border: 2px solid #ff8a1f;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px; line-height: 1.5;
  min-width: 128px;
}
.single-progress .sp-title { font-weight: 800; color: #ffcf6b; font-size: 13px; }
.single-progress .sp-name { font-size: 11px; opacity: .85; }
.single-progress b { color: #ffcf6b; font-size: 14px; }
.single-progress .sp-dots { display: flex; gap: 3px; margin-top: 4px; }
.single-progress .sp-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(246,239,221,.2); }
.single-progress .sp-dots span.w { background: #5fd07a; }
.single-progress .sp-dots span.l { background: #e5484d; }
.single-progress .sp-res { font-weight: 800; margin-top: 4px; }
.single-progress .sp-res.won { color: #5fd07a; }
.single-progress .sp-res.failed { color: #ff7b7f; }

.single-pop {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%);
  z-index: 57; pointer-events: none;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,140,30,.95), rgba(110,25,5,.96));
  border: 3px solid #ffcf6b;
  border-radius: 18px;
  padding: 16px 22px;
  width: min(380px, calc(100vw - 32px));
  box-shadow: 0 0 40px rgba(255,120,20,.6), var(--shadow);
  color: #fff;
  font-size: 16px;
}
.single-pop.animate { animation: singlePop .5s cubic-bezier(.2,1.4,.4,1); }
.single-pop .spop-big { font-size: 24px; font-weight: 900; letter-spacing: 1px; margin-bottom: 6px; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.single-pop .spop-big.win { color: #b6ffb0; }
.single-pop .spop-big.fail { color: #ffd0d0; }
.single-pop .spop-sub { font-size: 13px; opacity: .9; margin-top: 6px; }
@keyframes singlePop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

.hand-row .card.sitout-back {
  background: repeating-linear-gradient(45deg, var(--team-b), var(--team-b) 6px, #1a2949 6px, #1a2949 12px);
  border: 2px solid var(--ivory);
  cursor: default;
  opacity: .8;
}
.single-result { text-align: center; font-size: 22px; font-weight: 900; margin: 4px 0 10px; }
.single-result.won { color: #5fd07a; }
.single-result.failed { color: #ff7b7f; }

@media (max-width: 640px) {
  .single-progress { top: 6px; left: 6px; padding: 4px 8px; min-width: 0; font-size: 11px; }
  .single-pop .spop-big { font-size: 20px; }
  .single-prompt .sq { font-size: 13px; width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .single-pop.animate { animation: none; } }

/* ===================================================================
   Top bar (Quit, code, score) always reachable — even while the bidding,
   trump, double or result panels are open. Panels start below the bar.
   =================================================================== */
.table-wrap .topbar { position: relative; z-index: 42; }
.overlay { padding-top: calc(var(--topbar-h, 72px) + 10px); overflow-y: auto; }
#biddingOverlay, #trumpOverlay, #doubleOverlay { padding-top: calc(var(--topbar-h, 72px) + 10px); }

/* ===================================================================
   Lobby: session management
   =================================================================== */
.admin-box { margin-top: 18px; border-top: 1px dashed rgba(246,239,221,.2); padding-top: 10px; text-align: left; }
.admin-box summary { cursor: pointer; font-size: 14px; color: rgba(246,239,221,.8); padding: 8px 0; min-height: 40px; }
.admin-login { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-login input { flex: 1; min-width: 160px; min-height: 44px; }
.admin-login .btn { min-height: 44px; }
.admin-top { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin: 8px 0; }
.admin-top button, .admin-close { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.admin-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: rgba(0,0,0,.25); border: 1px solid rgba(203,161,53,.3); border-radius: 10px; padding: 10px; font-size: 13px; line-height: 1.5; }
.admin-info { flex: 1; min-width: 180px; }
.admin-sub { opacity: .75; font-size: 12px; }
.admin-sid { opacity: .6; font-size: 11px; }
.st-active { color: #7be08f; }
.admin-empty { opacity: .75; font-size: 13px; padding: 6px 0; }
.admin-msg { margin-top: 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: rgba(95,208,122,.15); }
.admin-msg.bad { background: rgba(229,72,77,.18); }
.admin-dialog { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.admin-dialog-card { background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark)); border: 1px solid var(--brass); border-radius: 14px;
  padding: 18px; max-width: 360px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.admin-dialog-card p { font-size: 16px; margin: 0 0 16px; line-height: 1.5; }
.admin-dialog-actions { display: flex; gap: 10px; justify-content: center; }
.admin-dialog-actions button { min-height: 44px; padding: 8px 18px; }

/* ===================================================================
   Bigger cards on the table (hand cards unchanged) — no overlap:
   the play area is ≥ 3 card widths wide and ≥ 2 card heights tall.
   =================================================================== */
.trick-area { width: 290px; height: 268px; }
.trick-slot { width: 86px; height: 122px; }
.trick-slot .card { width: 86px; height: 122px; font-size: 24px; padding: 6px 7px; border-radius: 9px; box-shadow: 0 5px 12px rgba(0,0,0,.45); }
.trick-slot .card .suit-mid { font-size: 38px; }
.trick-slot .card .rank-top { display: flex; flex-direction: column; align-items: flex-start; }
.trick-slot .card .corner-suit { display: block; font-size: 18px; line-height: 1; }
@media (max-width: 640px) {
  .trick-area { width: 206px; height: 196px; }
  .trick-slot { width: 62px; height: 90px; }
  .trick-slot .card { width: 62px; height: 90px; font-size: 19px; padding: 4px 5px; border-radius: 7px; }
  .trick-slot .card .suit-mid { font-size: 28px; }
  .trick-slot .card .corner-suit { font-size: 15px; }
}
@media (max-width: 360px) {
  .trick-area { width: 186px; height: 178px; }
  .trick-slot { width: 56px; height: 82px; }
  .trick-slot .card { width: 56px; height: 82px; font-size: 17px; }
  .trick-slot .card .suit-mid { font-size: 25px; }
}

/* ===================================================================
   After every trick: "ফোঁটার অবস্থা" (collection so far, both teams)
   =================================================================== */
.trick-fota {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  pointer-events: none;                 /* never blocks a click */
  min-width: 250px; max-width: calc(100% - 24px);
  background: linear-gradient(180deg, rgba(40,24,12,.97), rgba(20,12,6,.97));
  border: 2px solid var(--brass);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  text-align: center;
}
.trick-fota.pop { animation: tfPop .3s cubic-bezier(.2,1.3,.4,1); }
@keyframes tfPop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.trick-fota .tf-title { font-size: 16px; font-weight: 800; color: var(--brass-soft); margin-bottom: 6px; letter-spacing: .5px; }
.trick-fota .tf-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; border-top: 1px dashed rgba(246,239,221,.15); }
.trick-fota .tf-name { font-size: 16px; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.trick-fota .tf-num { font-size: 30px; color: #ffe08a; white-space: nowrap; }
.trick-fota .tf-num small { font-size: 14px; color: var(--ivory); font-weight: 600; }
@media (max-width: 640px) {
  .trick-fota { min-width: 0; width: calc(100% - 20px); padding: 10px 12px; }
  .trick-fota .tf-name { font-size: 14px; max-width: 58vw; }
  .trick-fota .tf-num { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .trick-fota.pop { animation: none; } }

/* ===================================================================
   Round result: large red/black card, team names instead of "দল A/B"
   =================================================================== */
.round-result-card {
  border-radius: 16px;
  padding: 14px 16px 16px;
  margin: 4px 0 14px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.round-result-card.red   { background: linear-gradient(180deg, #d63a3f, #8e1418); border: 3px solid #ffb4b6; color: #fff; }
.round-result-card.black { background: linear-gradient(180deg, #3a3a3f, #0e0e10); border: 3px solid #9a9aa2; color: #fff; }
.rrc-head { font-size: 13px; font-weight: 800; letter-spacing: 3px; opacity: .85; }
.rrc-team { font-size: 22px; font-weight: 800; margin: 6px 0 2px; line-height: 1.25; word-break: break-word; }
.rrc-kind { font-size: 20px; font-weight: 700; margin-top: 4px; }
.rrc-num  { font-size: 64px; font-weight: 900; line-height: 1; margin-top: 4px; text-shadow: 0 3px 10px rgba(0,0,0,.4); }
.rrc-sub  { font-size: 14px; margin-top: 8px; opacity: .92; }

.round-collect { background: rgba(0,0,0,.25); border: 1px solid rgba(203,161,53,.35); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.round-collect .rc-title { font-size: 13px; color: var(--brass-soft); font-weight: 700; margin-bottom: 4px; }
.round-collect .rc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; padding: 3px 0; }
.round-collect .rc-row b { font-size: 20px; color: #ffe08a; white-space: nowrap; }

/* totals with the 6♥/6♠ cards: bigger names and numbers */
.score-summary .st-name { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.score-summary > div > b { font-size: 20px; }
.score-summary > div > b.red { color: #ff8a8a; }
.score-summary > div > b.black { color: #e8e8ee; }

/* top bar: team names instead of letters (shortened with … if long) */
.score-team-name .stn-text { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
@media (max-width: 640px) {
  .score-team-name .stn-text { max-width: 76px; }
  .rrc-team { font-size: 19px; }
  .rrc-num { font-size: 54px; }
  .round-collect .rc-row { font-size: 14px; }
}

/* top bar: the two names of each team, one per line (never squeezed to a letter) */
.score-team-name { min-width: 0; }
.score-team-name .stn-text { display: inline-block; max-width: 110px; min-width: 44px; line-height: 1.2; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (max-width: 640px) { .score-team-name .stn-text { max-width: 64px; min-width: 40px; font-size: 10px; } }
.score-team-name .stn-text { width: auto; height: auto; border-radius: 0; }

/* short phones (e.g. 320×568/640): slightly smaller table cards so the felt is not crowded */
@media (max-width: 640px) and (max-height: 700px) {
  .trick-area { width: 180px; height: 168px; }
  .trick-slot, .trick-slot .card { width: 54px; height: 78px; }
  .trick-slot .card { font-size: 16px; }
  .trick-slot .card .suit-mid { font-size: 22px; }
}

/* Double/Redouble: how the trump was chosen (suit stays secret) */
.trump-type {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 4px auto 12px; padding: 8px 14px; max-width: 320px;
  border-radius: 12px; border: 2px solid var(--brass); background: rgba(0,0,0,.3);
}
.trump-type:empty { display: none; }
.trump-type .tt-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .75; }
.trump-type b { font-size: 20px; letter-spacing: 1px; }
.trump-type .tt-hand { color: #ffe08a; }
.trump-type .tt-seventh { color: #9fd3ff; }
.trump-type .tt-bn { font-size: 13px; opacity: .9; }

/* ===================================================================
   Player handover / replacement — players panel, vacant seats
   =================================================================== */
.players-chip { position: relative; }
.players-chip.has-vacant { border-color: #e0a43a; }
.chip-alert { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.players-panel { width: min(360px, calc(100vw - 24px)); max-height: 70vh; }
.pp-row { padding: 8px 0; border-bottom: 1px dashed rgba(246,239,221,.15); }
.pp-row:last-child { border-bottom: 0; }
.pp-row.off .pp-name { opacity: .7; }
.pp-row.vacant { background: repeating-linear-gradient(135deg, rgba(246,239,221,.04) 0 6px, transparent 6px 12px); border-radius: 8px; padding: 8px 6px; }
.pp-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; font-size: 14px; }
.pp-seat { font-size: 11px; font-weight: 700; color: var(--brass-soft); white-space: nowrap; }
.pp-name { font-weight: 700; min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-row.vacant .pp-name { font-weight: 600; opacity: .8; font-style: italic; }
.pp-team { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; color: #fff; }
.pp-team.team-0 { background: var(--team-a); }
.pp-team.team-1 { background: var(--team-b); }
.pp-tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 8px; letter-spacing: .3px; }
.pp-tag.host { background: var(--brass); color: #2A1B04; }
.pp-tag.me { background: rgba(246,239,221,.18); }
.pp-st { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; white-space: nowrap; }
.st-on { background: rgba(95,208,122,.18); color: #8ee6a0; }
.st-off { background: rgba(193,68,59,.3); color: #ffb3ad; }
.st-vac { background: rgba(224,164,58,.25); color: #f3cf86; }
.pp-sub { font-size: 12px; opacity: .75; margin-top: 3px; }
.pp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.players-panel button[data-act], .spect-actions button.go { font-size: 12px; padding: 6px 9px; min-height: 34px; border-radius: 8px;
  background: rgba(246,239,221,.14); color: var(--ivory); touch-action: manipulation; }
.players-panel button[data-act].danger { background: rgba(165,51,58,.85); }
.players-panel button[data-act].go, .spect-actions button.go { background: rgba(203,161,53,.9); color: #2A1B04; font-weight: 700; }
.players-panel button[data-act]:disabled { opacity: .45; cursor: not-allowed; }
.pp-req-head { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--brass-soft); }
.pp-req { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.pp-req .pp-actions { margin-top: 0; }
.pp-note { font-size: 13px; margin: 10px 0 6px; color: var(--brass-soft); }
.players-panel .pp-wide { width: 100%; margin-top: 8px; min-height: 40px; font-size: 13px; }
.req-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: rgba(203,161,53,.35); }
.seat-badge.vacant { opacity: .9; border-style: dashed; }
.seat-badge.vacant .nm { font-style: italic; }
.net-banner .vac-line { font-weight: 600; }
.chat-msg.system { align-self: center; max-width: 92%; }
.chat-msg.system .bubble { background: rgba(246,239,221,.1); color: var(--brass-soft); font-size: 12px; font-style: italic; text-align: center; }
.seat-dialog { z-index: 120; }
.seat-dialog.hidden { display: none; }
.seat-choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.seat-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: 10px; background: rgba(246,239,221,.1); color: var(--ivory); border: 1px solid rgba(203,161,53,.45); font-size: 15px; font-weight: 700; text-align: left; }
.seat-choice.team-0 { border-left: 5px solid var(--team-a); }
.seat-choice.team-1 { border-left: 5px solid var(--team-b); }
.seat-choice small { font-weight: 400; opacity: .75; font-size: 12px; }
.seat-choice:disabled { opacity: .4; }
@media (max-width: 640px) {
  .players-panel { top: auto; bottom: calc(210px + env(safe-area-inset-bottom, 0px)); right: 10px; max-height: 55vh; }
  .pp-name { max-width: 110px; }
}

/* ===================================================================
   Player names always fully visible (left / right seats never go off-screen)
   On small & medium screens the side seats sit INSIDE the table edge
   instead of hanging half outside it; long names wrap instead of being cut.
   =================================================================== */
.seat-badge .nm, .seat-badge .tm { overflow-wrap: break-word; line-height: 1.25; }
.seat-badge .tm { display: block; }

@media (max-width: 1100px) {
  .seat-left  { left: -8px;  right: auto; transform: translate(0, -50%); align-items: flex-start; }
  .seat-right { right: -8px; left: auto;  transform: translate(0, -50%); align-items: flex-end; }
  .seat-left .seat-badge, .seat-right .seat-badge { max-width: 150px; }
}

@media (max-width: 640px) {
  .seat { gap: 4px; }
  .seat-badge { padding: 4px 8px; font-size: 13px; min-width: 0; border-radius: 10px; }
  .seat-badge .tm { font-size: 10px; }
  .seat-top .seat-badge { max-width: 60vw; }
  .seat-left .seat-badge, .seat-right .seat-badge { max-width: 86px; padding: 4px 6px; font-size: 12px; }
  .seat-left, .seat-right { max-width: 88px; }
  /* smaller face-down cards beside the side players so they stay on screen */
  .seat-left .mini-card-back, .seat-right .mini-card-back { width: 18px; height: 27px; margin-left: -12px; border-radius: 4px; }
  .seat-left .mini-card-back:first-child, .seat-right .mini-card-back:first-child { margin-left: 0; }
  .seat-top .mini-card-back { width: 22px; height: 32px; margin-left: -12px; }
  .seat-top .mini-card-back:first-child { margin-left: 0; }
}
@media (max-width: 360px) {
  .seat-badge { font-size: 12px; padding: 3px 6px; }
}

/* ===================================================================
   ROYAL TOP BAR — brown & gold, ২৯ logo in the middle,
   both teams on the sides, Quit / code / round underneath.
   (markup: game.php → .topbar.tb-royal)
   =================================================================== */
.topbar.tb-royal {
  --gold-1: #fbe7a1; --gold-2: #e2b650; --gold-3: #b07d25; --gold-4: #6e4a14;
  --tb-gold: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 38%, var(--gold-3) 70%, var(--gold-4) 100%);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  flex-wrap: nowrap;
  padding: 10px 14px 12px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  position: relative;
  background:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(255,196,92,.30), transparent 70%),
    radial-gradient(circle at 12% 30%, rgba(255,210,140,.07) 0 18px, transparent 19px),
    radial-gradient(circle at 88% 30%, rgba(255,210,140,.07) 0 18px, transparent 19px),
    repeating-radial-gradient(circle at 50% 120%, rgba(255,220,160,.035) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #4a2912 0%, #2c170a 55%, #1a0d05 100%);
  border-bottom: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
}
/* double gold rule along the bottom */
.topbar.tb-royal::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-4) 45%, #1a0d05 45% 60%, var(--gold-3) 60%, var(--gold-2));
  pointer-events: none;
}
.topbar.tb-royal .brand { margin: 0; font-size: inherit; letter-spacing: 0; }

/* keep the bar content a sensible width on big screens */
.topbar.tb-royal > .tb-main, .topbar.tb-royal > .tb-sub { width: 100%; max-width: 1080px; margin: 0 auto; }

/* ---- row 1 ---- */
.tb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0;
  position: relative;
}
/* thin gold line running behind the panels and the logo */
.tb-main::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-3) 8%, var(--gold-2) 50%, var(--gold-3) 92%, transparent);
  opacity: .7;
}

/* team panel: outer gold frame + inner dark plate */
.tb-team {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
  padding: 5px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(70,38,14,.95), rgba(28,14,5,.95));
  border: 1.5px solid var(--gold-3);
  box-shadow: inset 0 0 0 1px rgba(255,215,130,.18), 0 3px 10px rgba(0,0,0,.5);
}
.tb-team-a { justify-self: stretch; margin-right: -6px; }
.tb-team-b { justify-self: stretch; margin-left: -6px; }
.tb-spade {
  flex-shrink: 0;
  font-size: 20px; line-height: 1;
  background: var(--tb-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
.tb-team .score-team {
  flex: 1; min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "dot name cards score";
  align-items: center; column-gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #24130a, #140a04);
  border: 1.5px solid var(--gold-2);
  box-shadow: inset 0 1px 0 rgba(255,230,160,.25), inset 0 0 12px rgba(0,0,0,.6);
}
.tb-team .score-team-name { display: contents; }
.tb-team .score-team-name > span:first-child {         /* team colour dot */
  grid-area: dot; width: 16px; height: 16px; border-radius: 50%;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.45), inset 0 2px 2px rgba(255,255,255,.25), 0 0 0 1px rgba(0,0,0,.5);
}
.tb-team .score-team-name .team-a-dot { background: radial-gradient(circle at 35% 30%, #c2465a, #7a1c2a 70%); }
.tb-team .score-team-name .team-b-dot { background: radial-gradient(circle at 35% 30%, #3a5fc0, #13286e 70%); }
.tb-team .score-team-name .stn-text {
  grid-area: name;
  max-width: none; min-width: 0; width: auto; height: auto; border-radius: 0;
  font-size: 17px; font-weight: 700; line-height: 1.25; color: #fff6e0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.tb-team .six-pair { grid-area: cards; }
.tb-team .six-card { width: 38px; height: 54px; }
.tb-team .six-card + .six-card { margin-left: -12px; }
.tb-team .score-team-text {
  grid-area: score;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--gold-2);
  background: linear-gradient(180deg, rgba(90,52,16,.6), rgba(30,16,6,.8));
  color: var(--gold-1);
  font-size: 14px; font-weight: 700; text-align: center; white-space: nowrap;
  box-shadow: inset 0 0 6px rgba(0,0,0,.6);
}
.tb-team .score-team-text.red   { color: #ff9a9a; }
.tb-team .score-team-text.black { color: #fff; }

/* ---- the ২৯ logo ---- */
.tb-logo {
  position: relative; z-index: 2;
  width: 132px; height: 104px;
  display: flex; align-items: flex-end; justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.6));
}
.tb-lcard {
  position: absolute; top: 0; z-index: 1;
  width: 44px; height: 62px; border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(226,182,80,.18) 0 30%, transparent 31%),
    linear-gradient(160deg, #2b2b2b, #0b0b0b);
  border: 2px solid var(--gold-2);
  box-shadow: inset 0 0 0 2px #0b0b0b, inset 0 0 0 3px rgba(226,182,80,.45), 0 3px 6px rgba(0,0,0,.6);
}
.tb-lcard-back  { left: 50%; transform: translateX(-8%) rotate(14deg); }
.tb-lcard-front {
  left: 50%; transform: translateX(-92%) rotate(-12deg);
  display: flex; flex-direction: column; align-items: flex-start; padding: 3px 5px;
  font-style: normal; font-weight: 800; line-height: 1;
}
.tb-lcard-front i { font-style: normal; color: var(--gold-1); font-size: 13px; }
.tb-lcard-front i + i { font-size: 12px; }
.tb-num {
  position: relative; z-index: 3;
  font-family: 'Tiro Bangla', serif;
  font-size: 62px; font-weight: 700; line-height: .9;
  margin-bottom: 14px;
  color: #f6cf62;
  text-shadow:
    0 -1px 0 #fff2b8,
    0 1px 0 #c8942f, 0 2px 0 #a8741d, 0 3px 0 #7a5418, 0 4px 0 #4a2f0a,
    0 0 2px #2a1606, 0 0 14px rgba(255,190,80,.55), 0 6px 10px rgba(0,0,0,.7);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tb-num.tb-shine { background: var(--tb-gold); -webkit-background-clip: text; background-clip: text; }
}
.tb-flourish {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 104px; height: 22px;
  fill: var(--gold-2); filter: drop-shadow(0 1px 0 rgba(0,0,0,.6));
}
.tb-swirl {
  position: absolute; top: 14px; width: 30px; height: 18px;
  border-top: 2px solid var(--gold-2); border-radius: 50% 50% 0 0;
  opacity: .9;
}
.tb-swirl::after {
  content: ''; position: absolute; top: 2px; width: 7px; height: 7px; border-radius: 50%;
  border: 2px solid var(--gold-2); border-left-color: transparent; border-bottom-color: transparent;
}
.tb-swirl-l { left: -6px;  transform: rotate(-18deg); }
.tb-swirl-l::after { left: -6px; transform: rotate(-45deg); }
.tb-swirl-r { right: -6px; transform: rotate(18deg); }
.tb-swirl-r::after { right: -6px; transform: rotate(135deg); }

/* ---- row 2 ---- */
.tb-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.tb-chips { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }

.tb-quit.btn-danger {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 26px 10px 16px;
  min-height: 48px;
  font-size: 19px; font-weight: 700; letter-spacing: .3px;
  color: #fff; border-radius: 14px;
  background: linear-gradient(180deg, #e0413f 0%, #b3191c 55%, #86100f 100%);
  border: 2px solid var(--gold-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 1px #3a1f05, 0 4px 10px rgba(0,0,0,.5);
  text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.tb-quit.btn-danger::before {
  content: ''; width: 22px; height: 22px; flex-shrink: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffe6b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M15 12H7M10 8l-4 4 4 4'/%3E%3C/svg%3E");
}
.tb-quit.btn-danger:hover { filter: brightness(1.08); }

.topbar.tb-royal .tb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 16px; color: #fff3d6;
  background: linear-gradient(180deg, #3a200c, #1c0e05);
  border: 1.5px solid var(--gold-2);
  box-shadow: inset 0 1px 0 rgba(255,230,160,.25), 0 0 0 1px #2a1606, 0 3px 8px rgba(0,0,0,.45);
}
.topbar.tb-royal .tb-chip b { font-size: 20px; font-weight: 800; color: var(--gold-1); }
.tb-code::before, .tb-round::before {
  content: ''; width: 22px; height: 22px; flex-shrink: 0; margin-right: 2px;
  background: no-repeat center / contain;
}
.tb-code::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fbe7a1'/%3E%3Cstop offset='1' stop-color='%23b07d25'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='8' cy='8' r='5.5' fill='url(%23g)'/%3E%3Ccircle cx='8' cy='8' r='2' fill='%231c0e05'/%3E%3Cpath d='M11.5 11.5L20 20M16 16l2.5-2.5M18.5 18.5L21 16' stroke='url(%23g)' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.tb-round::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2b650' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5z' fill='%23e2b650'/%3E%3Cpath d='M3 12.5l9 5 9-5'/%3E%3Cpath d='M3 16.5l9 5 9-5'/%3E%3C/svg%3E");
}
.tb-gem {
  width: 12px; height: 12px; flex-shrink: 0;
  background: var(--tb-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(255,200,90,.7);
  border: 1px solid #3a1f05;
}
.topbar.tb-royal .tb-icon-chip { padding: 6px 12px; font-size: 14px; }
.topbar.tb-royal .tb-icon-chip b { font-size: 15px; }

/* ---- tablets / small laptops ---- */
@media (max-width: 900px) {
  .tb-team .score-team { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot name cards" "dot name score"; row-gap: 4px; }
  .tb-team .score-team-text { justify-self: center; padding: 2px 8px; font-size: 12px; }
}

/* ---- phones ---- */
@media (max-width: 640px) {
  .topbar.tb-royal { gap: 8px; padding: 8px 8px 11px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .tb-logo { width: 84px; height: 76px; }
  .tb-lcard { width: 30px; height: 42px; border-radius: 4px; }
  .tb-lcard-front i { font-size: 10px; } .tb-lcard-front i + i { font-size: 9px; }
  .tb-num { font-size: 44px; margin-bottom: 11px; }
  .tb-flourish { width: 72px; height: 15px; }
  .tb-swirl { display: none; }
  .tb-team { padding: 3px; border-radius: 14px; gap: 2px; }
  .tb-team-a { margin-right: -10px; } .tb-team-b { margin-left: -10px; }
  .tb-spade { display: none; }
  .tb-team .score-team {
    padding: 5px 6px; column-gap: 5px; row-gap: 3px; border-radius: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "dot name cards" "dot name score";
  }
  .tb-team-b .score-team { padding-left: 10px; }
  .tb-team-a .score-team { padding-right: 10px; }
  .tb-team .score-team-name > span:first-child { width: 10px; height: 10px; }
  .tb-team .score-team-name .stn-text { font-size: 13px; }
  .tb-team .six-card { width: 24px; height: 34px; border-radius: 3px; }
  .tb-team .six-card + .six-card { margin-left: -8px; }
  .tb-team .six-pips { inset: 4px 4px; }
  .tb-team .six-pip { font-size: 6px; }
  .tb-team .six-idx { font-size: 5px; }
  .tb-team .score-team-text { font-size: 10px; padding: 1px 5px; border-radius: 6px; justify-self: center; }

  .tb-sub { gap: 6px; }
  .tb-chips { gap: 5px; flex-wrap: nowrap; }
  .tb-quit.btn-danger { font-size: 15px; min-height: 40px; padding: 6px 14px 6px 10px; gap: 6px; border-radius: 12px; }
  .tb-quit.btn-danger::before { width: 18px; height: 18px; }
  .topbar.tb-royal .tb-chip { min-height: 36px; padding: 4px 10px; font-size: 13px; gap: 4px; }
  .topbar.tb-royal .tb-chip b { font-size: 15px; }
  .tb-code::before, .tb-round::before { width: 16px; height: 16px; margin-right: 0; }
  .tb-gem { width: 8px; height: 8px; }
  .tb-lbl { display: none; }                       /* 👥 / 👁 chips: icon + count only */
  .topbar.tb-royal .tb-icon-chip { padding: 4px 8px; font-size: 13px; }
  .topbar.tb-royal .tb-icon-chip b { font-size: 12px; }
}
@media (max-width: 420px) {
  .tb-gem { display: none; }
  .tb-quit.btn-danger::before { width: 16px; height: 16px; }
  .tb-quit.btn-danger { padding: 6px 10px 6px 8px; font-size: 14px; }
  .topbar.tb-royal .tb-chip { padding: 4px 8px; font-size: 12px; }
  .topbar.tb-royal .tb-icon-chip { padding: 4px 6px; }
  .tb-team .score-team-name .stn-text { font-size: 12.5px; }
}

/* short phones: Mic / Speaker are smaller and lower there, so the notice can sit lower too */
@media (max-width: 640px) and (max-height: 700px) {
  .net-banners { bottom: calc(206px + env(safe-area-inset-bottom, 0px)); }
}

/* ===================================================================
   Trump card: name of the player who chose the trump, above the card
   =================================================================== */
.trump-slot-who {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 130px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a200c, #1c0e05);
  border: 1.5px solid var(--brass);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  color: #fff3d6;
  font-size: 13px; line-height: 1.2;
  white-space: nowrap;
}
.trump-slot-who b { font-weight: 700; color: var(--brass-soft); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.trump-slot-who small { font-size: 10px; opacity: .8; }
.trump-slot-who .tsw-ic { font-size: 12px; }
.trump-slot-who.team-0 { border-left: 4px solid var(--team-a); }
.trump-slot-who.team-1 { border-left: 4px solid var(--team-b); }
.trump-slot-who.hidden { display: none; }
@media (max-width: 600px) {
  .trump-slot { gap: 4px; }
  .trump-slot-who { max-width: 96px; padding: 2px 7px; font-size: 11px; gap: 3px; }
  .trump-slot-who .tsw-ic { font-size: 10px; }
  .trump-slot-who small { display: none; }
}

/* ===================================================================
   Chat message pop-up on the table (shown 4 s, then fades away)
   Sits just left of the 💬 button, the tail points at the button.
   =================================================================== */
.chat-popups {
  position: fixed;
  right: 82px;
  bottom: 214px;
  z-index: 47;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none;
}
.chat-popup {
  position: relative;
  max-width: 260px;
  padding: 7px 12px 8px;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(180deg, rgba(58,32,12,.97), rgba(28,14,5,.97));
  border: 1.5px solid var(--brass);
  box-shadow: 0 6px 16px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,230,160,.2);
  color: #fff6e0;
  animation: chatPopIn .25s cubic-bezier(.2,.9,.3,1.3);
  transition: opacity .3s, transform .3s;
}
.chat-popup:last-child::after {                    /* little tail towards the chat button */
  content: ''; position: absolute; right: -8px; bottom: 8px;
  border: 7px solid transparent; border-left-color: var(--brass); border-right: 0;
}
.chat-popup.team-0 { border-left: 4px solid var(--team-a); }
.chat-popup.team-1 { border-left: 4px solid var(--team-b); }
.chat-popup .cp-who { font-size: 14px; font-weight: 700; color: var(--brass-soft); line-height: 1.2; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-popup .cp-text { font-size: 18px; line-height: 1.35; overflow-wrap: break-word; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chat-popup.leaving { opacity: 0; transform: translateY(-6px) scale(.96); }
@keyframes chatPopIn { from { opacity: 0; transform: translateX(10px) scale(.85); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .chat-popups { right: 60px; bottom: calc(196px + env(safe-area-inset-bottom, 0px)); }
  .chat-popup { max-width: max(150px, calc(100vw - 196px)); padding: 6px 10px 7px; border-radius: 12px 12px 4px 12px; }
  .chat-popup .cp-who { font-size: 13px; }
  .chat-popup .cp-text { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .chat-popup { animation: none; transition: none; } }

/* ===================================================================
   Top bar score as a "ফোঁটা" tile: ivory tile, 2 × 3 dot places,
   red dots = লাল, black dots = কালো (replaces the 6♥/6♠ pair up there)
   =================================================================== */
.tb-team .score-team { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot name cards"; }
.tb-team .score-team-text, .tb-team .six-pair { display: none; }
.fota-tile {
  grid-area: cards;
  display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr);
  place-items: center; gap: 4px;
  width: 50px; height: 70px; padding: 6px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fffbe9, #f3e6bd);
  border: 2px solid var(--brass);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset 0 -3px 6px rgba(150,110,40,.25), 0 3px 8px rgba(0,0,0,.5);
}
.fota-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px dashed rgba(120,90,40,.35);            /* empty place */
  transition: transform .25s, background .25s;
}
.fota-tile.red .fota-dot.on {
  border: 0;
  background: radial-gradient(circle at 35% 30%, #ff7b7b 0 18%, #e3141d 45%, #a50d12 100%);
  box-shadow: 0 1px 2px rgba(80,0,0,.5);
}
.fota-tile.black .fota-dot.on {
  border: 0;
  background: radial-gradient(circle at 35% 30%, #6b6b6b 0 15%, #111 50%, #000 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
}

@media (max-width: 640px) {
  .tb-team .score-team { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot name cards"; }
  .fota-tile { width: 38px; height: 54px; padding: 4px; gap: 3px; border-radius: 5px; border-width: 1.5px; }
  .fota-dot { width: 11px; height: 11px; border-width: 1px; }
}

/* ===================================================================
   Chat window: never taller than the space under the top bar, so the
   ✕ close button is always visible; sits above the Mic / Speaker buttons.
   =================================================================== */
.chat-drawer {
  z-index: 48;
  max-height: min(60vh, calc(100vh - var(--topbar-h, 150px) - 214px - 20px));
  max-height: min(60dvh, calc(100dvh - var(--topbar-h, 150px) - 214px - 20px));
}
.chat-drawer-head { flex-shrink: 0; }
.chat-drawer-head button { opacity: 1; min-width: 40px; min-height: 36px; font-size: 20px; border-radius: 8px; }
.chat-drawer-head button:hover { background: rgba(246,239,221,.1); }
.chat-messages { min-height: 60px; }
@media (max-width: 640px) {
  .chat-drawer {
    max-height: calc(100vh - var(--topbar-h, 150px) - 196px - 16px);
    max-height: calc(100dvh - var(--topbar-h, 150px) - 196px - env(safe-area-inset-bottom, 0px) - 16px);
  }
  .emoji-row { gap: 4px; padding: 6px 8px 0; }
  .emoji-row button { font-size: 18px; padding: 3px 6px; }
}

/* ===================================================================
   Players panel: GamesZone "Admin Control" (unlock with ADMIN_PASSWORD)
   =================================================================== */
.pp-admin { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(246,239,221,.2); }
.players-panel .pp-admin-btn[data-act] {
  width: 100%; min-height: 36px; font-size: 12px; font-weight: 700;
  border-radius: 8px; background: rgba(246,239,221,.08); color: rgba(246,239,221,.8);
  border: 1px solid rgba(203,161,53,.35);
}
.players-panel .pp-admin-btn[data-act]:hover { border-color: var(--brass); color: var(--ivory); }
.pp-admin-form label { display: block; font-size: 12px; font-weight: 700; color: var(--brass-soft); margin-bottom: 6px; }
.pp-admin-row { display: flex; gap: 6px; align-items: center; }
.pp-admin-row input {
  flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px;
  border-radius: 8px; border: 1px solid rgba(203,161,53,.5);
  background: rgba(0,0,0,.35); color: var(--ivory); font: inherit; font-size: 14px;
}
.players-panel .pp-admin-row button[data-act] { font-size: 12px; padding: 6px 10px; min-height: 36px; border-radius: 8px;
  background: rgba(246,239,221,.14); color: var(--ivory); white-space: nowrap; }
.players-panel .pp-admin-row button[data-act].go { background: var(--brass); color: #2a1b04; font-weight: 700; }
.pp-admin-on {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4;
  background: rgba(40,110,60,.25); border: 1px solid rgba(95,208,122,.55); color: #d9f5df;
}
.pp-admin-on b { color: #8ff0a6; }
.players-panel .pp-admin-off[data-act] { flex-shrink: 0; font-size: 12px; padding: 6px 10px; min-height: 32px; border-radius: 8px;
  background: rgba(165,51,58,.85); color: #fff; }

/* Early round decision popup (result already certain before trick 8) */
#earlyDecisionOverlay { z-index: 41; }
.early-decision-card h2.made { color: #7ee2a0; }
.early-decision-card h2.failed { color: #ff8f8f; }
.early-decision-card p { white-space: pre-line; }
.early-decision-note { margin-top: 10px; font-size: 14px; color: rgba(246,239,221,.75); }

/* ===================================================================
   Room chat: available from joining the room until the match ends.
   The 💬 button and the chat window live outside the waiting room and the
   table, and sit above the bidding / trump / double / result panels
   (.overlay 40, top bar 42, hand dock while bidding 45, Mic/Speaker 46,
   chat pop-ups 47), so chat can always be opened, used and closed.
   The panels' own buttons stay clickable: the chat button is small and
   sits at the side, and the chat window closes with ✕ or after sending.
   =================================================================== */
.chat-toggle { z-index: 48; }
.chat-drawer { z-index: 49; }
.chat-drawer.kb-open { transition: none; }

/* waiting room: button in the bottom-right corner, clear of
   "খেলা শুরু করুন" and "রুম ত্যাগ করুন" (the panel gets room below it) */
body.is-waiting #waitingScreen { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.is-waiting .chat-toggle,
body.is-waiting .chat-drawer { right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
body.is-waiting .chat-drawer {
  max-height: min(70vh, calc(100vh - 36px));
  max-height: min(70dvh, calc(100dvh - 36px - env(safe-area-inset-bottom, 0px)));
}
@media (max-width: 640px) {
  body.is-waiting .chat-toggle,
  body.is-waiting .chat-drawer { right: 10px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.is-waiting .chat-popups { right: 62px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.is-waiting .chat-drawer { max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 641px) {
  body.is-waiting .chat-popups { right: 82px; bottom: 18px; }
}

/* Several players' messages at the same time: every player's pop-up shows
   together (one per player). With 3–4 at once they get more compact. */
.chat-popups { max-height: calc(100vh - var(--topbar-h, 150px) - 230px); max-height: calc(100dvh - var(--topbar-h, 150px) - 230px); justify-content: flex-end; }
.chat-popups.many { gap: 4px; }
.chat-popups.many .chat-popup { padding: 5px 10px 6px; }
.chat-popups.many .chat-popup .cp-who { font-size: 12px; margin-bottom: 0; }
.chat-popups.many .chat-popup .cp-text { font-size: 15px; -webkit-line-clamp: 2; }
body.is-waiting .chat-popups { max-height: calc(100dvh - 90px); }
@media (max-width: 640px) {
  .chat-popups.many .chat-popup .cp-text { font-size: 14px; line-height: 1.3; }
}

/* Chat window on small / short phones (e.g. iPhone SE): the head, the emoji
   row and the input row never get cut off — only the message list shrinks
   and scrolls. On short screens the window may cover the hand while it is
   open (it closes with ✕ or after sending). */
.chat-drawer .chat-drawer-head,
.chat-drawer .emoji-row,
.chat-drawer .chat-input-row { flex-shrink: 0; }
.chat-drawer .chat-messages { flex: 1 1 auto; min-height: 48px; }
@media (max-width: 640px) {
  .chat-drawer .emoji-row { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior: contain; padding-bottom: 4px; scrollbar-width: none; }
  .chat-drawer .emoji-row::-webkit-scrollbar { display: none; }
  .chat-drawer .emoji-row button { flex: 0 0 auto; }
}
@media (max-width: 640px) and (max-height: 760px) {
  .chat-drawer {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - var(--topbar-h, 150px) - 16px);
    max-height: calc(100dvh - var(--topbar-h, 150px) - 16px - env(safe-area-inset-bottom, 0px));
  }
}

/* Visitors' / spectators' messages also pop up (marked "দর্শক") */
.chat-popup.spect { border-left: 4px solid #9b7fd4; }
.chat-popup .cp-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; margin-left: 4px;
  border-radius: 8px; background: rgba(155,127,212,.3); color: #e4d8ff; vertical-align: middle; }
/* 4–5 pop-ups at once: one line each so they all fit on a phone */
.chat-popups.crowded .chat-popup .cp-text { -webkit-line-clamp: 1; font-size: 14px; }
.chat-popups.crowded .chat-popup .cp-who { font-size: 11px; }

/* GamesZone Admin: "player's cards" panel (only ever shown on the admin's own screen) */
body.ga-on .card-back-row[data-seat] { cursor: pointer; padding: 6px; margin: -6px; }
/* while Admin Control is on, the dimmed backdrop of the bidding / trump / result overlays lets
   taps through to the card piles behind it (the overlay card itself works as before) */
body.ga-on .overlay { pointer-events: none; }
body.ga-on .overlay .overlay-card { pointer-events: auto; }
.admin-hand {
  position: fixed;
  left: 50%; top: 66px;
  transform: translateX(-50%);
  z-index: 63;
  width: min(560px, calc(100vw - 16px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 2px solid var(--brass);
  border-radius: 14px;
  padding: 10px 12px 10px;
  color: var(--ivory);
  box-shadow: var(--shadow);
}
.admin-hand .ah-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-hand .ah-title { font-size: 15px; overflow-wrap: anywhere; }
.admin-hand .ah-title b { color: var(--brass-soft); }
.admin-hand .ah-title small { font-size: 12px; opacity: .8; }
.admin-hand .ah-close {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(203,161,53,.6); background: rgba(0,0,0,.3); color: var(--ivory);
  font-size: 16px; cursor: pointer;
}
.admin-hand .ah-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.admin-hand .ah-tab {
  flex: 1 1 auto; min-height: 36px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(203,161,53,.4); background: rgba(0,0,0,.25); color: var(--ivory);
  font: inherit; font-size: 13px; cursor: pointer;
}
.admin-hand .ah-tab.on { background: var(--brass); color: #2a1b04; font-weight: 700; border-color: var(--brass); }
.admin-hand .ah-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 4px 0; }
.admin-hand .card { flex: 0 0 auto; cursor: default; }
.admin-hand .ah-seventh {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(203,161,53,.45);
}
.admin-hand .ah-seventh span { font-size: 13px; color: var(--brass-soft); font-weight: 700; }
.admin-hand .ah-wait { text-align: center; padding: 18px 0; font-size: 14px; opacity: .8; }
.admin-hand .ah-note { margin-top: 8px; font-size: 11.5px; text-align: center; opacity: .65; }
@media (max-width: 480px) {
  .admin-hand .card { width: 40px; height: 58px; font-size: 13px; padding: 3px 4px; }
  .admin-hand .card .suit-mid { font-size: 17px; }
}

.pp-admin-on { flex-wrap: wrap; }

/* "দর্শক : নাম" — a new spectator joined (8 s, top-left corner under the top bar) */
.spect-join-pill {
  position: fixed;
  left: 8px; top: 8px;
  z-index: 44;                       /* above the dimmed overlays, below the hand dock, popups and dialogs */
  max-width: min(260px, 36vw);
  padding: 5px 12px;
  border-radius: 14px;
  background: rgba(20,12,6,.9);
  border: 1px solid rgba(203,161,53,.55);
  color: var(--ivory);
  font-size: 13px; line-height: 1.35;
  overflow-wrap: anywhere;           /* a long name wraps to a second line instead of being cut */
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  pointer-events: none;              /* never catches a tap */
  animation: spjIn .25s ease-out;
}
/* phones: one slim line that fits between the top bar's buttons and the table / bidding box */
.spect-join-pill.compact {
  max-width: calc(100vw - 16px);
  padding: 1px 10px;
  border-radius: 10px;
  font-size: 12px; line-height: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: none;
}
@keyframes spjIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ===================================================================
   "ছাগল পীট" — a team won no trick in a full round.
   Covers the whole screen for at least 5 seconds; no close button, and every
   tap lands on this layer, so nothing behind it can be pressed.
   =================================================================== */
.goat-layer {
  position: fixed; inset: 0;
  z-index: 500;                       /* above every overlay, popup, panel and dialog */
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  background: rgba(6,4,2,.86);
  pointer-events: auto;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  cursor: default;
}
.goat-card {
  display: flex; flex-direction: column; align-items: center;
  width: min(520px, 100%);
  max-height: 100%;
  padding: 12px 16px 16px;
  text-align: center;
  background: radial-gradient(circle at 50% 28%, #2f8f5c, #134a30 72%);
  border: 3px solid var(--brass);
  border-radius: 22px;
  box-shadow: var(--shadow), 0 0 0 6px rgba(0,0,0,.3);
  color: var(--ivory);
  animation: goatIn .5s cubic-bezier(.2,1.5,.4,1);
}
.goat-img {
  display: block;
  width: min(340px, 74vw, 44vh);
  height: auto;
  pointer-events: none;
  animation: goatBob 1.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.goat-text { width: 100%; min-width: 0; }
.goat-names {
  font-size: clamp(19px, 5.6vw, 30px); font-weight: 800; line-height: 1.3;
  color: #fff;
  overflow-wrap: anywhere;            /* long names wrap, they are never cut */
}
.goat-big {
  font-size: clamp(34px, 11vw, 58px); font-weight: 900; line-height: 1.15;
  color: #ffd54a;
  text-shadow: 0 3px 0 #7a4b12, 0 6px 14px rgba(0,0,0,.45);
}
.goat-sub { font-size: clamp(17px, 4.8vw, 24px); font-weight: 700; margin-top: 2px; }
.goat-result { font-size: 13px; margin-top: 8px; color: rgba(246,239,221,.82); overflow-wrap: anywhere; }
.goat-bar { height: 6px; margin-top: 12px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.goat-bar i { display: block; height: 100%; border-radius: 3px; background: var(--brass-soft); transform-origin: left center; }
@keyframes goatBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes goatIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes goatBob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-6px); } }
/* the round / match result waits behind the picture */
body.goat-on #roundEndOverlay, body.goat-on #matchEndOverlay { display: none !important; }
/* phone held sideways: picture on the left, text on the right */
@media (max-height: 480px) and (orientation: landscape) {
  .goat-layer { padding: 6px; }
  .goat-card { flex-direction: row; gap: 14px; width: min(700px, 100%); padding: 8px 16px; }
  .goat-img { width: min(46vw, 78vh); flex: 0 0 auto; }
  .goat-names { font-size: clamp(17px, 3.4vw, 26px); }
  .goat-big { font-size: clamp(30px, 6.4vw, 48px); }
  .goat-sub { font-size: clamp(15px, 3vw, 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .goat-card, .goat-img { animation: none; }
}


/* ===================================================================
   Screen-capture guard (Android app only — see ScreenGuard in game.js).
   body.in-app     the page runs inside the app
   body.guard-wait cards are due but the app has not confirmed FLAG_SECURE → table covered
   body.guard-free result / waiting screens (capture allowed) → own cards off the screen
   Nothing here applies in an ordinary browser.
   =================================================================== */
body.guard-wait #tableScreen,
body.guard-wait .admin-hand { visibility: hidden !important; }
body.guard-wait::before {
  content: 'স্ক্রিন সুরক্ষা চালু হচ্ছে…';
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background: #0b2a1c; color: var(--ivory);
  font-size: 18px; line-height: 1.6;
}
body.guard-wait.guard-fail::before {
  content: 'স্ক্রিন সুরক্ষা চালু করা যায়নি, তাই কার্ড দেখানো হচ্ছে না। অ্যাপটি বন্ধ করে আবার খুলুন; না হলে নতুন সংস্করণ ইনস্টল করুন।';
}
body.guard-free #handRow,
body.guard-free #handHint,
body.guard-free .admin-hand { visibility: hidden !important; }

/* "তুরুপ প্রকাশ না হলে বণ্টন বাতিল" — 5 s notice, no close button, blocks the table */
.trump-void-layer {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6,4,2,.78);
  pointer-events: auto;                 /* nothing behind it can be tapped (spectators too) */
}
.trump-void-layer.hidden { display: none !important; }
.tv-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, var(--wood-mid), var(--wood-dark));
  border: 1px solid rgba(203,161,53,.55);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 20px 18px;
  text-align: center;
  animation: tvIn .25s ease-out;
}
.tv-title { font-size: 22px; font-weight: 700; color: var(--brass-soft); margin-bottom: 10px; }
.tv-badge {
  display: inline-block; margin-bottom: 12px; padding: 4px 14px; border-radius: 999px;
  background: rgba(193,68,59,.22); border: 1px solid rgba(193,68,59,.6); color: #ffd9d4; font-weight: 700; font-size: 14px;
}
.tv-text { font-size: 16.5px; line-height: 1.6; color: var(--ivory); }
.tv-count { margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--brass-soft); }
.tv-bar { margin-top: 8px; height: 6px; border-radius: 6px; background: rgba(246,239,221,.15); overflow: hidden; }
.tv-bar span { display: block; height: 100%; width: 100%; background: var(--brass); }
@keyframes tvBar { to { width: 0%; } }
@keyframes tvIn { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
body.trump-void-on .play-card-btn,
body.trump-void-on .reveal-trump-btn,
body.trump-void-on #earlyDecisionOverlay { display: none !important; }
@media (prefers-reduced-motion: reduce) { .tv-card { animation: none; } }

/* GamesZone Admin — team setup dialog (team A / B) */
.team-dialog .admin-dialog-card { max-width: 400px; }
.team-pick { display: flex; gap: 6px; flex-shrink: 0; }
.team-pick-btn { min-width: 44px; min-height: 36px; border-radius: 8px; font-weight: 700; font-size: 15px;
  background: rgba(246,239,221,.1); color: var(--ivory); border: 1px solid rgba(203,161,53,.45); cursor: pointer; }
.team-pick-btn.team-0.on { background: var(--team-a); border-color: var(--brass); }
.team-pick-btn.team-1.on { background: var(--team-b); border-color: var(--brass); }
.team-note { font-size: 13px; line-height: 1.5; color: var(--brass-soft); margin: 0 0 14px; }
.team-pass-row { margin-bottom: 14px; }
.waiting-team-btn { margin-top: 12px; }
.waiting-team-btn:disabled { opacity: .5; cursor: not-allowed; }

/* "গেম রিসেট" button (Host / GamesZone Admin) in the players panel */
.players-panel .pp-admin-btn.pp-reset-btn[data-act] { margin-bottom: 8px; border-color: rgba(229,72,77,.6); color: #ffb3b5; }
.players-panel .pp-admin-btn.pp-reset-btn[data-act]:hover { border-color: #e5484d; color: var(--ivory); }

/* finished trick: winner's card and name stay up for 3 s before the sweep */
.trick-slot.trick-win .card { box-shadow: 0 0 0 3px var(--brass), 0 0 14px rgba(203,161,53,.8); }
.trick-winner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  max-width: 200px; padding: 4px 10px; border-radius: 999px; background: rgba(20,12,4,.85); border: 1px solid var(--brass);
  color: var(--brass-soft); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; animation: trickWinIn .25s ease both; }
.trick-area.collecting .trick-winner { opacity: 0; transition: opacity .2s; }
@keyframes trickWinIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* GamesZone Admin — auto-play (robot) dialog */
.bot-dialog .admin-dialog-card { max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; }
.bot-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; text-align: left; }
.bot-row { padding: 10px 12px; border-radius: 10px; background: rgba(246,239,221,.08); border: 1px solid rgba(203,161,53,.4); }
.bot-row.team-0 { border-left: 5px solid var(--team-a); }
.bot-row.team-1 { border-left: 5px solid var(--team-b); }
.bot-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.bot-seat { font-size: 14px; color: var(--brass-soft); font-weight: 700; }
.bot-name-l { font-weight: 700; color: var(--ivory); min-width: 0; overflow-wrap: anywhere; }
.bot-st { flex-basis: 100%; font-size: 14px; opacity: .8; }
.bot-acts, .bot-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot-pick small { flex-basis: 100%; font-size: 14px; opacity: .8; }
.bot-btn { min-height: 36px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer;
  background: rgba(246,239,221,.12); color: var(--ivory); border: 1px solid rgba(203,161,53,.45); }
.bot-btn.go { background: var(--brass); color: #2a1b04; border-color: var(--brass); }
.bot-btn.danger { border-color: rgba(229,72,77,.7); color: #ffb3b5; }
.bot-btn:disabled { opacity: .45; cursor: not-allowed; }
.bot-name { min-height: 34px; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(203,161,53,.5);
  background: rgba(0,0,0,.35); color: var(--ivory); font: inherit; font-size: 16px; width: 160px; max-width: 100%; }
.bot-secs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(203,161,53,.12); border: 1px solid rgba(203,161,53,.45); text-align: left; font-size: 15px; font-weight: 700; }
.bot-secs input { width: 72px; min-height: 34px; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(203,161,53,.5);
  background: rgba(0,0,0,.35); color: var(--ivory); font: inherit; font-size: 16px; }
.bot-secs small { flex-basis: 100%; font-weight: 400; font-size: 14px; opacity: .8; }
.bot-timeout { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.bot-timeout input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brass); }
.bot-timeout.muted { opacity: .65; }
.bot-timeout small { font-weight: 400; font-size: 12px; }
.bot-rig { flex-wrap: wrap; }
.bot-rig small { flex-basis: 100%; padding-left: 26px; font-weight: 400; font-size: 12px; opacity: .8; }
.bot-rig-modes { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0 26px; font-size: 14px; }
.bot-rig-modes label { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 2px 8px; cursor: pointer; }
.bot-rig-modes input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--brass); }
.bot-rig-modes small { grid-column: 2; font-size: 12px; opacity: .75; }
