*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* A card table at night: green felt, ivory cards, brass for whose turn it is. */
:root {
  --felt: #0e3428;
  --felt-deep: #08231b;
  --felt-raised: #144437;
  --line: #2a5e4f;
  --ivory: #f4efe3;
  --ivory-edge: #ddd4bf;
  --ink: #1a1a1d;
  --card-red: #b3202d;
  --card-back: #8e1d27;
  --brass: #d9a845;
  --brass-deep: #8a6418;
  --text: #edf2ec;
  --muted: #9fbbaf;
  --danger: #f2817f;
  --ok: #94dcae;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --card-w: 64px;
  --radius: 12px;
  --shadow-card: 0 2px 0 var(--ivory-edge), 0 10px 22px -12px rgba(0, 0, 0, .7);
}

/* Arabic: Amiri plays the role of Bodoni, Plex Sans Arabic the role of Figtree. */
html[lang="ar"] {
  --serif: "Amiri", "Bodoni Moda", Georgia, serif;
  --sans: "IBM Plex Sans Arabic", "Figtree", -apple-system, "Geeza Pro", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: radial-gradient(120% 70% at 50% 0%, #17503f 0%, transparent 60%) no-repeat, var(--felt);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}

.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 48px 0; }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.brand {
  background: none;
  border: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ivory);
}
.topbar-actions { display: flex; gap: 4px; }

/* ---------- buttons & fields ---------- */

.btn-primary, .btn-secondary, .btn-ghost {
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  border: 0;
  min-height: 44px;
  transition: transform .08s ease, filter .15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #e8bd5f, var(--brass));
  color: #2a1d05;
  box-shadow: 0 2px 0 var(--brass-deep);
}
.btn-secondary {
  background: var(--felt-raised);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost { background: none; color: var(--muted); padding-inline: 12px; }
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
.wide { width: 100%; }

.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field.inline { grid-template-columns: auto 90px; align-items: center; gap: 10px; }
input {
  background: var(--felt-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 17px;
  color: var(--text);
  width: 100%;
  min-height: 46px;
}
input:focus { border-color: var(--brass); outline: none; }

.panel {
  background: rgba(8, 35, 27, .55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.panel h2 { font-size: 16px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 120px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brass);
  color: #2a1d05;
  white-space: nowrap;
}
.tag.soft { background: var(--felt-raised); color: var(--muted); }
.tag.off { background: transparent; color: var(--danger); border: 1px solid currentColor; }

/* ---------- home & lobby ---------- */

.home, .lobby { display: grid; gap: 18px; padding-top: 20px; }
.title {
  font-family: var(--serif);
  font-size: clamp(56px, 18vw, 84px);
  line-height: 1;
  text-align: center;
  color: var(--ivory);
}
.tagline { text-align: center; color: var(--muted); margin-top: -8px; }
.code-input, .room-code {
  font-family: "Bodoni Moda", Georgia, serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-variation-settings: "opsz" 6;
}
.code-input { font-size: 22px; text-align: center; }
.lobby { text-align: center; }
.lobby .panel { text-align: start; }
.room-code { font-size: 56px; color: var(--ivory); line-height: 1; margin-top: -8px; }
.lobby-list { list-style: none; display: grid; gap: 8px; }
.lobby-list li { display: flex; align-items: center; gap: 10px; }
.pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 30px; height: 40px;
  flex: none;
  border-radius: 5px;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}
.avatar i { font-style: normal; font-size: 12px; }
.avatar.red i { color: var(--card-red); }

/* ---------- playing cards ---------- */

.card {
  position: relative;
  width: var(--card-w);
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  box-shadow: var(--shadow-card);
  direction: ltr;
}
.card.face { background: var(--ivory); color: var(--ink); }
.card.face.red { color: var(--card-red); }
.card .idx {
  position: absolute;
  top: 4px; left: 5px;
  font-family: "Bodoni Moda", Georgia, serif;
  font-weight: 700;
  font-size: calc(var(--card-w) * .26);
  line-height: .95;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-variation-settings: "opsz" 6;
}
.card .idx i { font-style: normal; font-size: .8em; }
.card .idx.flip { top: auto; left: auto; bottom: 4px; right: 5px; transform: rotate(180deg); }
.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--card-w) * .42);
}
.card .court {
  position: absolute;
  inset: 6% 21%;
  display: block;
}
.card.has-court .idx { font-size: calc(var(--card-w) * .2); top: 3px; left: 3px; z-index: 1; }
.card.has-court .idx.flip { top: auto; left: auto; bottom: 3px; right: 3px; }
.card .court svg { width: 100%; height: 100%; display: block; }
.hand.small .card .court { inset: 5% 6% 5% 30%; }
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.09) 0 2px, transparent 2px 7px),
    var(--card-back);
  border: 3px solid var(--ivory);
}
.card.ghost { border: 2px dashed var(--line); box-shadow: none; }
.card.big { --card-w: 70px; }
.card.peeking { outline: 3px solid var(--brass); animation: peek .25s ease-out; }
@keyframes peek { from { transform: rotateY(90deg); } to { transform: none; } }

/* ---------- the table ---------- */

.table { display: grid; gap: 14px; padding-top: 4px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.banner {
  background: var(--brass);
  color: #2a1d05;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius);
  padding: 8px 12px;
}

.opponents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.seat {
  background: rgba(8, 35, 27, .55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.seat.turn { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(217, 168, 69, .35); }
.seat.out { opacity: .5; }
.seat.mine { padding: 14px; }
.seat-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.seat-head .pname { flex: 1; min-width: 0; font-size: 14px; }
.score {
  font-family: "Bodoni Moda", Georgia, serif;
  font-variation-settings: "opsz" 6;
  font-weight: 700;
  font-size: 20px;
  color: var(--ivory);
}
.chip {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--ivory);
  color: var(--ink);
  border: 2px dashed var(--brass-deep);
  flex: none;
}
.chip.check { background: var(--brass); border-style: solid; font-size: 12px; }

/* Hands keep the two-row layout: top row = slots 0,1; bottom row = slots 2,3. */
.hand {
  display: grid;
  grid-template-columns: repeat(2, var(--card-w));
  gap: 10px;
  justify-content: center;
  --card-w: 64px;
}
.hand.small { --card-w: 34px; gap: 5px; grid-template-columns: repeat(2, var(--card-w)); }
.hand.small.revealed { --card-w: 44px; }
.hand:has(.slot:nth-child(5)) { grid-template-columns: repeat(3, var(--card-w)); }
.slot { border-radius: 8px; }
.slot .card { width: 100%; }
.slot.empty { aspect-ratio: 5 / 7; border: 1.5px dashed var(--line); border-radius: 7px; }
.slot.selectable { cursor: pointer; }
.slot.selectable .card { box-shadow: 0 0 0 2px var(--brass), var(--shadow-card); }
.slot.selectable:hover .card { transform: translateY(-3px); }
.slot.selected .card { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--ok), var(--shadow-card); }
.slot .card { transition: transform .12s ease; }
.hand.small .card .idx { top: 2px; left: 3px; }
.hand.small .card .idx.flip { display: none; }
.hand.small .card.back { border-width: 2px; }

.center-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 6px 0;
}
.stack {
  background: none;
  border: 0;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  --card-w: 64px;
}
.stack:disabled { opacity: 1; }
.stack:not(:disabled) .card { box-shadow: 0 0 0 2px var(--brass), var(--shadow-card); }
.stack .cap { font-size: 13px; color: var(--muted); }
.stack .count {
  position: absolute;
  top: -8px; inset-inline-end: -8px;
  background: var(--felt-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 7px;
}
.deck .card.back { box-shadow: 3px 3px 0 -1px var(--ivory-edge), 6px 6px 0 -2px var(--card-back), var(--shadow-card); }

.prompt { display: grid; gap: 8px; justify-items: center; text-align: center; min-height: 92px; }
.drawn .label { margin-bottom: 4px; }
.hint { color: var(--muted); }
.hint.strong { color: var(--ivory); font-weight: 700; font-size: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.check-btn { padding-inline: 26px; }
.drawn { display: flex; align-items: center; gap: 16px; text-align: start; }
.choices { display: flex; gap: 16px; }
.choice { background: none; border: 0; border-radius: 10px; }
.choice:hover .card { transform: translateY(-4px); }
.choice .card { transition: transform .12s ease; }

.log { list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.log li:first-child { color: var(--text); }

/* ---------- round result ---------- */

.result {
  display: grid;
  gap: 12px;
  text-align: center;
  background: rgba(8, 35, 27, .7);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 14px;
}
.result h2 { font-family: var(--serif); font-size: 26px; color: var(--ivory); }
.winner { font-size: 34px !important; color: var(--brass) !important; }
.scores { width: 100%; border-collapse: collapse; font-size: 15px; }
.scores th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px; }
.scores td { padding: 8px 4px; border-top: 1px solid var(--line); }
.scores td:first-child { text-align: start; font-weight: 600; }
.scores tr.out td { color: var(--danger); }

/* ---------- sheet & toast ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.sheet {
  background: var(--felt);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 20px 20px calc(16px + env(safe-area-inset-bottom));
  gap: 12px;
}
.sheet-body { overflow: auto; display: grid; gap: 8px; align-content: start; }
.sheet-body h2 { font-family: var(--serif); font-size: 28px; color: var(--ivory); }
.sheet-body h3 { font-size: 15px; color: var(--brass); margin-top: 8px; }
.sheet-body ul { padding-inline-start: 20px; display: grid; gap: 4px; }

.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ivory);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  z-index: 30;
  max-width: calc(100% - 32px);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- last move marks: everyone sees which position changed ---------- */

.slot { position: relative; }
.slot.marked .card, .slot.marked.empty { box-shadow: 0 0 0 3px var(--brass), var(--shadow-card); }
.slot.marked.fresh .card, .slot.marked.fresh.empty { animation: marked 1.2s ease-out 2; }
@keyframes marked {
  0% { box-shadow: 0 0 0 0 rgba(217, 168, 69, .9), var(--shadow-card); transform: scale(1.06); }
  60% { box-shadow: 0 0 0 10px rgba(217, 168, 69, 0), var(--shadow-card); transform: none; }
  100% { box-shadow: 0 0 0 3px var(--brass), var(--shadow-card); }
}
.mark {
  position: absolute;
  top: -8px;
  inset-inline-end: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brass);
  color: #2a1d05;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  z-index: 1;
}
.hand.small .mark { top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; font-size: 10px; }

.matched-tag {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background: var(--felt-deep);
  color: var(--brass);
  border: 1px solid var(--brass);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.secs {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--felt-deep);
  color: var(--brass);
  font-size: 12px;
  font-weight: 700;
  margin-inline-start: 4px;
}

/* ---------- invite, end game, claim ---------- */

.invite { text-align: center; }
.invite .title { font-size: clamp(44px, 14vw, 64px); }
.invite-form { display: grid; gap: 14px; text-align: start; }
.btn-primary.big { font-size: 19px; min-height: 56px; }
.end-btn { padding: 6px 10px; min-height: 32px; font-size: 13px; color: var(--danger); }
.end-btn.armed { background: var(--card-red); color: var(--ivory); border-radius: 999px; }
.claim { text-align: center; }

/* While you look at your own cards they grow, in place, so positions stay clear. */
.hand { transition: --card-w .2s; }
.hand.zoom { --card-w: min(112px, 28vw); gap: 14px; }
.hand.zoom:has(.slot:nth-child(5)) { --card-w: min(100px, 26vw); }
.hand.zoom .card.peeking { outline-width: 4px; }

/* Seat headers must fit narrow opponent boxes in both directions. */
.seat-head { flex-wrap: wrap; row-gap: 4px; }
.seat-head .pname { min-width: 3ch; }
.seat-head .score { margin-inline-start: auto; }
.av-wrap { position: relative; display: inline-flex; flex: none; }
.off-dot {
  position: absolute;
  bottom: -3px;
  inset-inline-end: -3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--felt-deep);
}
.seat.offline .hand { opacity: .7; }
.opponents .seat-head { gap: 6px; }
.opponents .chip { width: 18px; height: 18px; font-size: 9px; border-width: 1.5px; }
.opponents .chip.check { font-size: 10px; }
.opponents .score { font-size: 18px; }

.sound-btn { padding-inline: 10px; font-size: 18px; }

/* ---------- chat & reactions ---------- */

.chat-fab {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  inset-inline-end: 18px;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--felt-raised);
  font-size: 24px;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.6);
  z-index: 15;
}
.chat-fab .badge {
  position: absolute;
  top: -4px; inset-inline-end: -4px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--card-red);
  color: var(--ivory);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.chat-drawer {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 560px;
  height: min(70dvh, 520px);
  background: var(--felt-deep);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 40px rgba(0,0,0,.45);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  gap: 10px;
  z-index: 25;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-head h2 { font-family: var(--serif); font-size: 22px; color: var(--ivory); }
.reactions { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.react {
  flex: none;
  border: 1px solid var(--line);
  background: var(--felt-raised);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.react.emoji { font-size: 20px; padding: 4px 10px; }
.chat-list { list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.chat-list li {
  align-self: flex-start;
  max-width: 85%;
  background: var(--felt-raised);
  border-radius: 14px;
  padding: 6px 12px;
  overflow-wrap: anywhere;
}
.chat-list li b { color: var(--brass); font-size: 13px; display: block; }
.chat-list li.me { align-self: flex-end; background: #1d5747; }
.chat-list li.react-line span { font-size: 20px; }
.chat-list li.empty { align-self: center; background: none; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* Speech bubble over a seat for reactions and new messages. */
.seat { position: relative; }
.bubble {
  position: absolute;
  top: -10px;
  inset-inline-start: 50%;
  transform: translate(-50%, -100%);
  max-width: min(220px, 80vw);
  background: var(--ivory);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  z-index: 5;
  overflow-wrap: anywhere;
  animation: bubble-in .18s ease-out;
  pointer-events: none;
}
[dir="rtl"] .bubble { transform: translate(50%, -100%); }
.bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: var(--ivory);
}
.bubble.emoji { font-size: 30px; padding: 4px 10px; line-height: 1.2; }
@keyframes bubble-in { from { opacity: 0; margin-top: 8px; } to { opacity: 1; margin-top: 0; } }
.seat.mine .bubble { top: -6px; }
/* keep the floating chat button from covering the bottom of the page */
main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* Opponents sit across the table: their hand is turned 180°, so the bottom
   row they looked at first is farthest from you, and left/right swap.
   Each slot turns back so card faces and badges stay upright. */
.opponents .hand { transform: rotate(180deg); }
.opponents .hand .slot { transform: rotate(180deg); }

/* ---------- compact table (5-8 players) ---------- */

.opponents.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; }
.opponents.compact .seat { padding: 8px 4px 6px; gap: 5px; border-radius: 12px; }
.opponents.compact .seat-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "av name" "av score";
  gap: 0 5px;
  align-items: center;
  padding-inline: 2px;
}
.opponents.compact .av-wrap { grid-area: av; }
.opponents.compact .avatar { width: 22px; height: 30px; font-size: 12px; border-radius: 4px; }
.opponents.compact .avatar i { font-size: 10px; }
.opponents.compact .pname { grid-area: name; font-size: 12px; line-height: 1.2; }
.opponents.compact .score { grid-area: score; font-size: 15px; margin: 0; line-height: 1.1; }
.opponents.compact .off-dot { width: 9px; height: 9px; }
/* Dealer and check chips sit on the box corners instead of in the header. */
.opponents.compact .chip { position: absolute; top: -7px; width: 18px; height: 18px; z-index: 2; }
.opponents.compact .chip:not(.check) { inset-inline-start: -5px; }
.opponents.compact .chip.check { inset-inline-end: -5px; }
.opponents.compact .hand.small { --card-w: 24px; gap: 3px; }
.opponents.compact .hand.small:has(.slot:nth-child(5)) { --card-w: 19px; }
.opponents.compact .hand.small .card.back { border-width: 1.5px; border-radius: 4px; }
.opponents.compact .slot.empty { border-radius: 4px; }
.opponents.compact .mark { min-width: 15px; height: 15px; font-size: 9px; top: -5px; inset-inline-end: -5px; padding: 0 3px; }
/* Revealed at round end: corner index only, big enough to read. */
.opponents.compact .hand.small.revealed { --card-w: 30px; }
.opponents.compact .hand.small.revealed:has(.slot:nth-child(5)) { --card-w: 24px; }
.opponents.compact .card.face .pip,
.opponents.compact .card.face .court { display: none; }
.opponents.compact .card.face .idx { font-size: calc(var(--card-w) * .42); top: 2px; left: 3px; }
.opponents.compact .bubble { font-size: 12px; max-width: 150px; }
.opponents.compact .bubble.emoji { font-size: 24px; }

/* Crowded table: tighten the middle so deck, pile and your hand fit too. */
.table.crowded { gap: 10px; }
.table.crowded .center-row { padding: 0; gap: 22px; }
.table.crowded .stack { --card-w: 50px; gap: 3px; }
.table.crowded .prompt { min-height: 0; gap: 6px; }
.table.crowded .prompt .hint.strong { font-size: 16px; }
.table.crowded .seat.mine { padding: 10px; gap: 6px; }
.table.crowded .seat.mine .hand:not(.zoom) { --card-w: 54px; gap: 8px; }
.table.crowded .hand.zoom { --card-w: min(96px, 25vw); }
.table.crowded .drawn .card.big { --card-w: 56px; }
.table.crowded .choices .card.big { --card-w: 60px; }
.table.crowded .log { display: none; }

.head-actions { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.table-head .end-btn { padding: 6px 8px; }
