/* Bonkey — dark poker-night theme, phone-first portrait (375×667 reference). */

:root {
  --bg:        #101418;
  --bg-raise:  #181e24;
  --panel:     #1c232b;
  --felt:      #1b5e46;
  --felt-deep: #124233;
  --rail:      #2a1a12;
  --card:      #fffdf7;
  --card-back: #263b52;
  --ink:       #e8eaed;
  --muted:     #8b98a5;
  --line:      #2c353f;
  --gold:      #f0b429;
  --gold-deep: #c88f13;
  --chip-red:  #d84343;
  --accent:    #4fc3a1;
  --accent-deep: #2f9c7c;
  --red-suit:  #d84343;
  --black-suit:#22303a;
  --up:        #5fd39a;
  --down:      #ff7a6b;
  --shadow:    0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.45);
  --cardback-img: none;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ---------- shared ---------- */

.icon {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}
#btn-menu .icon { fill: currentColor; stroke: none; }

.wordmark {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 26px rgba(240, 180, 41, 0.28);
}
.wordmark.small { font-size: 1.35rem; }

.tagline { color: var(--muted); margin-top: -8px; text-align: center; }
.muted   { color: var(--muted); }
.tiny    { font-size: 0.78rem; }
.fine-print { color: var(--muted); font-size: 0.68rem; opacity: 0.8; }
.small-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
}

.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--gold);
  border-color: var(--gold-deep);
  color: #1a1206;
  font-weight: 800;
}
.btn.primary:active { background: var(--gold-deep); }
.btn.secondary {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn.danger {
  background: transparent;
  border: 1.5px solid var(--chip-red);
  color: var(--down);
}
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.link-btn {
  font: inherit;
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.error { color: var(--down); font-weight: 600; min-height: 1.2em; text-align: center; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  width: 100%;
  max-width: 280px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.text-input, .num-input {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.text-input { width: 230px; }
.text-input:focus, .num-input:focus { outline: none; border-color: var(--accent); }
.text-input.code {
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  width: 140px;
  padding-left: calc(14px + 0.3em);
}
.num-input {
  width: 100%;
  padding: 9px 8px;
  font-weight: 700;
  -moz-appearance: textfield;
  appearance: textfield;
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input.big { width: 130px; font-size: 1.4rem; font-weight: 800; }

#join-form, #pending-form { display: flex; gap: 10px; align-items: center; }
#pending-form { flex-direction: column; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.tag.you { background: var(--accent-deep); color: #08110d; }

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

.card {
  position: relative;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: none;
}
.card .c-rank { font-weight: 800; }
.card.red   { color: var(--red-suit); }
.card.black { color: var(--black-suit); }

.card.big  { width: 74px;  height: 104px; border-radius: 10px; gap: 4px; }
.card.big .c-rank { font-size: 1.9rem; }
.card.big .c-suit { font-size: 1.5rem; }

.card.comm { width: 17.5%; aspect-ratio: 5 / 7; gap: 2px; }
.card.comm .c-rank { font-size: clamp(0.9rem, 4.6vw, 1.35rem); }
.card.comm .c-suit { font-size: clamp(0.8rem, 4vw, 1.15rem); }
.card.comm.empty {
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.card.mini { width: 24px; height: 34px; border-radius: 4px; gap: 1px; }
.card.mini .c-rank { font-size: 0.66rem; }
.card.mini .c-suit { font-size: 0.6rem; }

.card.back {
  background:
    var(--cardback-img),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 3px, transparent 3px 6px),
    var(--card-back);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.card.best {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
  box-shadow: 0 0 12px rgba(240, 180, 41, 0.6);
}
.card.mucked { opacity: 0.35; filter: grayscale(0.6); }

/* ---------- setup ---------- */

.setup-panel {
  width: 100%;
  max-width: 340px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setup-panel .small-label { margin-top: 6px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg-raise);
  color: var(--ink);
  cursor: pointer;
}
.chip-btn.on {
  border-color: var(--gold);
  background: rgba(240, 180, 41, 0.14);
  color: var(--gold);
}

.field-row { display: flex; gap: 8px; }
.field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* ---------- seating ---------- */

.room-code {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  margin-right: -0.25em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 26px;
}

.share-row { display: flex; gap: 10px; }

.blinds-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}

.players-panel { width: 100%; max-width: 340px; padding: 12px 16px; }
.players-panel .small-label { margin-bottom: 6px; }
#seat-list { list-style: none; }
#seat-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-weight: 600;
}
#seat-list li:last-child { border-bottom: none; }
#seat-list .p-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#seat-list .p-stack { font-weight: 800; color: var(--accent); }
.empty-seat { color: var(--muted); font-weight: 500; }
#spec-line { margin-top: 8px; }

/* ---------- table layout (fits 375×667, never scrolls) ---------- */

#screen-table {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

#table-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex: none;
}
#hdr-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.hdr-blinds { font-weight: 800; font-size: 0.95rem; color: var(--gold); white-space: nowrap; }
.hdr-hand   { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.hdr-actions { display: flex; gap: 6px; }
.round-btn {
  font: inherit;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-btn .icon { width: 1.1em; height: 1.1em; }

#felt-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: 62dvh;
}

#felt {
  position: absolute;
  inset: 7% 9%;
  border-radius: 46% / 40%;
  background: radial-gradient(ellipse at 50% 38%, #27795c 0%, var(--felt) 55%, var(--felt-deep) 100%);
  border: 6px solid var(--rail);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.45),
    0 4px 22px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6%;
}
#felt.custom-felt { background-size: cover; background-position: center; }

#pot-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#pot-total {
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 999px;
  padding: 3px 12px;
}
.pot-side { font-size: 0.66rem; color: rgba(255, 255, 255, 0.75); font-weight: 600; }

#community {
  display: flex;
  gap: 4%;
  width: 100%;
  justify-content: center;
}

#table-note {
  position: absolute;
  bottom: 16%;
  left: 10%;
  right: 10%;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

/* seat pods */
#seats-layer { position: absolute; inset: 0; pointer-events: none; }

.pod {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 92px;
}
.pod-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 3px 8px 4px;
  text-align: center;
  min-width: 62px;
  max-width: 92px;
}
.pod-name {
  font-size: 0.66rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pod-stack { font-size: 0.78rem; font-weight: 800; color: var(--accent); }
.pod.folded .pod-body, .pod.away .pod-body { opacity: 0.45; }
.pod.folded .pod-cards { display: none; }
.pod.turn .pod-body {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(240, 180, 41, 0.5), 0 0 16px rgba(240, 180, 41, 0.35), var(--shadow);
  animation: turn-pulse 1.6s ease-in-out infinite;
}
.pod-you .pod-stack { color: var(--gold); }

.pod-cards { display: flex; gap: 3px; }

.pod-tag {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 5px;
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--muted);
  white-space: nowrap;
}
.pod-tag.tag-hot { background: var(--chip-red); color: #fff; }
.pod-tag.tag-act { background: rgba(0, 0, 0, 0.55); color: #cdd6dd; }
.pod-tag.tag-add { background: var(--accent-deep); color: #08110d; }

.pod-ring {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  transform: rotate(-90deg);
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
}
/* Right-side pods hug the clipped table edge — hang their ring on the
 * table-center side so it can never be cropped on narrow phones. */
.pod-right .pod-ring { right: auto; left: -9px; }
.ring-bg  { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 3; }
.ring-arc {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
}
.ring-arc.urgent { stroke: var(--chip-red); }

/* bet markers + dealer disc + flying chips */
.bet-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.bet-disc, .fly-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 3px, rgba(255, 255, 255, 0.85) 3px 4px, transparent 4px),
    var(--chip-red);
  border: 2px dashed rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  flex: none;
}
.bet-amt {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 1px 6px;
}

.dealer-disc {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #14181c;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.fly-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: left 0.5s ease-in, top 0.5s ease-in, opacity 0.5s ease-in;
  z-index: 6;
}

/* showdown box */
#showdown-box {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  text-align: center;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(240, 180, 41, 0.5);
  border-radius: 12px;
  padding: 8px 10px;
  backdrop-filter: blur(2px);
  animation: fade-up 0.35s ease-out;
}
.sd-line { font-size: 0.86rem; font-weight: 800; color: var(--gold); }
.sd-line + .sd-line { margin-top: 2px; }
.showdown-count { font-size: 0.7rem; color: var(--muted); margin-top: 3px; min-height: 1em; }

/* banner + your strip */
#table-banner {
  flex: none;
  min-height: 1.25em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
#table-banner.attention { color: var(--gold); font-weight: 800; }
#table-banner.warn { color: var(--down); font-weight: 700; }

#you-strip {
  flex: none;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-height: 112px;
}
#you-cards { display: flex; gap: 6px; flex: none; }
#you-cards .card.big:nth-child(2) { transform: rotate(4deg) translateY(2px); }

#action-bar { flex: 1; max-width: 270px; }
#action-main { display: flex; gap: 6px; }
.btn.act {
  flex: 1;
  padding: 12px 4px;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 12px;
  white-space: nowrap;
}
.btn.act.fold  { background: var(--panel); border: 1.5px solid var(--line); color: var(--down); }
.btn.act.call  { background: var(--accent-deep); color: #08110d; }
.btn.act.raise { background: var(--gold); color: #1a1206; }
.btn.act.ghost { background: var(--panel); border: 1.5px solid var(--line); color: var(--muted); flex: 0 0 30%; }

#raise-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.raise-top { display: flex; align-items: center; justify-content: center; gap: 12px; }
.raise-amount {
  font-size: 1.5rem;
  font-weight: 800;
  min-width: 96px;
  text-align: center;
  color: var(--gold);
}
.step-btn {
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--bg-raise);
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
#raise-slider {
  width: 100%;
  accent-color: var(--gold);
  touch-action: none;
}
.presets .chip-btn { font-size: 0.72rem; padding: 5px 9px; flex: 1; text-align: center; }
.raise-confirm-row { display: flex; gap: 6px; }

/* ---------- ledger drawer ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 20;
}
.overlay-panel {
  width: 100%;
  max-width: 360px;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  position: relative;
}
.sheet-panel {
  width: 100%;
  max-width: 320px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  align-items: center;
}

.overlay.drawer { align-items: flex-end; padding: 0; }
.drawer-panel {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 18px 18px 0 0;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 78dvh;
  overflow-y: auto;
  animation: slide-up 0.25s ease-out;
}
.drawer-grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 0 auto;
}

.lg-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  align-items: baseline;
  text-align: right;
}
.lg-row:last-child { border-bottom: none; }
.lg-row .lg-name, .lg-row span:first-child { text-align: left; }
.lg-head { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.lg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lg-net { font-weight: 800; }
.lg-net.up { color: var(--up); }
.lg-net.down { color: var(--down); }

#settled-rows .lg-row { grid-template-columns: 1.5fr 1fr 1.2fr 1fr; }

.ledger-self { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#ledger-self-note { text-align: center; min-height: 1em; }

/* ---------- settled ---------- */

.settled-title { font-size: 1.5rem; font-weight: 800; margin-top: -6px; }
.ledger-panel, .pays-panel { width: 100%; max-width: 360px; padding: 10px 16px; }
.pays-panel { padding-bottom: 14px; }
.pays-panel .small-label { margin: 4px 0 6px; }
.pay-line { font-size: 0.9rem; font-weight: 700; padding: 4px 0; }

/* ---------- modals ---------- */

.modal-x {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
}
.rules-panel { text-align: left; }
.rules-panel h2 { font-size: 1.15rem; font-weight: 800; }
.rules-sub { font-size: 0.85rem; font-weight: 800; margin-top: 4px; }
.rules-list { padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 0.82rem; }
.rank-list { padding-left: 22px; display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; }
.rank-list li span { color: var(--muted); margin-left: 6px; font-size: 0.74rem; }
.newgame-panel .btn { width: 100%; }

/* ---------- meme toast ---------- */

#meme-toast {
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translateX(-50%) rotate(var(--rot, -2deg));
  z-index: 40;
  pointer-events: none;
  animation: meme-in 0.3s ease-out;
}
#meme-img {
  display: block;
  width: min(64vw, 260px);
  height: auto;
  max-height: 42vh;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.65);
}

/* ---------- animations ---------- */

@keyframes turn-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.25); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0.6; }
  to   { transform: none; opacity: 1; }
}
@keyframes meme-in {
  from { opacity: 0; transform: translateX(-50%) rotate(var(--rot, -2deg)) scale(0.7); }
  to   { opacity: 1; transform: translateX(-50%) rotate(var(--rot, -2deg)) scale(1); }
}
@keyframes deal-in {
  /* `to` leaves transform unset so cards settle into their natural pose
     (e.g. the fanned second hole card) instead of snapping to none. */
  from { opacity: 0; transform: translateY(-14px) scale(0.85); }
  to   { opacity: 1; }
}
.card.deal-in { animation: deal-in 0.3s ease-out both; animation-delay: calc(var(--i, 0) * 0.12s); }
.pod.deal-in {
  animation: pod-deal 0.3s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.05s);
}
@keyframes pod-deal {
  from { opacity: 0.2; }
  to   { opacity: 1; }
}
/* pods keep their translate(-50%,-50%) so only fade for deal-in */

@keyframes flip-in {
  0%   { transform: perspective(400px) rotateY(90deg); opacity: 0; }
  100% { transform: perspective(400px) rotateY(0deg); opacity: 1; }
}
.card.flip-in {
  animation: flip-in 0.35s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.15s);
  backface-visibility: hidden;
}

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

/* slightly taller phones: give the felt more room */
@media (min-height: 780px) {
  #felt-wrap { max-height: 66dvh; }
  .card.big { width: 82px; height: 116px; }
}

/* ------------------------------------------------------------ avatars ---- */
.avatar-label { margin-top: 4px; }
#avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 168px;
  overflow-y: auto;
  padding: 2px;
}
.avatar-chip {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
}
.avatar-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-chip.picked {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

/* seat-pod face: sits above the name, overlapping the pod edge */
.pod-body { position: relative; }
.pod-avatar {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  background: var(--panel);
}
.pod-body.has-avatar { padding-top: 14px; }
