/* CardCircle — seats around the felt (TC.seats in seats.js): plates, fanned face-down hands,
   books, speech bubbles, travelling cards. Shared by multi-seat games. */

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ---------- Plate ---------- */
.seat-plate {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  min-height: 48px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(2, 16, 9, 0.62);
  color: var(--ink);
  font: inherit;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, opacity 0.3s, transform 0.15s var(--ease);
}
button.seat-plate { cursor: default; }
.avatar {
  --hue: 150;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font: 800 1.05rem/1 var(--font-display);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at 35% 30%, hsl(var(--hue) 55% 62%), hsl(var(--hue) 50% 38%) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.seat-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.seat-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-tag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.seat-count {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font: 700 0.8rem/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.seat-count:empty { display: none; }
.seat-key { position: absolute; top: -8px; right: -4px; }

/* Whose turn it is: a gold ring and a soft glow. */
.seat.turn .seat-plate {
  border-color: var(--gold-2);
  background: rgba(30, 26, 8, 0.7);
  box-shadow: 0 0 0 2px rgba(244, 220, 149, 0.35), 0 0 26px rgba(244, 220, 149, 0.28);
}
.seat.turn .avatar { animation: turn-pulse 1.6s ease-in-out infinite; }
@keyframes turn-pulse {
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 4px rgba(244, 220, 149, 0.45); }
}
/* A seat the player can pick right now, and the one picked. */
.seat.pickable button.seat-plate { cursor: pointer; }
.seat.pickable button.seat-plate:hover { border-color: var(--gold-2); transform: translateY(-2px); }
.seat.chosen .seat-plate { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(244, 220, 149, 0.55), 0 0 26px rgba(244, 220, 149, 0.3); }
.seat.asked .seat-plate { border-color: rgba(244, 220, 149, 0.7); }
.seat.out .seat-plate { opacity: 0.45; }
.seat.out .fan { opacity: 0.3; }

/* ---------- Fanned face-down hand ---------- */
.fan {
  --mini: 34px;
  --spread: 6deg;
  --dx: 8px;
  position: relative;
  width: calc(var(--mini) * 3.2);
  height: calc(var(--mini) * 1.55);
}
.fan .card {
  --w: var(--mini);
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: calc(var(--mini) * -0.5);
  transform-origin: 50% 120%;
  transform: translateX(calc(var(--k) * var(--dx))) rotate(calc(var(--k) * var(--spread)));
  transition: transform 0.3s var(--ease);
}
.fan .card .card-face, .fan .card .card-back { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.card.blank .card-face { visibility: hidden; }

/* ---------- Books ---------- */
.books {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  max-width: 100%;
}
.book {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 30px;
  border-radius: 4px;
  font: 800 0.78rem/1 var(--font-display);
  color: var(--suit-black);
  background: linear-gradient(160deg, #fff, var(--card-face));
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 1px 1px 0 #e6e1d2, 2px 2px 0 #d3cdbb, 3px 3px 0 #c4bda9, 3px 4px 6px rgba(0, 0, 0, 0.4);
}
.book.new { animation: book-in 0.6s var(--ease); }
@keyframes book-in {
  0% { transform: scale(0.4) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(4deg); opacity: 1; box-shadow: 0 0 0 4px rgba(244, 220, 149, 0.6), 0 0 22px rgba(244, 220, 149, 0.7); }
}

/* ---------- Speech bubble ---------- */
.bubble {
  position: absolute;
  top: calc(100% - 6px);
  left: 50%;
  z-index: 15;
  width: max-content;
  max-width: min(220px, 80vw);
  padding: 9px 14px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  text-align: center;
  color: #1b1a14;
  background: #fbf7e9;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  translate: -50% 0;
  opacity: 0;
  scale: 0.85;
  pointer-events: none;
  transition: opacity 0.2s, scale 0.25s var(--ease);
}
.bubble::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top: 0;
  border-bottom-color: #fbf7e9;
}
.bubble.show { opacity: 1; scale: 1; }
.seat.mine .bubble { top: auto; bottom: calc(100% + 4px); }
.seat.mine .bubble::before { top: auto; bottom: -7px; border-bottom: 0; border-top: 8px solid #fbf7e9; }

/* ---------- A card travelling across the table ---------- */
.card.traveller {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  margin: 0;
}
