/* Royal Flush Club — members' room: oxblood baize, dark wood rail, brass, ivory cards.
   Deliberately single-theme (a card room has its own light); every color is painted explicitly. */
:root {
  color-scheme: dark;
  --ground: #120c0b;
  --panel: #1c1311;
  --panel-2: #26191a;
  --line: rgba(201, 164, 92, 0.18);
  --line-strong: rgba(201, 164, 92, 0.42);
  --text: #efe6d8;
  --muted: #a8958a;
  --faint: #6f5f58;
  --brass: #c9a45c;
  --brass-hi: #e3c47f;
  --brass-ink: #2a1d0c;
  --felt: #5a1722;
  --felt-hi: #772231;
  --rail: #2a1512;
  --ivory: #f5eedf;
  --card-red: #b01f2d;
  --card-black: #1b1512;
  --danger: #e0634d;
  --ok: #7fbf8a;
  --display: 'Prata', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ui: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r: 14px;
}

* { box-sizing: border-box; }
/* The window, not the document.
   100vh is wrong inside Telegram: it is the browser viewport, not the height Telegram
   actually gives the app, so the action bar ended up under the phone's home indicator and
   the page grew taller than the window — which is what let it be dragged around. The
   height comes from Telegram (--tg-viewport-stable-height, mirrored into --app-h by
   app.js) and the root is pinned so only inner containers ever scroll. */
:root {
  --app-h: 100%;
  --safe-top: 0px;
  --safe-bottom: 0px;
}
html, body {
  height: var(--app-h);
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

#app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(119, 34, 49, 0.28), transparent 60%),
    var(--ground);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.crest { display: flex; align-items: center; background: none; border: 0; padding: 4px 0; min-width: 0; }
.crest-lockup { display: flex; align-items: center; gap: 9px; min-width: 0; }
.crest-lockup .br-mark { flex: none; }
.crest-lockup .br-inline { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .crest-lockup .br-inline { font-size: 13.5px; letter-spacing: .05em; } }
.wallet { display: flex; align-items: center; gap: 8px; flex: none; }
.chip-count { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.chip-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: repeating-conic-gradient(var(--brass) 0 30deg, var(--felt) 30deg 60deg);
  box-shadow: inset 0 0 0 3px var(--brass), 0 0 0 1px rgba(0,0,0,.4);
  flex: none;
}
.vip-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--brass-ink); background: var(--brass);
  padding: 2px 7px; border-radius: 999px;
}

.screen { flex: 1; min-height: 0; overflow-y: auto; }
#lobby { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- lobby ---------- */
.mode-note {
  font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 8px 12px;
}
.purse { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 12px; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.purse-amount { font-family: var(--display); font-size: 40px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.purse-amount small { font-family: var(--ui); font-size: 14px; color: var(--muted); margin-left: 6px; }
.purse-stats { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  border: 0; border-radius: 12px; padding: 12px 16px;
  font-weight: 600; font-size: 15px; line-height: 1.1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-brass { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--brass-ink); }
.btn-ivory { background: var(--ivory); color: var(--card-black); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-fold { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(224, 99, 77, .5); }
.btn-small { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }

.membership {
  position: relative;
  border-radius: var(--r);
  padding: 18px 16px 16px;
  background:
    linear-gradient(135deg, rgba(227,196,127,.10), transparent 45%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  display: grid; gap: 12px;
}
.membership h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; text-wrap: balance; }
.membership ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.membership li { display: flex; gap: 8px; }
.membership li::before { content: '◆'; color: var(--brass); font-size: 9px; line-height: 21px; }
.membership .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.price { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.price small { font-family: var(--ui); font-weight: 400; font-size: 13px; color: var(--muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; }
.section-head span { font-size: 12.5px; color: var(--muted); }

.tables { display: flex; flex-direction: column; }
.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 2px;
}
.table-row:last-child { border-bottom: 0; }
.table-row.open { box-shadow: inset 2px 0 0 var(--brass); padding-left: 10px; }
.table-row:hover .tr-name { color: var(--brass-hi); }
.tr-name { grid-area: 1 / 1; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-lock { font-size: 10.5px; letter-spacing: .12em; font-weight: 700; color: var(--brass); border: 1px solid var(--brass); padding: 1px 6px; border-radius: 999px; }
.tr-meta { grid-area: 2 / 1; font-size: 12.5px; color: var(--muted); }
.tr-side { grid-area: 1 / 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tr-go { grid-area: 2 / 2; justify-self: end; min-width: 92px; }
.tr-blinds { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.seat-dots { display: flex; gap: 3px; }
.seat-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seat-dots i.on { background: var(--brass); box-shadow: none; }
.seat-dots i.me { background: var(--ivory); box-shadow: none; }

.invite { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--panel); }
.invite p { margin: 0; font-size: 14px; color: var(--muted); max-width: 34ch; }

/* ---------- private rooms ---------- */
.friends { display: grid; gap: 10px; }
.friends-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice .btn { padding: 10px 6px; font-family: var(--mono); font-size: 15px; }
.choice .btn span { display: grid; justify-items: center; gap: 2px; }
.choice .btn small { font-family: var(--ui); font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.choice .btn.on { box-shadow: inset 0 0 0 2px var(--brass); color: var(--brass-hi); background: rgba(201, 164, 92, .08); }
.choice .btn.on small { color: var(--brass); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.switch input { width: 20px; height: 20px; accent-color: var(--brass); flex: none; }
.code-input {
  width: 100%; padding: 14px 12px; text-align: center;
  font-size: 32px; font-weight: 700; letter-spacing: .24em; text-indent: .24em;
  color: var(--text); background: var(--panel-2);
  border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-strong);
}
.code-input::placeholder { color: var(--faint); }
.room-code {
  margin: 4px 0 16px; padding: 14px 12px; text-align: center;
  font-size: 40px; font-weight: 700; letter-spacing: .2em; text-indent: .2em;
  color: var(--brass-hi);
  border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}

.leaders { display: grid; gap: 0; counter-reset: lb; }
.leader { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.leader:last-child { border-bottom: 0; }
.leader .pos { font-family: var(--mono); color: var(--faint); }
.leader .won { font-family: var(--mono); color: var(--ok); }
.fineprint { font-size: 12px; color: var(--faint); line-height: 1.5; margin: 0; max-width: 60ch; }

/* ---------- table screen ---------- */
.table-screen { display: flex; flex-direction: column; overflow: hidden; }
.tablebar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex: none; }
.tablebar-title { flex: 1; min-width: 0; }
.tb-name { font-family: var(--display); font-size: 17px; line-height: 1.2; }
.tb-meta { font-size: 12px; color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 19px; line-height: 1;
  display: grid; place-items: center;
}

.felt-wrap {
  position: relative;
  flex: 1;
  min-height: 330px;
  margin: 4px 16px 0;
}
.rail {
  position: absolute;
  inset: 44px 12% 64px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #3a1d18, var(--rail) 40%, #1a0c0a);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 12px;
}
.felt {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background:
    radial-gradient(70% 55% at 50% 45%, var(--felt-hi), var(--felt) 70%, #3d0f17);
  box-shadow: inset 0 0 0 2px rgba(201,164,92,.55), inset 0 0 0 7px rgba(0,0,0,.18), inset 0 10px 30px rgba(0,0,0,.45);
  display: grid; place-items: center;
  overflow: hidden;
}
.felt-print {
  font-family: var(--display); font-size: 10px; letter-spacing: .42em; text-transform: uppercase;
  color: rgba(227,196,127,.32);
  pointer-events: none;
}
.felt-center { display: grid; justify-items: center; gap: 8px; z-index: 1; }
.pot { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--brass-hi); background: rgba(0,0,0,.28); padding: 3px 10px; border-radius: 999px; min-height: 24px; }
.pot:empty { visibility: hidden; }
.board { display: flex; gap: 4px; min-height: 58px; }
.street { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(245,238,223,.55); min-height: 16px; }

/* cards — the deck skin is set per table by --dk-* and changes every dozen hands */
.felt-wrap {
  --dk-face: var(--ivory);
  --dk-ink: var(--card-black);
  --dk-red: var(--card-red);
  --dk-back: var(--felt);
  --dk-trim: rgba(201,164,92,.45);
}
.card {
  --w: 40px;
  position: relative;
  width: var(--w); height: calc(var(--w) * 1.42);
  border-radius: 6px;
  background: var(--dk-face);
  color: var(--dk-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
  user-select: none;
  flex: none;
  transition: background 1.2s ease, color 1.2s ease;
}
.card .face { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card .r { font-family: var(--display); font-size: calc(var(--w) * .46); }
.card .s { font-size: calc(var(--w) * .42); margin-top: 1px; }
.card.red { color: var(--dk-red); }
.card.back, .card .rear {
  background:
    repeating-linear-gradient(45deg, var(--dk-trim) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, var(--dk-trim) 0 2px, transparent 2px 7px),
    var(--dk-back);
}
.card.back { box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 0 0 2px var(--dk-face); }
.card.dim { filter: brightness(.55) saturate(.6); }
.card.win { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 16px rgba(227,196,127,.6); transform: translateY(-3px); }

/* dealing: cards arrive from the shoe, staggered, and settle */
.card.enter { animation: deal 1.15s cubic-bezier(.16,.84,.26,1) both; }
.card.d0 { animation-delay: 0s; }
.card.d1 { animation-delay: .34s; }
.card.d2 { animation-delay: .68s; }
.card.d3 { animation-delay: 1.02s; }
.card.d4 { animation-delay: 1.36s; }
@keyframes deal {
  from { opacity: 0; transform: translate(34px, -46px) rotate(14deg) scale(.82); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}

/* the flip: the element turns, the back is a real second face */
.card.flip { transform-style: preserve-3d; animation: flip-in 1.65s cubic-bezier(.24,.78,.3,1) both; }
.card.flip .rear {
  position: absolute; inset: 0; border-radius: inherit;
  transform: rotateY(180deg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 2px var(--dk-face);
}
.card.flip .face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
@keyframes flip-in {
  from { opacity: 0; transform: translate(26px, -34px) rotateY(180deg) scale(.86); }
  40%  { opacity: 1; }
  to   { opacity: 1; transform: rotateY(0) scale(1); }
}

/* seats */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 92px;
  display: grid; justify-items: center; gap: 3px;
  z-index: 2;
  transition: opacity .2s ease;
}
.seat.folded { opacity: .45; }
.seat.empty { opacity: .6; }
.avatar {
  --p: 0;
  position: relative;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2);
  font-weight: 700; font-size: 16px;
  box-shadow: 0 0 0 2px var(--rail), 0 4px 10px rgba(0,0,0,.4);
}
.avatar.bot { background: #231a1f; color: var(--muted); }
.avatar.me { background: var(--ivory); color: var(--card-black); }
.seat.acting .avatar::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--brass-hi) calc(var(--p) * 1turn), rgba(201,164,92,.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 29px, #000 30px);
          mask: radial-gradient(circle, transparent 29px, #000 30px);
}
.seat.acting .avatar { box-shadow: 0 0 0 2px var(--brass), 0 0 18px rgba(227,196,127,.35); }
.seat.winner .avatar { box-shadow: 0 0 0 3px var(--brass-hi), 0 0 24px rgba(227,196,127,.7); }
.seat-plate {
  background: rgba(18,12,11,.88);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px 8px 4px;
  text-align: center;
  min-width: 78px;
  max-width: 100%;
}
.seat-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-stack { font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--brass-hi); }
.seat-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; white-space: nowrap; background: var(--ivory); color: var(--card-black); z-index: 3; }
.seat-tag.allin { background: var(--danger); color: #fff; }
.seat-tag.hand { background: var(--brass); color: var(--brass-ink); }
.seat.mine { width: 150px; }
.seat.mine .avatar { display: none; }
.dealer {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ivory); color: var(--card-black);
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
  transform: translate(-50%, -50%);
  z-index: 3;
}
.bet {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--ivory);
  background: rgba(0,0,0,.35); padding: 2px 8px 2px 3px; border-radius: 999px;
  z-index: 2;
}
.sit-here { background: none; border: 1px dashed var(--line-strong); color: var(--muted); border-radius: 999px; width: 50px; height: 50px; font-size: 22px; }

/* The result used to sit dead centre, on top of the board and the winning cards —
   exactly what a player wants to look at when checking whether they won. It lives
   above the felt now, and the cards underneath stay readable. */
.banner {
  position: absolute; left: 50%; top: 4%;
  transform: translate(-50%, 0);
  z-index: 5;
  background: rgba(18,12,11,.94);
  border: 1px solid var(--brass);
  border-radius: 14px;
  padding: 10px 16px;
  text-align: center;
  min-width: 200px; max-width: 86%;
  animation: pop .9s cubic-bezier(.2,.9,.3,1.2) both;
  pointer-events: none;
}
.banner b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--brass-hi); }
.banner span { font-size: 13px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -12px) scale(.94); } }

/* action bar */
.actions {
  flex: none;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28,19,17,.6), var(--panel));
  display: grid; gap: 10px;
  min-height: 74px;
}
.act-row { display: grid; grid-template-columns: 1fr 1.25fr 1.25fr; gap: 8px; }
.act-row .btn { padding: 14px 8px; font-size: 15px; }
.act-row .btn small { display: block; font-family: var(--mono); font-size: 12.5px; opacity: .8; margin-top: 2px; }
.act-row .btn span { display: grid; justify-items: center; }
.act-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); min-height: 48px; }
.act-status b { color: var(--text); font-weight: 600; }
.act-status .btns { display: flex; gap: 8px; flex: none; }
.raise-panel { display: grid; gap: 10px; }
.raise-top { display: flex; justify-content: space-between; align-items: baseline; }
.raise-top .num { font-size: 22px; font-weight: 700; color: var(--brass-hi); }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.presets .btn { padding: 8px 4px; font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--brass); height: 28px; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 560px; max-height: 82%;
  overflow-y: auto;
  z-index: 21;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -1px 0 var(--line-strong);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: up .62s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 22px; }
.sheet p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.sheet .stack { display: grid; gap: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; align-items: baseline; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }
.verify-ok { color: var(--ok); font-weight: 600; }
.verify-bad { color: var(--danger); font-weight: 600; }
.deck-line { display: flex; flex-wrap: wrap; gap: 3px; }
.deck-line .card { --w: 22px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 14px; }
.log li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.log li.street { color: var(--brass-hi); font-family: var(--mono); font-size: 13px; }
.log li.win { color: var(--ok); }

.toast {
  position: fixed; left: 50%; top: calc(62px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  z-index: 30;
  background: var(--ivory); color: var(--card-black);
  padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  max-width: calc(100% - 32px);
  animation: fade .5s ease both;
}

/* Narrow phones: the side seats used to overlap the board. The felt is pulled in and
   the seats sit tighter against the rail. Checked at 360, 390 and 430 px. */
@media (max-width: 430px) {
  .felt-wrap { margin-inline: 10px; }
  .rail { inset: 40px 6% 58px; }
  .seat { width: 82px; }
  .seat.mine { width: 136px; }
  .seat-plate { min-width: 70px; padding: 3px 6px 4px; }
  .seat-name { font-size: 11.5px; }
  .seat-stack { font-size: 12px; }
  .board { gap: 3px; }
  .shelf-slot { transform: scale(.82); transform-origin: left top; }
  .seat.mine .shelf-slot { transform-origin: right top; }
}
@media (max-width: 380px) {
  .seat { width: 80px; }
  .avatar { width: 44px; height: 44px; font-size: 14px; }
  .seat.acting .avatar::before { -webkit-mask: radial-gradient(circle, transparent 26px, #000 27px); mask: radial-gradient(circle, transparent 26px, #000 27px); }
  .card { --w: 34px; }
  .seat.mine .seat-cards .card { --w: 40px; }
  .purse-amount { font-size: 34px; }
}
@media (min-height: 760px) {
  .card { --w: 46px; }
  .seat.mine .seat-cards .card { --w: 52px; }
}
/* =========================================================================
   Desktop. Not the phone layout stretched: on a wide screen the club is one
   room you look at whole — the house on the left, the table in the middle,
   the company and the hand history on the right. Nothing is behind a tap.
   ========================================================================= */
.side { display: none; }

@media (min-width: 1100px) {
  :root {
    --r: 18px;
    /* glass over light, not boxes over boxes */
    --panel: rgba(34, 23, 21, 0.62);
    --panel-2: rgba(48, 31, 32, 0.72);
    --line: rgba(201, 164, 92, 0.16);
    --line-strong: rgba(201, 164, 92, 0.34);
    --glass: saturate(1.35) blur(22px);
    --pad: clamp(16px, 1.4vw, 24px);
    --step: clamp(15px, 0.35vw + 13.4px, 17px);
  }

  /* Wide-gamut upgrade where the browser has it; the hex ramp above stays the fallback. */
  @supports (color: oklch(0.5 0.1 20deg)) {
    :root {
      --ground: oklch(0.155 0.016 30deg);
      --text: oklch(0.93 0.018 85deg);
      --muted: oklch(0.71 0.024 55deg);
      --faint: oklch(0.55 0.02 45deg);
      --brass: oklch(0.75 0.09 85deg);
      --brass-hi: oklch(0.86 0.09 88deg);
      --felt: oklch(0.34 0.11 15deg);
      --felt-hi: oklch(0.42 0.13 14deg);
      --ok: oklch(0.79 0.13 150deg);
      --danger: oklch(0.7 0.16 30deg);
    }
  }

  body { font-size: var(--step); }

  #app {
    max-width: min(1840px, 100%);
    padding: 0 clamp(18px, 1.8vw, 34px) clamp(16px, 1.6vw, 26px);
    display: grid;
    grid-template-columns: clamp(324px, 24vw, 400px) minmax(0, 1fr) clamp(324px, 23vw, 400px);
    /* three rows: the bar, the section tabs, then the club itself. The tabs used to
       share row 1 with the bar and covered the wallet button, which made it — and
       everything under it — unclickable. */
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: clamp(14px, 1.3vw, 24px);
    background:
      radial-gradient(70% 46% at 50% -6%, rgba(119, 34, 49, 0.3), transparent 64%),
      radial-gradient(40% 40% at 88% 108%, rgba(201, 164, 92, 0.07), transparent 70%),
      var(--ground);
  }

  .topbar { grid-column: 1 / -1; grid-row: 1; padding-inline: 2px; }
  #lobby { grid-column: 1; grid-row: 3; }
  #table { grid-column: 2; grid-row: 3; }
  /* Правая колонка описывает стол, и в этих разделах она скрыта — но сетка всё равно
     держала под неё место, и раздел обрывался, не доходя до правого края экрана.
     Поэтому здесь раздел занимает все три колонки, а не первые две. */
  #profile, #tournaments, #slots, #rating, #shop { grid-column: 1 / -1; grid-row: 3; overflow-y: auto; padding: var(--pad); }
  .side { grid-column: 3; grid-row: 3; }
  /* on a wide screen the sections are a tab row of their own, not a phone tray */
  .mainnav {
    grid-column: 1 / -1; grid-row: 2;
    display: flex; justify-self: start; align-self: center;
    gap: 4px; margin-bottom: 10px; padding: 0;
    background: none; border: 0; backdrop-filter: none;
  }
  .nav-item { flex-direction: row; grid-auto-flow: column; padding: 8px 14px; font-size: 13.5px; }
  .ni-mark { font-size: 15px; }
  #profile, #tournaments, #slots { display: flex; flex-direction: column; gap: 22px; }
  .wallet-row { grid-template-columns: repeat(2, minmax(0, 260px)); }
  /* читаемая ширина сохраняется, но теперь она стоит по центру раздела, а не жмётся к
     левому краю, раз раздел занимает всю ширину экрана */
  .idcard, .wallet-card, .ref-card { max-width: 860px; margin-inline: auto; width: 100%; }

  /* the three columns read as one surface, lit rather than outlined */
  #lobby, .table-screen, .side, #profile, #tournaments, #slots, #rating, #shop {
    border-radius: var(--r);
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
  }
  #lobby { padding: var(--pad); gap: clamp(18px, 1.6vw, 26px); container-type: inline-size; }
  .side {
    display: flex; flex-direction: column; gap: 14px;
    padding: var(--pad); overflow-y: auto;
    container-type: inline-size;
  }
  #sideBody { display: flex; flex-direction: column; gap: 14px; }

  /* ----- the table itself gets the room ----- */
  .tablebar { padding: 14px 18px 6px; }
  .tb-name { font-size: 21px; }
  .tb-meta { font-size: 13px; }
  .felt-wrap { min-height: 0; margin: 6px clamp(18px, 1.8vw, 34px) 0; }
  .rail { inset: clamp(46px, 6vh, 72px) 7% clamp(72px, 9vh, 104px); }
  .felt { box-shadow: inset 0 0 0 2px rgba(201,164,92,.5), inset 0 0 0 9px rgba(0,0,0,.16), inset 0 14px 44px rgba(0,0,0,.42); }
  .felt-print { font-size: 13px; letter-spacing: .5em; }
  .felt-center { gap: 12px; }
  .pot { font-size: 17px; padding: 5px 16px; }
  .board { gap: 7px; min-height: 84px; }
  .street { font-size: 12px; letter-spacing: .2em; }
  .card { --w: clamp(46px, 3.6vw, 62px); border-radius: 8px; }
  .seat { width: 124px; gap: 5px; }
  .seat.mine { width: 190px; }
  .seat-cards .card { --w: clamp(30px, 2.2vw, 38px); }
  .seat.show .seat-cards .card { --w: clamp(36px, 2.6vw, 44px); }
  .seat.mine .seat-cards .card { --w: clamp(54px, 4.2vw, 72px); }
  .avatar { width: 62px; height: 62px; font-size: 19px; }
  .seat.acting .avatar::before { inset: -6px; -webkit-mask: radial-gradient(circle, transparent 36px, #000 37px); mask: radial-gradient(circle, transparent 36px, #000 37px); }
  .seat-plate { min-width: 96px; padding: 4px 10px 5px; border-radius: 11px; }
  .seat-name { font-size: 13px; }
  .seat-stack { font-size: 14px; }
  .seat-tag { font-size: 11.5px; padding: 2px 9px; }
  .dealer { width: 24px; height: 24px; font-size: 11px; }
  .bet { font-size: 13.5px; padding: 3px 10px 3px 4px; }
  .sit-here { width: 62px; height: 62px; font-size: 26px; }
  .banner { padding: 14px 24px; border-radius: 18px; }
  .banner b { font-size: 23px; }

  /* ----- action bar: a desk, not a phone tray ----- */
  .actions {
    padding: 14px clamp(18px, 1.8vw, 34px) 18px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.22));
    min-height: 92px;
  }
  .act-row { grid-template-columns: 1fr 1.3fr 1.3fr; gap: 12px; max-width: 760px; margin-inline: auto; }
  .act-row .btn { padding: 17px 10px; font-size: 16.5px; }
  .act-status { font-size: 15px; }
  .raise-panel { max-width: 760px; margin-inline: auto; width: 100%; }
  .presets .btn { padding: 10px 6px; font-size: 13.5px; }

  /* mouse affordances the phone never needed */
  .btn { transition: transform .12s ease, filter .18s ease, box-shadow .18s ease; }
  .btn:hover:not(:disabled) { filter: brightness(1.08); }
  .btn-ghost:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--brass); }
  .table-row { border-radius: 12px; padding-inline: 10px; transition: background .16s ease; }
  .table-row:hover { background: rgba(201, 164, 92, 0.07); }
  .table-row.open { background: rgba(201, 164, 92, 0.1); box-shadow: inset 2px 0 0 var(--brass); }
  .table-row.open .tr-name { color: var(--brass-hi); }
  .icon-btn:hover { box-shadow: inset 0 0 0 1px var(--brass); color: var(--brass-hi); }
  .seat.empty .sit-here:hover { border-style: solid; border-color: var(--brass); color: var(--brass-hi); }

  /* ----- right rail ----- */
  .side h4 {
    margin: 0 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
  }
  .side-card { border-radius: 14px; background: rgba(0, 0, 0, 0.2); padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
  .side-empty { color: var(--faint); font-size: 13.5px; margin: 0; }
  .roster { display: grid; gap: 2px; }
  .roster-row {
    display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
    padding: 7px 8px; border-radius: 10px; font-size: 14px;
  }
  .roster-row.acting { background: rgba(201, 164, 92, 0.12); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .roster-row.folded { opacity: .45; }
  .roster-row.mine .rr-name { color: var(--brass-hi); font-weight: 600; }
  .rr-badge {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; font-weight: 700; background: var(--panel-2); color: var(--muted);
  }
  .rr-badge.human { background: var(--ivory); color: var(--card-black); }
  .rr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rr-stack { font-family: var(--mono); font-weight: 700; color: var(--brass-hi); font-size: 13.5px; }
  .rr-sub { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); }
  .side .log { max-height: 34vh; overflow-y: auto; font-size: 13.5px; }
  .side .log li { padding: 6px 0; }
  .side .leaders { font-size: 13.5px; }
  .side .leader { padding: 7px 0; }
  .keys { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
  .keys div { display: flex; align-items: center; gap: 8px; }
  kbd {
    font-family: var(--mono); font-size: 11px; font-weight: 700;
    min-width: 22px; padding: 2px 6px; text-align: center;
    border-radius: 6px; color: var(--text);
    background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 0 rgba(0,0,0,.5);
  }

  /* the centre column when no table is open yet */
  .table-idle {
    flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px;
    text-align: center; padding: 40px;
  }
  .table-idle .mark { font-size: 68px; color: var(--brass); opacity: .5; line-height: 1; }
  .table-idle h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2vw, 32px); }
  .table-idle p { margin: 0; color: var(--muted); max-width: 44ch; }

  /* sheets become dialogs in the middle of the screen */
  .sheet {
    left: 50%; top: 50%; bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 560px; max-height: 84vh;
    border-radius: var(--r);
    /* the rails are glass; a dialog has to be solid or the text swims */
    background: #1e1513;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), inset 0 0 0 1px var(--line-strong);
    padding: 20px 24px 24px;
    animation: dialog-in .58s cubic-bezier(.2, .8, .3, 1) both;
  }
  .sheet .grab { display: none; }
  @keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
  .scrim { backdrop-filter: blur(3px); }
  .toast { top: auto; bottom: 28px; }
}

/* =========================================================================
   Table: timer, emotes, pre-actions, stepper
   ========================================================================= */
.turn-timer {
  --p: 1;
  position: relative; height: 26px; border-radius: 999px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.turn-timer i {
  position: absolute; inset: 0; transform-origin: left center;
  transform: scaleX(var(--p));
  background: linear-gradient(90deg, rgba(201,164,92,.28), rgba(227,196,127,.5));
  transition: transform .25s linear;
}
.turn-timer b { position: relative; font-size: 12.5px; font-weight: 700; color: var(--brass-hi); letter-spacing: .04em; }
.turn-timer.urgent i { background: linear-gradient(90deg, rgba(224,99,77,.35), rgba(224,99,77,.6)); }
.turn-timer.urgent b { color: #ffd9d2; }

   Слоты и прочие быстрые розыгрыши

.meta-link {
  border: 0; background: transparent; padding: 0 0 0 8px;
  color: var(--brass); font-size: 12px; text-decoration: underline; text-underline-offset: 2px;
}
.meta-link:hover { color: var(--brass-hi); }

/* multi-tabling strip */
.tabs-strip {
  display: flex; gap: 8px; padding: 0 16px 6px; flex: none;
  overflow-x: auto; scrollbar-width: none;
}
.tabs-strip::-webkit-scrollbar { display: none; }
.tab-chip {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 13px; border: 0; border-radius: 999px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.tab-chip small { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.tab-chip.on { color: var(--text); box-shadow: inset 0 0 0 1px var(--brass); background: rgba(201,164,92,.1); }
.tab-chip.on small { color: var(--brass-hi); }
.tab-chip.turn { box-shadow: inset 0 0 0 1px var(--brass-hi); color: var(--brass-hi); }
.turn-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--brass-hi);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

.result-line {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  animation: pop .8s cubic-bezier(.2,.9,.3,1.2) both;
}
.result-line b { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--text); }
.result-line span { font-size: 13px; color: var(--muted); }
.result-line.win { box-shadow: inset 0 0 0 1px var(--brass); background: rgba(201,164,92,.12); }
.result-line.win b { color: var(--brass-hi); }

.turn-row { display: flex; align-items: center; gap: 8px; }
.turn-row .turn-timer { flex: 1; }
.bank-btn { flex: none; display: grid; justify-items: center; gap: 0; line-height: 1.1; padding: 5px 10px; }
.bank-btn small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.seat.away { opacity: .5; }
.seat.away .seat-plate { box-shadow: inset 0 0 0 1px var(--line-strong); }
.seat.away .seat-name::after { content: ' · отошёл'; color: var(--faint); font-size: 11px; }

.prebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prebar-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.prebar .btn.on { box-shadow: inset 0 0 0 2px var(--brass); color: var(--brass-hi); background: rgba(201,164,92,.1); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .num { font-size: 22px; font-weight: 700; color: var(--brass-hi); min-width: 5ch; text-align: center; }
.step {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.step:active { transform: scale(.94); }
.step:disabled { opacity: .35; }


/* An emote is the only thing a player can say here, so it is big and it moves:
   it rises, bounces in, keeps a small idle motion, then fades on its own. */
.emote-bubble {
  position: absolute; top: -52px; left: 50%;
  font-size: 40px; z-index: 6; pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55));
  animation: emote-in 1.05s cubic-bezier(.2,.9,.25,1.5) both,
             emote-idle 2.4s ease-in-out 1.05s 2,
             emote-out 1.2s ease 7.4s both;
}
@keyframes emote-in {
  from { opacity: 0; transform: translate(-50%, 26px) scale(.3) rotate(-18deg); }
  70%  { opacity: 1; transform: translate(-50%, -6px) scale(1.22) rotate(6deg); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(0); }
}
@keyframes emote-idle {
  0%, 100% { transform: translate(-50%, 0) scale(1) rotate(0); }
  35%      { transform: translate(-50%, -7px) scale(1.09) rotate(-7deg); }
  70%      { transform: translate(-50%, -2px) scale(1.03) rotate(5deg); }
}
@keyframes emote-out {
  to { opacity: 0; transform: translate(-50%, -30px) scale(.7); }
}

/* ---------- ported from Royal Flush Club 1.0: emotes, artifacts, gifts ---------- */

/* the emote blooms beside the player rather than sitting on top of them */
.emote-bubble {
  position: absolute; top: -58px; left: 50%;
  z-index: 8; pointer-events: none;
  display: grid; place-items: center;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.5));
}
.emote-bubble svg { width: 58px; height: 58px; }

/* an artifact stands on the felt next to its owner */

/* a present in flight, its trail, and the burst where it lands */
.gift-fly {
  position: absolute; left: 0; top: 0; z-index: 30;
  pointer-events: none; will-change: transform;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.55));
}
.gift-spark {
  position: absolute; z-index: 29; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 30%, #f2c14e 45%, transparent 70%);
  animation: spark-fade 1.1s ease-out both;
}
@keyframes spark-fade { from { transform: scale(1.4); opacity: 1; } to { transform: scale(.2) translateY(10px); opacity: 0; } }
.gift-burst { position: absolute; z-index: 29; width: 0; height: 0; pointer-events: none; }
.gift-burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #ffe7a0; box-shadow: 0 0 8px #f2c14e;
  transform: rotate(var(--a)) translateY(0);
  animation: burst 1.3s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes burst { to { transform: rotate(var(--a)) translateY(-52px) scale(.3); opacity: 0; } }

/* frames a player bought, worn by the name plate */
.seat-plate.frame-platinum { border: 1.5px solid #cfd6e4; box-shadow: 0 0 10px rgba(207,214,228,.45), inset 0 0 0 1px rgba(255,255,255,.18); }
.seat-plate.frame-fire {
  border: 1.5px solid #e08a3c;
  box-shadow: 0 0 12px rgba(224,138,60,.5);
  animation: frame-flicker 2.6s ease-in-out infinite;
}
@keyframes frame-flicker { 50% { box-shadow: 0 0 18px rgba(240,170,80,.75); border-color: #f5b25c; } }

/* the avatar is a drawing now, not two letters */
.avatar svg { width: 100%; height: 100%; border-radius: 50%; display: block; }

/* prizes */
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; left: 50%; top: 46%;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--brass);
  animation: burst var(--d, 1.2s) cubic-bezier(.15,.7,.4,1) var(--delay, 0s) both;
}
.confetti i.gold { background: var(--ivory); border-radius: 50%; width: 10px; height: 10px; }
@keyframes burst {
  from { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
  to { opacity: 0; transform: translate(var(--x), 62vh) rotate(var(--r)) scale(.7); }
}

/* tiers in the lobby */
.tier-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.tier-low .tier-dot { background: rgba(227,196,127,.45); }
.tier-mid .tier-dot { background: rgba(227,196,127,.75); }
.tier-high .tier-dot { background: var(--brass); }
.tier-vip .tier-dot { background: var(--brass-hi); box-shadow: 0 0 8px rgba(227,196,127,.8); }
.tr-lock.here { color: var(--ivory); border-color: var(--ivory); }
.tr-lock.low { color: var(--faint); border-color: var(--faint); }

/* =========================================================================
   Profile, wallet, invites
   ========================================================================= */
#profile { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 22px; }
.idcard { display: grid; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--panel); }
.idcard-top { display: flex; align-items: center; gap: 14px; }
.idcard-top h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; }
.idcard-sub { font-size: 13px; color: var(--muted); }
.ava-lg {
  width: 62px; height: 62px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--panel-2); display: grid; place-items: center;
  font-weight: 700; font-size: 21px; color: var(--brass-hi);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.idrows { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.idrows dt { color: var(--muted); }
.idrows dd { margin: 0; text-align: right; }
.idrows dd.num { font-family: var(--mono); font-weight: 600; }

.wallet-card, .ref-card { display: grid; gap: 14px; }
.wallet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-big { padding: 18px 14px; border-radius: 16px; font-size: 16px; }
.btn-big span { display: grid; justify-items: center; gap: 3px; }
.btn-big small { font-size: 12px; font-weight: 400; opacity: .75; }

.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.pack {
  position: relative; border: 0; border-radius: 14px; padding: 14px 10px 12px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; justify-items: center; gap: 2px;
}
.pack:active { transform: scale(.97); }
.pack.best { box-shadow: inset 0 0 0 2px var(--brass); }
.pack-flag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: var(--brass); color: var(--brass-ink); border-radius: 999px; padding: 2px 8px;
  white-space: nowrap;
}
.pack-chips { font-size: 17px; font-weight: 700; color: var(--brass-hi); }
.pack-label { font-size: 12px; color: var(--muted); }
.pack-price { font-family: var(--mono); font-size: 13.5px; font-weight: 700; margin-top: 4px; }

.ref-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ref-stats > div { padding: 12px 14px; border-radius: 13px; background: var(--panel); display: grid; gap: 2px; }
.ref-stats .num { font-size: 24px; font-weight: 700; font-family: var(--mono); color: var(--brass-hi); }
.ref-stats small { font-size: 12px; color: var(--muted); }
.ref-link { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ref-link code {
  flex: 1; min-width: 180px; font-family: var(--mono); font-size: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line); word-break: break-all;
}
.ref-list { display: grid; }
.ref-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ref-row:last-child { border-bottom: 0; }
.ref-row .dim { color: var(--faint); font-size: 13px; }

.fld-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 14px; color: var(--muted); }
.fld-row > span { grid-column: 1 / -1; }
.name-input {
  border: 0; border-radius: 10px; padding: 10px 12px; font-size: 15px;
  color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  min-width: 0;
}

/* status, experience and the shop */
.lvl-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.lvl-badge {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--brass-ink); background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
.lvl-bar { height: 6px; border-radius: 3px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-hi)); }
.lvl-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

#shop { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 20px; }
.shop-head { display: grid; gap: 8px; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.art-grid.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.art-card {
  display: grid; justify-items: center; gap: 4px;
  padding: 11px 7px 10px; border: 0; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text); text-align: center;
  transition: box-shadow .15s ease, transform .1s ease;
}
.art-card:active { transform: scale(.97); }
.art-card:disabled { opacity: .4; }
.art-card.on, .art-card.owned { box-shadow: inset 0 0 0 2px var(--brass); background: rgba(201,164,92,.1); }
.art-card b { font-weight: 600; font-size: 12.5px; line-height: 1.2; }
.art-card .art-price { font-family: var(--mono); font-size: 12px; color: var(--brass-hi); }
.art-card .art-note { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.art-fig { display: grid; place-items: center; height: 54px; }

/* hand history and preferences */
.prefs, .hist-card { display: grid; gap: 10px; }
.hist { display: grid; }
.hist-row {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center;
  border: 0; background: transparent; text-align: left;
  padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text);
}
.hist-row:last-child { border-bottom: 0; }
.hist-row:hover { background: rgba(201,164,92,.06); }
.hist-when { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.hist-cards { display: flex; gap: 2px; }
.hist-cards .card { --w: 20px; border-radius: 3px; }
.hist-cards .card .r { font-size: 10px; }
.hist-cards .card .s { font-size: 9px; }
.hist-table { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-net { font-weight: 700; color: var(--faint); }
.hist-row.up .hist-net { color: var(--ok); }
.hist-row.down .hist-net { color: var(--danger); }
.hist-h { margin: 16px 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cards-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cards-row .card { --w: 30px; }
.hist-opps { display: grid; gap: 8px; }
.hist-opp { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hist-opp .dim { color: var(--faint); font-size: 12px; }

/* the wallet in the top bar is a way into the profile now */
.wallet { border: 0; background: transparent; padding: 4px 2px; border-radius: 10px; }
.wallet:active { transform: scale(.96); }

/* =========================================================================
   Main navigation, halls, tournaments, slots
   ========================================================================= */
.mainnav {
  flex: none; display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 12, 11, .92);
  border-top: 1px solid var(--line);
  backdrop-filter: saturate(1.3) blur(14px);
}
.nav-item {
  border: 0; background: transparent; color: var(--faint);
  display: grid; justify-items: center; gap: 2px;
  padding: 7px 2px; border-radius: 12px;
  font-size: 10px; letter-spacing: 0;
  transition: color .16s ease, background .16s ease;
}
.ni-mark { font-size: 19px; line-height: 1; }
.nav-item.on { color: var(--brass-hi); background: rgba(201, 164, 92, .1); }
.nav-item:active { transform: scale(.94); }

/* halls: every hall laid out at once, each table with its own way in */
.rooms-section { display: grid; gap: 10px; }
.section-lede { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.hall-chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hall-chips::-webkit-scrollbar { display: none; }
.hall-chip {
  flex: none; border: 0; border-radius: 999px; padding: 7px 14px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: color .16s ease, box-shadow .16s ease, background .16s ease;
}
.hall-chip.on { color: var(--ink-on-brass, #23160f); background: var(--brass); box-shadow: none; }


.hall-block {
  position: relative; overflow: hidden;
  border-radius: 15px; padding: 14px 14px 6px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; gap: 8px;
}
.hall-block::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--hall-ink, var(--faint));
}
.hall-block.tier-low { --hall-ink: rgba(227,196,127,.55); }
.hall-block.tier-mid { --hall-ink: var(--brass); }
.hall-block.tier-vip { --hall-ink: var(--brass-hi); }
.hall-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hall-id { display: grid; gap: 2px; min-width: 0; }
.hall-id h4 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--hall-ink); }
.hall-blinds { font-size: 13px; color: var(--muted); font-weight: 600; }
.hall-count { text-align: right; font-size: 11px; color: var(--muted); line-height: 1.25; flex: none; }
.hall-count b { display: block; font-family: var(--mono); font-size: 20px; color: var(--faint); }
.hall-count b.live { color: var(--ok, #7fbf8a); }
.hall-about { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.hall-locked {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border-radius: 11px; background: rgba(227,196,127,.09);
  box-shadow: inset 0 0 0 1px rgba(227,196,127,.25); font-size: 12.5px; color: var(--brass-hi);
}
.tables.in-hall { border-radius: 0; background: none; padding: 0; }

/* tournaments */
.hero-slide {
  position: relative; overflow: hidden;
  border-radius: var(--r); padding: 22px 20px 20px;
  background: linear-gradient(160deg, rgba(119, 34, 49, .5), var(--panel) 62%);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  display: grid; gap: 8px;
}
.hero-glow {
  position: absolute; inset: -60% -20% auto auto; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(227, 196, 127, .3), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-40px, 30px) scale(1.15); } }
.hero-slide h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 6vw, 34px); }
.hero-slide p { margin: 0; color: var(--muted); font-size: 14px; }
.hero-meta { font-size: 13.5px; color: var(--muted); }
.hero-meta b { color: var(--brass-hi); }
.countdown { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.cd-label { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cd-time { font-size: clamp(20px, 5vw, 26px); font-weight: 700; color: var(--brass-hi); }
.hero-state { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }

.soon-card { position: relative; border-radius: var(--r); padding: 18px; background: var(--panel); display: grid; gap: 6px; }
.soon-badge {
  justify-self: start; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass-ink); background: var(--brass); border-radius: 999px; padding: 3px 10px;
}
.soon-card h3 { margin: 4px 0 0; font-family: var(--display); font-weight: 400; font-size: 20px; }
.soon-card p { margin: 0; color: var(--muted); font-size: 14px; max-width: 62ch; }

.rules { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.rules dt { color: var(--muted); }
.rules dd { margin: 0; text-align: right; }
.levels { display: grid; gap: 1px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.2); }
.level-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 8px 12px; font-size: 13.5px; align-items: baseline; }
.level-row:nth-child(odd) { background: rgba(255,255,255,.02); }
.level-row.before-break { box-shadow: inset 0 -2px 0 var(--brass); }
.lv-no { color: var(--faint); }
.lv-blinds { font-weight: 700; color: var(--brass-hi); }
.lv-ante { font-size: 12.5px; color: var(--muted); }
.tourn-list { display: grid; }
.tourn-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tourn-row:last-child { border-bottom: 0; }
.tr-when { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-buy { font-weight: 700; color: var(--brass-hi); }
.tr-state { font-size: 11.5px; color: var(--muted); }
.tr-state.registering, .tr-state.late { color: var(--ok); }

/* slots */
#slots, #tournaments { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 20px; }
.slot-stage { display: grid; gap: 16px; justify-items: center; }
.slot-cab {
  width: 100%; max-width: 460px;
  border-radius: 22px; padding: 18px;
  background: linear-gradient(170deg, #2c1b19, #170f0e);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 24px 50px -24px #000;
  display: grid; gap: 14px; justify-items: center;
}
.slot-top { display: grid; justify-items: center; gap: 2px; }
.slot-name { font-family: var(--display); font-size: 26px; color: var(--brass-hi); letter-spacing: .04em; }
.slot-sub { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.slot-window {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%;
  padding: 10px; border-radius: 16px;
  background: #0d0908; box-shadow: inset 0 0 0 2px var(--brass), inset 0 6px 20px rgba(0,0,0,.8);
}
.slot-reel {
  height: 92px; overflow: hidden; border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 22%, transparent 78%, rgba(0,0,0,.55));
}
.slot-strip { display: grid; }
.slot-strip i { height: 92px; display: grid; place-items: center; font-size: 46px; font-style: normal; }
.slot-result { min-height: 30px; font-size: 16px; color: var(--muted); }
.slot-result.win { color: var(--brass-hi); }
.slot-result b { font-family: var(--mono); font-size: 24px; }
.slot-bets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.slot-bets .btn.on { box-shadow: inset 0 0 0 2px var(--brass); color: var(--brass-hi); }
.slot-go { width: 100%; }
.paytable { width: 100%; max-width: 460px; font-size: 13.5px; color: var(--muted); }
.paytable summary { cursor: pointer; padding: 8px 0; color: var(--brass); }
.pay-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 14px; margin: 6px 0 10px; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; }
.pay-sym { font-size: 15px; }

/* focus that survives a keyboard-only session */
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 4px; }

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

/* ---------- age gate ----------
   Covers everything, because a question you can play around is not a gate. */
.agegate {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 24px; background: rgba(10, 6, 6, 0.93); backdrop-filter: blur(10px);
  animation: gate-in .4s ease both;
}
@keyframes gate-in { from { opacity: 0; } }
.agegate .gate-card {
  width: min(420px, 100%); text-align: center;
  background: linear-gradient(180deg, rgba(48, 30, 28, .95), rgba(26, 17, 16, .95));
  border-radius: 22px; box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .28), 0 30px 60px -30px #000;
  padding: 30px 24px 24px;
  animation: gate-rise .5s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes gate-rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.agegate h2 { font-family: var(--display, Georgia, serif); font-weight: 400; font-size: 25px; margin: 12px 0 8px; }
.agegate p { font-size: 14px; line-height: 1.55; color: var(--muted, #a8958a); margin: 0 0 16px; }
.agegate .stack { display: grid; gap: 9px; }
.agegate .fineprint { margin: 14px 0 0; font-size: 12px; }

/* ---------- self-control ---------- */
.lim-today {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 12px;
  font-size: 12.5px; color: var(--muted, #a8958a);
}
.pauses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pause-btn {
  display: grid; gap: 2px; padding: 11px 6px; border: 0; border-radius: 13px;
  background: rgba(201, 164, 92, .08); color: inherit; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .2);
  transition: box-shadow .16s ease, background .16s ease;
}
.pause-btn:hover { background: rgba(201, 164, 92, .14); box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .42); }
.pause-btn b { font-size: 14px; font-weight: 600; }
.pause-btn small { font-size: 11.5px; color: var(--muted, #a8958a); }
.pause-on {
  padding: 14px 16px; border-radius: 14px; text-align: center;
  background: rgba(207, 68, 54, .12); box-shadow: inset 0 0 0 1px rgba(207, 68, 54, .35);
}
.pause-on b { display: block; font-size: 14.5px; margin-bottom: 4px; }

/* ---------- settings rows ----------
   One list, one switch per row: a preference is never its own menu. */
.settings { display: grid; margin-top: 4px; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left; background: none; border: 0; color: inherit;
  border-bottom: 1px solid var(--line); padding: 13px 0; min-height: 56px; cursor: pointer;
}
.setting:last-child { border-bottom: 0; }
.setting-text { display: grid; gap: 2px; }
.setting-text b { font-weight: 600; font-size: 15px; }
.setting-text > span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.suit-row { display: flex; gap: 6px; margin-top: 4px; }
.suit-dot { width: 24px; height: 24px; border-radius: 6px; background: var(--ivory); color: #17110f; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.suit-dot.red { color: var(--card-red); }
.setting .switch {
  width: 46px; height: 28px; border-radius: 999px; background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-strong); position: relative; flex: none;
  transition: background .2s ease; display: block; padding: 0;
}
.setting .switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s cubic-bezier(.3,.7,.3,1), background .2s ease; }
.setting .switch.on { background: var(--brass); box-shadow: none; }
.setting .switch.on i { transform: translateX(18px); background: var(--brass-ink, #2a1d0c); }

/* four-colour deck: ♦ blue, ♣ green — applies everywhere a card is drawn */
:root { --suit-diamond: #2f6fd6; --suit-club: #238a55; }
.four-color .card.s-d, .four-color .suit-dot.s-d { color: var(--suit-diamond); }
.four-color .card.s-c, .four-color .suit-dot.s-c { color: var(--suit-club); }
/* a little more card for smaller eyes and smaller screens */
.big-cards .board .card, .big-cards .seat.mine .seat-cards .card { transform: scale(1.14); }
.big-cards .board { gap: 9px; }

/* ---------- onboarding: three screens, shown once ---------- */
.onboarding {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(90% 55% at 50% 0%, rgba(119, 34, 49, .55), transparent 70%), var(--ground, #100b0a);
  display: flex; flex-direction: column; overflow: hidden;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  animation: onb-fade .25s ease both;
}
@keyframes onb-fade { from { opacity: 0; } }
.onb-track { flex: 1; display: flex; transition: transform .38s cubic-bezier(.3, .7, .2, 1); touch-action: pan-y; min-height: 0; }
.onb-slide {
  flex: 0 0 100%; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 28px; text-align: center; max-width: 100%;
}
.onb-slide h2 { margin: 10px 0 0; font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.15; text-wrap: balance; max-width: 16ch; }
.onb-slide p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; max-width: 34ch; }
.onb-art { height: 190px; display: grid; place-items: center; }
.onb-hello { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.onb-invite { display: flex; align-items: center; max-width: 100%; }
.onb-ava { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 2px var(--line-strong), 0 6px 14px rgba(0, 0, 0, .4); flex: none; }
.onb-ava.host { background: var(--ivory); color: #17110f; box-shadow: 0 0 0 2px var(--brass); }
.onb-line { width: 18px; height: 2px; background: repeating-linear-gradient(90deg, var(--brass) 0 4px, transparent 4px 7px); flex: none; }
.onb-link { font-size: 12.5px; font-weight: 600; color: var(--brass-ink, #2a1d0c); background: var(--brass); padding: 7px 10px; border-radius: 999px; white-space: nowrap; animation: onb-pulse 1.8s ease-in-out infinite; }
.onb-friends { display: flex; }
.onb-friends .onb-ava { width: 38px; height: 38px; margin-left: -8px; font-size: 12.5px; }
.onb-friends .onb-ava:first-child { margin-left: 0; }
@keyframes onb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.onb-hint { position: relative; }
.onb-cards { display: flex; gap: 6px; transform: rotate(-4deg); }
.onb-cards .card { box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.onb-cards .card:last-child { transform: rotate(8deg) translateY(4px); }
.onb-pill { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(18, 12, 11, .92); color: var(--brass-hi); border: 1px solid var(--brass); font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.onb-bottom { padding: 12px 16px 18px; display: grid; gap: 14px; }
.onb-dots { display: flex; justify-content: center; gap: 7px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line-strong); transition: width .25s ease, background .25s ease; }
.onb-dots i.on { width: 22px; background: var(--brass); }
.onb-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; max-width: 480px; width: 100%; margin: 0 auto; }
@media (max-height: 640px) { .onb-art { height: 140px; } .onb-hello svg { width: 100px; height: 100px; } .onb-slide h2 { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) {
  .onb-track { transition: none; }
  .onb-link { animation: none; }
  .onboarding, .agegate, .agegate .gate-card { animation: none; }
}

/* ---------- chip leader: the blood frame and the announcement ----------
   Not for sale in the shop: it belongs to whoever is ahead of everyone, for as long
   as they stay ahead. A tie has no leader, so the frame is never on two plates. */
.seat-plate.blood {
  position: relative;
  border: 1.5px solid #b3001b;
  background: linear-gradient(180deg, rgba(58, 0, 8, .95), rgba(24, 0, 4, .95));
  animation: blood-pulse 1.3s ease-in-out infinite;
}
.seat-plate.blood .seat-name { color: #ffd6da; font-weight: 700; text-shadow: 0 0 6px rgba(255, 30, 60, .6); }
.seat-plate.blood .seat-stack { color: #ff5c6e; }
@keyframes blood-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(179, 0, 27, .55), inset 0 0 6px rgba(224, 0, 31, .3); }
  50% { box-shadow: 0 0 18px rgba(224, 0, 31, .9), 0 0 32px rgba(179, 0, 27, .4), inset 0 0 10px rgba(224, 0, 31, .45); }
}

.cl-overlay {
  position: fixed; inset: 0; z-index: 88; pointer-events: none;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(120, 0, 15, .55) 0%, rgba(40, 0, 5, .88) 70%, rgba(10, 0, 2, .95) 100%);
  animation: cl-in .45s ease-out both;
}
.cl-overlay.out { animation: cl-out .6s ease-in both; }
.cl-drips { position: absolute; inset: 0 0 auto 0; height: 0; }
.cl-drips i {
  position: absolute; top: 0; width: 10px; height: var(--h); border-radius: 0 0 10px 10px;
  background: linear-gradient(#5a0009, #c4001d 70%, #ff1a3a);
  transform-origin: 50% 0; animation: cl-drip 1.6s cubic-bezier(.5, 0, .6, 1) var(--d) both;
}
.cl-drips i::after { content: ''; position: absolute; left: -2px; bottom: -6px; width: 14px; height: 14px; border-radius: 50%; background: #c4001d; }
.cl-card { position: relative; text-align: center; padding: 0 16px; animation: cl-slam .7s cubic-bezier(.2, 1.6, .4, 1) .1s both; }
.cl-title {
  font-family: var(--display); font-size: clamp(30px, 10.5vw, 72px); line-height: 1; letter-spacing: .02em; white-space: nowrap;
  color: #fff; text-shadow: 0 0 18px rgba(255, 0, 40, .9), 0 0 42px rgba(200, 0, 30, .7), 0 4px 0 #6d000f;
  animation: cl-throb 1s ease-in-out .8s infinite;
}
.cl-name { margin-top: 16px; font: 800 clamp(22px, 7vw, 34px)/1.15 var(--ui); color: #ffd6da; overflow-wrap: anywhere; }
@keyframes cl-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cl-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes cl-drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes cl-slam { 0% { transform: scale(2.4); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: scale(1); opacity: 1; } }
@keyframes cl-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.cl-rain { position: absolute; inset: 0; overflow: hidden; }
.cl-rain b {
  position: absolute; top: -12px; width: 7px; height: 10px;
  background: radial-gradient(circle at 40% 65%, #ff3a55 0 25%, #c4001d 55%, #7a0010 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%;
  box-shadow: 0 0 6px rgba(255, 20, 50, .5);
  animation: cl-fall var(--t) cubic-bezier(.5, 0, .9, .6) var(--d) infinite;
}
@keyframes cl-fall { 0% { transform: translateY(0) scaleY(.8); opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(105vh) scaleY(1.25); opacity: 0; } }
.cl-title .cl-drop-letter { position: relative; display: inline-block; }
.cl-title .cl-drop-letter::after {
  content: ''; position: absolute; left: 50%; top: 88%; width: 5px; height: 7px; margin-left: -2.5px;
  background: #d0001f; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: cl-letter-drip 1.8s cubic-bezier(.6, 0, .9, .5) var(--d) infinite;
}
@keyframes cl-letter-drip { 0% { transform: translateY(0) scale(.2); opacity: 0; } 20% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(120px) scale(1, 1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .seat-plate.blood, .cl-title, .cl-card, .cl-drips i, .cl-rain b, .cl-title .cl-drop-letter::after { animation: none !important; }
  .cl-rain b, .cl-title .cl-drop-letter::after { display: none; }
}

/* ---------- Sit & Go: the tournament that starts when the seats fill ---------- */
.sg-card { display: grid; gap: 10px; }
.sg-live { display: grid; gap: 8px; }
.sg-live-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; border: 0; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; color: inherit;
  background: rgba(61, 157, 104, .14); box-shadow: inset 0 0 0 1px rgba(61, 157, 104, .45);
}
.sg-live-row b { display: block; font-size: 14.5px; font-weight: 600; }
.sg-live-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.sg-go { font-size: 13px; font-weight: 600; color: #8fd7ab; white-space: nowrap; }
.sg-list { display: grid; gap: 10px; }
.sg-row {
  display: grid; gap: 7px; padding: 14px 15px 12px; border-radius: 16px; position: relative; overflow: hidden;
  background: var(--panel, rgba(32, 22, 21, .72)); box-shadow: inset 0 0 0 1px var(--line);
}
.sg-row.on { box-shadow: inset 0 0 0 1.5px var(--brass); background: rgba(201, 164, 92, .1); }
.sg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sg-head b { font-size: 16px; font-weight: 600; }
.sg-buy { font-size: 14px; color: var(--brass-hi); white-space: nowrap; }
.sg-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.sg-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.sg-meta b { color: var(--text); font-weight: 600; }
.sg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.sg-seats { font-size: 12.5px; color: var(--muted); }
.sg-bar { height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.sg-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-hi)); transition: width .4s cubic-bezier(.3, .7, .3, 1); }

/* ---------- NFT showcase ----------
   Collectibles the player already owns in Telegram. Ported from the 1.0 sources; the
   card is a gradient the gift's own backdrop colours drive, so every one looks different. */
.settings-title { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.muted { color: var(--muted); font-weight: 400; }
.nft-note { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.nft-rail { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.nft-rail::-webkit-scrollbar { display: none; }
.nft {
  position: relative; flex: none; width: var(--ns); scroll-snap-align: start;
  display: grid; grid-template-rows: 1fr auto; gap: 2px; padding: 0; border: 0; cursor: pointer;
  border-radius: 14px; overflow: hidden; color: var(--ct, #fff);
  background: radial-gradient(circle at 50% 38%, var(--c1), var(--c2) 78%);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.nft::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 48%, transparent 60%); background-size: 250% 100%; animation: nft-sheen 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes nft-sheen { 0%, 60% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.nft-art { display: grid; place-items: center; padding: 12% 12% 0; }
.nft-art img, .nft-art svg { width: 100%; height: auto; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.nft-cap { display: grid; padding: 4px 8px 8px; text-align: left; }
.nft-cap b { font-size: calc(var(--ns) * .105); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nft-cap span { font: 700 calc(var(--ns) * .09) var(--mono); opacity: .75; }
.nft-rare { position: absolute; top: 7px; right: 7px; font: 700 10px var(--mono); padding: 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; }
.nft.pinned { outline: 2px solid var(--brass-hi); outline-offset: -2px; }
.nft-pin { position: absolute; top: 7px; left: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--brass-hi) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 7 11l5-6' fill='none' stroke='%232a1d0c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.nft-hero { display: grid; place-items: center; padding: 4px 0 12px; }
.nft-hero .nft { cursor: default; }
.nft-traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-bottom: 14px; }
.nft-traits span { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--line); }
.nft-traits small { font-size: 11px; color: var(--muted); }
.nft-traits b { font-size: 13.5px; }
.nft-traits i { font-style: normal; font: 700 11px var(--mono); color: var(--brass-hi); }
.nft-mini { display: grid; place-items: center; width: var(--ns); height: var(--ns); border-radius: 9px; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--c1), var(--c2) 80%); border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.nft-mini img, .nft-mini svg { width: 82%; height: 82%; object-fit: contain; }

/* results table, shared by tournament summaries */
.table-scroll { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 6px 8px 8px 0; box-shadow: inset 0 -1px 0 var(--line-strong); }
.ledger td { padding: 9px 8px 9px 0; box-shadow: inset 0 -1px 0 var(--line); white-space: nowrap; }
.ledger th:not(:first-child), .ledger td:not(:first-child) { text-align: right; }
.t-results tr.champ td { color: var(--brass-hi); }
.ko-ico { vertical-align: -1px; }
@media (prefers-reduced-motion: reduce) { .nft::after { animation: none; } }

/* ---------- login form (ACCOUNTS=1 only) ---------- */
.auth-form { display: grid; gap: 9px; margin-bottom: 14px; text-align: left; }
.auth-err {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 11px; font-size: 13px;
  background: rgba(207, 68, 54, .14); color: #f0a094; box-shadow: inset 0 0 0 1px rgba(207, 68, 54, .4);
}
.cap-box { display: grid; gap: 8px; justify-items: stretch; }
.cap-box svg { width: 100%; height: auto; border-radius: 10px; background: #f5eedf; }

/* ---------- splash ----------
   Drawn from the brand pack: the club opens on its own mark, not on an empty lobby.
   It paints before any script runs, so the first frame is already Broadway Royal. */
.splash {
  position: fixed; inset: 0; z-index: 95;
  display: grid; align-content: center; justify-items: center; gap: 26px;
  padding: 32px;
  background:
    radial-gradient(120% 70% at 50% 18%, #5d1e34 0%, #3a1220 46%, #1a0a10 100%);
  transition: opacity .55s ease, visibility .55s ease;
}
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-bar {
  display: block; width: min(210px, 56vw); height: 2px; border-radius: 2px;
  background: rgba(201, 164, 92, .2); overflow: hidden;
}
.splash-bar i {
  display: block; height: 100%; width: 38%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-hi), var(--brass));
  animation: splash-run 1.5s cubic-bezier(.4, 0, .3, 1) infinite;
}
@keyframes splash-run { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.splash-note {
  font-size: 11.5px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--muted); text-indent: .38em;
}
@media (prefers-reduced-motion: reduce) {
  .splash-bar i { animation: none; width: 100%; }
  .splash { transition: none; }
}

/* the mark stands in for the bare suit on the gate and the welcome */
.agegate .br-mark, .onb-hello .br-mark { filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .55)); }
.gate-card > .br-mark { margin: 0 auto 4px; }

/* =========================================================================
   Рейтинг клуба: подиум, зачёты, статусы
   ========================================================================= */
.lb-card { display: grid; gap: 10px; padding: 14px; border-radius: 15px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.lb-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-top: 10px; }
.pod {
  position: relative; display: grid; justify-items: center; gap: 5px;
  padding: 12px 6px 8px; border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.2));
  box-shadow: inset 0 0 0 1px var(--line); text-align: center; min-width: 0;
}
.pod-1 { padding-top: 22px; box-shadow: inset 0 0 0 1px var(--mc); }
.pod-3 { padding-top: 6px; }
.pod.me { background: linear-gradient(180deg, rgba(227,196,127,.16), rgba(0,0,0,.2)); }
.pod-ava {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 19px;
  background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--mc); color: var(--ivory);
}
.pod-ava .lvl-badge { position: absolute; right: -5px; bottom: -3px; }
.pod-name { font-size: 12.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-val { font-family: var(--mono); font-size: 13px; color: var(--brass-hi); }
.pod-val small { font-family: var(--ui); font-size: 10px; color: var(--muted); }
.pod-step {
  margin-top: 2px; width: 100%; padding: 3px 0; border-radius: 6px 6px 0 0;
  background: var(--mc); color: #23160f; font-weight: 800; font-size: 13px;
}

.seg { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px var(--line); }
.seg button {
  flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 8px;
  padding: 8px 6px; color: var(--muted); font-size: 12.5px; font-weight: 600;
  transition: color .16s ease, background .16s ease;
}
.seg button.on { background: var(--brass); color: #23160f; }
.seg.small button { padding: 6px 10px; font-size: 12px; }
.lb-controls { display: flex; justify-content: flex-start; }

.tier-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tier-row::-webkit-scrollbar { display: none; }
.tier-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border: 0; border-radius: 999px; padding: 6px 11px;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.tier-chip.on { color: var(--ivory); box-shadow: inset 0 0 0 1px var(--brass); background: rgba(201,164,92,.14); }
.tier-chip small { font-family: var(--mono); color: var(--faint); }

.lb-list { display: flex; flex-direction: column; }
.lb-row {
  display: grid; grid-template-columns: 30px auto minmax(0, 1fr) auto;
  align-items: center; gap: 9px; padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row.me { background: rgba(227,196,127,.09); border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(227,196,127,.22); }
.lb-row.pinned { margin-top: 8px; border-bottom: 0; }
.lb-rank { font-family: var(--mono); font-size: 14px; color: var(--muted); text-align: center; }
.lb-rank.medal { color: var(--mc); font-weight: 800; }
.lb-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font-style: normal; font-size: 10.5px; letter-spacing: .1em; color: var(--brass); }
.lb-val { font-family: var(--mono); font-size: 14px; color: var(--brass-hi); white-space: nowrap; }
.lb-val small { font-family: var(--ui); font-size: 10px; color: var(--muted); margin-left: 3px; }
.lb-empty { padding: 14px 0; font-size: 13px; color: var(--muted); }

.lb-mine { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.lb-mine-rank { font-family: var(--display); font-size: 24px; color: var(--brass-hi); }
.lb-mine-text { font-size: 12.5px; color: var(--muted); }
.lb-mine-val { font-family: var(--mono); font-size: 15px; }

.lvl-strip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px;
  width: 100%; text-align: left; border: 0; border-radius: 13px; padding: 11px 13px;
  background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px var(--lc, var(--line));
}
.lvl-text { display: grid; gap: 3px; min-width: 0; }
.lvl-text b { font-size: 15px; color: var(--lc, var(--ivory)); }
.lvl-text > span { font-size: 11.5px; color: var(--muted); }
.lvl-bar { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: var(--lc, var(--brass)); }
.lvl-perk { text-align: right; font-family: var(--mono); font-size: 14px; color: var(--brass-hi); }
.lvl-perk small { display: block; font-family: var(--ui); font-size: 10px; color: var(--muted); }

.ladder { display: grid; gap: 6px; margin-top: 10px; }
.ladder-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 11px; background: rgba(0,0,0,.2);
  box-shadow: inset 0 0 0 1px var(--line); opacity: .62;
}
.ladder-row.done { opacity: .85; }
.ladder-row.on { opacity: 1; box-shadow: inset 0 0 0 1px var(--lc); background: rgba(255,255,255,.05); }
.ladder-name { display: grid; gap: 1px; }
.ladder-name b { font-size: 14px; color: var(--lc); }
.ladder-name span { font-size: 11px; color: var(--muted); }
.ladder-perk { font-size: 11.5px; color: var(--muted); text-align: right; }
.ladder-perk em { display: block; font-style: normal; font-size: 10.5px; letter-spacing: .1em; color: var(--brass); }
.leader.me { color: var(--brass-hi); }

/* =========================================================================
   Карточка места: эмоции и подарки
   ========================================================================= */
.seat-sheet-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 4px; }
.seat-sheet-head h3 { margin: 0; }
.seat-sheet-head p { margin: 2px 0 0; font-size: 12.5px; }
.seat-sheet-ava { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: block; background: var(--panel-2); }
.seat-sheet-ava svg { width: 100%; height: 100%; }
.sheet-h { margin: 16px 0 4px; font-family: var(--display); font-weight: 400; font-size: 16px; }

.emote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.emote-pick {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px;
  border: 0; border-radius: 12px; background: rgba(0,0,0,.24);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 10.5px;
  transition: box-shadow .16s ease, background .16s ease;
}
.emote-pick:active { transform: scale(.94); }
.emote-pick:hover { background: rgba(201,164,92,.12); box-shadow: inset 0 0 0 1px var(--brass); color: var(--ivory); }
.emote-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.gift-pick {
  display: grid; justify-items: center; gap: 3px; padding: 10px 6px;
  border: 0; border-radius: 12px; background: rgba(0,0,0,.24);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ivory); font-size: 11.5px;
}
.gift-pick small { color: var(--muted); font-size: 10.5px; }
.gift-pick:active { transform: scale(.94); }

/* =========================================================================
   Список комнат: рядом со столом и в шторке на телефоне
   ========================================================================= */
.room-list { display: grid; gap: 10px; }
.room-group { display: grid; gap: 1px; }
.room-group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 4px 2px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line); margin-bottom: 3px;
}
.room-group-head b { font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--hall-ink, var(--ivory)); }
.room-group.tier-low { --hall-ink: var(--hall-low, rgba(227,196,127,.55)); }
.room-group.tier-mid { --hall-ink: var(--hall-mid, var(--brass)); }
.room-group.tier-vip { --hall-ink: var(--brass-hi); }
/* background обязателен: это <button>, и без него браузер красит его своим серым
   (buttonface). Строки комнат в правой колонке выглядели как неоформленные кнопки,
   а подпись «6 мест» цвета --faint на этом сером становилась нечитаемой. */
.room-row {
  width: 100%; border: 0; background: transparent; text-align: left; color: var(--text); font: inherit;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 9px; font-size: 13px; cursor: pointer;
  transition: background .14s ease;
}
.room-row:hover { background: rgba(255,255,255,.05); }
.room-row.open { background: rgba(201,164,92,.14); box-shadow: inset 0 0 0 1px var(--brass); }
.room-row.here .rm-seats { color: var(--brass-hi); }
.rm-name { display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-blinds { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rm-seats { font-size: 11px; color: var(--faint); min-width: 54px; text-align: right; }
/* доля окна Telegram, а не браузерного vh: внутри Mini App оно выше видимой области */
.rooms-card { max-height: calc(var(--app-h) * .42); overflow-y: auto; }

/* =========================================================================
   Карточка товара в магазине
   ========================================================================= */
.art-poor { font-size: 10px; letter-spacing: .06em; color: var(--danger); }
.item-card { display: grid; justify-items: center; gap: 8px; text-align: center; }
.item-card h3 { margin: 0; }
.item-fig { display: grid; place-items: center; min-height: 112px; }
.item-fig-plain { font-size: 72px; line-height: 1; }
.item-fig-plain svg { width: 96px; height: 96px; }
.item-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 30ch; }
.item-kv { width: 100%; margin-top: 4px; }

/* =========================================================================
   Разделение разделов
   Каждый экран читался как сплошной текст: заголовок раздела ничем не отличался
   от строки под ним. Теперь у заголовка есть засечка и линия, а у раздела — воздух.
   ========================================================================= */
#rating { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 20px; }

.section-head {
  align-items: baseline;
  padding-bottom: 7px; margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.section-head h3 {
  position: relative; padding-left: 13px; font-size: 21px;
}
.section-head h3::before {
  content: ''; position: absolute; left: 0; top: .18em; bottom: .18em;
  width: 3px; border-radius: 2px; background: var(--brass);
}
.section-head span { flex: none; color: var(--muted); }
.screen > section + section { margin-top: 2px; }
.hall-block .section-head, .lb-card .section-head { border-bottom: 0; }

/* =========================================================================
   Сукно из магазина
   Цвет сукна хранился в профиле, но интерфейс его никогда не читал: купленное
   сукно не меняло ровным счётом ничего. Теперь оно переопределяет токены стола.
   ========================================================================= */
.felt-wrap[data-felt="emerald"] { --felt: #14452c; --felt-hi: #1d613d; }
.felt-wrap[data-felt="sapphire"] { --felt: #152a52; --felt-hi: #1e3c74; }
.felt-wrap[data-felt="onyx"] { --felt: #17151a; --felt-hi: #262230; }
.felt-wrap[data-felt="onyx"] .felt { box-shadow: inset 0 0 0 2px rgba(227,196,127,.75), inset 0 0 0 7px rgba(0,0,0,.3), inset 0 10px 30px rgba(0,0,0,.55); }

/* =========================================================================
   Золотая рубашка и золотой дождь
   Обе косметики хранились в профиле и не рисовались нигде — деньги за воздух.
   ========================================================================= */
.seat.gold-back .card.back, .seat.gold-back .card .rear {
  background:
    repeating-linear-gradient(45deg, rgba(255,240,200,.5) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(255,240,200,.5) 0 2px, transparent 2px 7px),
    linear-gradient(150deg, #d7aa52, #8a5c14 55%, #f3d99a);
}
.seat.gold-back .card.back { box-shadow: 0 2px 6px rgba(0,0,0,.4), inset 0 0 0 2px #f8e8ba; }

.goldrain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.goldrain i {
  position: absolute; top: -8%; width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff6cf, #e3c47f 45%, #a1711c);
  box-shadow: 0 0 8px rgba(227,196,127,.6);
  animation: goldfall var(--t, 1.8s) linear var(--d, 0s) forwards;
}
@keyframes goldfall {
  from { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  to { transform: translateY(115%) rotate(420deg); opacity: .15; }
}
@media (prefers-reduced-motion: reduce) { .goldrain { display: none; } }

/* пять кнопок в шапке стола не помещаются рядом с названием на узком экране */
.tb-name, .tb-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .tablebar { gap: 5px; padding: 8px 10px; }
  .icon-btn { width: 34px; height: 34px; font-size: 17px; }
  .tb-name { font-size: 15px; }
}

/* сообщение вместо вечного «Загружаем клуб…», когда вход не прошёл */
.load-error {
  display: grid; gap: 10px; justify-items: start;
  padding: 16px; border-radius: 15px;
  background: rgba(190, 60, 70, .1); box-shadow: inset 0 0 0 1px rgba(190, 60, 70, .35);
}
.load-error h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ivory); }
.load-error p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* =========================================================================
   Страница не должна ездить вбок
   Приложение таскалось влево-вправо: что-то одно шире экрана — и весь документ
   получает горизонтальную прокрутку, а в Telegram это читается как «всё разъезжается».
   Прокрутка по горизонтали запрещена на корне, а внутренние широкие блоки
   (полоска столов, зачёты рейтинга, таблица выплат) крутятся сами по себе.
   ========================================================================= */
/* Высота и обрезка — везде; ширина — только на узком экране.
   Раньше ширина стояла здесь же и без условий, а это правило идёт ПОСЛЕ
   медиазапроса с десктопной раскладкой и перебивало его: на широком экране
   #app оставался шириной 560px, хотя внутри него лежала сетка из трёх колонок
   общей шириной больше 600px. Боковая панель вылезала за собственный контейнер,
   её обрезало, а меню теряло последний раздел. */
#app { overflow: hidden; height: var(--app-h); }
@media (max-width: 1099px) {
  #app { max-width: min(560px, 100%); }
}
.screen { overflow-x: hidden; overscroll-behavior: contain; }
/* всё, что и правда шире экрана, скроллится внутри себя, а не тянет за собой страницу */
.tabs-strip, .hall-chips, .tier-row, .pay-rows, .presets, .buyin-quick, .stepper {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

/* =========================================================================
   Стол: место, часы хода, талисман, банк
   ========================================================================= */

/* Номер места — чтобы за столом было понятно, кто где сидит. */
.seat-no {
  position: absolute; top: -6px; left: -6px; z-index: 4;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.55); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.seat.mine .seat-no { background: rgba(201,164,92,.28); color: var(--brass-hi); }

/* Сколько секунд осталось — на самой табличке игрока, видно всему столу. */
.seat-clock {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--brass-hi); letter-spacing: .04em;
}
.seat-clock.urgent { color: var(--danger); animation: clock-pulse .9s ease-in-out infinite; }
@keyframes clock-pulse { 50% { opacity: .45; } }

/* Кнопка эмоции над своим местом: раньше эмоции были спрятаны в шапке стола. */
.seat-emote {
  position: absolute; top: -14px; right: -10px; z-index: 5;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--brass), 0 3px 8px rgba(0,0,0,.45);
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.seat-emote:active { transform: scale(.9); }

/* Талисман стоял сверху-сбоку и заезжал на сукно; теперь он под табличкой. */

/* Выигрыш поднят над картами, чтобы сумма не ложилась на них. */

/* Банк и сайд-поты. */
.pot { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.25; }
.pot b { font-weight: 700; }
.side-pot { font-family: var(--ui); font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* Фишки, уезжающие из банка победителю. */
.pot-chip {
  position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
  pointer-events: none; z-index: 5;
  background: radial-gradient(circle at 34% 30%, #fff6cf, #e3c47f 45%, #a1711c);
  box-shadow: 0 0 0 2px rgba(60,30,14,.55), 0 2px 6px rgba(0,0,0,.5);
}

/* Быстрые суммы бай-ина и три шага ставки. */
.buyin-quick { display: flex; gap: 6px; }
.buyin-quick .btn { flex: 1; display: grid; gap: 1px; justify-items: center; padding: 8px 6px; }
.buyin-quick small { font-size: 10.5px; opacity: .75; }
.stepper { display: flex; gap: 5px; justify-content: center; }
.stepper .step {
  flex: 1; min-width: 0; border: 0; border-radius: 10px; padding: 9px 4px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ivory); font-family: var(--mono); font-size: 12.5px; font-weight: 700;
}
.stepper .step:disabled { opacity: .35; }
.presets .btn { display: grid; gap: 1px; justify-items: center; }
.presets .btn small { font-size: 10px; opacity: .7; font-family: var(--mono); }

/* =========================================================================
   Превью косметики в магазине
   ========================================================================= */
.cp { display: grid; place-items: center; }
.cp-felt {
  border-radius: 999px;
  background: radial-gradient(70% 55% at 50% 45%, var(--fb), var(--fa) 72%, #120c0b);
  box-shadow: inset 0 0 0 2px rgba(201,164,92,.55), inset 0 6px 14px rgba(0,0,0,.45);
}
.cp-frame {
  padding: 5px 12px; border-radius: 9px; font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,.45); color: var(--ivory);
}
.cp-frame.frame-platinum { border: 1.5px solid #cfd6e4; box-shadow: 0 0 10px rgba(207,214,228,.45); }
.cp-frame.frame-fire {
  border: 1.5px solid #e3a54f;
  box-shadow: 0 0 12px rgba(227,165,79,.6);
  animation: cp-fire 2.4s ease-in-out infinite;
}
@keyframes cp-fire { 50% { box-shadow: 0 0 20px rgba(240,190,110,.85); border-color: #f5d79a; } }
.cp-cards { display: flex; }
.cp-card {
  width: 26px; height: 36px; border-radius: 4px; display: block;
  background:
    repeating-linear-gradient(45deg, rgba(255,240,200,.5) 0 2px, transparent 2px 7px),
    linear-gradient(150deg, #d7aa52, #8a5c14 55%, #f3d99a);
  box-shadow: inset 0 0 0 1.5px #f8e8ba, 0 2px 5px rgba(0,0,0,.45);
}
.cp-card + .cp-card { margin-left: -12px; transform: rotate(9deg); }
.cp-fx { position: relative; width: 56px; height: 40px; overflow: hidden; border-radius: 8px; background: rgba(0,0,0,.35); }
.cp-fx i {
  position: absolute; top: -20%; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff6cf, #e3c47f 45%, #a1711c);
  animation: cp-rain 1.9s linear var(--d, 0s) infinite;
}
@keyframes cp-rain { to { transform: translateY(150px); } }
.cp-bonus { font-family: var(--display); font-size: 26px; color: var(--brass-hi); }
.cp-av svg { display: block; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .cp-fx i, .cp-frame.frame-fire { animation: none; } }

/* =========================================================================
   Баннер победителя
   ========================================================================= */
.banner { transition: opacity .4s ease, transform .4s ease; }
.banner.out { opacity: 0; transform: translate(-50%, -10px); }
.banner .ban-pot {
  display: block; font-size: 12.5px; color: var(--ivory); margin-top: 3px;
}
.banner .ban-pot i {
  font-style: normal; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brass); margin-right: 6px;
}

/* Связь пропала — место и фишки держит сервер. */
.link-warn {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 60;
  max-width: 92vw; padding: 8px 14px; border-radius: 999px;
  background: rgba(120, 40, 30, .95); box-shadow: 0 6px 20px rgba(0,0,0,.5);
  color: var(--ivory); font-size: 12.5px; text-align: center;
}

/* «Показать больше»: и для залов, и для столов внутри зала */
.more-btn {
  width: 100%; margin-top: 8px; border: 0; border-radius: 11px; padding: 11px 14px;
  background: rgba(0,0,0,.24); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--brass-hi); font-size: 13px; font-weight: 600;
  transition: background .16s ease;
}
.more-btn:hover { background: rgba(201,164,92,.12); }
.more-btn:active { transform: scale(.985); }
.more-halls { margin-top: 2px; }

/* =========================================================================
   Что скроллится, а что нет
   Корень прибит, поэтому прокрутка живёт только внутри разделов. Стол не
   скроллится вообще — он обязан помещаться целиком.
   ========================================================================= */
.screen {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* Стол не прокручивается и не тянется пальцем, но обрезать его нельзя: карты и теги
   верхних мест стоят выше аватара и попадали под нож. Режет только сам экран стола. */
.table-screen { overflow: hidden; }
.felt-wrap, .rail, #seats { overflow: visible; touch-action: none; }
.table-screen { touch-action: none; }
/* кнопки и слайдер обязаны отвечать на палец, иначе стол станет неиграбельным */
.actions, .actions *, .tablebar, .tablebar *, .tabs-strip, .seat, .seat *, .sheet, .sheet * {
  touch-action: manipulation;
}
input[type="range"] { touch-action: pan-x; }

/* безопасные зоны Telegram: шапка сверху, домашняя полоска снизу */
.topbar { padding-top: calc(8px + var(--safe-top)); }
.mainnav { padding-bottom: calc(6px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px))); }
.actions { padding-bottom: calc(12px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px))); }
.sheet { padding-bottom: calc(18px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px))); }

/* =========================================================================
   Панель действий: всё помещается в ширину экрана
   Статус и кнопки стояли в одной строке, поэтому «Встать и выйти» уезжала за
   правый край, а текст статуса ломался на четыре строки.
   ========================================================================= */
.act-status {
  display: block; min-height: 0; padding-bottom: 2px;
  font-size: 13px; line-height: 1.35; color: var(--muted);
}
.actions .btns {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 7px;
}
.actions .btns .btn {
  min-width: 0; padding: 10px 6px; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-row { grid-template-columns: 1fr 1.2fr 1.2fr; gap: 7px; }
.act-row .btn { padding: 13px 6px; font-size: 14px; }
.presets { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.presets .btn { padding: 7px 3px; font-size: 11.5px; }

/* Табличка игрока не должна ложиться на его карты. */
.seat.show .seat-plate, .seat.mine .seat-plate { margin-top: 2px; }
.seat-hand { font-size: 10.5px; line-height: 1.2; }

/* =========================================================================
   Чип-лидер: объявление, а не занавес
   Полноэкранная заставка закрывала стол целиком на пять секунд и срабатывала
   почти каждую раздачу. Осталась та же анимация, но полосой поверх шапки —
   видно, кто вырвался вперёд, и при этом видно стол.
   ========================================================================= */
.cl-overlay {
  inset: auto 0 auto 0;
  top: calc(56px + var(--safe-top));
  display: block;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(40,0,5,.92), rgba(120,0,15,.92), rgba(40,0,5,.92));
  box-shadow: 0 8px 24px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,60,90,.45);
  border-radius: 14px;
  margin: 0 12px;
  max-width: calc(100% - 24px);
}
.cl-card { padding: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cl-title { font-size: clamp(16px, 5vw, 24px); }
.cl-name { margin-top: 0; font-size: clamp(13px, 4vw, 17px); }
/* дождь и потёки были рассчитаны на весь экран — в полосе они лишний шум */
.cl-rain, .cl-drips { display: none; }

/* =========================================================================
   Баннер победителя: между верхним местом и бордом
   На 4% от верха он ложился ровно на карты игрока напротив. Здесь единственная
   свободная полоса сукна, и текст ужат так, чтобы в неё помещаться.
   ========================================================================= */
.banner {
  top: 30%;
  padding: 8px 14px;
  min-width: 0; max-width: min(66%, 250px);
  border-radius: 12px;
}
.banner b { font-size: 15px; line-height: 1.25; }
.banner span { font-size: 11.5px; }
.banner .ban-pot { font-size: 11.5px; }

/* Банк уступает место баннеру сразу: плавное затухание в этот момент читается как
   две наложенные надписи, потому что баннер появляется мгновенно. */

/* =========================================================================
   Никакого выделения текста пальцем
   Любое перетаскивание по экрану выделяло подписи синим и вызывало меню
   «копировать» — в приложении, где перетаскивание это жест, а не работа с текстом.
   ========================================================================= */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, code, .kv dd, .ref-link code {
  -webkit-user-select: text;
  user-select: text;
}

/* «отошёл» приписывался к имени и обрезался вместе с ним — теперь это своя строка */
.seat.away .seat-name::after { content: none; }
.seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Иконки в шапке стола нарисованы, а не набраны эмодзи — эмодзи выбивался из шрифта. */
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; color: var(--brass-hi); display: block; }
.icon-btn { color: var(--brass-hi); }


/* =========================================================================
   Талисман: значок у портрета, а не предмет на сукне
   На отдельной полке он уезжал в сторону и налезал на стол. Теперь это
   аккуратный кружок в углу аватара — «очень рядом», как и просили.
   ========================================================================= */

/* =========================================================================
   «Вернуться за стол»
   Пилюля внизу перекрывала последнюю строку списка и терялась среди кнопок.
   Она переехала на правый край по центру высоты: не закрывает ни список, ни
   нижнее меню, всегда на одном месте — и пока за вами держится место, её видно
   с любого экрана.
   ========================================================================= */
.back-to-table {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 30; display: grid; justify-items: center; gap: 3px;
  padding: 12px 9px 12px 11px; border: 0;
  border-radius: 14px 0 0 14px;
  background: var(--brass); color: #23160f;
  font-size: 11px; font-weight: 700; line-height: 1.15;
  box-shadow: -4px 0 18px rgba(0,0,0,.5);
  max-width: 96px;
}
.btt-text { writing-mode: horizontal-tb; }
.back-to-table b {
  font-weight: 700; font-size: 10px; opacity: .72;
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.back-to-table:active { transform: translateY(-50%) scale(.95); }
.btt-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #23160f;
  animation: btt-pulse 1.6s ease-in-out infinite;
}
@keyframes btt-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .btt-dot { animation: none; } }

/* =========================================================================
   Попапы крупнее
   Шторка открывалась на 82% высоты мелким кеглем: списки эмоций и подарков
   приходилось листать, а читать — щуриться.
   ========================================================================= */
.sheet {
  max-height: 88%;
  padding: 8px 18px calc(24px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
}
.sheet .grab { width: 52px; height: 5px; margin: 6px auto 14px; cursor: grab; }
.sheet h3 { font-size: 25px; margin-bottom: 8px; }
.sheet h4, .sheet .sheet-h { font-size: 17px; }
.sheet p { font-size: 15px; line-height: 1.5; }
.sheet .fineprint { font-size: 13px; }
.sheet .btn { padding: 14px 16px; font-size: 15px; }
.emote-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.emote-pick { padding: 13px 6px; font-size: 12px; gap: 6px; }
.emote-pick svg { width: 46px; height: 46px; }
.gift-grid { gap: 10px; }
.gift-pick { padding: 13px 8px; font-size: 12.5px; }
.seat-sheet-head h3 { font-size: 22px; }

/* Баланс за столом — это число, за которым следят каждую раздачу. */
.wallet .num { font-size: 19px; }
.wallet .chip-dot { width: 15px; height: 15px; }
.seat.mine .seat-plate { min-width: 96px; padding: 5px 12px 6px; }
.seat.mine .seat-name { font-size: 12.5px; }
.seat.mine .seat-stack { font-size: 17px; }

/* =========================================================================
   Чат стола
   Последние реплики висят над сукном, чтобы разговор было видно, не открывая
   ничего; полная переписка и поле ввода — в шторке.
   ========================================================================= */
.chat-feed {
  position: absolute; left: 8px; right: 8px; bottom: 4px;
  z-index: 6; pointer-events: none;
  display: grid; gap: 3px; justify-items: start;
}
.chat-line {
  max-width: 90%; padding: 5px 10px; border-radius: 12px;
  background: rgba(10,7,6,.82); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px; color: var(--ivory); line-height: 1.3;
  animation: chat-in .35s ease both;
}
.chat-line b { color: var(--brass-hi); font-weight: 600; margin-right: 6px; }
@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } }

.chat-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brass-hi);
  box-shadow: 0 0 0 2px var(--panel);
}
.icon-btn { position: relative; }

.chat-log {
  display: grid; gap: 8px; max-height: calc(var(--app-h) * .46); overflow-y: auto;
  padding: 4px 2px; margin-bottom: 12px;
}
.chat-msg {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline;
  padding: 8px 11px; border-radius: 11px;
  background: rgba(0,0,0,.24); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
}
.chat-msg.mine { background: rgba(201,164,92,.12); box-shadow: inset 0 0 0 1px rgba(201,164,92,.3); }
.cm-who { color: var(--brass-hi); font-weight: 600; font-size: 13px; white-space: nowrap; }
.cm-text { overflow-wrap: anywhere; }
.cm-at { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-form input {
  min-width: 0; border: 0; border-radius: 12px; padding: 13px 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text); font: inherit; font-size: 15px;
}
.chat-form input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--brass); }

/* Разбор раздачи в шторке истории. */
.hand-pots { display: grid; gap: 6px; }
.hand-pot {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline;
  padding: 8px 11px; border-radius: 10px; background: rgba(0,0,0,.22);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px;
}
.hand-pot > span:first-child { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }
.hand-pot .num { font-family: var(--mono); color: var(--brass-hi); font-weight: 700; }
.hand-pot small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.hand-players { display: grid; gap: 7px; }
.hand-player {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center;
  padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.hand-player:last-child { border-bottom: 0; }
.hand-player.folded { opacity: .55; }
.hand-player.won .hp-res { color: var(--ok); font-weight: 700; }
.hp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-res { text-align: right; font-family: var(--mono); font-size: 13px; }
.hp-res small { display: block; font-family: var(--ui); font-size: 10.5px; color: var(--muted); }
.hand-tabs { margin-bottom: 12px; overflow-x: auto; }
.hand-tabs button { white-space: nowrap; }

/* =========================================================================
   Карты за столом
   Геометрия мест теперь параметрическая: места лежат на эллипсе, а ставка и
   баттон — точки на линии от места к центру. Места хватает всем, поэтому карты
   вернулись к раскладке, которая читалась лучше: свои крупные и в потоке под
   табличкой, вскрытые чужие — рядом с аватаром, закрытые — тонкой стопкой за ним.
   ========================================================================= */
.seat-cards {
  /* Закрытые карты соперника лежат ровно за его аватаром, а не выступают вбок.
     Выступ был шириной в целую карту, и в него попадали то баттон, то фишка ставки —
     хотя те стоят далеко от самого места. */
  position: absolute; top: calc(-6px * var(--tbl)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; z-index: -1;
}
.seat-cards .card { --w: 24px; }
.seat.show .seat-cards { position: static; transform: none; order: -1; z-index: 1; gap: 3px; }
.seat.show .seat-cards .card { --w: 28px; }
.seat.mine .seat-cards { position: static; transform: none; order: -1; z-index: 1; gap: 5px; }
.seat.mine .seat-cards .card { --w: 46px; }

/* Тег комбинации всегда над картами своего владельца. */
.seat .seat-tag { top: -10px; }
.seat.show .seat-tag, .seat.mine .seat-tag { top: -12px; }

.seat:not(.mine) .seat-plate { min-width: 74px; padding: 3px 8px 4px; }

}

/* Карты вне сукна (история, разбор раздачи) брали цвета колоды стола, которые
   объявлены на .felt-wrap, и получались чёрными. Здесь у них свой, светлый набор. */
.sheet, .screen {
  --dk-face: var(--ivory);
  --dk-ink: var(--card-black);
  --dk-red: var(--card-red);
  --dk-back: #4a1520;
  --dk-trim: rgba(201,164,92,.45);
}

/* Полоса чип-лидера не должна ложиться на открытую шторку. */
.cl-overlay { z-index: 18; }

/* =========================================================================
   Кошелёк на главной
   Кнопка бонуса стояла справа от суммы и налезала на неё: при большом балансе
   («10 026 301») им просто не хватало строки. Теперь бонус — отдельная строка
   под суммой, по тому же левому краю и во всю ширину.
   ========================================================================= */
.purse { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: stretch; }
.purse-main { min-width: 0; }
.purse-bonus {
  justify-self: stretch; width: 100%;
  padding: 11px 16px; font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.purse-bonus .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.purse-bonus:disabled { opacity: .75; }
.purse-stats { grid-column: 1; }

/* =========================================================================
   Значок артефакта — в углу бокса места
   Раньше стоял под ником в полный размер и мозолил глаза. Теперь это метка
   14–16px в правом верхнем углу: приглушена, поверх неё ничего не идёт и она
   ничего не закрывает — ни ник, ни стек, ни кольцо таймера, ни карты.
   ========================================================================= */
.shelf-slot {
  position: absolute; top: 0; right: 0; z-index: 6;
  margin: 0; display: block; pointer-events: auto;
}
.seat.mine .shelf-slot { top: auto; bottom: 34px; right: -2px; }
.shelf {
  position: relative; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(10,7,6,.9); box-shadow: inset 0 0 0 1px rgba(201,164,92,.5);
  opacity: .82; transform: none; transition: opacity .15s ease;
}
.shelf:hover, .shelf:active { opacity: 1; }
.shelf svg, .shelf img { width: 15px; height: 15px; display: block; }
.shelf-more {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 13px; height: 13px; padding: 0 3px; border-radius: 999px;
  background: var(--brass); color: #23160f;
  font-family: var(--mono); font-size: 9px; font-style: normal; font-weight: 700;
  display: grid; place-items: center;
}

/* =========================================================================
   Статус «Отошёл»
   Раньше место просто сереет и непонятно, ушёл человек или думает. Плашка
   внутри бокса места, под стеком: ник и стек читаются, карты, ставки,
   дилер-баттон и значок артефакта не перекрываются.
   ========================================================================= */
.seat-away {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--brass-ink, #23160f); background: var(--brass);
  border-radius: 999px; padding: 1px 7px; margin-top: 2px;
  display: inline-block; white-space: nowrap;
}
.seat.away { opacity: 1; }
.seat.away .avatar { opacity: .5; }
.seat.away .seat-plate { box-shadow: inset 0 0 0 1px rgba(201,164,92,.45); }
.seat.away .seat-name, .seat.away .seat-stack { opacity: 1; }

/* =========================================================================
   Разделы не должны уезжать под нижнее меню
   Последняя строка списка, последняя карточка магазина и последняя строка
   рейтинга прятались под таббар: у прокручиваемых экранов не было запаса
   снизу на его высоту.
   ========================================================================= */
:root { --nav-h: 62px; }
#lobby, #shop, #rating, #profile, #tournaments, #slots {
  padding-bottom: calc(var(--nav-h) + 24px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
}

/* =========================================================================
   Баннер победителя привязан к борду, а не к проценту высоты
   На 360×640 фиксированные 30% приходились ровно на общие карты. Теперь он
   всегда стоит вплотную над бордом, где бы тот ни оказался.
   ========================================================================= */
.banner {
  /* Под бордом, а не над ним. Сверху между верхним местом и общими картами свободной
     полосы нет ни на одном экране — таблички игрока напротив всегда оказывались под
     баннером. Снизу до собственных карт места хватает везде. */
  top: calc(50% + 20px + 38px * var(--tbl));
  bottom: auto;
  transform: translate(-50%, 0);
}
.banner.out { transform: translate(-50%, 8px); }

/* =========================================================================
   Размер основных кнопок
   Кнопки, промах по которым что-то стоит, не бывают ниже 44px: вход за стол,
   «Показать больше», кнопки в шторках и в панели действий.
   ========================================================================= */
.tr-go, .more-btn, .sheet .btn, .actions .btn, .purse-bonus, .chat-form button {
  min-height: 44px;
}
.actions .btns .btn { min-height: 44px; }
.crest { min-height: 32px; }
.tier-chip, .hall-chip { min-height: 32px; }

/* Ползунок ставки и бай-ина — то, что тянут пальцем, поэтому он не тоньше кнопки. */
input[type=range] { height: 44px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--panel);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
input[type=range]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel);
  background: var(--brass); box-shadow: 0 2px 6px rgba(0,0,0,.5);
}

/* =========================================================================
   Низкие экраны: стол ужимается целиком, а не обрезается
   На 360×640 сукну достаётся около 340px высоты. Автопроверки проходили, но
   глазами карты верхнего места упирались в шапку. Здесь уменьшается вся
   мебель стола разом, пропорционально, без перекомпоновки.
   ========================================================================= */
@media (max-height: 700px) {
  .tablebar { padding: 5px 10px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .tb-name { font-size: 14px; }
  .tb-meta { font-size: 10.5px; }

  .felt-wrap { padding-top: 30px; margin: 2px 10px 0; min-height: 0; }
  .rail { inset: 34px 9% 46px; padding: 8px; }

  .avatar { width: 40px; height: 40px; }
  .seat { width: 76px; }
  .seat-plate { min-width: 64px; padding: 2px 6px 3px; }
  .seat-name { font-size: 11px; }
  .seat-stack { font-size: 11.5px; }
  .seat.mine .seat-stack { font-size: 15px; }
  .seat-hand { font-size: 9.5px; }
  .seat.mine .seat-cards .card { --w: 36px; }
  .seat.show .seat-cards .card { --w: 18px; }
  .board .card { --w: 32px; }
  .board { min-height: 46px; gap: 3px; }

  .banner { bottom: calc(50% + 38px); padding: 6px 11px; max-width: 84%; }
  .banner b { font-size: 13.5px; }
  .banner span, .banner .ban-pot { font-size: 10.5px; }

  .actions { padding: 8px 12px calc(10px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px))); gap: 7px; }
  .act-row .btn { padding: 11px 5px; font-size: 13.5px; }
  .act-status { font-size: 12px; }
}

/* Полоса чип-лидера: «CHIP LEADER» плюс имя не влезали в узкий экран и уезжали
   за оба края, потому что заголовок был с nowrap. */
.cl-overlay { overflow: hidden; }
.cl-card { max-width: 100%; }
.cl-title { white-space: normal; font-size: clamp(14px, 4.4vw, 22px); }
.cl-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* =========================================================================
   Главная: меньше, тише, понятнее
   Было: каждый стол с жёлтой кнопкой, зелёные и синие залы, лента фильтров и
   подпись под заголовком. Всё это спорило за внимание, а войти в зал было
   непонятно. Стало: заголовок зала — сам по себе кнопка входа, жёлтый остаётся
   только за столом, где вы уже сидите.
   ========================================================================= */
.hall-block { padding: 10px 12px 4px; gap: 4px; border-radius: 13px; }
.hall-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px;
  width: 100%; padding: 8px 2px; border: 0; background: none;
  text-align: left; color: var(--text); font: inherit;
}
.hall-id { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.hall-id b {
  font-family: var(--display); font-weight: 400; font-size: 18px;
  color: var(--hall-ink, var(--ivory)); white-space: nowrap;
}
.hall-blinds { font-size: 12px; color: var(--muted); font-weight: 600; }
.hall-count { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.hall-go { font-size: 18px; color: var(--brass); line-height: 1; width: 14px; text-align: center; }
.hall-block.open .hall-go { color: var(--muted); }
.hall-about { display: none; }
.hall-block.open .hall-about { display: block; margin: 0 2px 4px; font-size: 12px; }

.table-row { padding: 9px 2px; gap: 4px 10px; }
.tr-name { font-size: 14.5px; }
.tr-meta { font-size: 11.5px; }
.tr-blinds { font-size: 13.5px; }
.tr-go { min-width: 84px; font-size: 12.5px; padding: 10px 10px; }
.more-btn { margin-top: 4px; padding: 10px 14px; font-size: 12.5px; }

.section-head h3 { font-size: 19px; }
.rooms-section { gap: 8px; }
.purse-amount { font-size: 34px; }
.hall-count b.live { color: var(--brass-hi); }


/* =========================================================================
   Плотнее и тише
   Строка стола занимала две высоты кнопки, потому что кнопка стояла под
   блайндами. Кнопка уходит в третью колонку на всю высоту строки — та же
   информация в двух третях места. Жёлтым остаётся только то, что игрок
   действительно должен заметить: бонус, который уже можно забрать.
   ========================================================================= */
.table-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 8px 2px; }
.tr-name { grid-area: 1 / 1; }
.tr-meta { grid-area: 2 / 1; }
.tr-side { grid-area: 1 / 2 / 3 / 3; flex-direction: column; align-items: flex-end; gap: 3px; }
.tr-go { grid-area: 1 / 3 / 3 / 4; align-self: center; margin-left: 10px; min-width: 78px; }

/* Бонус: обычная кнопка, пока он не готов, и брасс — когда готов. */
.purse-bonus { font-size: 13px; padding: 10px 14px; }
.purse-bonus.btn-ghost { color: var(--muted); }

/* Нижнее меню: те же рисованные иконки, что и в шапке стола. */
.mainnav .ni-mark svg { width: 21px; height: 21px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.on .ni-mark svg { stroke: var(--brass-hi); }


/* Строка стола держится в одну высоту: подпись не переносится, кнопка узкая. */
.tr-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-side { flex-direction: row; align-items: center; gap: 7px; }
.tr-go { min-width: 72px; padding: 9px 12px; margin-left: 8px; }

/* Бонус стоит под балансом отдельной строкой. Сбоку от суммы он жался в угол,
   спорил с крупной цифрой за внимание и на узком экране обрезался многоточием. */
.purse { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.purse-main { grid-column: 1; }
.purse-bonus { grid-column: 1; justify-self: stretch; width: 100%; min-width: 0; }
.purse-stats { grid-column: 1; }

/* Верхним местам нужен воздух: их карты и тег комбинации стоят выше аватара и
   упирались в край области стола. Рельс сдвинут вниз, сукно от этого не страдает. */
.felt-wrap { padding-top: 30px; }
.rail { inset: 62px 12% 64px; }

/* Карты в полоске столов: при мультистоле выбор стола делается по руке. */
.tab-chip { gap: 6px; }
.tab-cards { display: flex; gap: 2px; }
.tab-cards .card { --w: 16px; border-radius: 3px; }
.tab-cards .card .r { font-size: 9px; }
.tab-cards .card .s { font-size: 8px; }
.tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 88px; }

/* Кнопка тайм-банка: подпись вместо двух безымянных чисел. */
.bank-btn { padding: 6px 12px; line-height: 1.15; }
.bank-btn span { display: block; font-size: 12.5px; font-weight: 700; }
.bank-btn small { display: block; font-family: var(--ui); font-size: 10px; color: var(--muted); }

/* =========================================================================
   Панель ставок на низком экране
   Слайдер, три шага, пять пресетов и ряд действий вместе съедали столько
   высоты, что сукну оставалось меньше двухсот точек — и места начинали
   налезать на центр. На низких экранах панель ужимается, стол остаётся столом.
   ========================================================================= */
@media (max-height: 700px) {
  .raise-panel { gap: 6px; }
  .raise-top .num { font-size: 18px; }
  /* Ползунок — третий способ назвать ту же сумму после шагов и пресетов. На низком
     экране он уходит первым: кнопки остаются во весь палец, а столу возвращается
     сорок с лишним точек высоты. */
  .raise-panel input[type=range] { display: none; }
  .presets .btn small { display: none; }
}

/* =========================================================================
   Стол масштабируется целиком
   Мебель стола была в фиксированных точках: на 430×932 она терялась, на
   360×640 налезала друг на друга. Один множитель --tbl задаётся из реальной
   высоты сукна, и от него считается всё остальное.
   ========================================================================= */
.felt-wrap { --tbl: 1; }
.seat { width: calc(92px * var(--tbl)); }
.avatar { width: calc(50px * var(--tbl)); height: calc(50px * var(--tbl)); }
.seat-plate { min-width: calc(74px * var(--tbl)); padding: calc(3px * var(--tbl)) calc(8px * var(--tbl)) calc(4px * var(--tbl)); }
.seat-name { font-size: calc(12px * var(--tbl)); }
.seat-stack { font-size: calc(12.5px * var(--tbl)); }
.seat-hand, .seat-clock { font-size: calc(10.5px * var(--tbl)); }
.seat-away { font-size: calc(10px * var(--tbl)); padding: 1px calc(7px * var(--tbl)); }
.seat-tag { font-size: calc(10.5px * var(--tbl)); padding: 1px calc(7px * var(--tbl)); }
.seat-no { min-width: calc(17px * var(--tbl)); height: calc(17px * var(--tbl)); font-size: calc(10px * var(--tbl)); }
.seat-cards .card { --w: calc(24px * var(--tbl)); }
.seat.show .seat-cards .card { --w: calc(28px * var(--tbl)); }
.seat.mine { width: calc(150px * var(--tbl)); }
.seat.mine .seat-cards .card { --w: calc(46px * var(--tbl)); }
.seat.mine .seat-stack { font-size: calc(17px * var(--tbl)); }
.board .card { --w: calc(40px * var(--tbl)); }
.board { min-height: calc(58px * var(--tbl)); }
.bet { font-size: calc(12px * var(--tbl)); padding: 2px calc(8px * var(--tbl)) 2px 3px; }
.bet .chip-dot { width: calc(12px * var(--tbl)); height: calc(12px * var(--tbl)); }
.dealer { width: calc(20px * var(--tbl)); height: calc(20px * var(--tbl)); font-size: calc(10px * var(--tbl)); }
.shelf { width: calc(22px * var(--tbl)); height: calc(22px * var(--tbl)); }
.shelf svg, .shelf img { width: calc(15px * var(--tbl)); height: calc(15px * var(--tbl)); }
.pot { font-size: calc(14px * var(--tbl)); }
.banner b { font-size: calc(15px * var(--tbl)); }


/* На узком и низком экране баннеру остаётся ровно ширина борда — иначе он достаёт
   до табличек боковых мест. */
@media (max-height: 700px) {
  .banner { max-width: min(58%, 210px); }
  .banner b { font-size: 13px; }
}


/* =========================================================================
   Борд уступает место боковым игрокам
   Пять карт по 40 точек — это 200 с лишним точек посреди сукна шириной 340.
   Боковые места упирались в борд не потому, что стояли не там, а потому что
   борд занимал всю середину. На узком столе карты борда мельче.
   ========================================================================= */
.board .card { --w: calc(40px * var(--tbl)); }
@media (max-width: 400px) {
  .board .card { --w: calc(31px * var(--tbl)); }
  .board { gap: 3px; }
}
@media (max-height: 700px) {
  .board .card { --w: calc(29px * var(--tbl)); }
}


/* Баннер не должен доставать до табличек боковых мест: те стоят на 13% и 87%
   ширины сукна, поэтому на узком экране ему остаётся середина и не больше. */
@media (max-width: 400px) {
  .banner { max-width: 160px; }
  .banner b { font-size: 12.5px; line-height: 1.3; }
  .banner span, .banner .ban-pot { font-size: 10px; }
}

/* Результат строкой в панели — вариант для низких экранов, где над сукном
   свободного места нет. Тот же текст, та же вёрстка, просто другое место. */
.result-banner {
  padding: 8px 12px; border-radius: 11px;
  background: rgba(18,12,11,.94); box-shadow: inset 0 0 0 1px var(--brass);
  text-align: center; animation: pop .5s cubic-bezier(.2,.9,.3,1.2) both;
}
.result-banner b { display: block; font-family: var(--display); font-weight: 400; font-size: 16px; color: var(--brass-hi); }
.result-banner span { font-size: 12px; color: var(--muted); }
.result-banner .ban-pot { display: block; font-size: 11.5px; color: var(--ivory); }
.result-banner .ban-pot i { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); margin-right: 5px; }

/* Фишка ставки и баттон лежат НА столе, поверх всего остального: если они всё же
   касаются края чужой таблички, это читается как фишка на сукне, а не как сбой. */
.bet { z-index: 5; }
.dealer { z-index: 6; }


/* =========================================================================
   Блоки мест компактнее — именно они отнимали место у фишек
   Ставка и баттон стоят на линии от игрока к центру. Всё, что им нужно, —
   чтобы сам блок места был меньше: тогда между ним и бордом появляется полоса.
   ========================================================================= */
.seat-plate { min-width: calc(66px * var(--tbl)); padding: calc(2px * var(--tbl)) calc(7px * var(--tbl)) calc(3px * var(--tbl)); }
.seat:not(.mine) .seat-plate { min-width: calc(70px * var(--tbl)); max-width: 100%; }
/* 80px не хватало на обычное имя: «Игрок #9754» обрезалось до «Игрок #97…» почти
   на каждом месте. Кольцо мест теперь строится по настоящему столу, запас по бокам
   появился — блок можно расширить, не задевая соседей. */
.seat { width: calc(88px * var(--tbl)); gap: 2px; }
.seat-name { font-size: calc(11px * var(--tbl)); }
.seat-stack { font-size: calc(11.5px * var(--tbl)); }
.avatar { width: calc(44px * var(--tbl)); height: calc(44px * var(--tbl)); }
.bet { font-size: calc(11px * var(--tbl)); padding: 1px calc(6px * var(--tbl)) 1px 2px; }
.bet .chip-dot { width: calc(10px * var(--tbl)); height: calc(10px * var(--tbl)); }
.dealer { width: calc(17px * var(--tbl)); height: calc(17px * var(--tbl)); font-size: calc(9px * var(--tbl)); }


/* =========================================================================
   Баттон дилера — на фланге аватара своего места
   Пока он был точкой на сукне, на каком-нибудь экране он обязательно задевал
   чью-то табличку или карты. Теперь он часть блока места и стоит со стороны,
   обращённой к центру стола: там у аватара свободно с обеих сторон.
   ========================================================================= */
.dealer {
  position: absolute; top: calc(12px * var(--tbl));
  width: calc(18px * var(--tbl)); height: calc(18px * var(--tbl));
  border-radius: 50%; display: grid; place-items: center;
  background: var(--ivory); color: var(--card-black);
  font-size: calc(9.5px * var(--tbl)); font-weight: 700;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
  transform: none; z-index: 6;
}
.seat.side-right .dealer { right: calc(-4px * var(--tbl)); left: auto; }
.seat.side-left .dealer { left: calc(-4px * var(--tbl)); right: auto; }
.seat.mine .dealer { top: auto; bottom: calc(6px * var(--tbl)); }


/* =========================================================================
   Меньше информации на сукне
   Плашка над картами («Сет», «Колл», «+1 202») висела поверх карт, борда и
   соседних табличек — на телефоне это и был главный источник каши. Всё, что она
   говорила, теперь строка внутри таблички: фиксированный бокс, который ни на
   что не налезает. Сумма выигрыша осталась только в итоге раздачи, а секунды —
   только кольцом вокруг аватара.
   ========================================================================= */
.seat-tag {
  position: static; transform: none; z-index: auto;
  display: block; max-width: 100%;
  margin-top: calc(1px * var(--tbl));
  padding: 0; border-radius: 0; background: none;
  font-size: calc(10px * var(--tbl)); font-weight: 700;
  letter-spacing: .02em; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seat-tag.allin { background: none; color: var(--danger); }
.seat-tag.hand { background: none; color: var(--brass-hi); }
.pot { flex-direction: row; gap: 0; }


/* =========================================================================
   Стол шире, баттон у таблички
   Овал занимал чуть больше половины ширины экрана, а места стояли по его краю —
   поэтому вскрытые карты боковых игроков оказывались за бортом, в темноте.
   Баттон был привязан к верху блока места, а верх блока — это карты, вот он на
   них и ложился. Теперь он у таблички: она всегда внизу и всегда одного размера.
   ========================================================================= */
.rail { inset: 62px 6% 64px; }

.dealer { top: auto; bottom: calc(4px * var(--tbl)); }
.seat.side-right .dealer { right: calc(-6px * var(--tbl)); left: auto; }
.seat.side-left .dealer { left: calc(-6px * var(--tbl)); right: auto; }
.seat.mine .dealer { bottom: calc(4px * var(--tbl)); }


/* Вскрытые карты соперника встают ПОД табличку, а не над аватаром: блок места
   растёт внутрь стола, а не наружу, и карты верхнего игрока перестают уезжать
   за борт в темноту. Своё место — исключение, там карты крупные и сверху. */
.seat:not(.mine).show .seat-cards { order: 1; margin-top: calc(2px * var(--tbl)); }
.seat:not(.mine).show .seat-cards .card { --w: calc(26px * var(--tbl)); }


/* Баттон стоит целиком рядом с табличкой, а не на её углу, и на её высоте —
   внизу он попадал на плашку «Отошёл». */
.dealer { top: auto; bottom: calc(16px * var(--tbl)); }
.seat.side-right .dealer { right: calc(-15px * var(--tbl)); left: auto; }
.seat.side-left .dealer { left: calc(-15px * var(--tbl)); right: auto; }
.seat.mine .dealer { bottom: calc(10px * var(--tbl)); }

/* На маленьком столе закрытые карты соперника мельче — иначе они достают до банка. */
@media (max-height: 700px) {
  .seat-cards .card { --w: calc(19px * var(--tbl)); }
  .seat:not(.mine).show .seat-cards .card { --w: calc(21px * var(--tbl)); }
}


/* На низком экране сукну достаётся около 270 точек: собственные карты в 46 точек
   при вскрытии достают до общих. Там они мельче — читаются всё равно, потому что
   стоят ближе всех к глазу. */
@media (max-height: 700px) {
  .seat.mine .seat-cards .card { --w: calc(34px * var(--tbl)); }
  .seat.mine .seat-plate { padding: calc(1px * var(--tbl)) calc(6px * var(--tbl)) calc(2px * var(--tbl)); }
  .seat.mine .seat-stack { font-size: calc(14px * var(--tbl)); }
}


/* С открытой панелью ставок на 360×640 сукно совсем узкое, и фишка ставки
   касается угла таблички своего же игрока. Там она мельче и прижата плотнее. */
@media (max-height: 700px) {
  .bet { font-size: calc(10px * var(--tbl)); padding: 1px calc(5px * var(--tbl)) 1px 2px; }
  .bet .chip-dot { width: calc(8px * var(--tbl)); height: calc(8px * var(--tbl)); }
}


/* =========================================================================
   Подпись улицы убрана
   «ПРЕФЛОП», «ФЛОП», «РАЗДАЧА ОКОНЧЕНА» повторяли то, что и так видно: сколько
   карт лежит на столе и что говорит панель действий. На маленьком экране эта
   строка отнимала у сукна место, которого не было.
   ========================================================================= */
.street { display: none; }


/* Полоса таймера рисуется покадрово из серверного дедлайна, поэтому CSS-переход ей
   только мешал: на каждом ререндере он начинался заново, и полоса дёргалась. */
.turn-timer i { transition: none; }


/* =========================================================================
   Реплика над игроком
   Раньше последние три строки чата постоянно висели над сукном: они занимали
   место, перекрывали стол и не показывали, кто именно говорит. Теперь фраза
   всплывает над своим же аватаром и через пару секунд уходит; вся переписка
   с полем ввода осталась в шторке чата.
   ========================================================================= */
.say-bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: calc(150px * var(--tbl, 1));
  padding: calc(5px * var(--tbl, 1)) calc(9px * var(--tbl, 1));
  border-radius: calc(12px * var(--tbl, 1));
  background: rgba(10, 7, 6, .92); box-shadow: inset 0 0 0 1px var(--line);
  font-size: calc(12px * var(--tbl, 1)); line-height: 1.25;
  color: var(--ivory); text-align: center; word-break: break-word;
  z-index: 9; pointer-events: none;
  animation: say-in .22s ease both;
}
/* верхний ряд: над ним нет места, реплика уходит под плашку */
.seat.at-top .say-bubble { bottom: auto; top: calc(100% + 6px); }
@keyframes say-in { from { opacity: 0; transform: translate(-50%, 6px) scale(.92); } }
.chat-feed:empty { display: none; }

/* =========================================================================
   Панель действий фиксированной высоты
   Панель меняла высоту вместе с содержимым: приходил результат раздачи —
   стол поднимался, открывалась панель рейза — стол сжимался вдвое. Кнопки
   уезжали из-под пальца между двумя кадрами. Теперь высота постоянная, а
   панель рейза не раздвигает её, а всплывает над ней.
   ========================================================================= */
:root { --actbar: 112px; }
.actions {
  position: relative;
  height: calc(var(--actbar) + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
  min-height: 0;
  align-content: center;
  overflow: visible;
}
/* статус и «⋯» стоят в одну строку: подпись слева, управление справа */
.act-status {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.act-status > span:first-child { min-width: 0; }
.act-status .btns { display: flex; flex: none; gap: 6px; }
.table-menu {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); color: var(--text);
  font-size: 20px; line-height: 1; letter-spacing: 1px;
}
.table-menu:active { background: rgba(255, 255, 255, .09); }

/* Панель рейза всплывает вверх от нижнего края панели, а не растягивает её.
   Нижние кнопки «Отмена» и «Рейз» стояли в самом низу экрана, под домашней
   полоской iPhone, — теперь между ними и краем всегда есть безопасная зона. */
.raise-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 14;
  padding: 12px 16px calc(14px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
  background: linear-gradient(180deg, rgba(20, 14, 12, .98), var(--panel));
  border-top: 1px solid var(--brass);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, .55);
  animation: raise-up .18s ease both;
}
@keyframes raise-up { from { opacity: 0; transform: translateY(14px); } }
.raise-panel .act-row .btn { padding: 15px 8px; }

@media (max-height: 700px) {
  :root { --actbar: 96px; }
  .raise-panel { padding-top: 9px; gap: 6px; }
}

/* фишки улицы уезжают в банк */
.bet-sweep {
  position: absolute; z-index: 7; pointer-events: none;
  transform: translate(-50%, -50%);
}

/* --- панель рейза: компактнее и не поверх собственных карт ------------------
   Панель всплывает вверх и неизбежно накрывает нижнее место — а нижнее место
   ваше, и именно на свои карты смотрят, когда выбирают размер ставки. Поэтому
   панель ужата в четыре ряда, а стол на это время один раз плавно поднимается.
   Это единственный сдвиг, который остался, и он осознанный: пока панель
   открыта, стол стоит на месте. */
.raise-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.raise-head .raise-top { gap: 8px; }
.raise-head .stepper { justify-self: end; }
.raise-panel .presets { grid-template-columns: repeat(5, 1fr); }
.raise-panel .presets .btn { padding: 7px 2px; font-size: 11.5px; }
.raise-panel input[type=range] { height: 30px; }

/* Насколько поднять стол, считает сам клиент: ровно столько, сколько занимает
   панель сверх обычной высоты, и не больше, чем остаётся до шапки стола —
   иначе на маленьком экране верхнее место уезжало под заголовок. */
.table-screen .felt-wrap { transition: transform .18s ease; }
.table-screen .felt-wrap { transform-origin: top center; }
.table-screen.raising .felt-wrap {
  transform: translateY(calc(-1 * var(--raise-lift, 0px))) scale(var(--raise-scale, 1));
}

/* =========================================================================
   Цвета залов
   Все три зала были латунными и отличались только насыщенностью — на глаз
   они читались как один. Низкий зал получает густой зелёный, средний —
   синий, VIP остаётся фирменной латунью: это его отличие, а не просто ещё
   один оттенок. Цвет держится только на метке зала и полосе слева, само
   сукно и кнопки остаются в фирменном стиле.
   ========================================================================= */
:root {
  --hall-low: #2f8f5b;
  --hall-low-soft: rgba(47, 143, 91, .55);
  --hall-mid: #3d7ec9;
  --hall-mid-soft: rgba(61, 126, 201, .55);
}
.hall-block.tier-low { --hall-ink: var(--hall-low); }
.hall-block.tier-mid { --hall-ink: var(--hall-mid); }
.hall-block.tier-vip { --hall-ink: var(--brass-hi); }
.tier-low .tier-dot { background: var(--hall-low); }
.tier-mid .tier-dot { background: var(--hall-mid); }
.hall-block.tier-low::before { background: var(--hall-low-soft); }
.hall-block.tier-mid::before { background: var(--hall-mid-soft); }

/* =========================================================================
   Карточки схлопывались до одних отступов
   Все разделы — колонки flex, а у карточек с закруглением стоит overflow:
   hidden. Из-за этого их автоматический минимальный размер равен нулю, и при
   длинной странице flex сжимал их до высоты собственных полей: на экране
   оставалась пустая плашка с заголовком в углу, а текст и обратный отсчёт
   обрезались. Ни один элемент этих экранов не должен сжиматься — запрет
   касается каждого раздела, а не только «Турниров» и «Слотов».
   ========================================================================= */
#lobby > *, #shop > *, #rating > *, #profile > *, #tournaments > *, #slots > * { flex: none; }

/* поля своей комнаты */
.field { display: grid; gap: 4px; }
.field input {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .25);
  color: var(--text); font-size: 15px; font-family: var(--ui);
}
.field input:focus { outline: none; border-color: var(--brass); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* выбор языка в профиле */
.lang-pick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lang-pick .btn.on { background: var(--brass); color: var(--ink-on-brass, #23160f); }

/* =========================================================================
   Нижнее меню под число включённых разделов
   В облегчённом клубе половина разделов выключена, а сетка была жёстко на
   шесть колонок: оставшиеся кнопки жались влево, а справа зияла пустота.
   Колонок ровно столько, сколько кнопок осталось.
   ========================================================================= */
.mainnav[data-items="2"] { grid-template-columns: repeat(2, 1fr); }
.mainnav[data-items="3"] { grid-template-columns: repeat(3, 1fr); }
.mainnav[data-items="4"] { grid-template-columns: repeat(4, 1fr); }
.mainnav[data-items="5"] { grid-template-columns: repeat(5, 1fr); }

/* =========================================================================
   Фишка ставки чуть мельче
   Ставки стоят близко к своим игрокам — так просили, и так понятно, чья она.
   Но на узком экране пилюля задевала то плашку места, то кнопку дилера:
   зазор между ними всего несколько пикселей. Двигать ставку дальше некуда —
   там дилер, ближе — плашка. Поэтому уменьшена сама фишка, а не расстояние.
   ========================================================================= */
.bet { font-size: calc(11px * var(--tbl)); padding: 1px calc(6px * var(--tbl)) 1px 2px; }
.bet .chip-dot { width: calc(10px * var(--tbl)); height: calc(10px * var(--tbl)); }

/* =========================================================================
   Боковые колонки на широком экране
   Лобби нарисовано под ширину телефона — 560px. На десктопе оно оказывается в
   колонке вдвое уже, и содержимое, рассчитанное на полную ширину, начинает
   вылезать: названия столов переносились на две строки, блок «Игра с друзьями»
   выходил за колонку на 63 пикселя, метка VIP — на 19. Здесь строки приведены
   к ширине, которая у них реально есть.
   ========================================================================= */
@media (min-width: 1100px) {
  /* Название стола — в одну строку с многоточием. «Лоу 1», разорванное на
     «Лоу» и «1», выглядит как сломанная вёрстка, а не как узкая колонка. */
  #lobby .tr-name {
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 6px;
  }
  #lobby .tr-name .tier-dot { flex: none; }
  #lobby .tr-lock { flex: none; }
  #lobby .tr-meta { min-width: 0; }

  /* Кружки занятых мест — первое, чем можно пожертвовать: рядом стоит «2/4». */
  #lobby .tr-dots { display: none; }
  #lobby .tr-go { min-width: 64px; padding-inline: 10px; margin-left: 6px; }

  /* Заголовки секций переносятся, а не выходят за край. */
  #lobby .section-head,
  #lobby .hall-head,
  #lobby .friends-row { flex-wrap: wrap; row-gap: 4px; }
  #lobby .section-head > span,
  #lobby .hall-count { text-align: left; }
  #lobby .friends-row .btn { flex: 1 1 auto; min-width: 0; }
  #lobby p,
  #lobby .fineprint { min-width: 0; overflow-wrap: anywhere; }

  /* Правая колонка: строка комнаты в один ряд без обрезки. */
  .side .room-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .side .rm-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .rm-seats { flex: none; white-space: nowrap; }
}


/* =========================================================================
   Появление результата раздачи
   Баннер и строка результата анимировались общей `pop` — она осталась от времён,
   когда результат висел по центру сукна и позиционировался через translate(-50%).
   Теперь оба стоят обычными блоками в панели действий, и этот же -50% уносил их
   на пол-ширины за левый край экрана на время анимации.
   ========================================================================= */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
}
.result-banner, .result-line { animation: rise .42s cubic-bezier(.2, .9, .3, 1.2) both; }
