/* 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; }
.pill-toggle { background: none; border: 0; padding: 0.18rem 0.2rem; font: inherit; font-size: 0.8rem; color: var(--brass); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pill-toggle:hover { color: var(--bone); }
.pill-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
.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; }
/* a picture deck: the picture lies over the drawn card (face or back), which shows only if the picture is missing */
.card.img { overflow: hidden; }
.card.img:not(.back) { background: #fffdf7; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); }
.card.img > img { position: absolute; inset: 0; z-index: 1; 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);
}
/* each label starts at the gap between the rows and grows away from it, so a board won by several players (a split
   low) never runs into the other board's label */
.run:first-child .run-win { top: auto; bottom: 0; transform: none; }
.run:nth-child(2) .run-win { top: 0; transform: none; }
.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) * 1.45 + 0.35rem); }   /* clear of the winning board cards, which are lifted */
/* 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: 3; }   /* chips in front are drawn over the seats, never under them */
.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: 3; transform: translate(-50%, -50%);   /* above the seats: never under anyone's cards */
  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; align-items: center; gap: 1rem; flex-wrap: wrap; }
.chooser-text { min-width: 0; }
.chooser-title { font-weight: 650; color: var(--brass); }
/* dealer's choice: the dialog with the games */
dialog.sheet.chooser-sheet { width: min(34rem, 96vw); }
.chooser-tabs { flex-wrap: wrap; margin: 0.2rem 0 0.1rem; }
.chooser-games { display: flex; flex-direction: column; gap: 0.3rem; max-height: min(52vh, 26rem); overflow-y: auto; padding-right: 0.2rem; scrollbar-width: thin; scrollbar-color: rgba(236, 230, 216, 0.25) transparent; }
.chooser-game { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; width: 100%; padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: 0.6rem; background: rgba(236, 230, 216, 0.03); color: var(--bone); font: inherit; text-align: left; cursor: pointer; }
.chooser-game:hover, .chooser-game:focus-visible { border-color: var(--brass); background: rgba(207, 166, 78, 0.1); }
.chooser-game.now { border-style: dashed; }
.cg-name { font-weight: 600; }
@media (max-width: 520px) { .chooser-dlg { padding: 1.1rem; gap: 0.75rem; } }
/* a short screen (a phone on its side): the list gets the room */
@media (max-height: 520px) {
  .chooser-dlg { gap: 0.5rem; padding: 0.9rem 1.1rem; max-height: 94dvh; }
  .chooser-dlg h2 { font-size: 1.15rem; }
  .chooser-dlg .dlg-body { display: none; }
  .chooser-dlg .chooser-games { max-height: none; flex: 1; min-height: 6rem; }
  .chooser-dlg .chooser-game { padding: 0.4rem 0.75rem; }
  .chooser-dlg .dlg-actions { margin-top: 0; }
}
.cg-limit { flex: none; font-size: 0.82rem; 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):not(.side-l):not(.side-r) .hname:not(.hn-flip):not(.hn-edge) { 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: 7%; bottom: 6%; width: 30%; height: auto; aspect-ratio: 1; fill: #14202a; opacity: 0.85; 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) max-content 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-x: visible; overflow-y: clip; padding-top: 0.3rem; }   /* the tops of the cards, every card whole across */
.rp-hand .card { flex: none; }
.rp-hand .card + .card { margin-left: calc(var(--w) * -1 * var(--rp-ov, 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: an "up" tag in the lower left corner, which stays in view where the cards overlap and
   covers neither the rank nor the suit; the cards only you can see have none */
.card.upmark::after {
  content: 'up'; position: absolute; left: 7%; bottom: 6%; z-index: 2;
  padding: 0.08em 0.45em 0.12em; border-radius: 999px;
  background: #16313a; color: #f1dba0; box-shadow: 0 0 0 1px rgba(241, 219, 160, 0.55);
  font-size: max(0.55rem, calc(var(--w) * 0.19)); font-weight: 700; line-height: 1; letter-spacing: 0.02em;
  pointer-events: none;
}
/* 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; }

/* ------------------------------------------------------------------ phones: the table keeps its size */
/* The table gets a fixed share of the screen and the betting controls sit compactly right under it. Before, the
   table only got what the controls left over, so on a short phone it shrank until your cards covered the board.
   Controls that do not fit (sit out, add chips...) are reached by scrolling down. */
@media (max-width: 860px) {
  .stage { height: auto; min-height: 0; }
  .felt-wrap { flex: none; height: clamp(21rem, calc(100dvh - var(--top) - 14.5rem), 124vw); }
  .betbox { gap: 0.4rem; max-width: none; }
  .turn-head { font-size: 0.95rem; }
  .btnrow .btn { padding: 0.6rem 0.5rem; }
  .raise-row { flex-wrap: nowrap; gap: 0.6rem; }
  .raise-row input[type='number'] { width: 5.6rem; flex: none; padding: 0.4rem 0.6rem; font-size: 1rem; }
  .raise-row input[type='range'] { flex: 1; min-width: 0; }
  .quick-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .quick-row::-webkit-scrollbar { display: none; }
  .quick-row .btn { flex: none; padding: 0.35rem 0.7rem; }
}

/* ------------------------------------------------------------------ draw games: which draw the hand is on */
.draws {
  position: absolute; left: 50%; top: 51%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem;
  border-radius: 999px; background: rgba(0, 0, 0, 0.42); color: var(--bone);
  font-size: max(0.75rem, calc(var(--u) * 1.45)); font-weight: 650; white-space: nowrap;
}
.felt.has-board .draws { top: auto; bottom: calc(50% + var(--bh) + 2.7rem); transform: translateX(-50%); }
.felt.has-draws:not(.has-board) .felt-print { top: 63%; }
.draws.dots-only { padding: 0.3rem 0.5rem; }
.draws.dots-only .draw-text { display: none; }
.draw-pips { display: inline-flex; gap: 0.3rem; }
.draw-pip { width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid rgba(236, 230, 216, 0.45); }
.draw-pip.done { background: var(--brass); border-color: var(--brass); }
.draw-pip.now { background: var(--bone); border-color: var(--brass); box-shadow: 0 0 0 2px rgba(207, 166, 78, 0.45); }

/* ------------------------------------------------------------------ hands never cover each other */
/* fitHands() sets --hs on a hand that would run into another seat; it shrinks toward its own name plate */
.hand { scale: var(--hs, 1); transform-origin: 50% 0; }
.seat.bottom .hand { transform-origin: 50% 100%; }
.seat.side-l .hand { transform-origin: 0 50%; }
.seat.side-r .hand { transform-origin: 100% 50%; }
@media (max-width: 860px) {
  .seat:not(.you) .hand.backs { transform-origin: 50% 100%; }
  .seat.top:not(.you) .hand.backs { transform-origin: 50% 0; }
}
/* a hand making room: its cards close up (sq1, sq2), or it moves to the other side of its name plate (flip) */
.hand.sq1 .card + .card { margin-left: calc(var(--w) * -0.55) !important; }
.hand.sq2 .card + .card { margin-left: calc(var(--w) * -0.68) !important; }
.seat.top .hand.flip { top: auto; bottom: calc(100% - 0.35rem); transform-origin: 50% 100%; }
.seat.bottom .hand.flip { bottom: auto; top: calc(100% - 0.15rem); transform-origin: 50% 0; }
@media (max-width: 860px) {
  .seat:not(.you) .hand.backs.flip { bottom: auto; top: calc(100% - 0.3rem); transform-origin: 50% 0; }
  .seat.top:not(.you) .hand.backs.flip { top: auto; bottom: calc(100% - 0.3rem); transform-origin: 50% 100%; }
}
/* ...or slides part of the way onto its own name plate (tuck) */
.seat.bottom .hand.tuck { translate: 0 45%; }
.seat.top .hand.tuck { translate: 0 -45%; }
.seat.bottom .hand.flip.tuck { translate: 0 -45%; }
.seat.top .hand.flip.tuck { translate: 0 45%; }
.seat.side-l .hand.tuck { translate: -35% 0; }
.seat.side-r .hand.tuck { translate: 35% 0; }
@media (max-width: 860px) {
  .seat:not(.you) .hand.backs.tuck { translate: 0 45%; }
  .seat.top:not(.you) .hand.backs.tuck { translate: 0 -45%; }
  .seat:not(.you) .hand.backs.flip.tuck { translate: 0 -45%; }
  .seat.top:not(.you) .hand.backs.flip.tuck { translate: 0 45%; }
}
/* ...or sits beside its name plate, on the side toward the middle of the table (beside) */
.seat:not(.you) .hand.beside { top: 50%; bottom: auto; transform: translateY(-50%); }

.seat.mid-r:not(.you) .hand.beside { top: 50%; bottom: auto; transform: translateY(-50%); left: calc(100% - 0.2rem); right: auto; transform-origin: 0 50%; }
.seat.mid-l:not(.you) .hand.beside { top: 50%; bottom: auto; transform: translateY(-50%); left: auto; right: calc(100% - 0.2rem); transform-origin: 100% 50%; }
.seat.mid-r.seat:not(.you) .hand.beside.tuck { translate: -35% 0; }
.seat.mid-l.seat:not(.you) .hand.beside.tuck { translate: 35% 0; }

/* ------------------------------------------------------------------ the Results box */
.res-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.res-table th { text-align: right; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 0 0.6rem 0.4rem; border-bottom: 1px solid var(--line); }
.res-table td { text-align: right; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.res-table .res-name { text-align: left; }
.res-table td.res-name { font-weight: 650; }
.res-table td.res-name small { margin-left: 0.45rem; font-weight: 500; color: var(--muted); }
.res-table tr.you td.res-name span { color: var(--brass); }
.res-table tr.gone td { color: var(--muted); }
.res-net { font-weight: 700; }
.res-net.up { color: #8fdc9c; } .res-net.down { color: #e3a0a8; }
.res-table tr.gone .res-net.up { color: #6fa97a; } .res-table tr.gone .res-net.down { color: #b07f86; }
.res-note { margin: 0; }
@media (max-width: 520px) { .res-table th:nth-child(3), .res-table td:nth-child(3) { display: none; } .res-table th, .res-table td { padding-inline: 0.35rem; } }

/* ------------------------------------------------------------------ a table drawn scaled down to fit (fitFelt) */
.felt-wrap.scaled { overflow: clip; overflow-clip-margin: 1.5rem; }   /* the full-size layout box must not make the page scroll */
.felt { scale: var(--fs, 1); transform-origin: 50% 50%; }
/* narrower computer windows (or zoomed in): the betting controls stay in their box instead of growing over the table */
@media (min-width: 861px) and (max-width: 1250px) {
  .betbox { column-gap: 0.7rem; }
  .betbox .btnrow .btn { min-width: 6.2rem; padding: 0.6rem 0.8rem; font-size: 0.98rem; }
  .betbox .quick-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .betbox .quick-row::-webkit-scrollbar { display: none; }
  .betbox .quick-row .btn { flex: none; }
  .raise-row input[type='number'] { width: 5.5rem; }
}
/* short computer windows (or zoomed in): smaller controls leave more room for the table */
@media (min-width: 861px) and (max-height: 720px), (min-width: 861px) and (max-width: 1250px) {
  .betbox .btnrow { align-self: center; }
  .betbox .btnrow .btn { padding: 0.55rem 0.8rem; }
  .dock { padding-top: 0.45rem; padding-bottom: 0.5rem; }
  .dock-main { min-height: 0; }
  .manage { margin-top: 0.4rem; gap: 0.35rem; }
  .manage .btn, .manage .pre, .prebox .pre { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
}

/* the table's occasional bomb pot */
.pill.bomb.now { background: var(--wine); border-color: var(--wine-bright); color: #fbeff0; }
.rot-note.bomb-note { color: #e3a0a8; }
.field.bomb-every, .field.bomb-size { margin-top: 0.6rem; }
.field.bomb-every select { max-width: 16rem; }

/* ------------------------------------------------------------------ labels making room (fitLabels) */
.seat.top .hname.hn-flip { bottom: auto; top: calc(100% + 0.25rem); }
.seat.bottom .hname.hn-flip, .seat.side-l .hname.hn-flip, .seat.side-r .hname.hn-flip { top: auto; bottom: calc(100% + 0.25rem); }
.hname.hn-small { font-size: max(0.58rem, calc(var(--u) * 1)); padding: 0.05rem 0.4rem; }
/* a seat against the rail with no room beyond its plate: the hand's name sits across the plate's outer edge */
.seat.bottom .hname.hn-edge, .seat.side-l .hname.hn-edge, .seat.side-r .hname.hn-edge { top: calc(100% - 0.7rem); bottom: auto; }
.seat.top .hname.hn-edge { bottom: calc(100% - 0.7rem); top: auto; }
.felt.runwin-off .run-win { display: none; }
.felt.twice.runwin-off.has-board.has-result .result { display: flex; top: auto; bottom: calc(50% + var(--bh) * 1.45 + 0.35rem); }
.felt.result-off .result { visibility: hidden; }

/* ------------------------------------------------------------------ a phone on its side: the wide oval, not the tall table */
@media (max-width: 860px) and (orientation: landscape) {
  .felt { --felt-w: min(96cqw, 230cqh); aspect-ratio: 2.3; }
  .felt-wrap { height: max(16rem, calc(100dvh - var(--top) - 1rem)); }
}
.hname.hn-hide { display: none; }
@media (max-width: 860px) and (orientation: landscape) {
  .card.hero { --w: 2.1rem; }
  .hand.mine.many .card.hero { --w: 1.9rem; }
}
/* phones: nothing on the table may make the page scroll sideways (the seats are kept on screen by separateSeats) */
@media (max-width: 860px) { .felt-wrap, .table-screen { overflow-x: clip; } }
/* a side seat's cards making room: above its plate instead of beside it */
.seat.side-l:not(.you) .hand.flip, .seat.side-r:not(.you) .hand.flip { top: auto; bottom: calc(100% - 0.3rem); left: 50%; right: auto; transform: translateX(-50%); transform-origin: 50% 100%; }
.seat.side-l:not(.you) .hand.flip.tuck, .seat.side-r:not(.you) .hand.flip.tuck { translate: 0 45%; }

/* wide computer screens: the seat options (sit out, top up, add chips...) stand to the left of the betting controls
   instead of in a row under them, so the box under the table is lower and the table gets the room */
@media (min-width: 1400px) {
  .stage { --dock-h: 8.9rem; }
  .stage-head { padding: 0.55rem 1rem 0.15rem; }
  .dock { display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); column-gap: 1.2rem; align-items: end; }
  .dock-main { grid-column: 2; grid-row: 1; align-self: stretch; min-height: 0; }
  .manage { grid-column: 1; grid-row: 1; margin-top: 0; align-self: end; gap: 0.4rem; }
  .manage .btn, .manage .pre { padding: 0.32rem 0.65rem; font-size: 0.84rem; }
}

/* the game being played, in large type above the table, with how many hands of it are left */
.now-game { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; }
.now-game[hidden] { display: none; }
.ng-name { display: flex; align-items: baseline; justify-content: center; gap: 0.55rem; max-width: 100%; min-width: 0; }
.ng-game { font-family: var(--display); font-weight: 600; font-size: 1.55rem; color: var(--brass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ng-limit { flex: none; font-size: 0.95rem; font-weight: 650; color: var(--bone); }
.ng-count { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.6rem; font-size: 0.95rem; color: var(--muted); }
.ng-count b { color: var(--bone); font-weight: 700; }
@media (max-width: 860px) {
  .now-game { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 0.7rem; margin-top: 0.15rem; }
  .ng-count span { display: none; }   /* "Hand 3 of 8" is enough on a phone; the rest is in the tooltip */
  .ng-game { font-size: 1.25rem; }
  .ng-limit, .ng-count { font-size: 0.85rem; }
}

/* the Info tab: the rules of the game being played */
.info-panel { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; padding-right: 0.2rem; font-size: 0.86rem; line-height: 1.45; scrollbar-width: thin; }
.info-panel[hidden] { display: none; }
.info-panel .info-game { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--brass); margin: 0; }
.info-panel .info-stakes, .info-panel .info-table { color: var(--muted); font-size: 0.82rem; }
.info-pick-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.info-pick { flex: 1; min-width: 0; padding: 0.4rem 0.55rem; border-radius: 0.5rem; border: 1px solid rgba(207, 166, 78, 0.45); background: rgba(8, 20, 24, 0.85); color: var(--bone); font: inherit; font-size: 0.86rem; }
.info-pick:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.info-panel .info-back { align-self: flex-start; }
.info-panel h4 { margin-top: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--bone); }
.info-panel p { color: rgba(236, 230, 216, 0.88); }
.info-ranks summary { cursor: pointer; font-weight: 650; font-size: 0.82rem; margin-top: 0.3rem; }
.info-ranks ol { margin: 0.3rem 0 0 1.2rem; color: rgba(236, 230, 216, 0.85); }
/* a narrower computer window: the game's name gets a line of its own, name and count side by side */
@media (min-width: 861px) and (max-width: 1199px) {
  .stage-head { flex-wrap: wrap; row-gap: 0.15rem; }
  .now-game { order: 3; flex-basis: 100%; flex-direction: row; justify-content: center; align-items: baseline; gap: 0.8rem; }
  .ng-game { font-size: 1.3rem; }
}
.info-panel p, .info-panel h4, .info-panel h3 { margin: 0; }
/* a phone on its side: the game's name shares the stakes' line, so the table keeps its height */
@media (max-width: 860px) and (orientation: landscape) {
  .stage-head .tstakes { grid-column: 1; }
  .now-game { grid-column: 2; grid-row: 2; margin-top: 0; justify-content: flex-end; }
  .ng-game { font-size: 1.1rem; }
}
@media (max-width: 860px) and (orientation: landscape) {
  .rot { display: none; }   /* the list of games is in the Info tab; the game being played is named above the table */
}

/* all in with cards to come: each player's equity and how often they win, on the name plate's last line */
.pstate.eq { color: rgba(236, 230, 216, 0.85); line-height: 1.15; }
.pstate.eq > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstate.eq b { color: var(--brass); font-weight: 800; font-size: 1.12em; }
.rp-rows > .rp-row { flex: none; }   /* rows never squeeze into each other when the dialog is short of room: it scrolls instead */
.dlg-form.replay > * { flex: none; }   /* the dialog scrolls; nothing in it is squeezed under the next part */
.pstate.won-text { color: var(--brass); font-weight: 800; font-size: max(0.78rem, calc(var(--u) * 1.5)); }
/* nine or ten seats on a phone on its side: smaller name plates and pictures, so neighbours do not run into each other */
.felt.crowded .seat { --av: 1.8rem; }
.felt.crowded .plate { padding: 0.2rem 0.4rem 0.4rem; }
.felt.crowded .pname { font-size: 0.66rem; }
.felt.crowded .pstack { font-size: 0.86rem; }
.felt.crowded .pstate { font-size: 0.58rem; min-height: 0.8rem; }
/* a top seat's winning cards stand out toward the middle of the table, not up onto the player's own name plate */
.seat.top:not(.side-l):not(.side-r) .hand:not(.flip) .card.lit { transform: translateY(calc(var(--w) * 0.3)); }
/* your folded hand: held down, it shows clearly (no fading while held) */
.seat.you.folded .hand { cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.felt.hold-folded .seat.you.folded .hand, .felt.hold-folded .seat.you.folded .hand .card.dim { opacity: 1; filter: none; transition: none; }
/* the Players tab also shows the table's results (as the Results box does) */
.prow-name { display: flex; align-items: baseline; gap: 0.25rem; }
.prow-net { margin-left: auto; font-weight: 800; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.prow-net.up { color: #8fdc9c; } .prow-net.down { color: #e3a0a8; }
.prow.gone { opacity: 0.75; }
.prow-gap { width: 1.8rem; }
.prow-head { margin-top: 0.3rem; font-weight: 650; }
.prow-reset { align-self: flex-start; }
.boot-row { display: flex; align-items: center; gap: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.seat.folded.showing .hand { opacity: 1; }   /* the last to fold turned cards up: shown clearly */
/* the admin page's Server card: the machine's memory, disk and swap as filling bars */
.adm-machine { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.8rem; }
.adm-meter-top { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.86rem; }
.adm-meter-top span { color: var(--muted); }
.adm-meter-bar { height: 0.55rem; border-radius: 999px; background: rgba(236, 230, 216, 0.1); overflow: hidden; margin-top: 0.2rem; }
.adm-meter-bar i { display: block; height: 100%; border-radius: inherit; background: #6fb98a; }
.adm-meter-bar.warm i { background: var(--brass); }
.adm-meter-bar.hot i { background: #d9606a; }
/* cards a player turned over for the table after the hand, at any seat: pushed up out of the hand (at the top of the
   table, down toward the middle, the way winning cards stand out at a showdown) and outlined in gold. In your own
   seat, where all your cards look face up to you, one "Shown to the table" label also goes across the foot of the hand. */
.hand .card.shown { transform: translateY(calc(var(--w) * -0.3)); }
.seat.top:not(.side-l):not(.side-r) .hand:not(.flip) .card.shown { transform: translateY(calc(var(--w) * 0.3)); }
.hand.shows-mine::after {
  content: attr(data-shown); position: absolute; left: 50%; bottom: 0.3rem; transform: translateX(-50%);
  z-index: 5; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--brass); color: #1b1408;
  font: 800 0.7rem/1.2 var(--ui, system-ui); white-space: nowrap; pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* four action buttons (stud's fourth-street big bet): share the row instead of overflowing it */
.btnrow.many .btn { min-width: 0; padding-left: 0.65rem; padding-right: 0.65rem; white-space: nowrap; }
@media (max-width: 520px) { .btnrow.many { flex-wrap: nowrap; } .btnrow.many .btn { flex: 1 1 auto; font-size: 0.92em; padding-left: 0.45rem; padding-right: 0.45rem; } }

/* lobby tabs on a phone: three tabs share the width, a long name takes two lines, the "playing" note goes */
@media (max-width: 600px) {
  .lobby-tabs { gap: 0; }
  .lobby-tab { display: block; flex: 1 1 0; min-width: 0; padding: 0.55rem 0.35rem 0.5rem; text-align: center; font-size: 0.92rem; line-height: 1.25; }
  .lobby-tab .tab-note { display: none; }
}

/* Omaha 3-2-1 (see renderBoard): the three flops stacked, a turn card between each pair of flops, and the river level
   with the middle flop. --ts (flop to flop) is set by fitTree to the most the table has room for, up to a small gap; at
   the least each flop shows 66% of the one above (rank and suit end at about 59% of a card's height). */
.felt.tree {
  --tw: max(1.9rem, calc(var(--u) * 3.8));   /* card width */
  --th: calc(var(--tw) * 1.4);               /* card height */
  --ts: calc(var(--th) * 0.66);              /* from one flop to the next */
  --tg: calc(var(--u) * 0.35);               /* between cards in a flop */
  --tx: calc(var(--u) * 1);                  /* before the turns, and before the river */
  --bh: calc(var(--ts) + var(--th) / 2);     /* half the board's height */
}
.felt.tree .felt-print, .felt.tree .pot { display: none; }
.felt.tree .board { top: 49%; }
.board.tree { display: block; width: calc(var(--tw) * 5 + var(--tg) * 4 + var(--tx) * 2); height: calc(var(--ts) * 2 + var(--th)); }
.board.tree .card.sm, .board.tree .card-slot.sm { --w: var(--tw); }
.board.tree .tp { position: absolute; }
.board.tree .tp0, .board.tree .tp3, .board.tree .tp6 { left: 0; }
.board.tree .tp1, .board.tree .tp4, .board.tree .tp7 { left: calc(var(--tw) + var(--tg)); }
.board.tree .tp2, .board.tree .tp5, .board.tree .tp8 { left: calc((var(--tw) + var(--tg)) * 2); }
.board.tree .tp0, .board.tree .tp1, .board.tree .tp2 { top: 0; }
.board.tree .tp3, .board.tree .tp4, .board.tree .tp5 { top: var(--ts); }
.board.tree .tp6, .board.tree .tp7, .board.tree .tp8 { top: calc(var(--ts) * 2); }
.board.tree .tp9, .board.tree .tp10 { left: calc((var(--tw) + var(--tg)) * 3 + var(--tx)); }
.board.tree .tp9 { top: calc(var(--ts) * 0.5); }
.board.tree .tp10 { top: calc(var(--ts) * 1.5); }
.board.tree .tp11 { left: calc((var(--tw) + var(--tg)) * 4 + var(--tx) * 2); top: var(--ts); }
@media (max-width: 640px) { .felt.tree { --tw: max(1.45rem, calc(var(--u) * 3.8)); } }
@media (max-height: 520px) {   /* a phone on its side: a shallow table, with your own cards close under the board */
  .felt.tree { --tw: max(1.2rem, calc(var(--u) * 3.5)); }
  .felt.tree .board { top: 44%; }
}
/* the winning board cards keep their brass edge but stay in place: three rows of cards leave no room to stand up */
.board.tree .card.lit { transform: none; }

/* the lobby's table info: the rules of each game a table offers */
.lobby-info-dlg { width: min(34rem, calc(100vw - 2rem)); }
.lobby-info { display: flex; flex-direction: column; gap: 0.6rem; max-height: min(44rem, calc(100vh - 3rem)); }
.lobby-info .lobby-info-body { flex: 1 1 auto; min-height: 8rem; overflow-y: auto; padding: 0.2rem 0.4rem 0.2rem 0; }

/* table passwords in the lobby: which ones you have, and a way to enter another */
.access-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0 0 0.9rem; }
.access-bar[hidden] { display: none; }
.no-tables .btn + .btn { margin-left: 0.5rem; }
/* the admin page's table passwords */
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.acc-row { display: flex; gap: 0.6rem; align-items: flex-start; justify-content: space-between; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 0.6rem; }
.acc-main { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.acc-main .small { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.acc-code { font-size: 0.85rem; color: var(--brass); overflow-wrap: anywhere; }
.acc-btns { display: flex; flex-direction: column; gap: 0.35rem; flex: none; }
.acc-dlg { width: min(32rem, calc(100vw - 2rem)); }
.acc-form { max-height: min(46rem, calc(100vh - 3rem)); overflow-y: auto; }
.acc-form .field { display: flex; flex-direction: column; gap: 0.25rem; }
.acc-picks { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 0.6rem; max-height: 18rem; overflow-y: auto; }
.acc-picks.off { opacity: 0.45; pointer-events: none; }
.acc-pick-head { margin: 0.3rem 0 0; font-weight: 650; font-size: 0.82rem; color: var(--brass); }
.acc-picks .check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }

/* the server was updated while this page was open */
.update-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.7rem 0.6rem 1rem; border: 1px solid var(--brass); border-radius: 0.7rem; background: var(--panel, #12252a); box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45); max-width: calc(100vw - 2rem); }
.settings-version { margin: -0.4rem 0 0.2rem; color: var(--muted); }

/* the side panel folds away on a computer screen (Hide, top right of it); folded, a tab at the right edge opens it */
.side-top { display: flex; align-items: flex-start; gap: 0.4rem; }
.side-top .side-tabs { flex: 1; min-width: 0; gap: 0.2rem; }
.side-top .side-tab { flex: 0 1 auto; min-width: 0; padding: 0.3rem 0.55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-hide { flex: none; width: 1.7rem; height: 1.85rem; border: 1px solid var(--line); border-radius: 0.5rem; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.side-hide:hover { color: var(--bone); border-color: var(--brass); }
.side-open { display: none; }
.table-screen.side-off { grid-template-columns: minmax(0, 1fr) 2.2rem; }
.table-screen.side-off .side { display: none; }
.table-screen.side-off .side-open {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0.5rem; margin: 0.7rem 0.4rem 0.8rem 0;
  padding: 0.8rem 0; border: 1px solid var(--line); border-radius: 0.6rem; background: rgba(18, 37, 42, 0.7); color: var(--muted); cursor: pointer; font: inherit;
}
.side-open:hover { color: var(--bone); border-color: var(--brass); }
.side-open:focus-visible, .side-hide:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.side-open-text { writing-mode: vertical-rl; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.side-unread { min-width: 1.3rem; padding: 0.1rem 0.3rem; border-radius: 999px; background: var(--brass); color: #1b1408; font-size: 0.72rem; font-weight: 700; text-align: center; }
.side-unread[hidden] { display: none; }
/* on a phone the panel is under the table anyway: nothing to fold */
@media (max-width: 860px) {
  .side-hide, .table-screen.side-off .side-open { display: none; }
  .table-screen.side-off .side { display: flex; }
}

/* the controls under the table, compact: the seat options and quick bet sizes put away (the ⌄ button at the top
   right of the controls; ⌃ brings them back). The betting buttons and the amount stay. */
@media (max-width: 860px) { .dock { position: relative; } }
.dock-toggle { position: absolute; top: -0.75rem; right: 0.9rem; z-index: 2; width: 1.7rem; height: 1.45rem; padding: 0; border: 1px solid var(--line); border-radius: 0.45rem; background: rgb(14, 30, 34); color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.dock-toggle:hover { color: var(--bone); border-color: var(--brass); }
.dock-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.dock-compact .manage, .dock-compact .quick-row { display: none; }
.dock-compact .dock-main { min-height: 0; }
.dock-compact .dock { padding-top: 0.45rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 861px) {
  .stage.dock-compact { --dock-h: 6.6rem; }
  .dock-compact .dock-main { min-height: 5.6rem; }
  .dock-compact .betbox { grid-template-areas: ". head" "raise buttons"; }
}
@media (min-width: 1400px) {
  .stage.dock-compact { --dock-h: 6.6rem; }
  .dock-compact .dock { display: block; }
}
