/* Card Room. Felt green, walnut rail, brass trim, bone-white type. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Bodoni';
  src: url('/fonts/libre-bodoni-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Bodoni';
  src: url('/fonts/libre-bodoni-latin-wght-italic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --felt: #14474b;
  --felt-deep: #0d3236;
  --ink: #0c171b;
  --panel: #12252a;
  --walnut: #3a2a20;
  --walnut-dark: #22170f;
  --brass: #cfa64e;
  --brass-soft: rgba(207, 166, 78, 0.35);
  --bone: #ece6d8;
  --muted: #8fa3a6;
  --wine: #8c2f3c;
  --wine-bright: #c4505f;
  --line: rgba(236, 230, 216, 0.12);
  --card-paper: #f4efe3;
  --card-red: #b3262e;
  --card-black: #14202a;
  --card-blue: #1f5fbf;
  --card-green: #1d7a3c;
  --top: 3.4rem;
  --display: 'Libre Bodoni', 'Bodoni 72', Didot, Georgia, serif;
  --ui: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

html { background: var(--ink); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(20, 71, 75, 0.55), transparent 60%),
    var(--ink);
  color: var(--bone);
  font: 400 1rem/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
b { font-weight: 650; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.small { font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------------ buttons and fields */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: rgba(236, 230, 216, 0.08);
  color: var(--bone);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(236, 230, 216, 0.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.quiet { border-color: rgba(236, 230, 216, 0.18); }
.btn.strong { font-weight: 700; }
.btn.primary { background: var(--brass); color: #1b1408; border-color: var(--brass); }
.btn.primary:hover:not(:disabled) { background: #dcb862; }
.btn.danger { background: var(--wine); border-color: #a73a49; color: #fbeff0; }
.btn.danger:hover:not(:disabled) { background: #a23646; }
.btn.small { padding: 0.38rem 0.75rem; font-size: 0.8rem; color: inherit; }
.btn.big { padding: 0.9rem 1.4rem; font-size: 1.02rem; }
.icon {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.icon:hover:not(:disabled) { border-color: var(--brass); color: var(--brass); }
.icon:disabled { opacity: 0.3; cursor: not-allowed; }

input[type='text'], input[type='password'], input[type='number'], input[type='search'], select, textarea {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(236, 230, 216, 0.22);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.32);
  color: var(--bone);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1rem) 55%, calc(100% - 0.7rem) 55%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; padding-right: 1.8rem; }
select option, select optgroup { background: #12252a; color: var(--bone); }
input::placeholder { color: rgba(143, 163, 166, 0.8); }
input[type='range'] { width: 100%; accent-color: var(--brass); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--brass); }

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.82rem; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 0.7rem; margin-top: 0.4rem; }
.field.inline select { width: auto; flex: 1; }
.field-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.field-note a { color: var(--brass); }
.form-error { min-height: 1.3rem; color: #eaa0aa; font-size: 0.88rem; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.1rem;
  background: rgba(8, 18, 21, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 0.55rem; }
.brand-mark { color: var(--brass); font-size: 1.15rem; }
.brand-name { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.3rem; letter-spacing: 0.01em; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.who-name { font-weight: 600; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.bank { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.bank-amt { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--brass); }
.bank-label { font-size: 0.78rem; color: var(--muted); }

/* ------------------------------------------------------------------ login */

.login {
  min-height: calc(100dvh - 2rem);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.6rem;
  padding: 2.5rem 1rem;
}
body[data-screen='login'] main, body[data-screen='replaced'] main { background: radial-gradient(70% 55% at 50% 38%, rgba(20, 71, 75, 0.75), transparent 75%); }
.login-art { height: 8.6rem; width: 100%; display: grid; place-items: center; }
.fan { position: relative; width: 22rem; height: 100%; }
.fan .card {
  position: absolute;
  left: 50%;
  top: 0;
  --w: 4.6rem;
  margin-left: calc(var(--w) / -2);
  transform-origin: 50% 190%;
  transform: rotate(calc(var(--i) * 8deg)) translateY(calc(var(--i) * var(--i) * 2px));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}
.login-card {
  width: min(26rem, 100%);
  padding: 1.8rem;
  border: 1px solid var(--brass-soft);
  border-radius: 1rem;
  background: rgba(8, 20, 23, 0.78);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.login-card h1 { font-family: var(--display); font-weight: 600; font-size: 2.5rem; line-height: 1.05; letter-spacing: -0.01em; }
.lede { margin: 0.7rem 0 1.4rem; color: #b9c6c8; line-height: 1.55; }
.login-form { display: flex; flex-direction: column; gap: 0.9rem; }
.connecting { text-align: center; padding: 5rem 1rem; color: var(--muted); }

/* ------------------------------------------------------------------ avatars and profile */

.avatar { display: block; flex: none; border-radius: 50%; object-fit: cover; background: #0e1b1f; user-select: none; -webkit-user-drag: none; }
.avatar.top { width: 1.9rem; height: 1.9rem; }
.avatar.big { width: 4.2rem; height: 4.2rem; border: 2px solid var(--brass-soft); }
.avatar-btn { display: grid; place-items: center; padding: 0; border: 2px solid rgba(236, 230, 216, 0.28); border-radius: 50%; background: none; cursor: pointer; transition: border-color 0.15s; }
.avatar-btn:hover, .avatar-btn:focus-visible { border-color: var(--brass); }
.avatar-picker { display: flex; flex-direction: column; gap: 0.7rem; max-height: 15rem; overflow-y: auto; padding: 0.2rem 0.3rem 0.2rem 0; scrollbar-width: thin; scrollbar-color: rgba(236, 230, 216, 0.25) transparent; }
.avatar-group-name { margin-bottom: 0.3rem; font-size: 0.78rem; color: var(--muted); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr)); gap: 0.4rem; }
.avatar-opt { display: grid; place-items: center; padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; transition: border-color 0.12s, transform 0.12s; }
.avatar-opt .avatar { width: 100%; aspect-ratio: 1; height: auto; }
.avatar-opt:hover { transform: scale(1.06); }
.avatar-opt.on { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(207, 166, 78, 0.3); }
.avatar-opt:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
.avatar-title { font-size: 0.82rem; color: var(--muted); margin-bottom: -0.5rem; }
.avatar-preview { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.avatar-preview .field-note { margin: 0; }
.picker-box { display: flex; flex-direction: column; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head h2 { line-height: 1.1; }
.profile-head .dlg-body { margin-top: 0.2rem; font-size: 0.88rem; }
.dlg-actions.spread { justify-content: space-between; flex-wrap: wrap; }
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: 0.7rem; background: rgba(0, 0, 0, 0.25); }
.seg { padding: 0.5rem 0.4rem; border: 0; border-radius: 0.5rem; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.seg.on { background: rgba(207, 166, 78, 0.18); color: var(--brass); }
.seg:focus-visible { outline: 2px solid var(--bone); outline-offset: 1px; }
.login-card.register { width: min(30rem, 100%); }
.login.register { align-content: start; padding-top: 1.5rem; gap: 1rem; }
.login.register .login-art { display: none; }
.login-card .avatar-picker { max-height: 9.5rem; }

/* ------------------------------------------------------------------ lobby */

.lobby { max-width: 66rem; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.lobby-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.lobby-head h1 { font-family: var(--display); font-weight: 600; font-size: 2.4rem; line-height: 1; }
.table-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.trow {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 9.5rem 8rem auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(207, 166, 78, 0.2);
  border-radius: 0.85rem;
  background: linear-gradient(180deg, rgba(20, 71, 75, 0.55), rgba(13, 50, 54, 0.55));
}
.lobby .tname h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby .tname .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgames { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lobby .tstakes { display: flex; flex-direction: column; }
.big-num { font-family: var(--display); font-weight: 700; font-size: 1.45rem; line-height: 1.1; }
.tseats { display: flex; flex-direction: column; gap: 0.3rem; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: rgba(236, 230, 216, 0.16); }
.dots i.on { background: var(--brass); }
.pill {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border: 1px solid rgba(236, 230, 216, 0.22);
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.pill.now { background: var(--brass); border-color: var(--brass); color: #1b1408; font-weight: 700; }
.pill.next { border-color: var(--brass); color: var(--brass); }
.pill.dc { border-color: var(--brass); color: var(--brass); }
.pill-note { font-size: 0.8rem; color: var(--muted); align-self: center; }
.no-tables { text-align: center; padding: 4rem 1rem; border: 1px dashed rgba(236, 230, 216, 0.2); border-radius: 1rem; }
.no-tables h2 { font-family: var(--display); font-weight: 600; font-size: 1.7rem; }
.no-tables p { max-width: 30rem; margin: 0.6rem auto 1.4rem; color: #b9c6c8; }

/* ------------------------------------------------------------------ dialogs */

dialog.sheet {
  width: min(30rem, 94vw);
  padding: 0;
  border: 1px solid var(--brass-soft);
  border-radius: 0.95rem;
  background: var(--panel);
  color: var(--bone);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.sheet.wide { width: min(44rem, 96vw); }
dialog.sheet::backdrop { background: rgba(4, 11, 13, 0.72); backdrop-filter: blur(2px); }
.dlg-form { display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem; max-height: 88dvh; overflow: auto; }
.dlg-form h2 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; }
.dlg-body { color: #b9c6c8; line-height: 1.5; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.3rem; }
.amount-row { display: flex; }
.amount-row input { font-family: var(--display); font-weight: 700; font-size: 1.6rem; text-align: center; padding: 0.4rem; }
.quick-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.quick-stakes { margin-top: 0.6rem; }

fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.7rem 0 0.2rem; min-width: 0; }
legend { padding-right: 0.6rem; font-weight: 650; font-size: 0.9rem; color: var(--brass); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.mode-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  cursor: pointer;
}
.mode input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mode.on { border-color: var(--brass); background: rgba(207, 166, 78, 0.1); }
.mode:focus-within { outline: 2px solid var(--brass); outline-offset: 2px; }
.mode-title { font-weight: 650; }
.mode-text { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }

.preset-row { display: flex; align-items: center; gap: 0.7rem; }
.preset-row label { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.entry { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.entry select:first-of-type { flex: 1.4; }
.entry select + select { flex: 1; }
.entry-no { width: 1.5rem; height: 1.5rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(207, 166, 78, 0.18); color: var(--brass); font-size: 0.78rem; font-weight: 700; }
.entry-tools { display: flex; gap: 0.25rem; }
.add-game { margin-top: 0.6rem; }

.check { display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer; }
.check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.check small { display: block; color: var(--muted); font-size: 0.82rem; }
.deck-sample { display: flex; gap: 0.5rem; }

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

.card {
  --w: 4.2rem;
  position: relative;
  flex: none;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * 0.11);
  background: linear-gradient(160deg, #fbf7ee, var(--card-paper) 60%, #e9e2d2);
  color: var(--card-black);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  user-select: none;
  transition: transform 0.18s ease, opacity 0.2s, box-shadow 0.18s;
}
.card.sm, .card-slot.sm { --w: max(2.1rem, calc(var(--u, 8px) * 4.4)); }
.card.md { --w: max(2.6rem, calc(var(--u, 8px) * 5.6)); }
.card.lg { --w: 4.2rem; }
.card.hero { --w: max(2.9rem, calc(var(--u, 8px) * 6.6)); }   /* your own cards, in your seat on the felt */
.card.s-h, .card.s-d { color: var(--card-red); }
.four-color .card.s-d { color: var(--card-blue); }
.four-color .card.s-c { color: var(--card-green); }
.card .rk {
  position: absolute;
  left: 10%;
  top: 3%;
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--w) * 0.5);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.card .corner { position: absolute; left: 12%; top: calc(var(--w) * 0.56); width: calc(var(--w) * 0.27); height: calc(var(--w) * 0.27); }
.card .pip { position: absolute; right: 7%; bottom: 6%; width: calc(var(--w) * 0.52); height: calc(var(--w) * 0.52); }
.card.up { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 -3px 0 var(--brass), inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(236, 230, 216, 0.16) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(236, 230, 216, 0.16) 0 1px, transparent 1px 5px),
    var(--wine);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 0 0 calc(var(--w) * 0.06) var(--card-paper);
}
/* the cards of a winning hand stand up out of the row, the way cards picked for a draw do; nothing is faded */
.card.lit { box-shadow: 0 0 0 2px var(--brass), 0 10px 18px rgba(0, 0, 0, 0.5); transform: translateY(calc(var(--w) * -0.3)); }
.card.dim { opacity: 0.38; filter: saturate(0.6); }
.card.sel { transform: translateY(-0.9rem); box-shadow: 0 0 0 2px var(--brass), 0 10px 18px rgba(0, 0, 0, 0.5); }
.card.pickable { cursor: pointer; }
.card.pickable:hover:not(.sel) { transform: translateY(-0.35rem); }
.card.pickable:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.card.shown { box-shadow: 0 0 0 2px var(--brass), 0 3px 8px rgba(0, 0, 0, 0.5); }
.card.fresh { animation: deal 0.3s ease-out both; }
@keyframes deal {
  from { opacity: 0; transform: translateY(-1.2rem) scale(0.88) rotate(-5deg); }
  to { opacity: 1; transform: none; }
}
.card-slot { flex: none; width: max(2.6rem, calc(var(--u, 8px) * 5.6)); height: calc(max(2.6rem, calc(var(--u, 8px) * 5.6)) * 1.4); border: 1.5px dashed rgba(236, 230, 216, 0.16); border-radius: 0.35rem; }
.card-slot.sm { width: var(--w); height: calc(var(--w) * 1.4); }
.suit { display: block; fill: currentColor; }
.card.img, .card.back.img { background: #fffdf7; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); overflow: hidden; }
.card.img > img { display: block; width: 100%; height: 100%; pointer-events: none; }
.card.img.up { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), 0 3px 0 -1px var(--brass); }
.card.img.lit { box-shadow: 0 0 0 2px var(--brass), 0 8px 16px rgba(0, 0, 0, 0.5); }
.card.img.sel { box-shadow: 0 0 0 2px var(--brass), 0 10px 18px rgba(0, 0, 0, 0.5); }
.card.img.shown { box-shadow: 0 0 0 2px var(--brass), 0 3px 8px rgba(0, 0, 0, 0.5); }

/* ------------------------------------------------------------------ table screen */

.table-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  height: calc(100dvh - var(--top));
}
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem 0.3rem; }
.stage-title { min-width: 0; }
.stage-head .tname { font-family: var(--display); font-weight: 600; font-size: 1.35rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-head .tstakes { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; color: var(--muted); }
.rot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.2rem 1rem 0.4rem; }
.rot-label { font-size: 0.8rem; color: var(--muted); margin-right: 0.2rem; }
.rot-note { font-size: 0.8rem; color: var(--muted); margin-left: 0.4rem; }

.felt-wrap { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; padding: 0.3rem 0.5rem; }
.felt {
  --felt-w: min(95cqw, 172cqh);
  --u: calc(var(--felt-w) / 100);
  --bh: max(1.9rem, calc(var(--u) * 4));
  position: relative;
  width: var(--felt-w);
  aspect-ratio: 1.78;
  border-radius: 999px;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(100% 100% at 50% 50%, var(--felt) 35%, var(--felt-deep) 100%);
  border: calc(var(--u) * 1.5) solid var(--walnut);
  box-shadow:
    0 0 0 2px var(--walnut-dark),
    inset 0 0 0 2px var(--brass-soft),
    inset 0 0 calc(var(--u) * 9) rgba(0, 0, 0, 0.5),
    0 26px 50px rgba(0, 0, 0, 0.5);
}
.felt-print {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(0, 0, 0, 0.26);
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
  transition: opacity 0.2s;
}
.felt.has-board .felt-print { top: 71%; }
.felt.has-result .felt-print { opacity: 0; }
.print-title { font-family: var(--display); font-style: italic; font-weight: 600; font-size: max(1.5rem, calc(var(--u) * 4.6)); line-height: 1.05; letter-spacing: -0.01em; }
.print-limit { font-size: max(0.8rem, calc(var(--u) * 1.6)); font-weight: 600; margin-top: 0.2rem; }
.print-street { font-size: max(0.7rem, calc(var(--u) * 1.3)); margin-top: 0.1rem; }

.center { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: calc(var(--u) * 0.6); }
.board.stacked { flex-direction: column; align-items: center; gap: calc(var(--u) * 0.5); }
.run { position: relative; display: flex; gap: calc(var(--u) * 0.6); }
.run-tag { position: absolute; right: 100%; top: 50%; margin-right: 0.5rem; transform: translateY(-50%); font-size: max(0.6rem, calc(var(--u) * 1.1)); font-weight: 600; color: rgba(236, 230, 216, 0.6); white-space: nowrap; }
.felt.twice { --bh: max(3.1rem, calc(var(--u) * 6.8)); }
.felt.twice .felt-print, .felt.twice .pot, .felt.twice .result { display: none; }
.felt.twice .board { top: 45%; }
.board-pot {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 0.7rem;
  display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  padding: 0.12rem 0.55rem 0.12rem 0.4rem; border-radius: 999px; background: rgba(0, 0, 0, 0.38);
}
.board-pot .pot-label { font-size: 0.7rem; }
.board-pot .pot-amt { font-size: max(0.9rem, calc(var(--u) * 1.7)); }
.run-win {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 0.6rem;
  display: flex; flex-direction: column; gap: 0.15rem; max-width: 6.5rem;
  font-size: max(0.66rem, calc(var(--u) * 1.2)); line-height: 1.15; text-align: left; color: #f1dba0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
.run:first-child .run-win { top: 66%; }      /* each label leans toward the gap between the rows, away from the seats' cards */
.run:nth-child(2) .run-win { top: 34%; }
.run-win .rw { display: block; min-width: 0; }
.run-win b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-win small { display: block; font-size: 0.92em; font-weight: 500; color: rgba(241, 219, 160, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pot {
  position: absolute;
  left: 50%;
  bottom: calc(50% + var(--bh) + 0.35rem);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
}
.pot-label { font-size: 0.78rem; color: var(--muted); }
.pot-amt { font-family: var(--display); font-weight: 700; font-size: max(1rem, calc(var(--u) * 2)); }
.felt:not(.has-board) .pot { bottom: auto; top: 41%; transform: translate(-50%, -50%); }
.felt:not(.has-board) .felt-print { top: 57%; }
.felt:not(.has-board) .result { top: calc(50% + 1.2rem); }
.result {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--bh) + 0.35rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  max-width: 60%;
  padding: 0.3rem 0.8rem;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.45);
  color: #f1dba0;
  font-size: max(0.75rem, calc(var(--u) * 1.4));
  font-weight: 600;
  text-align: center;
}
/* once a hand with a board is over, the winners take the pot's place above the board (your cards sit below it) */
.felt.has-board.has-result .pot { display: none; }
.felt.has-board.has-result .result { top: auto; bottom: calc(50% + var(--bh) + 0.35rem); }
/* chip stacks for bets and the pot: discs seen from the side, the first at the bottom */
.chips { display: inline-flex; flex-direction: column-reverse; align-items: center; flex: none; font-size: max(1rem, calc(var(--u) * 1.9)); padding-top: 0.1em; }
.chip { display: block; width: 1.1em; height: 0.5em; border-radius: 50%; --c: #ddd;
  background:
    radial-gradient(ellipse 38% 34% at 50% 50%, var(--c) 0 92%, transparent 100%),
    radial-gradient(ellipse 50% 50% at 50% 50%, #f5f1e6 0 30%, transparent 31%),
    repeating-conic-gradient(var(--c) 0 22deg, #f5f1e6 22deg 34deg);
  box-shadow: 0 0.13em 0 color-mix(in srgb, var(--c) 55%, #000), 0 0.16em 0.18em rgba(0, 0, 0, 0.45); }
.chip + .chip { margin-bottom: -0.36em; }
.c-q { --c: #4f8fc9; } .c-1 { --c: #d9d4c7; } .c-5 { --c: #c0392b; } .c-25 { --c: #1f8a4c; } .c-100 { --c: #2a2a2e; }
.c-500 { --c: #6b3fa0; } .c-1k { --c: #e0b028; } .c-5k { --c: #e07b28; } .c-25k { --c: #8e979f; }
.c-1 { background: radial-gradient(ellipse 38% 34% at 50% 50%, #ece7da 0 92%, transparent 100%), repeating-conic-gradient(#ece7da 0 22deg, #3b6ea8 22deg 34deg); }
.fx-chips { display: grid; place-items: center; }
.fx-chips .chips { font-size: inherit; }
.chip-dot {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--wine) 0 42%, transparent 44%),
    repeating-conic-gradient(var(--bone) 0 22.5deg, #5a1b26 22.5deg 45deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.bets { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.bet .chips { font-size: max(1.25rem, calc(var(--u) * 2.5)); }
.pot .chips, .board-pot .chips { font-size: max(1.15rem, calc(var(--u) * 2.2)); margin: -0.25rem 0 -0.1rem; }

/* the dealer button travels round the table */
.dealer-btn {
  position: absolute; z-index: 1; transform: translate(-50%, -50%);
  width: max(1.45rem, calc(var(--u) * 2.7)); height: max(1.45rem, calc(var(--u) * 2.7));
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #e4dfd2 70%, #c9c2b2);
  color: #1b1408; font-weight: 900; font-size: max(0.72rem, calc(var(--u) * 1.3));
  box-shadow: 0 2px 0 #9d968a, 0 4px 8px rgba(0, 0, 0, 0.45);
  transition: left 0.6s cubic-bezier(0.3, 0.7, 0.3, 1), top 0.6s cubic-bezier(0.3, 0.7, 0.3, 1);
}
@media (min-width: 861px) { .badge.dealer { display: none; } }
@media (max-width: 860px) {
  .dealer-btn { display: none; }
  .bet .chips { font-size: 0.9rem; }
  .pot .chips, .board-pot .chips { font-size: 0.85rem; }
  .seat { --av: 2.2rem; }
}

/* flying cards and chips, above everything on the felt */
.fx-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }
.fx-piece { position: absolute; left: 0; top: 0; margin: 0 !important; will-change: transform, opacity; }
.fx-piece.card { --w: auto; transition: none; }
.card.incoming { visibility: hidden; }
.card.flip-in { animation: flip-in 0.24s ease-out both; }
@keyframes flip-in { from { transform: perspective(400px) rotateY(85deg); filter: brightness(0.85); } to { transform: none; } }

/* the table's own look: an uploaded surface picture and a logo in the middle */
.felt.pictured { background-size: 100% 100%, cover; background-position: center; background-repeat: no-repeat; }
.felt-logo { position: absolute; left: 50%; top: 50%; width: 30%; height: 34%; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; z-index: 0; opacity: 0.92; }
.felt-logo[hidden] { display: none; }
.felt-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.felt.has-board .felt-logo { top: 50%; }
.felt:not(.has-board) .felt-logo { top: 47%; }
.felt-logo:not([hidden]) ~ .felt-print { opacity: 0.0; }
.stage-btns { display: flex; gap: 0.5rem; flex: none; }
.bet {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: max(0.78rem, calc(var(--u) * 1.4));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.seats { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.seat { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.seat.you { z-index: 3; }   /* your cards stay on top of your neighbours' */
.seat:not(.empty) { width: max(6.5rem, calc(var(--u) * 13.5)); }
.seat.empty {
  width: max(3rem, calc(var(--u) * 6));
  height: max(3rem, calc(var(--u) * 6));
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px dashed rgba(236, 230, 216, 0.26);
  background: rgba(0, 0, 0, 0.14);
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
  font-size: 0.85rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.seat.empty:disabled { cursor: default; border-style: solid; border-color: rgba(236, 230, 216, 0.1); background: transparent; }
.seat.empty:hover:not(:disabled) { border-color: var(--brass); color: var(--brass); background: rgba(207, 166, 78, 0.1); }
.seat-no { position: absolute; bottom: 0.2rem; font-size: 0.62rem; opacity: 0.6; }
.seat.empty:not(:disabled) .seat-no { display: none; }

.plate {
  position: relative;
  padding: 0.35rem 0.5rem 0.6rem;
  border: 1.5px solid rgba(236, 230, 216, 0.18);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #1c2d32, #101d21);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.pname { font-weight: 650; font-size: max(0.74rem, calc(var(--u) * 1.4)); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstack { font-family: var(--display); font-weight: 700; font-size: max(0.98rem, calc(var(--u) * 2)); line-height: 1.15; color: var(--brass); }
.pstate { min-height: 0.95rem; font-size: max(0.64rem, calc(var(--u) * 1.15)); line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.you .plate { border-color: rgba(236, 230, 216, 0.5); }
/* the avatar straddles the plate's outer edge (left for seats on the left half, right for the right half), so it never covers anyone's cards */
.seat { --av: max(2.4rem, calc(var(--u) * 5.6)); }
.seat-av { position: absolute; top: 50%; width: var(--av); height: var(--av); transform: translateY(-50%); border-radius: 50%; z-index: 2; }
.seat-av::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--brass) calc(var(--t, 1) * 360deg), rgba(0, 0, 0, 0.55) 0); opacity: 0; transition: opacity 0.2s; }
.seat.turn .seat-av::before { opacity: 1; }
.seat-av.low::before { background: conic-gradient(var(--wine-bright) calc(var(--t, 1) * 360deg), rgba(0, 0, 0, 0.55) 0); }
.seat-avatar { position: relative; display: block; width: 100%; height: 100%; border: 2px solid rgba(236, 230, 216, 0.55); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.seat.av-l .seat-av { left: calc(var(--av) / -2); }
.seat.av-r .seat-av { right: calc(var(--av) / -2); }
.seat.av-l .plate { padding-left: calc(var(--av) / 2 + 0.3rem); }
.seat.av-r .plate { padding-right: calc(var(--av) / 2 + 0.3rem); }
.seat.turn .seat-avatar { border-color: #1a1408; }
.seat.win .seat-avatar { border-color: var(--brass); }
.seat.away .seat-avatar { filter: grayscale(0.7); }
.seat.turn .plate { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(207, 166, 78, 0.35), 0 0 26px rgba(207, 166, 78, 0.35); }
.seat.folded .plate, .seat.folded .hand { opacity: 0.5; }
.seat.away .plate { filter: grayscale(0.7); opacity: 0.75; }
.seat.win .plate { border-color: var(--brass); background: linear-gradient(180deg, #3a3320, #1d1a10); }
.badges { position: absolute; top: -0.6rem; left: 0.35rem; display: flex; gap: 0.2rem; }
.badge {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}
.badge.dealer { background: var(--brass); }
.clock { position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.28rem; height: 3px; border-radius: 2px; background: rgba(236, 230, 216, 0.1); opacity: 0; }
.clock i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brass); }
.seat.turn .clock { opacity: 1; }
.clock.low i { background: var(--wine-bright); }

.hand { position: absolute; left: 50%; transform: translateX(-50%); display: flex; z-index: 1; }
.seat.top .hand { top: calc(100% - 0.15rem); }
.seat.bottom .hand { bottom: calc(100% - 0.35rem); }
.hand .card + .card { margin-left: -0.6rem; }
.hand.many .card + .card { margin-left: -1.15rem; }
.seat.side-l .hand, .seat.side-r .hand { top: 50%; bottom: auto; transform: translateY(-50%); }
.seat.side-l .hand { left: calc(100% - 0.2rem); }
.seat.side-r .hand { left: auto; right: calc(100% - 0.2rem); }
.hand.mine { z-index: 3; }
.seat.bottom .hand.mine { bottom: calc(100% + 0.95rem); }   /* clear of the dealer and blind badges and the winnings tag */
.hand.mine .card + .card { margin-left: calc(var(--w) * -0.3); }
.hand.mine.many .card + .card { margin-left: calc(var(--w) * -0.42); }
.hand.mine.huge .card.hero { --w: max(2.2rem, calc(var(--u, 8px) * 5)); }   /* stud: six or seven cards in your seat */
.hand.mine.huge .card + .card { margin-left: calc(var(--w) * -0.5); }
.hname {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0.1rem 0.55rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.62);
  color: #f1dba0;
  font-size: max(0.64rem, calc(var(--u) * 1.15));
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.seat.top .hname { bottom: calc(100% + 0.25rem); }
.seat.bottom .hname, .seat.side-l .hname, .seat.side-r .hname { top: calc(100% + 0.25rem); bottom: auto; }
.won {
  position: absolute;
  right: -0.4rem;
  top: -0.9rem;
  z-index: 4;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--brass);
  color: #1b1408;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  animation: rise 0.5s ease-out both;
}
.seat.you .won { right: auto; left: calc(100% + 0.35rem); top: calc(50% - 0.85rem); }   /* beside your own plate, off your badges */
@keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ dock */

.dock { padding: 0.7rem 1rem calc(0.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(8, 20, 23, 0.15), rgba(8, 20, 23, 0.8)); }
.dock-main { display: flex; align-items: center; gap: 1.6rem; min-height: 6.4rem; }
.actions { flex: 1; min-width: 14rem; transition: opacity 0.15s; }
.actions.busy { opacity: 0.55; pointer-events: none; }
.status { color: #b9c6c8; }
.betbox { display: flex; flex-direction: column; gap: 0.55rem; max-width: 30rem; }
.turn-head { display: flex; align-items: baseline; gap: 0.6rem; font-weight: 650; color: var(--brass); }
.turn-timer { font-family: var(--display); font-size: 1.05rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.btnrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btnrow .btn { min-width: 5.2rem; padding: 0.7rem 1.1rem; }
.raise-row { display: flex; align-items: center; gap: 0.8rem; }
.raise-row input[type='number'] { width: 7rem; flex: none; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.drawbox, .showbox, .votebox { display: flex; flex-direction: column; gap: 0.6rem; }
.votebox .turn-timer { align-self: flex-start; }
.btn.toggle-on { border-color: var(--brass); color: var(--brass); }
.chooser { display: flex; flex-direction: column; gap: 0.5rem; }
.chooser-title { font-weight: 650; color: var(--brass); }
.chooser-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: min(34vh, 15rem); overflow-y: auto; padding-right: 0.3rem; scrollbar-width: thin; scrollbar-color: rgba(236, 230, 216, 0.25) transparent; }   /* with every game on offer the list scrolls instead of squeezing the table */
.chooser-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.chooser-cat { width: 4.6rem; font-size: 0.8rem; color: var(--muted); }
.manage { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.manage:empty { display: none; }

/* ------------------------------------------------------------------ side panel */

.side { display: flex; flex-direction: column; gap: 0.7rem; min-height: 0; padding: 0.7rem 0.8rem 0.8rem 0; }
.side-block { display: flex; flex-direction: column; min-height: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 0.8rem; background: rgba(0, 0, 0, 0.22); }
.side-block.grow { flex: 1; }
.side-block.chat { flex: none; height: 14rem; }
.side-block h3 { font-size: 0.85rem; font-weight: 650; color: var(--muted); margin-bottom: 0.4rem; }
.log, .chat-list { flex: 1; min-height: 0; overflow-y: auto; font-size: 0.82rem; line-height: 1.45; scrollbar-width: thin; scrollbar-color: rgba(236, 230, 216, 0.2) transparent; }
.log-line { color: #b9c6c8; padding: 0.04rem 0; overflow-wrap: anywhere; }
.log-line.show { color: #d8d2c3; }
.log-line.win { color: #f1dba0; font-weight: 600; }
.log-sep { margin-top: 0.7rem; padding-top: 0.4rem; border-top: 1px solid var(--line); font-family: var(--display); font-style: italic; font-weight: 600; color: var(--brass); }
.log-sep:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.chat-line { overflow-wrap: anywhere; padding: 0.04rem 0; }
.chat-line b { color: var(--brass); font-weight: 650; }
.chat-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.chat-form input { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

/* ------------------------------------------------------------------ toasts and banner */

#toasts { position: fixed; left: 50%; bottom: 1.2rem; z-index: 100; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; width: min(34rem, 94vw); }
.toast { padding: 0.65rem 1.1rem; border: 1px solid rgba(236, 230, 216, 0.2); border-radius: 0.6rem; background: #1b3036; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); font-size: 0.92rem; animation: rise 0.25s ease-out both; }
.toast.error { border-color: var(--wine-bright); background: #3a1b22; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 200; padding: 0.45rem 1rem; background: var(--wine); color: #fbeff0; text-align: center; font-size: 0.88rem; font-weight: 600; }

/* ------------------------------------------------------------------ narrow screens */

/* short laptop windows: the felt is small, so the cards and plates on it are smaller too */
@media (min-width: 861px) and (max-height: 780px) {
  .card.sm, .card-slot.sm { --w: max(1.7rem, calc(var(--u, 8px) * 4.4)); }
  .card.md { --w: max(2.15rem, calc(var(--u, 8px) * 5.6)); }
  .card.hero { --w: max(2.3rem, calc(var(--u, 8px) * 6.6)); }
  .card-slot { width: max(2.15rem, calc(var(--u, 8px) * 5.6)); height: calc(max(2.15rem, calc(var(--u, 8px) * 5.6)) * 1.4); }
  .seat:not(.empty) { width: max(5.6rem, calc(var(--u) * 13.5)); }
  .seat.bottom .hand.mine { bottom: calc(100% + 0.8rem); }
  .felt.twice .card.sm, .felt.twice .card-slot.sm { --w: max(1.55rem, calc(var(--u, 8px) * 4)); }
}

@media (max-width: 960px) {
  .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 0.7rem 1rem; }
  .trow .tgames { grid-column: 1 / -1; order: 3; }
  .trow .tstakes { order: 2; }
  .trow .tseats { order: 4; }
  .trow .trow-btns { order: 5; grid-column: 2; grid-row: 1; }
}

@media (max-width: 860px) {
  .table-screen { display: block; height: auto; }
  .stage { height: calc(100dvh - var(--top)); min-height: 33rem; }
  .felt-wrap { padding: 0.2rem 0.3rem; }
  .felt { --felt-w: min(96cqw, 78cqh); aspect-ratio: 0.78; }
  .stage-head { padding: 0.5rem 0.8rem 0.2rem; }
  .rot { padding: 0.1rem 0.8rem 0.3rem; }
  .dock { padding: 0.5rem 0.8rem calc(0.6rem + env(safe-area-inset-bottom)); }
  .dock-main { flex-direction: column; align-items: stretch; gap: 0.4rem; min-height: 0; }
  .card.lg { --w: 3.5rem; }
  .card.hero { --w: 2.6rem; }
  .felt.twice .run-win { display: none; }
  .felt.twice.has-board.has-result .result { display: flex; top: calc(45% + 2.85rem); bottom: auto; width: max-content; max-width: 98%; font-size: 0.62rem; line-height: 1.08; padding: 0.12rem 0.45rem; gap: 0.05rem; }
  .felt.twice .result div { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .felt.twice .hname { display: none; }   /* the board is the thing to see; the winners are in the box below it and everyone's hands are in the hand history */
  .hand.mine .card + .card { margin-left: calc(var(--w) * -0.36); }
  .hand.mine.many .card.hero { --w: 2.25rem; }   /* five cards in your seat stay between your neighbours' cards */
  .hand.mine.many .card + .card { margin-left: calc(var(--w) * -0.52); }
  .hand.mine.huge .card.hero { --w: 1.75rem; }
  .hand.mine.huge .card + .card { margin-left: calc(var(--w) * -0.5); }
  .seat .hand.huge:not(.mine) .card:not(.back) { --w: 1.4rem; }   /* stud: seven cards beside every seat */
  .seat .hand.huge:not(.mine) .card + .card { margin-left: calc(var(--w) * -0.55); }
  .felt:not(.has-board) .result { top: calc(45% + 0.8rem); width: max-content; max-width: 94%; font-size: 0.66rem; padding: 0.25rem 0.5rem; }
  .hname { white-space: normal; width: max-content; max-width: 8.5rem; }
  .card.sm, .card-slot.sm { --w: 1.9rem; }
  .card.md { --w: 2.5rem; }
  .seat .hand .card.back { --w: 1.25rem; }
  .actions { min-width: 0; }
  .manage { margin-top: 0.4rem; }
  .side { padding: 0.5rem 0.8rem 1.2rem; }
  .side-block.grow { max-height: 18rem; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 0.7rem; }
  .who { display: none; }
  .bank-label { display: none; }
  .brand { gap: 0.35rem; }
  .topbar .btn { padding-inline: 0.65rem; }
  .top-right { gap: 0.5rem; }
  .topbar { gap: 0.5rem; }
  .brand-name { font-size: 1.1rem; }
  .login-card { padding: 1.4rem; }
  .login-card h1 { font-size: 2.1rem; }
  .fan { width: 17rem; }
  .fan .card { --w: 3.8rem; }
  .lobby { padding: 1.4rem 0.8rem 3rem; }
  .mode-row, .grid2 { grid-template-columns: 1fr; }
  .entry { flex-wrap: wrap; }
  .entry select:first-of-type { flex: 1 1 8rem; }
  .raise-row { flex-wrap: wrap; }
  .raise-row input[type='number'] { width: 100%; }
  .btnrow .btn { flex: 1; min-width: 0; }
  .seat:not(.empty) { width: 5.4rem; }
  .plate { padding: 0.2rem 0.3rem 0.45rem; }
  .pstack { font-size: 0.9rem; }
  .hand .card + .card { margin-left: -0.35rem; }
}

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

/* ------------------------------------------------------------------ settings: decks */
.dlg-form.settings fieldset { display: flex; flex-direction: column; gap: 0.6rem; }
.deck-list { display: flex; flex-direction: column; gap: 0.35rem; }
.deck-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.6rem; cursor: pointer; }
.deck-opt:has(input:checked) { border-color: var(--brass); background: rgba(207, 166, 78, 0.08); }
.deck-text b { display: block; font-weight: 650; }
.deck-text small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.deck-row { display: flex; }
.deck-row .card { --w: 2.3rem; }
.deck-row .card + .card { margin-left: -0.55rem; }
.back-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.back-opt { padding: 0.2rem; border: 2px solid transparent; border-radius: 0.5rem; background: none; cursor: pointer; }
.back-opt .card { --w: 2.3rem; }
.back-opt.on { border-color: var(--brass); }
.back-opt:focus-visible { outline: 2px solid var(--bone); }
.field.inline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.field.inline select { width: auto; min-width: 8rem; }
@media (max-width: 640px) {
  .deck-opt { grid-template-columns: auto minmax(0, 1fr); }
  .deck-row { grid-column: 2; }
}

/* ------------------------------------------------------------------ table look editor */
.look-editor { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.look-preview.felt { --felt-w: 15rem; --u: 0.15rem; width: 15rem; position: relative; }
.look-preview .felt-logo { opacity: 0.95; }
.look-controls { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.look-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatch { position: relative; width: 2.6rem; height: 2.6rem; padding: 0; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 0.55rem; background: rgba(0, 0, 0, 0.3); color: var(--muted); cursor: pointer; overflow: hidden; font: inherit; }
.swatch.on { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(207, 166, 78, 0.3); }
.swatch:focus-visible { outline: 2px solid var(--bone); outline-offset: 1px; }
.swatch-fill { position: absolute; inset: 0; }
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.swatch.logo img { object-fit: contain; padding: 0.2rem; }
.swatch small { font-size: 0.68rem; }
.swatch.upload { flex-direction: column; gap: 0; border-style: dashed; line-height: 1; }
.swatch.upload span { font-size: 1.2rem; color: var(--brass); }
.swatch.upload:hover, .swatch.upload:focus-within { border-color: var(--brass); }
.swatch-wrap { position: relative; display: inline-grid; }
.swatch-del { position: absolute; top: -0.35rem; right: -0.35rem; width: 1.15rem; height: 1.15rem; padding: 0; border: 0; border-radius: 50%; background: var(--wine); color: #fff; font-size: 0.8rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.swatch-wrap:hover .swatch-del, .swatch-del:focus-visible { opacity: 1; }
@media (hover: none) { .swatch-del { opacity: 1; } }
@media (max-width: 640px) {
  .look-editor { grid-template-columns: 1fr; }
  .look-preview.felt { justify-self: center; }
}

/* ------------------------------------------------------------------ lobby: who is seated */
.tpeople { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; margin-top: 0.2rem; }
.tperson { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--muted); }
.avatar.mini { width: 1.35rem; height: 1.35rem; border: 1px solid rgba(236, 230, 216, 0.3); }

/* ------------------------------------------------------------------ act in advance */
.prebox { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.5rem; }
.pre { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 0.55rem; background: rgba(0, 0, 0, 0.25); cursor: pointer; font-size: 0.9rem; font-weight: 600; user-select: none; }
.pre.on { border-color: var(--brass); color: var(--brass); background: rgba(207, 166, 78, 0.1); }
.pre input { width: 1rem; height: 1rem; }

/* ------------------------------------------------------------------ action buttons: big, on the right, like a casino client */
/* On a computer the controls under the table live in a box of fixed height laid over the bottom of the stage, so
   the table never moves or changes size when the betting buttons come and go. Anything taller than the box (the
   game list in dealer's choice) grows upwards over the felt's edge instead of pushing the table up. */
@media (min-width: 861px) {
  .stage { position: relative; --dock-h: 11.2rem; }
  .felt-wrap { margin-bottom: var(--dock-h); }
  .dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; min-height: var(--dock-h); background: linear-gradient(180deg, rgba(10, 22, 26, 0.94), rgba(8, 18, 21, 0.98)); }
  .dock-main { min-height: 6.9rem; }
  .betbox { margin-left: auto; max-width: 52rem; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: ". head" "raise buttons" "quick buttons"; column-gap: 1rem; row-gap: 0.35rem; align-items: center; }
  .betbox .turn-head { grid-area: head; justify-content: flex-end; }
  .betbox .btnrow { grid-area: buttons; justify-content: flex-end; flex-wrap: nowrap; align-self: stretch; }
  .betbox .btnrow .btn { min-width: 8.5rem; padding: 0.7rem 1.1rem; font-size: 1.05rem; font-weight: 700; border-radius: 0.7rem; }
  .betbox .raise-row { grid-area: raise; }
  .betbox .quick-row { grid-area: quick; justify-content: flex-start; }
}
.quick-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ------------------------------------------------------------------ create form: two sets of stakes */
.stakes-box { display: flex; flex-direction: column; gap: 0.9rem; }
.stake-block { display: flex; flex-direction: column; gap: 0.5rem; }
.stake-title { font-weight: 650; font-size: 0.9rem; }
.stake-block + .stake-block { padding-top: 0.8rem; border-top: 1px dashed var(--line); }

/* ------------------------------------------------------------------ phones: keep the middle of the table clear */
@media (max-width: 860px) {
  /* other players' face-down cards sit as a small fan on the edge of their name plate, not out on the felt */
  .seat:not(.you) .hand.backs { left: 50%; right: auto; top: auto; bottom: calc(100% - 0.3rem); transform: translateX(-50%); }
  .seat.top:not(.you) .hand.backs { bottom: auto; top: calc(100% - 0.3rem); }
  .seat:not(.you) .hand.backs .card.back { --w: 1.1rem; }
  .seat:not(.you) .hand.backs .card + .card { margin-left: -0.62rem; }
  .seat.top:not(.you) .hname { bottom: calc(100% + 0.2rem); }
  /* a compact header: the table name and buttons on one line, the stakes underneath */
  .stage-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 0.6rem; row-gap: 0.1rem; }
  .stage-title { display: contents; }
  .stage-head .tname { grid-column: 1; grid-row: 1; }
  .stage-btns { grid-column: 2; grid-row: 1; gap: 0.35rem; }
  .stage-btns .btn { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
  .stage-head .tstakes { grid-column: 1 / -1; grid-row: 2; gap: 0.1rem 0.8rem; font-size: 0.78rem; }
}

/* ------------------------------------------------------------------ lobby: groups of tables and the close button */
.trow-btns { display: flex; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.tgroup { list-style: none; margin: 1.1rem 0 0.2rem; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.15rem; color: var(--brass); }
.tgroup:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ profile: the player's own uploaded pictures */
.avatar-grid.own { grid-template-columns: repeat(auto-fill, 3.1rem); }
.own-wrap { position: relative; display: grid; }
.own-del { position: absolute; top: -0.25rem; right: -0.25rem; width: 1.15rem; height: 1.15rem; padding: 0; border: 0; border-radius: 50%; background: var(--wine); color: #fff; font-size: 0.8rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.own-wrap:hover .own-del, .own-del:focus-visible { opacity: 1; }
@media (hover: none) { .own-del { opacity: 1; } }
.avatar-opt.upload { width: 3.1rem; aspect-ratio: 1; flex-direction: column; gap: 0; border: 2px dashed var(--line); color: var(--muted); line-height: 1; }
.avatar-opt.upload span { font-size: 1.2rem; color: var(--brass); }
.avatar-opt.upload small { font-size: 0.62rem; }
.avatar-opt.upload:hover, .avatar-opt.upload:focus-within { border-color: var(--brass); }
.profile-pic { display: contents; }

/* ------------------------------------------------------------------ round 1: time bank, sit-out ticks, rabbit hunt, hand helper */
.bank-btn { margin-left: 0.4rem; padding: 0.25rem 0.6rem; font-size: 0.8rem; border-color: var(--brass); color: var(--brass); }
.bank-on { margin-left: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--wine-bright); }
.small-pre { padding: 0.32rem 0.65rem; font-size: 0.8rem; }
.rabbit-btn { margin-top: 0.4rem; }
.card.rabbit { opacity: 0.55; outline: 2px dashed rgba(236, 230, 216, 0.6); outline-offset: 2px; }
.hname.helper { background: rgba(207, 166, 78, 0.18); color: #f6e3b0; border: 1px solid rgba(207, 166, 78, 0.45); }

/* ------------------------------------------------------------------ lobby: who is here and the lobby chat */
.lobby-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1.2rem; max-width: 88rem; margin: 0 auto; padding-right: 1.2rem; }
.lobby-wrap .lobby { max-width: none; margin: 0; width: 100%; }
.lobby-side { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 2rem; position: sticky; top: calc(var(--top) + 0.5rem); align-self: start; max-height: calc(100dvh - var(--top) - 1rem); }
.lobby-side .side-block.chat { height: 22rem; }
.who-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; max-height: 16rem; overflow-y: auto; }
.who { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.5rem; align-items: center; }
.who .avatar { grid-row: span 2; width: 1.8rem; height: 1.8rem; }
.who-name { font-weight: 650; font-size: 0.88rem; }
.who-where { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .lobby-wrap { grid-template-columns: 1fr; padding-right: 0; }
  .lobby-side { position: static; max-height: none; padding: 0 1.2rem 2rem; }
}
@media (max-width: 640px) { .lobby-side { padding: 0 0.8rem 2rem; } }

/* ------------------------------------------------------------------ table side panel tabs: log, hands, players */
.side-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; }
.side-tab { padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 650; cursor: pointer; }
.side-tab.on { border-color: var(--brass); color: var(--brass); background: rgba(207, 166, 78, 0.1); }
.hand-list, .player-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.35rem; scrollbar-width: thin; }
.hand-list[hidden], .player-list[hidden], .log[hidden] { display: none; }
.hrow { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.55rem; border: 1px solid var(--line); border-radius: 0.5rem; background: rgba(0, 0, 0, 0.2); color: var(--bone); text-align: left; font: inherit; cursor: pointer; }
.hrow:hover { border-color: var(--brass-soft); }
.hrow-top { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.85rem; }
.hrow-net { margin-left: auto; font-weight: 700; }
.hrow-net.up, .hh-net.up { color: #8fd18f; }
.hrow-net.down, .hh-net.down { color: var(--wine-bright); }
.hrow-win { font-size: 0.75rem; color: #d8c48f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.4rem 0.45rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 0.5rem; }
.prow .avatar { width: 1.8rem; height: 1.8rem; }
.prow-name { font-size: 0.88rem; }
.prow-stats { font-size: 0.74rem; color: var(--muted); }
.prow-note { font-size: 0.75rem; color: #e6dcc3; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* note colour tags, on name plates and in the players list */
.prow.note-red, .seat.note-red .plate { border-left-color: #e05555; }
.prow.note-orange, .seat.note-orange .plate { border-left-color: #e8913a; }
.prow.note-yellow, .seat.note-yellow .plate { border-left-color: #e8d23a; }
.prow.note-green, .seat.note-green .plate { border-left-color: #4fbf6a; }
.prow.note-blue, .seat.note-blue .plate { border-left-color: #4f8fe0; }
.prow.note-purple, .seat.note-purple .plate { border-left-color: #a46ee0; }
.seat[class*='note-'] .plate { border-left-width: 5px; }
.seat:not(.you) .plate { cursor: pointer; }
.note-colors { display: flex; gap: 0.45rem; }
.note-color { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.note-color.on { outline: 2px solid var(--bone); outline-offset: 2px; }
.note-color.c-none { background: repeating-linear-gradient(45deg, #2a3b40 0 4px, #1a272b 4px 8px); }
.note-color.c-red { background: #e05555; } .note-color.c-orange { background: #e8913a; } .note-color.c-yellow { background: #e8d23a; }
.note-color.c-green { background: #4fbf6a; } .note-color.c-blue { background: #4f8fe0; } .note-color.c-purple { background: #a46ee0; }
.dlg-form textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 0.6rem; background: rgba(0, 0, 0, 0.3); color: var(--bone); font: inherit; resize: vertical; }
/* the hand summary */
.hand-summary .hh-board { display: flex; align-items: center; gap: 0.6rem; }
.hh-cards { display: flex; gap: 0.25rem; min-height: 1rem; }
.hh-cards .card { --w: 2.1rem; }
.hh-players { display: flex; flex-direction: column; gap: 0.35rem; }
.hh-player { display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.hh-player.you { border-color: var(--brass-soft); }
.hh-player.folded .hh-cards { opacity: 0.5; }
.hh-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-net { font-weight: 700; }
.hh-log summary { cursor: pointer; color: var(--brass); font-weight: 650; margin-bottom: 0.3rem; }
.hh-log .log-line { font-size: 0.82rem; }

/* the replay: every finished hand at the table, one row per seat, with the rabbit hunt */
dialog.sheet.replay-dlg { width: min(46rem, 97vw); }
.replay { gap: 0.8rem; }
.rp-title { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.rp-sub { font-family: var(--ui); font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.rp-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 4.4rem; }
.rp-board { display: flex; flex-direction: column; gap: 0.35rem; }
.rp-board-line { display: flex; align-items: center; gap: 0.5rem; }
.rp-label { font-size: 0.75rem; color: var(--muted); }
.rp-cards { display: flex; gap: 0.25rem; align-items: flex-end; }
.replay .card.md, .replay .card-slot.md { --w: 2.9rem; }
.rp-rabbit { position: relative; }
.rp-rabbit .card { filter: grayscale(1) brightness(0.88); }
.rp-rabbit .bunny { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: 58%; height: auto; aspect-ratio: 1; fill: #14202a; pointer-events: none; }
.bunny { width: 1.15rem; height: 1.15rem; fill: var(--bone); }
.rp-navbox { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 1 1 15rem; max-width: 22rem; }
.rp-handno { font-size: 0.88rem; color: var(--bone); }
.rp-pots { font-size: 0.8rem; color: var(--muted); white-space: pre; }
.rp-navrow { display: flex; align-items: center; gap: 0.25rem; width: 100%; }
.rp-nav { flex: none; width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 0.4rem; background: rgba(207, 166, 78, 0.16); color: var(--brass); font: inherit; font-size: 0.72rem; letter-spacing: -0.08em; cursor: pointer; }
.rp-nav:hover:not(:disabled) { background: rgba(207, 166, 78, 0.3); }
.rp-nav:disabled { opacity: 0.35; cursor: default; }
.rp-slider { flex: 1; min-width: 4rem; accent-color: var(--brass); }
.rp-rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; }
.rp-row { display: grid; grid-template-columns: 1.6rem 1.6rem 2.2rem minmax(4.5rem, 7.5rem) 7.6rem minmax(0, 1fr); align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0 0.7rem; }
.rp-row:nth-child(odd) { background: rgba(236, 230, 216, 0.045); }
.rp-row.you .rp-name { color: var(--brass); }
.rp-seatno { color: var(--muted); font-size: 0.8rem; text-align: center; }
.rp-dealer { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--bone); color: var(--ink); font-weight: 800; font-size: 0.7rem; }
.rp-pic .avatar { width: 2rem; height: 2rem; }
.rp-who { display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; }
.rp-name { font-weight: 650; font-size: 0.86rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-stack { font-size: 0.78rem; color: var(--muted); }
/* the cards are cut off at the row's edge, so a row stays short and the corners still show rank and suit */
.rp-hand { display: flex; align-self: start; height: 2.5rem; overflow: hidden; padding-top: 0.3rem; }
.rp-hand .card { --w: 2.3rem; flex: none; }
.rp-hand .card + .card { margin-left: calc(var(--w) * -0.42); }
.rp-row.folded .rp-hand .card { filter: grayscale(1) brightness(0.75); }
.rp-result { font-size: 0.85rem; color: var(--bone); }
.rp-result.up { color: #8fdc9c; } .rp-result.down { color: #e3a0a8; }
.rp-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.rp-rabbit-opt { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; cursor: pointer; }
.rp-rabbit-opt input { width: 1.05rem; height: 1.05rem; accent-color: var(--brass); }
.rp-foot-btns { display: flex; gap: 0.6rem; }
@media (max-width: 620px) {
  .rp-row { grid-template-columns: 1.2rem 1.4rem minmax(0, 1fr) auto; grid-template-areas: 'no btn who hand' 'no btn res res'; padding: 0.35rem 0.6rem; row-gap: 0.1rem; }
  .rp-row.empty { min-height: 1.6rem; }
  .rp-seatno { grid-area: no; } .rp-btn { grid-area: btn; } .rp-pic { display: none; }
  .rp-who { grid-area: who; align-items: flex-start; } .rp-hand { grid-area: hand; } .rp-result { grid-area: res; }
  .replay .card.md, .replay .card-slot.md { --w: 2.3rem; }
}

/* ------------------------------------------------------------------ tournaments */
.tbar { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; margin-top: 0.15rem; font-size: 0.82rem; color: var(--muted); }
.tbar-main { color: var(--brass); font-weight: 700; }
.trow.tourney { border-color: rgba(207, 166, 78, 0.35); }
.trow.tourney.running { background: linear-gradient(90deg, rgba(207, 166, 78, 0.1), transparent 60%), var(--panel); }
.trow.tourney.finished { opacity: 0.8; }
.tinfo h3 { font-family: var(--display); font-size: 1.05rem; margin: 0.9rem 0 0.35rem; color: var(--brass); }
.tfacts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 1rem; margin: 0.6rem 0 0; font-size: 0.88rem; }
.tfacts dt { color: var(--muted); }
.tfacts dd { margin: 0; }
.tcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; }
.tprizes, .tplayers { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.88rem; max-height: 14rem; overflow-y: auto; }
.tprizes li, .tplayers li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.15rem 0.4rem; border-radius: 0.3rem; background: rgba(0, 0, 0, 0.18); }
.tplayers li.out { opacity: 0.7; }
.tstruct { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tstruct th { text-align: left; color: var(--muted); font-weight: 600; padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--line); }
.tstruct td { padding: 0.18rem 0.4rem; border-bottom: 1px solid rgba(236, 230, 216, 0.06); font-variant-numeric: tabular-nums; }
.tstruct tr.now td { color: var(--brass); font-weight: 700; }
@media (max-width: 640px) { .tcols { grid-template-columns: 1fr; } }
/* tournament names are long ("NL Hold'em Sit & Go, 6 players"): let them wrap rather than cut off */
.lobby .trow.tourney .tname h3 { white-space: normal; line-height: 1.2; }
.lobby .trow.tourney .tname .small { white-space: normal; }
.lobby-head { flex-wrap: wrap; }
@media (max-width: 560px) {
  .lobby-head h1 { font-size: 2rem; }
  .lobby-head .trow-btns { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- admin page
   The back office: a ledger of players and tables. Hairline rules, figures in columns, brass for money. */
textarea { font: inherit; resize: vertical; line-height: 1.4; }
.btn.warn { color: #f0b9c0; border-color: rgba(196, 80, 95, 0.55); }
.btn.warn:hover:not(:disabled) { background: rgba(140, 47, 60, 0.35); }

.admin { max-width: 76rem; margin: 0 auto; padding: 1.4rem 1.25rem 3rem; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.adm-head h1 { font-family: var(--display); font-weight: 600; font-size: 2.4rem; line-height: 1; margin: 0 0 0.45rem; }
.adm-summary { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.adm-tabs { display: flex; gap: 0.2rem; margin: 1.3rem 0 1.2rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab { flex: none; padding: 0.65rem 0.95rem 0.6rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.adm-tab:hover { color: var(--bone); }
.adm-tab.on { color: var(--brass); border-bottom-color: var(--brass); }
.adm-tab:focus-visible { outline: 2px solid var(--bone); outline-offset: -2px; }
.adm-pane { min-width: 0; }
.adm-tools { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.adm-tools input[type='search'] { flex: 1 1 14rem; width: auto; }
.adm-tools select { flex: 0 1 15rem; width: auto; }
.adm-tools .small { flex: 1; margin: 0; }
.adm-empty { color: var(--muted); padding: 1.5rem 0; }

.adm-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.adm-table th { text-align: left; font-size: 0.78rem; font-weight: 650; color: var(--muted); padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.adm-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table .num { text-align: right; white-space: nowrap; }
.adm-table td.num:nth-child(2) { color: var(--brass); font-weight: 650; }
.adm-prow { cursor: pointer; }
.adm-table .unit { display: none; }
.adm-prow:hover td, .adm-prow:focus-visible td { background: rgba(236, 230, 216, 0.05); }
.adm-prow:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.adm-prow.off td { opacity: 0.6; }
.p-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.p-name b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-where, .p-seen { color: var(--muted); font-size: 0.88rem; }
.dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(236, 230, 216, 0.18); }
.dot.on { background: #5fc27e; box-shadow: 0 0 0 3px rgba(95, 194, 126, 0.18); }
.badges { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.badge { font-size: 0.7rem; font-weight: 650; padding: 0.1rem 0.45rem; border-radius: 1rem; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.admin { border-color: var(--brass-soft); color: var(--brass); }
.badge.bad { border-color: rgba(196, 80, 95, 0.6); color: #f0b9c0; }

.adm-group { margin-bottom: 1.6rem; }
.adm-group h2, .adm-card h2 { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.2rem; color: var(--brass); margin: 0 0 0.5rem; }
.adm-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.adm-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 17rem; gap: 0.5rem 1.2rem; align-items: center; padding: 0.75rem 0.2rem; border-bottom: 1px solid var(--line); }
.adm-row.paused { background: linear-gradient(90deg, rgba(207, 166, 78, 0.08), transparent 70%); }
.adm-row h3 { font-family: var(--display); font-weight: 600; font-size: 1.08rem; margin: 0 0 0.15rem; }
.adm-row .small { margin: 0.1rem 0 0; color: var(--muted); }
.r-seats { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; font-variant-numeric: tabular-nums; }
.r-seats .small { overflow: hidden; text-overflow: ellipsis; }
.r-btns { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }

.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1rem; align-items: start; }
.adm-card { display: flex; flex-direction: column; gap: 0.65rem; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--line); border-radius: 0.8rem; background: rgba(18, 37, 42, 0.7); }
.adm-card > .small { margin: -0.3rem 0 0; color: var(--muted); }
.adm-card h2 { margin: 0; }
.adm-inline { display: flex; gap: 0.5rem; align-items: center; }
.adm-inline input { flex: 1; }
.adm-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pass-show { font-family: var(--ui); font-weight: 650; letter-spacing: 0.04em; padding: 0.2rem 0.5rem; border-radius: 0.35rem; background: rgba(0, 0, 0, 0.3); }
.adm-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.adm-chips { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.5rem; }
.adm-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.adm-facts dt { color: var(--muted); }
.adm-facts dd { margin: 0; overflow-wrap: anywhere; }
.adm-player fieldset { display: flex; flex-direction: column; gap: 0.6rem; }
.adm-player .profile-head .badges { margin-top: 0.3rem; }

.adm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; }
.adm-log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 60vh; overflow-y: auto; }
.adm-log li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.88rem; overflow-wrap: anywhere; }
.adm-log time { color: var(--muted); font-variant-numeric: tabular-nums; }

.secret { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; border: 1px dashed var(--brass-soft); border-radius: 0.6rem; background: rgba(0, 0, 0, 0.3); }
.secret code { flex: 1; font-family: var(--ui); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.06em; color: var(--brass); user-select: all; }

.lobby-notice { margin: 0 0 1.1rem; padding: 0.75rem 1rem; border: 1px solid var(--brass-soft); border-left-width: 3px; border-radius: 0.6rem; background: rgba(207, 166, 78, 0.08); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-line.sys b { color: #e8c983; }
.chat-line.sys span { font-style: italic; }
.room-msg .dlg-body { font-size: 1.05rem; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .admin { padding: 1rem 1rem 2.5rem; }
  .adm-head h1 { font-size: 2rem; }
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody { display: block; }
  .adm-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.8rem; padding: 0.65rem 0.2rem; border-bottom: 1px solid var(--line); }
  .adm-table td { padding: 0; border: 0; }
  .adm-table td.p-name { grid-column: 1; grid-row: 1; }
  .adm-table td.num:nth-child(2) { grid-column: 2; grid-row: 1; }
  .adm-table td.num:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 0.85rem; color: var(--muted); }
  .adm-table td.num:nth-child(3):not(:empty)::before { content: 'on table '; }
  .adm-table td.p-where { grid-column: 1; grid-row: 2; }
  .adm-table td.p-seen { grid-column: 1; grid-row: 3; font-size: 0.8rem; }
  .adm-table td.num:nth-child(6) { grid-column: 2; grid-row: 3; font-size: 0.8rem; color: var(--muted); }
  .adm-table .unit { display: inline; }
  .adm-row { grid-template-columns: minmax(0, 1fr); }
  .r-btns { justify-content: flex-start; }
  .adm-two { grid-template-columns: minmax(0, 1fr); }
  .adm-log li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .adm-chips { grid-template-columns: minmax(0, 1fr); }
}

/* chip history and leaderboard */
/* chip amounts won or lost (not .card.up, a face-up stud card, whose black suits must stay black) */
.up:not(.card) { color: #8fd6a2; }
.down:not(.card) { color: #f0a3ad; }
.ledger-list, .lboard-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 55vh; overflow-y: auto; font-variant-numeric: tabular-nums; }
.ledger-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto 6rem; gap: 0.7rem; align-items: baseline; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.ledger-list time { color: var(--muted); font-size: 0.82rem; }
.l-what { display: flex; flex-direction: column; min-width: 0; }
.l-what small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-amt { font-weight: 650; text-align: right; }
.l-bal { color: var(--muted); text-align: right; }
.lboard .segs { margin: 0.2rem 0 0.4rem; }
.lboard-list li { display: grid; grid-template-columns: 1.8rem auto minmax(0, 1fr) auto 6.5rem; gap: 0.6rem; align-items: center; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--line); }
.lboard-list li.me { background: rgba(207, 166, 78, 0.1); }
.b-rank { color: var(--muted); text-align: right; }
.b-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-hands { color: var(--muted); font-size: 0.82rem; }
.b-net { font-weight: 700; text-align: right; }
@media (max-width: 560px) {
  .ledger-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-list time { grid-column: 1 / -1; }
  .l-bal { display: none; }
  .lboard-list li { grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; }
  .b-hands { display: none; }
}
/* long standing-table names ("Dealer's Choice Every Structure, 8 seats") wrap instead of being cut off */
.lobby .trow .tname h3 { white-space: normal; line-height: 1.2; }
@media (max-width: 560px) {
  /* a long rotation takes rows the felt needs: once a game is being played, show only it and the next one */
  .rot:has(.pill.now) .pill:not(.now):not(.next) { display: none; }
}

/* lobby tabs, filters and sortable columns */
.lobby-tabs { display: flex; gap: 0.2rem; margin: 0 0 0.9rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.lobby-tabs::-webkit-scrollbar { display: none; }
.lobby-tab { flex: none; display: flex; align-items: baseline; gap: 0.5rem; padding: 0.65rem 1rem 0.6rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-weight: 650; font-size: 1rem; cursor: pointer; }
.lobby-tab:hover { color: var(--bone); }
.lobby-tab.on { color: var(--brass); border-bottom-color: var(--brass); }
.lobby-tab:focus-visible { outline: 2px solid var(--bone); outline-offset: -2px; }
.tab-note { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.lobby-tools { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.9rem; }
.fchips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fchip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.32rem 0.75rem; border: 1px solid rgba(236, 230, 216, 0.2); border-radius: 999px; background: rgba(0, 0, 0, 0.2); color: var(--bone); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.fchip:hover { border-color: var(--brass-soft); }
.fchip.on { background: var(--brass); border-color: var(--brass); color: #1b1408; }
.fcount { font-size: 0.75rem; font-weight: 700; opacity: 0.7; font-variant-numeric: tabular-nums; }
.ftools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.ftools select { width: auto; padding-top: 0.38rem; padding-bottom: 0.38rem; font-size: 0.88rem; }
.fcheck { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.sort-select { display: none; }
.lobby-tools > .sort-select { align-self: flex-start; width: auto; }
.table-list .thead { padding-top: 0.2rem; padding-bottom: 0.2rem; border: 0; background: none; }
.th { display: flex; gap: 0.6rem; min-width: 0; }
.sort { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 650; cursor: pointer; }
.sort:hover { color: var(--bone); }
.sort.on { color: var(--brass); }
.sort-arrow { font-size: 0.62rem; }
.sort:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; border-radius: 3px; }
.tempty { list-style: none; color: var(--muted); padding: 1rem 0; display: flex; align-items: center; gap: 0.7rem; }
/* rows are a little tighter now there can be dozens of them */
.table-list { gap: 0.55rem; }
.table-list .trow:not(.thead) { padding: 0.8rem 1.1rem; }
@media (max-width: 960px) {
  .table-list .thead { display: none; }
  .sort-select { display: block; }
  .ftools .sort-select { margin-left: auto; }
}
/* a fixed action column so the header row lines up with the rows under it */
@media (min-width: 961px) {
  .table-list .trow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 9.5rem 8rem 5.2rem; }
  .table-list.tourneys .trow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 9.5rem 6rem 9.5rem; }
  .table-list .trow > :last-child:not(.th) { justify-self: end; }
}
/* run it twice: the shared cards' places on the second row stay empty */
.card-slot.shared { visibility: hidden; }
.card.gone { visibility: hidden; }   /* a card you threw away in a draw: its place waits for the new card */
/* locked dialogs (the long create forms): a close button in the corner, and the buttons stay at the bottom while the form scrolls */
.dlg-x { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 2; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: rgba(0, 0, 0, 0.25); color: var(--muted); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.dlg-x:hover { color: var(--bone); border-color: var(--line); }
.dlg-x:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
dialog.sheet.locked .dlg-form > h2 { position: sticky; top: -1.4rem; z-index: 1; margin: -1.4rem -1.4rem 0; padding: 1.15rem 4rem 0.85rem 1.4rem; background: var(--panel); border-bottom: 1px solid var(--line); }
dialog.sheet.locked .dlg-x { top: 0.85rem; }
dialog.sheet.locked .dlg-form > .dlg-actions { position: sticky; bottom: -1.4rem; z-index: 1; margin: 0.3rem -1.4rem -1.4rem; padding: 0.85rem 1.4rem; background: var(--panel); border-top: 1px solid var(--line); }
/* your own face-up stud cards, raised above your down cards like cards picked for a draw */
.card.raised { transform: translateY(calc(var(--w) * -0.3)); }
/* admin: pictures in the avatars folder that are not offered */
.adm-skip-list { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.adm-skip-list li { display: flex; flex-direction: column; gap: 0.1rem; overflow-wrap: anywhere; }
.adm-skip-list b { font-weight: 600; font-size: 0.9rem; }
.warn-text { color: #f0c48a; }
