/* ============================================================
   Seep, table styling
   ============================================================ */

:root {
  --felt-1: #0f5132;
  --felt-2: #0a3a24;
  --felt-3: #062418;
  --ink: #f4f1e8;
  --ink-dim: #a9b6ae;
  --gold: #e3b341;
  --gold-soft: #f0d38a;
  --teamA: #4cc4f5;
  --teamB: #ff8a5b;
  --panel: rgba(12, 26, 20, 0.72);
  --panel-line: rgba(227, 179, 65, 0.22);
  --danger: #ff6b6b;
  --ok: #57d98a;
  --cw: 74px;
  --ch: 104px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --cream: #FFFDF7;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(1200px 800px at 50% -10%, #123f2b 0%, #07160f 60%, #04100a 100%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body { display: flex; flex-direction: column; }

.screen { display: none; height: 100%; flex-direction: column; overflow: hidden; }
.screen.active { display: flex; }

.spacer { flex: 1; }
.mt { margin-top: 22px; }
.center { justify-content: center; text-align: center; }
.muted { color: var(--ink-dim); }
.small { font-size: 13px; }

/* ── buttons & inputs ─────────────────────────────────────── */

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: rgba(0, 0, 0, 0.25);
  color: #2a1c00;
  box-shadow: 0 6px 18px rgba(227, 179, 65, 0.22);
}
.btn.primary:hover { box-shadow: 0 10px 24px rgba(227, 179, 65, 0.32); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.danger { border-color: rgba(255, 107, 107, 0.4); color: #ffb4b4; }

input, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid rgba(227, 179, 65, 0.5); outline-offset: 1px; }
input::placeholder { color: rgba(244, 241, 232, 0.35); }
label { display: block; font-size: 12.5px; color: var(--ink-dim); font-weight: 600; }
label input { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink); }
.check input { width: auto; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 6px; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-soft); }

/* ── auth ─────────────────────────────────────────────────── */

.auth-wrap {
  margin: auto;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 0;
}
.brand { text-align: center; }
.brand h1 {
  font-family: var(--display);
  margin: 10px 0 2px;
  font-size: 52px;
  font-weight: 500;
  letter-spacing: 0.26em;
  font-weight: 800;
  background: linear-gradient(180deg, #fff8e2, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-suits { font-size: 26px; letter-spacing: 6px; opacity: 0.9; }
.brand-suits .h, .brand-suits .d { color: #e0524f; }
.tagline { margin: 0; color: var(--ink-dim); font-size: 13.5px; }

.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: rgba(0, 0, 0, 0.3); padding: 4px; border-radius: 12px; }
.tab {
  flex: 1; padding: 9px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink-dim); font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit;
}
.tab.active { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--ink-dim); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.12); }

/* ── topbar / lobby ───────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) 14px calc(20px + env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.25);
}
.logo { font-weight: 800; letter-spacing: 0.22em; color: var(--gold); font-size: 17px; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; font-size: 13px; }
.who .muted { font-size: 11.5px; }
.room-code { font-size: 13px; color: var(--ink-dim); }
.room-code b { color: var(--gold); letter-spacing: 0.16em; font-size: 15px; }

.lobby-grid {
  flex: 1; overflow: auto; padding: 22px;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-content: start;
}
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; text-align: center; }

.room-list { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.room-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.room-row .t { flex: 1; min-width: 0; }
.room-row .t b { display: block; font-size: 14px; }
.room-row .t span { font-size: 12px; color: var(--ink-dim); }
.pill { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.pill.live { background: rgba(255, 138, 91, 0.18); color: #ffbb9c; }

.board { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; }
.board .lrow { display: flex; gap: 10px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.board .lrow .n { flex: 1; }
.board .lrow .rank { color: var(--gold); width: 22px; font-weight: 700; }

/* ── seat setup ───────────────────────────────────────────── */

.setup-wrap { flex: 1; display: flex; overflow: auto; padding: 24px; }
.setup { margin: auto; width: min(620px, 94vw); }
.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.seat-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.seat-card.mine { border-color: var(--gold); background: rgba(227, 179, 65, 0.08); }
.seat-card .sname { font-weight: 700; font-size: 15px; }
.seat-card .steam { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.steam.a { color: var(--teamA); }
.steam.b { color: var(--teamB); }
.seat-card .sact { display: flex; gap: 8px; }
.code-chip { letter-spacing: 0.3em; color: var(--gold); }

/* ── game table ───────────────────────────────────────────── */

.felt { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 0; }

.game-top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scorecard { display: flex; align-items: center; gap: 14px; }
.scorecard .team { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.scorecard .team b { font-size: 19px; font-variant-numeric: tabular-nums; }
.scorecard .dot { width: 9px; height: 9px; border-radius: 50%; }
.teamA .dot { background: var(--teamA); box-shadow: 0 0 10px var(--teamA); }
.teamB .dot { background: var(--teamB); box-shadow: 0 0 10px var(--teamB); }
.scorecard .vs { font-size: 11px; color: var(--ink-dim); }
.round-chip { font-size: 12px; color: var(--ink-dim); }
.round-chip b { color: var(--ink); }

.table-area {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(96px, 0.9fr) minmax(0, 3fr) minmax(96px, 0.9fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 10px 14px 0;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(120% 100% at 50% 40%, var(--felt-1), var(--felt-2) 55%, var(--felt-3) 100%);
  border-radius: 0;
  position: relative;
}
.table-area::after {
  content: ""; position: absolute; inset: 14px;
  border: 1px solid rgba(227, 179, 65, 0.14); border-radius: 26px; pointer-events: none;
}
.pos-top { grid-area: 1 / 2; justify-self: center; }
.pos-left { grid-area: 2 / 1; align-self: center; }
.pos-right { grid-area: 2 / 3; align-self: center; }
.pos-bottom { grid-area: 3 / 2; justify-self: center; }
.floor-wrap { grid-area: 2 / 2; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }

/* player nameplates */
.player {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 14px;
  border: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  max-width: 190px;
}
.player.active {
  border-color: var(--gold);
  background: rgba(227, 179, 65, 0.1);
  box-shadow: 0 0 0 1px rgba(227, 179, 65, 0.25), 0 0 26px rgba(227, 179, 65, 0.2);
}
.player .pname { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.player .pmeta { font-size: 11px; color: var(--ink-dim); }
.player .tag { font-size: 9.5px; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.13); letter-spacing: 0.06em; }
.player .tag.ai { background: rgba(76, 196, 245, 0.2); color: #bfe9ff; }
.player .tag.off { background: rgba(255, 107, 107, 0.2); color: #ffbaba; }
.player.you .pname { color: var(--gold-soft); }
.player .tline { height: 3px; width: 42px; border-radius: 2px; }
.player.ta .tline { background: var(--teamA); }
.player.tb .tline { background: var(--teamB); }

.mini-hand { display: flex; gap: 2px; }
.pos-left .mini-hand, .pos-right .mini-hand { flex-direction: column; }
.mini-card {
  width: 15px; height: 21px; border-radius: 3px;
  background: repeating-linear-gradient(45deg, #7a1f2b, #7a1f2b 3px, #5e1721 3px, #5e1721 6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.pos-left .mini-card, .pos-right .mini-card { width: 21px; height: 15px; }

/* seep pile, the clearing card sits half out of the capture pile */
.seep-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.seep-mark {
  --cw: 34px; --ch: 48px;
  position: relative; width: var(--cw); height: calc(var(--ch) + 8px);
}
.seep-mark .card { position: absolute; top: 0; left: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.seep-cover {
  position: absolute; left: -4px; right: -4px; bottom: 0; height: 56%;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #7a1f2b, #7a1f2b 3px, #5e1721 3px, #5e1721 6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.55);
}
.seep-cover::before, .seep-cover::after {
  content: ""; position: absolute; inset: 0; border-radius: 5px;
  background: inherit; border: 1px solid rgba(255, 255, 255, 0.16);
}
.seep-cover::before { transform: translate(-2px, -3px) rotate(-3deg); z-index: -1; }
.seep-cover::after { transform: translate(2px, -5px) rotate(2.5deg); z-index: -2; }
.seep-pts {
  position: absolute; top: -6px; right: -8px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #2a1c00; font-size: 9.5px; font-weight: 800;
  padding: 1px 5px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* face-down reserve stacks (2-player) */
.reserve-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reserve-pile { position: relative; width: calc(var(--cw) * 0.92); height: calc(var(--ch) * 0.92 + 40px); }
.rcard {
  position: absolute; left: 0; top: calc(var(--i) * 3.2px);
  width: calc(var(--cw) * 0.92); height: calc(var(--ch) * 0.92);
  border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, #7a1f2b, #7a1f2b 4px, #5e1721 4px, #5e1721 8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4);
}
.rcard::after {
  content: ""; position: absolute; inset: 4px; border-radius: 4px;
  border: 1px solid rgba(227, 179, 65, 0.28);
}
.reserve-label { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); text-align: center; }
.reserve-label b { color: var(--gold-soft); font-size: 14px; display: block; }

/* drag and drop */
.drag-ghost {
  position: fixed; z-index: 500; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-5deg) scale(1.08);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.65); opacity: 0.96;
}
body.dragging { cursor: grabbing; }
body.dragging .hand .card { cursor: grabbing; }
.hand .card { cursor: grab; touch-action: pan-x; }
.drop-hot {
  outline: 3px solid var(--ok) !important; outline-offset: 4px;
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 0 30px rgba(87, 217, 138, 0.7) !important;
}

/* floor */
.floor {
  display: flex; flex-wrap: wrap; gap: 30px 34px;
  align-items: center; justify-content: center;
  padding: 12px; max-height: 100%; overflow: auto;
}
.floor-empty {
  position: absolute; pointer-events: none;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
}
.floor-empty.hide { display: none; }

.house {
  position: relative;
  padding: 16px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  display: flex; gap: 0; align-items: flex-end;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.house.ta { border-color: rgba(76, 196, 245, 0.5); box-shadow: inset 0 0 24px rgba(76, 196, 245, 0.1); }
.house.tb { border-color: rgba(255, 138, 91, 0.5); box-shadow: inset 0 0 24px rgba(255, 138, 91, 0.1); }
.house-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #2a1c00; font-weight: 800; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.house-solid { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-soft);
  background: rgba(0,0,0,0.6); padding: 2px 8px; border-radius: 999px; }

/* who built this house, you can read the table without opening the log */
.house-owner {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  white-space: nowrap; padding: 2px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
}
.house-owner.ta { color: var(--teamA); }
.house-owner.tb { color: var(--teamB); }
/* Houses read as tight piles by default and fan out on hover / tap. */
.group { display: flex; }
.group .card { transition: margin 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); }
.group .card:not(:first-child) { margin-left: calc(var(--cw) * -0.8); }
.house .group:not(:first-child) { margin-left: calc(var(--cw) * -0.58); transition: margin 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); }

.house:hover, .house.expanded { z-index: 12; }
.house:hover .group .card:not(:first-child),
.house.expanded .group .card:not(:first-child) { margin-left: calc(var(--cw) * -0.5); }
.house:hover .group:not(:first-child),
.house.expanded .group:not(:first-child) { margin-left: 10px; }

.house-count {
  margin-left: 6px; padding: 0 5px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); font-size: 10px; font-weight: 700;
}
.house-badge { cursor: zoom-in; }
.house.expanded .house-badge { cursor: zoom-out; }

/* cards */
.card {
  width: var(--cw); height: var(--ch);
  border-radius: 8px;
  background: linear-gradient(160deg, #fffdf7, #ece5d6);
  color: #14181c;
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  flex: none;
  transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.16s ease;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.card.red { color: #c8102e; }
.card .corner {
  position: absolute; line-height: 1; display: flex; flex-direction: column; align-items: center;
  font-weight: 800; font-size: calc(var(--cw) * 0.245);
}
.card .corner.tl { top: calc(var(--ch) * 0.04); left: calc(var(--cw) * 0.055); }
.card .corner.br { bottom: calc(var(--ch) * 0.04); right: calc(var(--cw) * 0.055); transform: rotate(180deg); }
.card .corner i { font-style: normal; font-size: calc(var(--cw) * 0.22); margin-top: 1px; }
/* Real pip layouts: 3x13 grid, lower half rotated as on a printed card.
   The inset clears the corner indices so pips never sit under them. */
.card .pips {
  position: absolute;
  inset: calc(var(--ch) * 0.15) calc(var(--cw) * 0.27);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(13, 1fr);
  align-items: center;
  justify-items: center;
  pointer-events: none;
}
.card .pips i {
  font-style: normal;
  font-size: calc(var(--cw) * 0.15);
  line-height: 1;
}
.card .pips i.flip { transform: rotate(180deg); }

/* Indices stay tight in the corner gutter, clear of the pip field. */
.card .corner { font-size: calc(var(--cw) * 0.26); }
.card .corner b { letter-spacing: -0.05em; }
.card .corner i { font-size: calc(var(--cw) * 0.2); margin-top: 0; }
/* "10" is two characters wide, shrink it or it reaches into the pips. */
.card.ten .corner b { font-size: calc(var(--cw) * 0.19); }

/* Court cards keep a clean monogram rather than fake figure art. */
.card .court {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  font-size: calc(var(--cw) * 0.46); font-weight: 700; line-height: 1;
}
.card .court em { font-style: normal; font-size: calc(var(--cw) * 0.3); }
.card.point::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.card.sel-target { cursor: pointer; }
.card.sel-target:hover { transform: translateY(-4px); }
.selectable { outline: 2px dashed rgba(227, 179, 65, 0.75); outline-offset: 3px; cursor: pointer; }
.selected { outline: 3px solid var(--gold); outline-offset: 3px; box-shadow: 0 0 22px rgba(227, 179, 65, 0.55); }
@keyframes previewPulse { 0%, 100% { box-shadow: 0 0 18px rgba(87, 217, 138, 0.45); } 50% { box-shadow: 0 0 30px rgba(87, 217, 138, 0.85); } }
.preview { outline: 3px solid var(--ok); outline-offset: 3px; animation: previewPulse 1.1s ease-in-out infinite; }
.house.preview { outline-offset: 5px; }
.house.selectable { outline-offset: 5px; }
.house.selected { outline-offset: 5px; }
.dimmed { filter: brightness(0.55) saturate(0.7); }

@keyframes dealin { from { opacity: 0; transform: translateY(-14px) scale(0.9); } to { opacity: 1; transform: none; } }
.floor .card, .floor .house { animation: dealin 0.28s ease both; }

/* hand */
.hand-area {
  padding: 8px calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.42));
}
.hand { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 96px; align-items: flex-end; }
.hand .card { --cw: 66px; --ch: 94px; cursor: pointer; }
.hand .card:hover { transform: translateY(-10px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5); }
.hand .card.chosen { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 16px 30px rgba(0, 0, 0, 0.55); }
.hand .card.playable-no { filter: brightness(0.6) grayscale(0.35); }

.action-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 40px; align-items: center; }
.action-bar .hintline { font-size: 13px; color: var(--ink-dim); }
.action-bar .hintline b { color: var(--gold-soft); }
.act {
  padding: 9px 16px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 700;
  border: 1px solid rgba(227, 179, 65, 0.45); background: rgba(227, 179, 65, 0.14); color: var(--gold-soft);
  transition: all 0.14s ease; font-family: inherit;
}
.act:hover { background: rgba(227, 179, 65, 0.28); transform: translateY(-1px); }
.act.seep { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #2a1c00; border-color: transparent; }
.act.plain { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.hand-tools { display: flex; gap: 8px; }

/* log + chat */
.log-panel {
  position: absolute; top: 56px; right: 14px; bottom: 14px; width: 300px;
  background: rgba(6, 18, 13, 0.94);
  border: 1px solid var(--panel-line); border-radius: 16px;
  display: none; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
  z-index: 20;
}
.log-panel.open { display: flex; }
.log-head { display: flex; align-items: center; padding: 12px 14px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-soft); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.log-head .x { margin-left: auto; }
.x { background: none; border: 0; color: var(--ink-dim); font-size: 20px; cursor: pointer; line-height: 1; }
.log-list { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.log-list .le { color: var(--ink-dim); }
.log-list .le b { color: var(--ink); }
.log-list .le.seep b, .log-list .le.seep { color: var(--gold); }
.log-list .le.chat { color: #b9d8ff; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* a played card sailing from its owner's seat onto the table */
.flying-card {
  position: fixed; z-index: 400; pointer-events: none;
  --cw: 62px; --ch: 88px;
  transform: translate(-50%, -50%) scale(0.55) rotate(-14deg);
  opacity: 0.2;
  transition: left 0.6s cubic-bezier(0.3, 0.85, 0.35, 1),
              top 0.6s cubic-bezier(0.3, 0.85, 0.35, 1),
              transform 0.6s cubic-bezier(0.3, 0.85, 0.35, 1),
              opacity 0.25s ease;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.7);
}

/* live move feed */
.feed {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; z-index: 25; width: min(640px, 94%);
}
@keyframes feedIn {
  0% { opacity: 0; transform: translateY(-16px) scale(0.9); }
  60% { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: none; }
}
@keyframes feedOut { to { opacity: 0; transform: translateY(-8px) scale(0.97); } }
.feed-item {
  background: rgba(6, 20, 13, 0.96);
  border: 1px solid rgba(227, 179, 65, 0.45);
  border-radius: 14px; padding: 11px 20px;
  font-size: 15.5px; font-weight: 600; line-height: 1.35; text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: feedIn 0.34s cubic-bezier(0.2, 1.3, 0.4, 1) both, feedOut 0.6s ease 6.5s forwards;
  max-width: 100%;
}
.feed-item b { font-weight: 800; font-size: 16px; }
.speed-pick {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.08em;
}
.speed-pick select { width: auto; padding: 5px 8px; font-size: 12px; border-radius: 8px; }
.feed-item b { font-weight: 700; }
.feed-item.ta b { color: var(--teamA); }
.feed-item.tb b { color: var(--teamB); }
.feed-item.big { border-color: var(--gold); background: rgba(40, 28, 4, 0.94); color: var(--gold-soft); }

/* toasts */
.toast-layer { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; z-index: 30; }
@keyframes pop { 0% { opacity: 0; transform: scale(0.7); } 18% { opacity: 1; transform: scale(1.06); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.02) translateY(-24px); } }
.toast {
  position: absolute;
  font-size: 44px; font-weight: 900; letter-spacing: 0.1em;
  color: var(--gold); text-shadow: 0 6px 30px rgba(0, 0, 0, 0.8);
  animation: pop 1.7s ease forwards;
}

/* modal */
.modal-layer {
  position: fixed; inset: 0; background: rgba(2, 8, 5, 0.72);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  backdrop-filter: blur(6px);
}
.modal-layer.open { display: flex; }
.modal {
  width: min(620px, 96vw); max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #10261b, #0a1a12);
  border: 1px solid var(--panel-line); border-radius: 20px; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; padding: 20px 22px 12px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 23px; color: var(--gold-soft); }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 0 22px 8px; font-size: 14px; line-height: 1.6; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-body h3 { color: var(--gold-soft); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; margin: 22px 0 7px; font-weight: 700; }
.modal-body ul { margin: 6px 0; padding-left: 20px; }
.modal-body li { margin: 4px 0; }

.score-table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 14px; }
.score-table th, .score-table td { padding: 9px 10px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.score-table th:first-child, .score-table td:first-child { text-align: left; color: var(--ink-dim); }
.score-table .tot { font-weight: 800; color: var(--gold); font-size: 16px; }
.notes { font-size: 13px; color: var(--ink-dim); }
.notes li { margin: 5px 0; }

/* banner */
.banner {
  /* Parked well clear of the top edge and invisible: at -140% its rounded
     bottom edge still poked into the table as a red smudge. */
  position: fixed; top: 16px; left: 50%;
  transform: translate(-50%, calc(-100% - 32px));
  opacity: 0; visibility: hidden; pointer-events: none;
  background: rgba(20, 8, 8, 0.95); border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ffd3d3; padding: 11px 18px; border-radius: 12px; font-size: 13.5px;
  transition: transform 0.28s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.2s ease,
              visibility 0s linear 0.28s;
  z-index: 200; box-shadow: var(--shadow);
}
.banner.show {
  transform: translate(-50%, 0);
  opacity: 1; visibility: visible;
  transition-delay: 0s, 0s, 0s;
}
.banner.ok { border-color: rgba(87, 217, 138, 0.45); color: #c8f7db; background: rgba(8, 22, 14, 0.95); }

/* responsive */
@media (max-width: 900px) {
  :root { --cw: 46px; --ch: 66px; }
  .hand .card { --cw: 54px; --ch: 77px; }
  .table-area { grid-template-columns: minmax(64px, 0.7fr) minmax(0, 3fr) minmax(64px, 0.7fr); padding: 8px 6px 0; }
  .log-panel { left: 14px; width: auto; }
  .seat-grid { grid-template-columns: 1fr; }
  .player { max-width: 120px; }
  .player .pmeta { display: none; }
}
@media (max-width: 560px) {
  :root { --cw: 38px; --ch: 55px; }
  .hand .card { --cw: 46px; --ch: 66px; }
  .brand h1 { font-size: 42px; }
}

.lead-line { font-size: 13.5px; color: var(--ink-dim); margin: 4px 0 0; }
.lead-line b { color: var(--gold-soft); }
.scorecard .vs.close { color: var(--gold); font-weight: 700; }

/* ============================================================
   Mobile, phones get a different layout, not just smaller cards
   ============================================================ */

/* Fill the visible viewport, not the one hidden behind browser chrome. */
html, body { height: 100dvh; }
.screen { height: 100dvh; }

@media (max-width: 820px) {
  .topbar, .game-top { padding: 8px 10px; gap: 8px; }
  .logo { font-size: 15px; letter-spacing: 0.16em; }
  .who { display: none; }
  .round-chip { display: none; }
  .btn.tiny { padding: 9px 12px; }          /* easier to hit with a thumb */

  .scorecard { gap: 8px; }
  .scorecard .team .label { display: none; }
  .scorecard .team b { font-size: 17px; }
  .scorecard .vs { font-size: 10.5px; max-width: 92px; line-height: 1.2; }

  .lobby-grid { padding: 12px; gap: 12px; grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: 14px; }
  .setup-wrap { padding: 12px; }

  /* The table keeps its shape; the side seats just get out of the way. */
  .table-area {
    grid-template-columns: minmax(52px, 0.5fr) minmax(0, 4fr) minmax(52px, 0.5fr);
    padding: 6px 4px 0;
    gap: 2px;
  }
  .table-area::after { inset: 6px; border-radius: 16px; }
  .player { max-width: 96px; padding: 5px 7px; gap: 3px; }
  .player .pmeta { display: none; }
  .player .pname { font-size: 11.5px; }
  .mini-hand { display: none; }
  .seep-mark { --cw: 26px; --ch: 37px; }

  :root { --cw: 56px; --ch: 79px; }

  /* Hand scrolls sideways instead of wrapping into unreadable rows. */
  .hand-area { padding: 6px 0 10px; gap: 6px; }
  .hand {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    justify-content: flex-start;
    padding: 10px 12px 4px;
    width: 100%;
    min-height: 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hand::-webkit-scrollbar { display: none; }
  .hand .card { --cw: 60px; --ch: 86px; scroll-snap-align: center; }
  .hand .card:hover { transform: none; }      /* hover is meaningless on touch */
  .hand .card.chosen { transform: translateY(-10px); }

  /* Actions scroll too, so a long list never pushes the hand off screen. */
  .action-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding: 0 12px;
    scrollbar-width: none;
  }
  .action-bar::-webkit-scrollbar { display: none; }
  .act { padding: 11px 15px; font-size: 13px; }
  .hand-tools { flex-wrap: wrap; justify-content: center; padding: 0 10px; }

  .log-panel { top: 0; right: 0; left: 0; bottom: 0; width: auto; border-radius: 0; }
  .feed { width: 96%; top: 6px; }
  .feed-item { font-size: 13.5px; padding: 9px 14px; }
  .toast { font-size: 32px; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 16px; }
  .modal-body { padding: 0 16px 8px; }
  .modal-head { padding: 16px 16px 10px; }

  /* Houses fan out on tap rather than hover, so keep them readable closed. */
  .group .card:not(:first-child) { margin-left: calc(var(--cw) * -0.72); }
  .house .group:not(:first-child) { margin-left: calc(var(--cw) * -0.5); }
}

@media (max-width: 520px) {
  :root { --cw: 46px; --ch: 65px; }
  .hand .card { --cw: 58px; --ch: 82px; }
  .brand h1 { font-size: 40px; letter-spacing: 0.18em; }
  .auth-wrap { gap: 18px; }
  .player { max-width: 78px; }
  .player .pname { font-size: 10.5px; }
  .house-badge { font-size: 10px; padding: 2px 7px; }
  .house-owner { font-size: 8.5px; padding: 1px 6px; }
}

/* Landscape phones are short, claw back vertical space. */
@media (max-height: 520px) and (orientation: landscape) {
  .hand .card { --cw: 46px; --ch: 66px; }
  .hand-tools { display: none; }
  .game-top { padding: 4px 10px; }
  .action-bar { min-height: 34px; }
}

/* ── mobile hand: overlap so more of it fits, and show it can scroll ── */
@media (max-width: 820px) {
  .hand-area { position: relative; }

  /* Fade at the edges is the only honest hint that the strip continues. */
  .hand-area::before,
  .hand-area::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; width: 26px;
    pointer-events: none; z-index: 3;
  }
  .hand-area::before { left: 0; background: linear-gradient(90deg, rgba(0,0,0,0.75), transparent); }
  .hand-area::after { right: 0; background: linear-gradient(270deg, rgba(0,0,0,0.75), transparent); }

  .hand { scroll-snap-type: none; padding: 12px 20px 6px; }
  .hand .card { position: relative; }
  /* Each card covers the previous one's right side, leaving its index legible. */
  .hand .card:not(:first-child) { margin-left: calc(var(--cw) * -0.3); }
  .hand .card.chosen,
  .hand .card:active { z-index: 6; }

  .hand-tools { gap: 6px; }
  .hand-tools .btn.tiny { padding: 8px 10px; font-size: 12px; }
  .speed-pick { font-size: 10px; gap: 4px; }
  .speed-pick select { padding: 6px; font-size: 11.5px; }
}

/* Private reminder to the holder of an unshown 9S/10D. */
.must-show {
  margin-top: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(227, 179, 65, 0.18); color: var(--gold-soft);
  border: 1px solid rgba(227, 179, 65, 0.5);
  animation: mustShowPulse 2.4s ease-in-out infinite;
}
@keyframes mustShowPulse { 0%,100% { opacity: 0.75; } 50% { opacity: 1; } }

/* ============================================================
   The Floor: identity mark
   ============================================================ */

.mark { display: block; }
.mark .m-spade { fill: var(--cream, #FFFDF7); }
.mark .m-diamond,
.mark .m-heart { fill: #C8102E; }
.mark .m-club { fill: var(--gold); }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.logo .mark { width: 26px; height: 26px; flex: none; }
.logo span {
  font-family: var(--display);
  font-weight: 600; font-size: 19px; letter-spacing: 0.2em;
  color: var(--gold); padding-left: 0.2em;
}

.brand-mark { display: flex; justify-content: center; margin-bottom: 6px; }
.brand-mark .mark { width: 92px; height: 92px; }

/* Warmer card stock and a softer felt, so it reads as a table rather than a UI. */
.card {
  background: linear-gradient(163deg, #FFFDF7 0%, #FBF6E9 55%, #F2EAD8 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.28), 0 8px 16px rgba(0,0,0,0.32),
              inset 0 0 0 1px rgba(20,10,0,0.10);
}
.table-area {
  background:
    radial-gradient(65% 55% at 50% 42%, rgba(255,255,255,0.07), transparent 72%),
    radial-gradient(125% 105% at 50% 38%, #14603A, #0B3F27 52%, #062418 100%);
}

/* The mark sits on the felt, so give it a little lift. */
.brand-mark .mark { filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45)); }

@media (max-width: 820px) {
  .logo .mark { width: 22px; height: 22px; }
  .logo span { font-size: 16px; letter-spacing: 0.16em; }
  .brand-mark .mark { width: 74px; height: 74px; }
}

/* Someone else still owes a 9 or 10: dimmer than your own reminder. */
.must-show:not(.mine) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-dim);
  border-color: rgba(255, 255, 255, 0.18);
  animation: none;
}

/* ============================================================
   Table animation
   ============================================================ */

/* A card back used for dealing and for sweeping cards away. */
.fly-back {
  width: var(--cw); height: var(--ch); border-radius: 8px;
  background: repeating-linear-gradient(45deg, #7a1f2b, #7a1f2b 4px, #5e1721 4px, #5e1721 8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.fly-back::after {
  content: ""; position: absolute; inset: 5px; border-radius: 5px;
  border: 1px solid rgba(227, 179, 65, 0.3);
}
.flying-card {
  transition-property: left, top, transform, opacity;
  transition-timing-function: cubic-bezier(0.22, 0.9, 0.28, 1);
}

/* Cards land rather than appear. */
@keyframes settle {
  0% { opacity: 0; transform: translateY(-22px) scale(1.1) rotate(-3deg); }
  55% { opacity: 1; transform: translateY(3px) scale(0.985) rotate(0.5deg); }
  100% { opacity: 1; transform: none; }
}
.floor .card, .floor .house { animation: settle 0.34s cubic-bezier(0.2, 1.1, 0.3, 1) both; }

/* Gold sparks when the floor is cleared. */
.spark {
  position: absolute; width: 7px; height: 7px; border-radius: 2px;
  background: linear-gradient(180deg, #fff3cf, var(--gold));
  transform: translate(-50%, -50%);
  animation: spark 0.9s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
  box-shadow: 0 0 10px rgba(227, 179, 65, 0.8);
}
@keyframes spark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.5) rotate(180deg);
  }
}
.felt.flash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 40;
  background: radial-gradient(60% 50% at 50% 45%, rgba(227, 179, 65, 0.3), transparent 70%);
  animation: flashOut 0.6s ease forwards;
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* Points floating up off the seat that won them. */
.score-pop {
  position: fixed; z-index: 420; pointer-events: none;
  transform: translate(-50%, -50%);
  font-size: 26px; font-weight: 900; color: var(--gold);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.8);
  animation: scorePop 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
@keyframes scorePop {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -90%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}

/* Whose turn it is should be obvious from across the room. */
.player.active { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(227,179,65,0.25), 0 0 22px rgba(227,179,65,0.16); }
  50% { box-shadow: 0 0 0 1px rgba(227,179,65,0.5), 0 0 38px rgba(227,179,65,0.34); }
}
.player.active .tline { animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0%, 100% { width: 42px; } 50% { width: 62px; } }

/* Cards in hand should feel springy. */
.hand .card {
  transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.35, 1), box-shadow 0.2s ease, filter 0.2s ease;
}
.hand .card.chosen {
  animation: lift 0.28s cubic-bezier(0.2, 1.5, 0.35, 1) both;
}
@keyframes lift {
  0% { transform: translateY(0) scale(1); }
  60% { transform: translateY(-22px) scale(1.05); }
  100% { transform: translateY(-16px) scale(1.03); }
}

/* Actions arriving should not just blink into place. */
.act { animation: settleIn 0.22s ease both; }
@keyframes settleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .floor .card, .floor .house, .act, .hand .card.chosen { animation: none; }
  .player.active, .player.active .tline { animation: none; }
  .flying-card, .spark, .score-pop { display: none !important; }
}

/* ============================================================
   Between rounds
   ============================================================ */

.round-title {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(50% 40% at 50% 50%, rgba(4, 14, 9, 0.82), transparent 75%);
  animation: titleCard 1.15s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}
.round-title span {
  font-family: var(--display); font-size: 26px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold-soft);
}
.round-title b {
  font-family: var(--display); font-size: 76px; line-height: 1;
  color: var(--cream); text-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
}
@keyframes titleCard {
  0% { opacity: 0; letter-spacing: 0.6em; }
  22% { opacity: 1; letter-spacing: 0.3em; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

.confetti {
  position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { opacity: 0; transform: translateY(-10px) rotate(0deg); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 92vh) rotate(var(--tilt)); }
}

/* Round summary */
.round-banner {
  display: flex; align-items: center; justify-content: center;
  padding: 13px 16px; border-radius: 12px; margin: 2px 0 16px;
  font-size: 15.5px; font-weight: 700; text-align: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  animation: settleIn 0.34s ease both;
}
.round-banner.ta { background: rgba(76, 196, 245, 0.14); border-color: rgba(76, 196, 245, 0.45); color: #bfe9ff; }
.round-banner.tb { background: rgba(255, 138, 91, 0.14); border-color: rgba(255, 138, 91, 0.45); color: #ffc4a8; }

.score-table td[data-count] { font-variant-numeric: tabular-nums; }
.score-table td.lead { color: var(--gold); font-weight: 700; }
.score-table tr.tot td { border-top: 1px solid rgba(227, 179, 65, 0.3); }

.modal { animation: modalIn 0.3s cubic-bezier(0.2, 1.1, 0.3, 1) both; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .round-title, .confetti { display: none !important; }
  .modal, .round-banner { animation: none; }
}

@media (max-width: 820px) {
  .floor { gap: 20px 22px; }
  .round-title b { font-size: 54px; }
  .round-title span { font-size: 18px; }
}

/* ── watch / activity / profile / replay ─────────────────────── */

.hide { display: none !important; }

.namelink { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.15s; }
.namelink:hover { text-decoration-color: currentColor; }

.board .lrow { align-items: center; }
.board .lrow .btn { margin-left: auto; }

.corner-tag.tag { background: rgba(227, 179, 65, 0.2); color: var(--gold-soft); font-size: 11px; padding: 5px 10px; border-radius: 999px; letter-spacing: 0.06em; margin-right: 6px; cursor: default; }
#watchers-badge.tag { background: rgba(76, 196, 245, 0.18); color: #bfe9ff; }

.profile-stats { display: flex; gap: 10px; margin-top: 6px; }
.profile-stats > div { flex: 1; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 10px; text-align: center; }
.profile-stats b { display: block; font-size: 20px; color: var(--gold-soft); }
.profile-stats span { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }

/* Grid, not flex-wrap: .pos-left/.pos-right force .mini-hand to flex-direction:
   column for the face-down piles, and grid is immune to that property, so a
   fixed column count is a reliable way to guarantee wrapping under every seat. */
.mini-hand.revealed {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 155px;
  justify-content: center;
}
.mini-hand.revealed .card.mini { --cw: 26px !important; --ch: 37px !important; }
/* The left/right seat columns are much narrower than the center one; fewer,
   taller columns keep the grid from spilling off the edge of the screen. */
.pos-left .mini-hand.revealed, .pos-right .mini-hand.revealed {
  grid-template-columns: repeat(2, 1fr);
  width: 63px;
}
/* Live play only needs room there for a name and a tiny face-down pile, but
   revealing full hands is the whole point of replay, so give those columns
   real width instead of letting the grid above get clipped by the edge. */
body.replay-mode .table-area {
  grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) minmax(110px, 1fr);
}

.replay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.replay-bar #replay-scrub { flex: 1; min-width: 120px; max-width: 320px; }
.replay-bar #replay-pos { min-width: 150px; text-align: center; }

body.replay-mode #action-bar,
body.replay-mode #hand,
body.replay-mode .hand-tools { display: none; }

body.spectator-mode #hand,
body.spectator-mode #btn-hint,
body.spectator-mode #btn-clear { display: none; }
