/* Heart Beats player app (§13.1, §13.2): the demo site's #play and /play/{operator}/{env}.
   Built on the site's tokens in /style.css. Rule: the table is its own grid box; bars, rails,
   panels and notices are sibling boxes, so nothing the player didn't open sits over the table and
   nothing resizes it during a match (player-app.js gives the felt an explicit size). */

.pa {
  --bar-h: 56px;
  --status-h: 28px;
  --ctrl-h: 60px;
  --rail-w: 76px;
  --tabs-h: 60px;
  --gap: 12px;
  --team0: #5eead4;
  --team1: #ffd166;
  --online: #34d399;
  --sat: 0px; --sar: 0px; --sab: 0px; --sal: 0px;
  position: relative; z-index: 1;
  display: grid; min-width: 0;
  color: var(--text); font: 15px/1.5 var(--body);
}
.pa [hidden] { display: none !important; }
.pa button { font-family: inherit; }
.pa h1, .pa h2, .pa h3 { margin: 0; }
.pa-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Frames ---------- */
/* full: the partner page, and the demo site while a table shows (fixed, one screen, no page scroll) */
.pa[data-frame="full"] {
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  position: fixed; inset: 0; z-index: 50; height: 100vh; height: 100dvh; overflow: hidden;
  background: radial-gradient(1200px 700px at 80% -10%, #2a0f55 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 30%, #1d0a3d 0%, transparent 60%),
              linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
}
.pa:fullscreen { background: var(--bg-1); }
/* page: the demo site's lobby, in the page flow under the site header */
.pa[data-frame="page"] { min-height: calc(100vh - 72px); }
html.pa-locked, html.pa-locked body { overflow: hidden; }

/* ---------- Grid layouts ---------- */
/* Desktop and landscape tablets (≥ 1024 × 600), and short screens outside a match */
.pa[data-layout="desk"], .pa[data-layout="short"][data-match="0"] {
  grid-template-columns: minmax(0, 1fr) calc(var(--rail-w) + var(--sar));
  grid-template-rows: calc(var(--bar-h) + var(--sat)) auto minmax(0, 1fr) auto;
  grid-template-areas: "bar bar" "status status" "main rail" "controls rail";
}
.pa[data-layout="desk"]:not([data-panel=""]) {
  grid-template-columns: minmax(0, 1fr) var(--panel-w, 340px) calc(var(--rail-w) + var(--sar));
  grid-template-areas: "bar bar bar" "status status status" "main panel rail" "controls panel rail";
}
.pa[data-layout="short"][data-match="0"] { --bar-h: 48px; }

/* Phones and portrait tablets */
.pa[data-layout="phone"] {
  --bar-h: 52px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: calc(var(--bar-h) + var(--sat)) auto minmax(0, 1fr) auto;
  grid-template-areas: "bar" "status" "main" "tabs";
}
.pa[data-layout="phone"][data-match="1"] {
  --bar-h: 48px; --status-h: 24px; --ctrl-h: 62px;
  grid-template-areas: "bar" "status" "main" "controls";
}

/* Short screens (landscape, height < 600) in a match: left rail, table, right column (status + controls) */
.pa[data-layout="short"][data-match="1"] {
  --status-h: 92px;
  grid-template-columns: calc(70px + var(--sal)) minmax(0, 1fr) calc(clamp(136px, 22vw, 210px) + var(--sar));
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "bar main status" "bar main controls";
}

/* Which bars exist where */
.pa-rail { display: none; }
.pa-tabs { display: none; }
.pa[data-layout="desk"] .pa-rail, .pa[data-layout="short"][data-match="0"] .pa-rail { display: flex; }
.pa[data-layout="phone"][data-match="0"] .pa-tabs { display: grid; }

/* ---------- App bar ---------- */
.pa-bar {
  grid-area: bar; position: relative; z-index: 3; min-width: 0;
  display: flex; align-items: center; gap: .5rem;
  padding: var(--sat) max(var(--gap), var(--sar)) 0 max(var(--gap), var(--sal));
  background: rgba(10, 5, 22, .82); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.pa-bar-start, .pa-bar-end { display: flex; align-items: center; gap: .5rem; flex: none; }
.pa-bar-end { margin-left: auto; }
.pa-brand { display: inline-grid; place-items: center; width: 36px; height: 40px; flex: none; }
.pa-brand img { width: 26px; height: auto; filter: drop-shadow(0 4px 12px rgba(255, 77, 141, .5)); }
.pa[data-frame="page"] .pa-brand { display: none; }
.pa-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; color: var(--muted); font-size: .92rem; }
.pa-title strong { color: var(--text); font: 700 1rem var(--display); letter-spacing: -.01em; }
.pa-title-sub::before { content: " · "; }
.pa[data-layout="phone"] .pa-title { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.pa[data-layout="phone"] .pa-title > * { overflow: hidden; text-overflow: ellipsis; }
.pa[data-layout="phone"] .pa-title-sub { font-size: .74rem; }
.pa[data-layout="phone"] .pa-title-sub::before { content: none; }
.pa[data-layout="phone"] .pa-brand { display: none; }
.pa-back {
  display: inline-flex; align-items: center; gap: .3rem; height: 40px; padding: 0 .85rem 0 .5rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .08);
  color: var(--text); font: 600 .88rem var(--body); cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s;
}
.pa-back:hover { border-color: var(--violet); background: rgba(155, 92, 255, .18); }
.pa-iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
  border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .08);
  color: var(--text); cursor: pointer; transition: background .2s, border-color .2s;
}
.pa-iconbtn:hover { border-color: var(--violet); background: rgba(155, 92, 255, .18); }
.pa-morebtn .pa-ic { width: 24px; height: 24px; stroke-width: 3; }
.pa-buybtn { gap: .35rem; padding: 0 .9rem 0 .7rem; }
.pa-conn { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.pa-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 209, 102, .18); flex: none; }
.pa-conn[data-state="online"] .pa-dot { background: var(--online); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.pa-conn[data-state="offline"] .pa-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 138, .25); }
.pa-conn[data-state="reconnecting"] .pa-dot, .pa-conn[data-state="connecting"] .pa-dot { animation: pa-blink 1s infinite; }
.pa-chip {
  display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 .85rem 0 .6rem;
  border-radius: 999px; border: 1px solid rgba(255, 209, 102, .28); background: rgba(255, 209, 102, .1);
  color: var(--gold); font: 700 1rem var(--display); font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap;
}
.pa-chip:hover { border-color: rgba(255, 209, 102, .6); }
.pa-chip-v { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.pa-chip-held { font: 600 .66rem var(--body); color: #f5e3b0; letter-spacing: .01em; }
.pa-chip.bump { animation: bump .6s var(--ease); }
.pa-chip.dip { animation: pa-dip .6s var(--ease); }
@keyframes pa-dip { 30% { transform: scale(.92); } }

/* Visually hidden labels that stay in the accessibility tree */
.pa[data-wide="0"] .pa-conn-txt, .pa[data-layout="phone"] .pa-buybtn .pa-lbl,
.pa[data-layout="short"][data-match="1"] .pa-lbl, .pa[data-layout="short"][data-match="1"] .pa-conn-txt {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pa[data-layout="phone"] .pa-buybtn { width: 40px; padding: 0; }
.pa[data-layout="phone"] .pa-back { padding-right: .7rem; }
.pa[data-layout="phone"][data-match="1"] .pa-back { width: 40px; padding: 0; justify-content: center; }
.pa[data-layout="phone"][data-match="1"] .pa-back .pa-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pa[data-layout="phone"] .pa-title { font-size: .82rem; }
.pa[data-layout="phone"] .pa-title strong { font-size: .92rem; }
.pa[data-layout="phone"] .pa-chip { padding: 0 .7rem 0 .5rem; font-size: .92rem; }
/* The return-to-casino link is its arrow alone on every phone (Stage 6 check, 2026-11-12): with its
   words ("Salon du casino") the casino's name beside it was cut to one letter at 390 px. The words stay
   for screen readers, and the menu has "Return to casino" in full. */
.pa[data-layout="phone"] .pa-casino { width: 40px; padding: 0; justify-content: center; }
.pa[data-layout="phone"] .pa-casino .pa-lbl { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 380px) {
  .pa[data-layout="phone"] .pa-back .pa-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pa[data-layout="phone"] .pa-back { width: 40px; padding: 0; justify-content: center; }
}

/* Short screens in a match: the app bar becomes the narrow left rail */
.pa[data-layout="short"][data-match="1"] .pa-bar {
  flex-direction: column; justify-content: flex-start; gap: 8px;
  padding: calc(8px + var(--sat)) 6px calc(8px + var(--sab)) max(6px, var(--sal));
  border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto;
}
.pa[data-layout="short"][data-match="1"] .pa-bar-start,
.pa[data-layout="short"][data-match="1"] .pa-bar-end { flex-direction: column; margin: 0; gap: 8px; }
.pa[data-layout="short"][data-match="1"] .pa-title { display: none; }
.pa[data-layout="short"][data-match="1"] .pa-back,
.pa[data-layout="short"][data-match="1"] .pa-buybtn { width: 44px; height: 44px; padding: 0; justify-content: center; }
.pa[data-layout="short"][data-match="1"] .pa-chip { flex-direction: column; justify-content: center; gap: 2px; width: 58px; height: auto; min-height: 44px; padding: 6px 4px; border-radius: 14px; font-size: .82rem; }
.pa[data-layout="short"][data-match="1"] .pa-chip .coin { width: 12px; height: 12px; }
.pa[data-layout="short"][data-match="1"] .pa-chip-v { align-items: center; }
.pa[data-layout="short"][data-match="1"] .pa-conn { order: 9; }

/* ---------- Status line (fixed height during a match) ---------- */
.pa-status {
  grid-area: status; position: relative; z-index: 2; min-width: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  height: var(--status-h); padding: 0 max(var(--gap), var(--sar)) 0 max(var(--gap), var(--sal));
  background: rgba(10, 5, 22, .55); border-bottom: 1px solid var(--line);
  color: #d9c8ff; font-size: .86rem; font-weight: 600; white-space: nowrap;
}
.pa[data-match="0"] .pa-status { height: auto; min-height: 34px; padding-block: .3rem; white-space: normal; text-align: center; }
.pa[data-match="0"] .pa-status[data-empty="1"] { display: none; }
.pa-status-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* "<name> is playing… 0:45": only the name shortens, so the verb and the clock stay readable. */
.pa-status-txt.has-name { display: inline-flex; align-items: baseline; max-width: 100%; }
.pa-status-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: isolate; }
.pa-status-rest { flex: none; white-space: pre; }
.pa-status[data-kind="turn"] { color: var(--gold); }
.pa-status[data-kind="urgent"] { color: var(--danger); }
.pa-status[data-kind="urgent"] .pa-status-txt { animation: pa-blink 1s infinite; }
.pa-status[data-kind="warn"] { color: #f5e3b0; background: rgba(255, 209, 102, .08); }
.pa-status[data-kind="bad"] { color: #ffc2cf; background: rgba(255, 107, 138, .1); }
.pa-status[data-kind="good"] { color: var(--teal); }
.pa-status-act { flex: none; height: 24px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .15); color: var(--text); font: 600 .78rem var(--body); cursor: pointer; }
.pa[data-layout="short"][data-match="1"] .pa-status {
  align-items: flex-start; justify-content: center; text-align: center; white-space: normal; line-height: 1.35;
  padding: calc(10px + var(--sat)) max(10px, var(--sar)) 8px 10px; border-left: 1px solid var(--line);
}
.pa[data-layout="short"][data-match="1"] .pa-status-txt, .pa[data-layout="short"][data-match="1"] .pa-status-txt.has-name { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.pa[data-layout="short"][data-match="1"] .pa-status-name, .pa[data-layout="short"][data-match="1"] .pa-status-rest { white-space: normal; overflow-wrap: anywhere; }

/* ---------- Main area ---------- */
.pa-main { grid-area: main; position: relative; z-index: 1; min-width: 0; min-height: 0; }
.pa[data-frame="full"] .pa-main { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.pa[data-match="1"] .pa-main { overflow: hidden; padding: var(--gap); }
.pa[data-layout="phone"][data-match="1"] .pa-main { padding: 6px max(6px, var(--sar)) 6px max(6px, var(--sal)); }
.pa[data-layout="short"][data-match="1"] .pa-main { padding: calc(6px + var(--sat)) 6px calc(6px + var(--sab)); }
.pa-stage { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }

/* ---------- Game controls ---------- */
.pa-controls {
  grid-area: controls; position: relative; z-index: 2; min-width: 0;
  display: flex; align-items: center; gap: .8rem; height: var(--ctrl-h);
  padding: 0 max(var(--gap), var(--sar)) 0 max(var(--gap), var(--sal));
  border-top: 1px solid var(--line); background: rgba(10, 5, 22, .55);
}
.pa-hint { flex: 1; min-width: 0; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pa-cbtns { display: flex; align-items: center; gap: .5rem; flex: none; }
.pa-controls .btn { --bh: 42px; padding: 0 1.1rem; }
.pa[data-layout="phone"] .pa-controls { height: calc(var(--ctrl-h) + var(--sab)); padding-bottom: var(--sab); gap: .5rem; }
.pa[data-layout="phone"] .pa-hint { font-size: .78rem; -webkit-line-clamp: 3; }
.pa[data-layout="phone"] .pa-controls .btn { --bh: 40px; padding: 0 .85rem; font-size: .86rem; }
.pa[data-layout="short"][data-match="1"] .pa-controls {
  flex-direction: column; align-items: stretch; justify-content: flex-end; height: auto; gap: 8px;
  padding: 8px max(8px, var(--sar)) calc(8px + var(--sab)) 8px; border-top: 0; border-left: 1px solid var(--line);
}
.pa[data-layout="short"][data-match="1"] .pa-hint { flex: 0 1 auto; font-size: .76rem; -webkit-line-clamp: 4; text-align: center; }
.pa[data-layout="short"][data-match="1"] .pa-cbtns { flex-direction: column; align-items: stretch; gap: 6px; }
.pa[data-layout="short"][data-match="1"] .pa-controls .btn { --bh: 40px; width: 100%; padding: 0 .6rem; }

/* ---------- Quick rail (desktop and landscape) ---------- */
.pa-rail {
  grid-area: rail; position: relative; z-index: 2; min-height: 0;
  flex-direction: column; gap: 4px; padding: 10px max(6px, var(--sar)) calc(10px + var(--sab)) 6px;
  border-left: 1px solid var(--line); background: rgba(10, 5, 22, .5); overflow-y: auto; scrollbar-width: none;
}
.pa[data-frame="page"] .pa-rail { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 72px); }
.pa-rbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; padding: 6px 2px; border-radius: 12px; border: 1px solid transparent; background: none;
  color: var(--muted); font: 600 .7rem/1.15 var(--body); text-align: center; cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.pa-rbtn .pa-ic { width: 22px; height: 22px; }
.pa-rbtn:hover { color: var(--text); background: rgba(155, 92, 255, .12); }
.pa-rbtn[aria-pressed="true"] { color: var(--text); background: rgba(155, 92, 255, .2); border-color: var(--line-strong); }
/* Sound is an on/off switch, not an open sheet */
.pa-rbtn:is([data-id="sound"], [data-id="motion"])[aria-pressed="true"] { background: none; border-color: transparent; color: #d9c8ff; }
.pa-rbtn:is([data-id="sound"], [data-id="motion"])[aria-pressed="false"] { color: var(--muted); opacity: .8; }
.pa[data-layout="short"] .pa-rbtn { min-height: 42px; gap: 1px; font-size: .64rem; }
.pa[data-layout="short"] .pa-rail { gap: 2px; padding-block: 4px; }
@media (pointer: coarse) { .pa-rbtn[data-id="shortcuts"] { display: none; } }

/* ---------- Tab bar (phones, outside a match) ---------- */
.pa-tabs {
  grid-area: tabs; position: relative; z-index: 3;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabs-h) + var(--sab)); padding: 0 var(--sar) var(--sab) var(--sal);
  background: rgba(10, 5, 22, .94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.pa[data-frame="page"] .pa-tabs { --sab: env(safe-area-inset-bottom, 0px); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; }
.pa[data-frame="page"][data-layout="phone"][data-match="0"] { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); }
.pa-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font: 600 .72rem var(--body); cursor: pointer;
}
.pa-tab .pa-ic { width: 22px; height: 22px; }
.pa-tab[aria-current="true"] { color: var(--text); }
.pa-tab[aria-current="true"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }

/* ---------- Side panel and sheets ---------- */
.pa-panel {
  grid-area: panel; position: relative; z-index: 2; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(34, 16, 74, .96), rgba(20, 10, 44, .96)); border-left: 1px solid var(--line-strong);
}
.pa[data-frame="page"][data-layout="desk"] .pa-panel { position: sticky; top: 72px; align-self: start; height: calc(100vh - 88px); }
/* Phones and short screens: full-height sheet over the app (modal; the rest is inert) */
.pa:not([data-layout="desk"]) .pa-panel {
  position: fixed; inset: 0; z-index: 60; border: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: linear-gradient(160deg, #22104a, #140a2c);
  animation: pa-sheet-in .28s var(--ease);
}
@keyframes pa-sheet-in { from { transform: translateY(24px); opacity: 0; } }
.pa-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
.pa-panel-head h2 { font-size: 1.2rem; font-weight: 750; }
.pa-panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 24px; }
.pa-turnbanner {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex: none;
  padding: 8px 12px 8px 18px; border-bottom: 1px solid rgba(255, 209, 102, .45);
  background: linear-gradient(90deg, rgba(255, 209, 102, .2), rgba(255, 77, 141, .2)); color: var(--gold); font-weight: 700;
}
.pa-turnbanner .btn { flex: none; }

/* ---------- Toasts (outside a match only) and blocker ---------- */
.pa-toasts { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.pa[data-layout="phone"] .pa-toasts { bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom, 0px)); }
.pa[data-layout="desk"] .pa-toasts { right: calc(var(--rail-w) + 16px); }
.pa-blocker { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(7, 3, 15, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pa-blockcard { max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center; }
.pa-blockcard h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.25; }
.pa-blockcard .cta-heart { width: 72px; }
/* Casino players type a name once (2026-11-07): the one-time name screen, in the blocker */
.pa-namecard { max-width: 440px; gap: 1rem; }
.pa-namecard .pa-note { width: 100%; margin: 0; text-align: center; }
.pa-nameform { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; width: 100%; max-width: 340px; }
.pa-namelabel { font-weight: 700; font-size: .9rem; color: #e3d4ff; }
.pa-nameform .pa-textin { max-width: none; height: 48px; text-align: center; font-size: 1.05rem; }
.pa-nameform .btn { width: 100%; }
.pa-nameerr { min-height: 1.2em; margin: 0; font-size: .9rem; color: var(--danger); }
.pa-nameerr:empty { display: none; }

/* ---------- Shared bits ---------- */
.pa-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.pa-row .btn { flex: 1 1 auto; }
.pa-sub { margin: 1.3rem 0 .6rem; font-size: 1rem; font-weight: 700; color: #e3d4ff; }
.pa-sub:first-child { margin-top: 0; }
.pa-note { margin: 0 0 1rem; padding: .75rem .95rem; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .08); font-size: .9rem; }
.pa-note h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.pa-note p { margin-bottom: .6rem; }
.pa-note-warn { border-color: rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .07); color: #f5e3b0; }
.pa-note-wait { display: flex; align-items: center; gap: .6rem; border-style: dashed; }
.pa-note-turn { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; border-color: rgba(255, 77, 141, .45); background: rgba(255, 77, 141, .08); }
.pa-field-err { min-height: 1.3em; margin: .3rem 0 0; color: var(--danger); font-size: .84rem; }
.pa-field-err:empty { min-height: 0; }
.pa-dl { margin: 0 0 1rem; display: grid; gap: .35rem; }
.pa-dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.pa-dl dt { color: var(--muted); }
.pa-dl dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pa-state { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; padding: 1.2rem; border-radius: 14px; color: var(--muted); text-align: center; font-size: .92rem; }
.pa-error { color: #ffc2cf; border: 1px solid rgba(255, 107, 138, .35); background: rgba(255, 107, 138, .06); }
.pa-empty-state { border: 1px dashed var(--line-strong); }
.pa-spin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--pink); animation: pa-spin .8s linear infinite; flex: none; }
.pa-spin.big { width: 42px; height: 42px; border-width: 3px; }
@keyframes pa-spin { to { transform: rotate(360deg); } }
@keyframes pa-blink { 50% { opacity: .45; } }
.pa-tag { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 .65rem; border-radius: 999px; font: 700 .78rem var(--body); white-space: nowrap; }
.pa-free { color: var(--teal); background: rgba(94, 234, 212, .12); border: 1px solid rgba(94, 234, 212, .35); }
.pa-fee { color: var(--gold); background: rgba(255, 209, 102, .1); border: 1px solid rgba(255, 209, 102, .3); }
.pa kbd { display: inline-block; min-width: 1.6em; padding: .1em .45em; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: rgba(0, 0, 0, .3); font: 700 .78rem var(--body); text-align: center; }
.pa-danger { background: linear-gradient(120deg, #ff6b8a, #e11d48) !important; box-shadow: 0 8px 30px -8px rgba(225, 29, 72, .6) !important; }
.pa-dialog h2 { font-size: 1.45rem; margin-bottom: .7rem; }
.pa-dialog .pa-dl { margin-top: .4rem; }

/* ---------- Lobby ---------- */
.pa-lobby { width: 100%; max-width: 1180px; margin-inline: auto; padding: clamp(14px, 2.6vw, 30px) max(clamp(14px, 2.6vw, 30px), var(--sar)) 32px max(clamp(14px, 2.6vw, 30px), var(--sal)); }
.pa-lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pa-lobby-head .eyebrow { margin-bottom: .6rem; }
.pa-lobby-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; }
.pa-gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.pa-gcard {
  display: flex; align-items: center; gap: .9rem; padding: .6rem; border-radius: 18px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s, box-shadow .25s, transform .2s var(--ease);
}
.pa-gcard:hover { border-color: var(--line-strong); box-shadow: var(--glow); }
.pa-gcard.on { border-color: rgba(255, 77, 141, .6); box-shadow: 0 0 0 1px rgba(255, 77, 141, .35), 0 10px 30px -12px rgba(255, 77, 141, .6); }
.pa-gcard .art { width: 112px; height: 78px; border-radius: 12px; flex: none; }
/* A cover picture on a game's card (player-app.js COVERS): the whole picture, square, on the card's dark. */
.pa-gcard .art-cover { width: 104px; height: 104px; background: #07040c var(--cover) center / contain no-repeat; box-shadow: inset 0 0 0 1px rgba(155, 92, 255, .25); }
.pa-gcard .art-cover::after { content: none; }
/* The owner's neon tiles (2026-11-06) are portrait and carry their own frame and glow. */
.pa-gcard .art-cover.art-tile { width: 84px; height: 108px; border-radius: 10px; background-color: transparent; box-shadow: none; }
.pa-gcard .mini { width: 32px; height: 46px; border-radius: 6px; }
.pa-gcard .mini b { top: 2px; left: 4px; font-size: .62rem; }
.pa-gcard .mini i { font-size: 1rem; }
.pa-gcard .m0 { transform: rotate(-16deg) translateX(-24px); }
.pa-gcard .m2 { transform: rotate(16deg) translateX(24px); }
.pa-gbody { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pa-gbody strong { font: 700 1.1rem var(--display); }
.pa-lobby-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (min-width: 1180px) { .pa-lobby-cols:has(> aside:not([hidden])) { grid-template-columns: minmax(0, 1fr) 300px; } }
.pa-lobby-main { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.pa-block { padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pa-bh { font-size: 1.15rem; font-weight: 750; margin-bottom: .7rem; }
.pa-tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.pa-trow {
  display: grid; align-items: center; gap: .4rem 1rem; padding: .65rem .8rem; border-radius: 14px;
  grid-template-columns: minmax(0, 1.7fr) auto auto minmax(0, 1fr) auto; grid-template-areas: "name seats tag wait btn";
  background: rgba(12, 6, 26, .5); border: 1px solid var(--line);
}
.pa-tname { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.pa-tname strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-tname small { font-size: .8rem; }
.pa-tseats { grid-area: seats; display: inline-flex; align-items: center; gap: .35rem; color: #d9c8ff; font-size: .86rem; white-space: nowrap; }
.pa-tseats .pa-ic { width: 18px; height: 18px; }
.pa-trow .pa-tag { grid-area: tag; justify-self: start; }
.pa-twait { grid-area: wait; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-trow .btn { grid-area: btn; }
.pa-privgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.pa-privgrid p { margin-bottom: .5rem; }
.pa-coderow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pa-coderow select, .pa-codein, .pa-amount, .pa-filter select, .pa-cur select {
  height: 42px; min-width: 0; padding: 0 .9rem; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, .3); color: var(--text); font: 600 .92rem var(--body);
}
.pa-coderow select { flex: 1 1 180px; }
.pa select option { background: #1c0f38; }
.pa-codein { flex: 1 1 140px; letter-spacing: .14em; text-transform: uppercase; }
.pa-codein::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; }
.pa-codein:focus, .pa-amount:focus, .pa-coderow select:focus, .pa-qty:focus, .pa-filter select:focus, .pa-cur select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(155, 92, 255, .25); }
.pa-lobby-cols > aside { position: sticky; top: 84px; }
@media (max-width: 640px) {
  .pa-trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "seats tag" "wait btn"; }
  .pa-trow .pa-tag { justify-self: end; }
  .pa-gcard .art { width: 92px; height: 66px; }
  .pa-gcard .art-cover { width: 84px; height: 84px; }
  .pa-gcard .art-cover.art-tile { width: 70px; height: 90px; }
}

/* ---------- Sheets ---------- */
.pa-stepper { display: flex; align-items: center; gap: .5rem; }
.pa-step { width: 48px; height: 48px; flex: none; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .1); color: var(--text); font: 700 1.4rem var(--display); cursor: pointer; }
.pa-step:hover { border-color: var(--violet); background: rgba(155, 92, 255, .2); }
.pa-qty { flex: 1; min-width: 0; height: 48px; padding: 0 .8rem; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .3); color: var(--gold); font: 800 1.4rem var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.pa-quick { display: flex; gap: .5rem; margin: .6rem 0 .3rem; }
.pa-chipbtn { flex: 1; height: 38px; border-radius: 999px; border: 1px solid rgba(255, 209, 102, .35); background: rgba(255, 209, 102, .08); color: var(--gold); font: 700 .92rem var(--body); cursor: pointer; }
.pa-chipbtn:hover { background: rgba(255, 209, 102, .16); }
.pa-cur { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; font-size: .9rem; color: var(--muted); }
.pa-cur select { flex: 1; }
.pa-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.pa-pkg {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .7rem .8rem; text-align: left;
  border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .07); color: var(--text); cursor: pointer;
}
.pa-pkg strong { font: 700 .98rem var(--display); }
.pa-pkg:hover { border-color: var(--violet); }
.pa-pkg.on { border-color: var(--gold); background: rgba(255, 209, 102, .1); box-shadow: 0 0 0 1px rgba(255, 209, 102, .4); }
.pa-bonus { color: var(--teal); font-weight: 700; font-size: .84rem; }
.pa-promo { position: absolute; top: -8px; right: 8px; padding: .1rem .5rem; border-radius: 999px; background: var(--grad); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.pa-price { min-height: 1.6em; margin: 1rem 0 .4rem; font: 700 1.1rem var(--display); color: var(--text); }
.pa-price.wait { color: var(--muted); font-weight: 500; }
.pa-price.err { color: var(--danger); font: 600 .92rem var(--body); }
.pa-buy .btn-block { margin-top: .6rem; }
.pa-done { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem 0; text-align: center; }
.pa-done .pa-ic { width: 52px; height: 52px; color: var(--teal); }
.pa-done.pa-bad .pa-ic { color: var(--danger); }
.pa-done h3 { font-size: 1.3rem; }
.pa-pending-list:empty { display: none; }
.pa-balance { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.pa-balance > div { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: 16px; border: 1px solid rgba(255, 209, 102, .28); background: linear-gradient(135deg, rgba(255, 209, 102, .12), rgba(255, 209, 102, .03)); }
.pa-balance strong { font: 800 1.3rem var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.pa-balance .pa-big { font-size: 1.9rem; }
.pa-txlist, .pa-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.pa-tx, .pa-match { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem .75rem; border-radius: 12px; background: rgba(12, 6, 26, .5); border: 1px solid var(--line); }
.pa-tx-main { display: flex; flex-direction: column; min-width: 0; }
.pa-tx-main strong { font-size: .92rem; }
.pa-tx-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.pa-tx-amt { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.pa-tx-amt small { font-size: .76rem; }
.pa .pos { color: var(--teal); }
.pa .neg { color: #ff9db2; }
.pa-sst { font-weight: 700; }
.pa-sst-settled, .pa-sst-refunded { color: var(--teal); }
.pa-sst-pending, .pa-sst-failed { color: var(--gold); }
.pa-segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 1rem; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.pa-seg { height: 38px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 .9rem var(--body); cursor: pointer; }
.pa-seg[aria-selected="true"] { background: var(--grad); color: #fff; }
.pa-filter { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; color: var(--muted); font-size: .9rem; }
.pa-filter select { flex: 1; }
.pa-more-row { display: flex; justify-content: center; padding: .8rem 0 0; }
.pa-more-row:empty { display: none; }
.pa-rules { margin: 0 0 1rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .45rem; color: #d9cdf2; }
.pa-score-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.pa-score-table th, .pa-score-table td { padding: .5rem .2rem; border-bottom: 1px dashed var(--line); text-align: left; font-weight: 500; }
.pa-score-table td { text-align: right; color: var(--gold); font-weight: 700; white-space: nowrap; }
.pa-mlist-nav, .pa-mgroup { display: flex; flex-direction: column; gap: 2px; margin-bottom: 1rem; }
.pa-mgroup { padding-top: .8rem; border-top: 1px solid var(--line); }
.pa-mitem {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 46px; padding: .55rem .7rem;
  border: 0; border-radius: 12px; background: none; color: var(--text); font: 600 .95rem var(--body); text-align: left; cursor: pointer;
}
.pa-mitem:hover { background: rgba(155, 92, 255, .14); }
.pa-mitem > span:not(.pa-switch) { flex: 1; }
.pa-mitem kbd { margin-left: auto; }
.pa-switch { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid var(--line-strong); transition: background .2s; }
.pa-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.pa-mitem[aria-checked="true"] .pa-switch { background: var(--violet); }
.pa-mitem[aria-checked="true"] .pa-switch::after { transform: translateX(18px); }
/* The Language item: a select at the end of the row, in the row's own colours. */
.pa-mitem-select { cursor: default; }
.pa-mselect { flex: none; max-width: 11rem; padding: .35rem .6rem; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(10, 6, 18, .6); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.pa-mselect:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
/* Right-to-left (Arabic): the app mirrors with the document; the felt keeps dir="ltr" (player-table.js). */
[dir="rtl"] .pa-mitem kbd { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pa-tx-amt { align-items: flex-start; text-align: left; }
[dir="rtl"] .pa-rules { padding-left: 0; padding-right: 1.2rem; }
[dir="rtl"] .pa-pkg { text-align: right; align-items: flex-end; }
[dir="rtl"] .pa-back .pa-ic, [dir="rtl"] .pa-mitem .pa-ic:first-child { transform: scaleX(-1); }
.pa-session { margin-bottom: 1rem; }
.pa-fine { margin-top: 1rem; }
.pa-keys { width: 100%; border-collapse: collapse; margin-top: .6rem; }
.pa-keys th, .pa-keys td { padding: .45rem .2rem; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: top; }
.pa-keys th { width: 38%; font-weight: 500; }

/* ---------- The table (felt): the Obsidian Pulse stage ----------
   The felt is the host of HBStage (pulse-stage.js, pulse-stage.css): the rendered room letterboxed
   inside the table box, the CSS 3D table plane in its camera, and a flat HUD over it. The
   stage's own stylesheet lays out the stage, the plane and the HUD box; the rules here dress what
   player-table.js puts in them: the plane layers (one full-plane wrapper per kind, keeping 3D,
   taking no pointer), the cards and stacks in them (placed by the stage, so nothing here sets a
   transform on a placed element), the score pad, and the HUD pieces (name pills, counts, the turn
   clock, the header strip, the deck count), laid out in stage px in em units: the HUD's font is
   14 px on screen whatever the stage's scale (--hb-hud-k, the inverse of the scale, set by the
   table), so every HUD size is written in em. The overlays (waiting, the round summary, the
   result card, the chkoba mark) sit in the felt box over the stage. The tokens (--hb-*) are in
   pulse.css, the card states the table sets for Pulse Motion too; the cards are the Heartbeat
   Deck (pulse-cards.css). */
.pa-felt {
  /* team identity (four players): team 0 silver, team 1 crimson; --team1-ink is the same crimson
     lifted for small text on the dark purple */
  --team0: var(--hb-silver); --team1: var(--hb-crimson-2); --team1-ink: #f0566e;
  position: relative; isolation: isolate; box-sizing: border-box; overflow: hidden;
  width: var(--tw, 100%); height: var(--th, 520px);
  border-radius: clamp(14px, 2.6vh, 26px);
  background: #0a0612;
  color: var(--hb-silver-2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 28px 64px -26px rgba(0, 0, 0, .9);
}
.pa-felt .muted { color: var(--hb-smoke); }
/* fullscreen and the full frame: the box meets the app's own darkness, no rim */
.pa[data-frame="full"] .pa-felt, .pa:fullscreen .pa-felt { box-shadow: none; }
.pa:fullscreen .pa-felt { border-radius: 0; }

/* ----- Plane layers: full-plane wrappers that keep 3D and never take a pointer ----- */
/* The plane itself takes no pointer either: in Chromium's depth-sorted hit test a plane that does
   wins against a card turned a few degrees or lifted a card's thickness above it (the first click
   on such a card then lands on the plane, while elementFromPoint says the card), so only the cards
   are targets and every point of a card is its own. */
.pa-felt .hb-cam > .hb-plane { pointer-events: none; }
.pa-felt .pa-layer {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0;
  transform: none; transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
  overflow: visible; pointer-events: none; outline: none;
}
/* Everything in a layer is laid out at its top left and placed by the stage's transform alone
   (the placement contract), turning about its own centre. The card selector repeats the rule at a
   higher specificity than the deck's own `.card.hb-card` (position: relative). */
.pa-felt .pa-layer > *, .pa-felt .pa-layer > .card.hb-card {
  position: absolute; left: 0; top: 0; margin: 0;
  transform-origin: 50% 50% 0;
}
/* Only my cards and the table's cards take a pointer; the backs and the stacks never do. */
.pa-felt .pa-hand > .card, .pa-felt .pa-tcards > .card { pointer-events: auto; }
.pa-felt .card:disabled { cursor: default; }
/* An opponent's back: 105 x 150 on the plane. */
.pa-felt .pa-ohand > .card { --h: 150px; }
/* The deck stack and a captured pile: one card box each, the 3D stack (HBDeck.stack) inside it. */
.pa-felt .pa-deckstack, .pa-felt .pa-pile {
  display: block; width: 140px; height: 200px;
  transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
}
.pa-felt .pa-deckstack > .hb-stack, .pa-felt .pa-pile > .hb-stack { position: absolute; left: 0; top: 0; margin: 0; transform: none; }
/* A chkoba's card under the pile: face up, crosswise, placed by the table (an inline transform). */
.pa-felt .pa-pile > .card.pa-chkcard { position: absolute; left: 0; top: 0; margin: 0; --h: 200px; pointer-events: none; }
/* A cast shadow in a layer (the stage puts a card's shadow right before it, so a lifted hand card's
   lies in the hand layer): the same look as the stage's own (pulse-stage.css .hb-shadow). */
.pa-felt .pa-layer > .hb-shadow {
  position: absolute; left: 0; top: 0; margin: 0;
  width: 140px; height: 200px;
  border-radius: calc(var(--h, 200px) * .1);
  background: rgba(0, 0, 0, var(--hb-sh-a, .5));
  filter: blur(var(--hb-sh-blur, 3px));
  transform-origin: 50% 50% 0;
  pointer-events: none;
  will-change: transform, opacity;
}
/* The score pad as a plane object (190 x 132, lying flat): the lab's pad still lies on the plane
   (preview/pulse-lab); the app's pad is a HUD piece, dressed further down. */
.pa-felt .pa-pad {
  box-sizing: border-box; width: 190px; height: 132px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
  border-radius: 6px; color: var(--hb-silver-2);
  background: linear-gradient(170deg, #241b36, #17112a);
  box-shadow: inset 0 0 0 1px rgba(207, 199, 230, .14), 0 .6px 1.2px rgba(0, 0, 0, .6), 0 3px 8px -3px rgba(0, 0, 0, .8);
  font: 500 15px/1.3 var(--body);
}
.pa-felt .pa-pad-t { font: 700 11px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--hb-smoke); margin-bottom: 4px; }
.pa-felt .pa-pad-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pa-felt .pa-pad-row strong { font: 800 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pa-felt .pa-pad-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hb-silver); }
.pa-felt .pa-pad-us strong { color: var(--hb-silver-2); }
.pa-felt .pa-pad-them strong { color: var(--team1-ink); }
.pa-felt .pa-pad-r { margin-top: auto; font-size: 11px; color: var(--hb-smoke); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The score pad in the HUD: an aubergine slate pinned beside the near-left corner of the felt, its
   text at the HUD's size on screen (names 14 px, numbers 17.5 px; on a dense stage 12 and 15)
   whatever the stage's scale. Flat like every HUD piece: the pin's transform is the only one
   (an individual `rotate` would swing the pinned translation about the pad's own origin). */
.pa-felt .hb-hud > .pa-pad {
  width: 9.4em; height: auto; padding: .5em .8em .55em;
  display: flex; flex-direction: column; gap: .1em;
  border-radius: .4em; color: var(--hb-silver-2);
  background: linear-gradient(170deg, #241b36, #17112a);
  box-shadow: inset 0 0 0 .07em rgba(207, 199, 230, .16), 0 .05em .1em rgba(0, 0, 0, .6), 0 .5em 1em -.4em rgba(0, 0, 0, .85);
  font: 500 1em/1.3 var(--body);
}
.pa-felt .hb-hud > .pa-pad .pa-pad-t { font: 700 .7em/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--hb-smoke); margin-bottom: .3em; }
.pa-felt .hb-hud > .pa-pad .pa-pad-row { display: flex; justify-content: space-between; gap: .6em; align-items: baseline; }
.pa-felt .hb-hud > .pa-pad .pa-pad-row strong { font: 800 1.25em/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pa-felt .hb-hud > .pa-pad .pa-pad-r { margin-top: .25em; font-size: .78em; }
.pa-felt[data-dense="1"] .hb-hud > .pa-pad { width: 8.4em; padding: .4em .65em .45em; }

/* ----- Cards on the plane: hairline edges for what can be played or taken ----- */
/* my hand: flat at rest; when it is my turn the playable cards carry a hairline silver edge, a
   mouse brightens it, and the chosen one stands raised (the stage lifts it off the felt, with its
   shadow) with a firmer edge. The edge is the card's own contact shadow (--hb-card-shadow), never a
   CSS transform: the transform is the stage's. */
.pa-felt.pa-myturn .pa-hand .card:not(:disabled) { cursor: pointer; --hb-card-shadow: 0 0 0 1.5px rgba(207, 199, 230, .55), 0 .6px 1.2px rgba(0, 0, 0, .55); }
@media (hover: hover) {
  .pa-felt.pa-myturn .pa-hand .card:not(:disabled):not(.chosen):hover { --hb-card-shadow: 0 0 0 1.5px rgba(207, 199, 230, .9), 0 .6px 1.2px rgba(0, 0, 0, .55); }
}
.pa-felt .pa-hand .card.chosen, .pa-felt.pa-myturn .pa-hand .card.chosen:not(:disabled) { --hb-card-shadow: 0 0 0 2px var(--hb-silver); }
/* not my turn: the faces stay readable (the deck's own dimming, never a filter) */
.pa-felt .pa-hand .card:disabled:not(.chosen) { --hb-card-dim: .94; }
/* a capture choice: the cards that can be taken carry a silver edge, the rest dim slightly; a
   chosen table card carries a crimson edge and stays in place */
.pa-felt .pa-tcards .card.target { cursor: pointer; --hb-card-shadow: 0 0 0 2px var(--hb-silver), 0 .6px 1.2px rgba(0, 0, 0, .55); }
.pa-felt .pa-tcards .card.chosen { --hb-card-shadow: 0 0 0 2px var(--hb-crimson-2), 0 .6px 1.2px rgba(0, 0, 0, .55); }
.pa-felt .pa-tcards.pa-picking .card:not(.target) { --hb-card-dim: .85; }
.pa-felt .card:focus-visible { outline: 3px solid var(--hb-silver); outline-offset: 3px; border-radius: calc(var(--h) * .1); }

/* ----- The HUD: 2D over the scene, in stage px, every size in em ----- */
.pa-felt .hb-hud { font: 400 calc(14px * var(--hb-hud-k, 1))/1.25 var(--body); color: var(--hb-silver-2); }
/* The pieces are information only: a card under a pill stays clickable. */
.pa-felt .hb-hud > * { pointer-events: none; box-sizing: border-box; }

/* header strip: entry and pool, the score under them at the top left; the round at the top right
   (the seat across sits in the middle of the top edge on the wide table) */
.pa-felt .pa-thdr {
  width: 100%; padding: .55em .9em; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l r" "c r";
  align-items: start; column-gap: .8em; row-gap: .15em; font-size: .86em; color: var(--hb-smoke);
}
.pa-thdr-l, .pa-thdr-c, .pa-thdr-r {
  padding: .25em .7em; border-radius: 999em; background: rgba(14, 9, 23, .66); border: .07em solid rgba(207, 199, 230, .14);
  -webkit-backdrop-filter: blur(.5em); backdrop-filter: blur(.5em);
}
.pa-thdr-l:empty, .pa-thdr-c:empty, .pa-thdr-r:empty { display: none; }
.pa-thdr-l { grid-area: l; justify-self: start; max-width: 100%; display: flex; align-items: center; gap: .5em; min-width: 0; white-space: nowrap; overflow: hidden; }
.pa-thdr-l > span:first-child:not(.pa-tag) { color: var(--hb-silver-2); font-weight: 700; }
.pa-dot-sep::before { content: "·"; margin-right: .5em; color: var(--hb-smoke); }
.pa-thdr-c { grid-area: c; justify-self: start; display: flex; padding-block: .2em; align-items: baseline; gap: .45em; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; font: 800 1.15em var(--display); color: var(--hb-silver-2); }
.pa-thdr-r { grid-area: r; justify-self: end; color: var(--hb-smoke); white-space: nowrap; }
.pa-thdr .pa-tag { height: auto; padding: 0; font-size: 1em; border: 0; background: none; }
.pa-thdr .pa-tag.pa-free { color: var(--hb-silver); }
.pa-score.pa-team-0 { color: var(--team0); }
.pa-score.pa-team-1 { color: var(--team1-ink, var(--team1)); }
.pa-score-sep { color: var(--hb-smoke); }
/* A long or right-to-left opponent name shortens; the scores and the separator never leave the strip. */
.pa-thdr-c > .pa-score, .pa-thdr-c > .pa-score-sep { flex: none; }
/* The score and the name are flex items, so the space between them in the text collapses: the gap draws it. */
.pa-thdr-c > .pa-score-them { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: baseline; gap: .3em; }
.pa-score-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: isolate; }
.pa-code-small { color: var(--hb-silver); letter-spacing: .1em; font-size: .95em; }
.pa-felt[data-narrow="1"] .pa-thdr { padding: .4em .6em; }
.pa-felt[data-narrow="1"] .pa-thdr-c { font-size: 1.05em; }

/* seats: dark glass pills with silver text, pinned to the stage's seat tags; the turn is a static
   silver ring and a dot. The seat across and my own line are rows; a side seat on a landscape
   table is a narrow column on the rim, on a portrait table a short row beside the table cards. */
.pa-felt .pa-seat { display: flex; flex-direction: column; align-items: center; max-width: 24em; }
.pa-felt .pa-stag, .pa-felt .pa-meline {
  --av: 2.15em;
  display: inline-flex; align-items: center; gap: .45em; max-width: 100%; padding: .3em .85em .3em .35em;
  border-radius: 999em; background: rgba(14, 9, 23, .76); border: .07em solid rgba(207, 199, 230, .2);
  -webkit-backdrop-filter: blur(.5em); backdrop-filter: blur(.5em);
  box-shadow: 0 .6em 1.4em -.9em rgba(0, 0, 0, .95), inset 0 .07em 0 rgba(238, 240, 244, .07);
  color: var(--hb-silver-2); white-space: nowrap;
}
/* a side seat: a narrow column (avatar, name, badges, counts) that fits the rim beside its hand;
   the wide table's rim is 270 stage px, the standard one's 160, the portrait tables' 180 */
.pa-pos-left .pa-stag, .pa-pos-right .pa-stag { flex-direction: column; gap: .25em; padding: .5em .5em .55em; border-radius: 1.3em; max-width: 6.4em; }
.pa-felt[data-preset="wide"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: min(6.4em, 262px); }
.pa-felt[data-preset="standard"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: min(6.4em, 156px); padding-inline: .35em; }
.pa-felt[data-preset="phone"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: 5.4em; padding: .4em .35em .45em; }
.pa-felt[data-preset="phone"] :is(.pa-pos-left, .pa-pos-right) .pa-sname { max-width: 4.4em; }
.pa-avatar {
  display: inline-grid; place-items: center; width: var(--av, 30px); height: var(--av, 30px); flex: none; border-radius: 50%;
  background: linear-gradient(145deg, #3a3b41, #222226); color: var(--hb-silver-2);
  box-shadow: inset 0 0 0 .07em rgba(207, 199, 230, .26); font: 700 .85em var(--display);
}
.pa-avatar-me { background: linear-gradient(145deg, #f1edf8, #aaa3c0); color: #150f22; box-shadow: none; }
.pa-avatar .pa-ic { width: 60%; height: 60%; }
.pa-avatar-empty { background: rgba(255, 255, 255, .04); border: .07em dashed rgba(207, 199, 230, .3); color: var(--hb-smoke); box-shadow: none; }
.pa-sid { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.pa-pos-left .pa-sid, .pa-pos-right .pa-sid { align-items: center; max-width: 100%; }
.pa-sname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .92em; color: var(--hb-silver-2); }
.pa-pos-left .pa-sname, .pa-pos-right .pa-sname { max-width: 6em; }
.pa-badges { display: flex; gap: .25em; flex-wrap: wrap; justify-content: center; }
.pa-badges:empty { display: none; }
.pa-badge { padding: .05em .4em; border-radius: 999em; border: .07em solid rgba(207, 199, 230, .3); color: var(--hb-silver); font-size: .66em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
/* Left, Autoplay, Reconnecting: warm, and still (nothing blinks at the table) */
.pa-badge-warn { border-color: rgba(227, 201, 163, .5); color: var(--hb-warm); }
.pa-team-0 .pa-badge-team { border-color: rgba(207, 199, 230, .55); color: var(--team0); }
.pa-team-1 .pa-badge-team { border-color: rgba(217, 32, 63, .6); color: var(--team1-ink, var(--team1)); }
.pa-felt[data-seats="4"] .pa-team-0 > .pa-stag, .pa-felt[data-seats="4"] .pa-meline.pa-team-0 { border-color: rgba(207, 199, 230, .5); }
.pa-felt[data-seats="4"] .pa-team-1 > .pa-stag, .pa-felt[data-seats="4"] .pa-meline.pa-team-1 { border-color: rgba(217, 32, 63, .6); }
.pa-felt[data-seats="4"] .pa-team-0 .pa-avatar { background: linear-gradient(145deg, #f1edf8, #aaa3c0); color: #150f22; box-shadow: none; }
.pa-felt[data-seats="4"] .pa-team-1 .pa-avatar { background: linear-gradient(145deg, #d9203f, #8c0f24); color: #f4f5f8; box-shadow: none; }
.pa-felt .pa-seat.pa-turn > .pa-stag, .pa-felt .pa-meline.pa-turn { border-color: rgba(10, 6, 18, .9); box-shadow: 0 0 0 .15em var(--hb-silver), 0 .6em 1.4em -.9em rgba(0, 0, 0, .95); }
.pa-seat.pa-turn .pa-sname::before, .pa-meline.pa-turn > .pa-sname::before {
  content: ""; display: inline-block; width: .42em; height: .42em; margin-right: .4em; border-radius: 50%; background: var(--hb-silver); vertical-align: .1em;
}
.pa-empty { opacity: .75; }

.pa-sstats { color: var(--hb-smoke); font-size: .78em; white-space: nowrap; }
.pa-pos-left .pa-sstats, .pa-pos-right .pa-sstats { white-space: normal; line-height: 1.2; text-align: center; }
.pa-pos-left .pa-sstats .pa-stat, .pa-pos-right .pa-sstats .pa-stat { display: block; }
.pa-pos-left .pa-stat-sep, .pa-pos-right .pa-stat-sep { display: none; }
.pa-stimer { min-width: 3em; color: var(--hb-silver); font: 800 .92em var(--display); font-variant-numeric: tabular-nums; }
/* the last seconds turn the clock crimson; it never blinks */
.pa-stimer.urgent, .pa-turninfo.urgent { color: var(--team1-ink, #f0566e); }
.pa-lastmove { display: inline-flex; align-items: center; gap: .3em; padding: .12em .5em; border-radius: .6em; background: rgba(10, 6, 18, .55); border: .07em solid rgba(207, 199, 230, .12); color: var(--hb-smoke); font-size: .76em; white-space: nowrap; }
.pa-lastmove.pa-chk { color: var(--hb-silver-2); border-color: rgba(217, 32, 63, .55); }
.pa-mini { display: inline-block; padding: 0 .25em; border-radius: .25em; background: var(--hb-silver-2); font: 800 .95em var(--display); }
.pa-mini.red { color: #c8172f; } .pa-mini.black { color: #121216; }
.pa-chkcards { display: inline-flex; gap: .25em; margin-inline-start: .35em; vertical-align: baseline; }

/* the deck count beside the stack, the empty-table hint at the centre */
.pa-felt .pa-deckn { color: var(--hb-smoke); font-size: .82em; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 .1em .3em rgba(0, 0, 0, .8); }
.pa-felt .pa-empty-table { font-size: .9em; color: var(--hb-smoke); white-space: nowrap; text-shadow: 0 .1em .3em rgba(0, 0, 0, .8); }

/* my line */
.pa-felt .pa-meline { padding: .25em .85em .25em .3em; }
.pa-meline .pa-sname { flex: 0 1 auto; min-width: 0; }
.pa-meline .pa-sstats { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.pa-turninfo { color: var(--hb-silver); font: 800 .92em var(--display); font-variant-numeric: tabular-nums; }
.pa-turninfo:empty { display: none; }

/* compact (a phone, a short screen): the HUD's font is already smaller (--hb-hud-k); the pills
   tighten so none of them reaches my cards */
.pa-felt[data-compact="1"] .pa-stag, .pa-felt[data-compact="1"] .pa-meline { --av: 1.8em; padding-block: .2em; }
.pa-felt[data-compact="1"] .pa-badge { font-size: .6em; }
.pa-felt[data-compact="1"] .pa-sstats, .pa-felt[data-compact="1"] .pa-lastmove { font-size: .72em; }
.pa-felt[data-compact="1"] .pa-thdr { padding: .4em .7em; }

/* dense (the stage drawn at less than half its design size: a phone, a short landscape screen, a
   small window): no pill may outgrow a card. The badges that only repeat what the pill's colour
   says go (Partner, Opponent, Bot, Your team; Left, Autoplay and Reconnecting stay), the rows
   tighten like the compact ones, a side column drops its avatar, lets a long name wrap to two
   lines instead of cutting it, and its last-move chip wraps instead of overflowing the pill. */
.pa-felt[data-dense="1"] .pa-stag, .pa-felt[data-dense="1"] .pa-meline { --av: 1.8em; padding-block: .2em; }
.pa-felt[data-dense="1"] .pa-sstats, .pa-felt[data-dense="1"] .pa-lastmove { font-size: .72em; }
.pa-felt[data-dense="1"] .pa-badge:not(.pa-badge-warn) { display: none; }
.pa-felt[data-dense="1"] .pa-badge { font-size: .6em; }
.pa-felt[data-dense="1"] :is(.pa-pos-left, .pa-pos-right) .pa-avatar { display: none; }
.pa-felt[data-dense="1"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { gap: .18em; padding: .3em .4em .35em; max-width: min(5.4em, 170px); }
.pa-felt[data-dense="1"][data-preset="wide"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: min(6em, 262px); }
.pa-felt[data-dense="1"][data-preset="standard"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: min(5.4em, 156px); }
.pa-felt[data-dense="1"][data-preset="phone"] :is(.pa-pos-left, .pa-pos-right) .pa-stag { max-width: 4.8em; padding-inline: .3em; }
.pa-felt[data-dense="1"] :is(.pa-pos-left, .pa-pos-right) .pa-sname {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pa-felt[data-dense="1"] :is(.pa-pos-left, .pa-pos-right) .pa-lastmove { max-width: 100%; font-size: .64em; white-space: normal; flex-wrap: wrap; justify-content: center; text-align: center; line-height: 1.2; }
/* a human opponent's clock on a dense stage joins the stats line (no third row over the backs), at the name's size */
.pa-felt[data-dense="1"] .pa-sstats .pa-stimer { font-size: 1.28em; min-width: 0; }

/* ----- Overlays in the felt box, over the stage (part of the table, not placed over it) ----- */
.pa-midover { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: auto; padding: 4px; }
.pa-midover[data-kind="round"] { background: rgba(10, 6, 18, .5); }
.pa-waiting {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; max-width: 30rem; padding: 1rem 1.3rem; text-align: center;
  border-radius: 18px; border: 1px solid rgba(207, 199, 230, .16); background: rgba(14, 9, 23, .78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .92);
}
.pa-waiting p { margin: 0; }
.pa-wtitle { font: 800 clamp(1.05rem, 2.6vh, 1.6rem) var(--display); color: var(--hb-silver-2); letter-spacing: -.005em; }
.pa-code { font: 800 1.6rem var(--display); letter-spacing: .2em; color: var(--hb-silver-2); }
.pa-round, .pa-rcard {
  width: min(460px, 100%); max-height: 100%; overflow: auto; padding: 1rem 1.1rem;
  border-radius: 18px; border: 1px solid rgba(207, 199, 230, .2); color: var(--hb-silver-2);
  background: linear-gradient(180deg, rgba(30, 30, 33, .97), rgba(18, 18, 20, .97));
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .92), inset 0 1px 0 rgba(238, 240, 244, .06);
  animation: pop-in .3s var(--hb-ease);
}
.pa-round h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.pa-round .round-list { grid-template-columns: 1fr 1fr; gap: .3rem; }
.pa-round .round-list li { padding: .35rem .6rem; font-size: .84rem; background: rgba(10, 6, 18, .5); border-color: rgba(207, 199, 230, .12); }
.pa-round .round-list li.me { border-color: rgba(207, 199, 230, .5); }
.pa-round .round-list li.them { border-color: rgba(217, 32, 63, .5); }
.pa-rtotal { margin: .6rem 0 .1rem; font: 800 1.05rem var(--display); }
.pa-round p { margin-bottom: .2rem; }
.pa-felt[data-compact="1"] .pa-round { padding: .6rem .8rem; }
.pa-felt[data-compact="1"] .pa-round .round-list li { padding: .2rem .5rem; font-size: .76rem; }
.pa-reality { margin-top: .7rem; padding: .7rem .8rem; border-radius: 14px; border: 1px solid rgba(227, 201, 163, .4); background: rgba(227, 201, 163, .06); }
.pa-reality strong { color: var(--hb-warm); }
.pa-reality p { margin: .2rem 0 .5rem; font-size: .88rem; }
.pa-rbtns { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }
@media (max-width: 420px) { .pa-round .round-list { grid-template-columns: 1fr; } }

/* result screen (in the felt box, over the scene) */
.pa-result { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: clamp(6px, 2vh, 18px); background: rgba(10, 6, 18, .68); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.pa-rcard { text-align: center; }
.pa-ricon { display: grid; place-items: center; }
.pa-ricon .pa-ic { width: 52px; height: 52px; color: var(--hb-silver); }
.pa-ricon.win .pa-ic { color: var(--hb-silver-2); }
.pa-rcard h2 { font-size: clamp(1.4rem, 3.5vh, 2rem); margin: .2rem 0 .3rem; }
/* a win: silver, with a thin crimson rule under the title */
.pa-rcard h2.win::after { content: ""; display: block; width: 2.4em; height: 2px; margin: .3em auto 0; border-radius: 2px; background: var(--hb-crimson-2); }
.pa-rcard p { margin-bottom: .4rem; }
.pa-rcard .scoreline { font: 800 1.6rem var(--display); }
.pa-money { margin: .5rem 0; display: grid; gap: .2rem; text-align: left; }
.pa-money > div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid rgba(207, 199, 230, .1); font-size: .9rem; }
.pa-money dt { color: var(--hb-smoke); }
.pa-money dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pa-payouts { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .25rem; }
.pa-payouts li { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem .6rem; border-radius: 10px; background: rgba(10, 6, 18, .45); border: 1px solid rgba(207, 199, 230, .12); font-size: .88rem; }
.pa-payouts li.pa-team-0 { border-color: rgba(207, 199, 230, .4); }
.pa-payouts li.pa-team-1 { border-color: rgba(217, 32, 63, .45); }
.pa-payouts li.pa-you { font-weight: 700; }
.pa-payouts strong { font-variant-numeric: tabular-nums; }
.pa-settle { margin: .5rem 0 0; font-weight: 700; font-size: .92rem; }
/* Short screens: the money breakdown moves beside the title so "Play again" stays in view. */
.pa[data-layout="short"] .pa-ricon { display: none; }
.pa[data-layout="short"] .pa-rcard { padding: .6rem .9rem; }
.pa[data-layout="short"] .pa-rcard h2, .pa[data-layout="short"] .pa-rcard .scoreline { font-size: 1.3rem; margin: .1rem 0; }
.pa[data-layout="short"] .pa-rcard:has(> .pa-money) {
  width: min(640px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 1rem; align-content: center; align-items: center;
}
.pa[data-layout="short"] .pa-rcard:has(> .pa-money) > * { grid-column: 1; }
.pa[data-layout="short"] .pa-rcard > .pa-money { grid-column: 2; grid-row: 1 / span 9; margin: 0; }
.pa[data-layout="short"] .pa-money > div { padding: .15rem 0; font-size: .82rem; }
.pa[data-layout="short"] .pa-payouts li { padding: .2rem .5rem; font-size: .82rem; }
.pa[data-layout="short"] .pa-rbtns { margin-top: .3rem; }
.pa[data-layout="short"] .pa-rbtns .btn { height: auto; min-height: 38px; max-width: 100%; padding: .4rem 1rem; white-space: normal; line-height: 1.2; text-align: center; }
.pa[data-layout="short"] .pa-money dd { white-space: nowrap; }
.pa-settle.ok { color: var(--hb-silver-2); }
.pa-settle.wait { color: var(--hb-warm); }

/* effects (in the felt box, never blocking input): the chkoba mark, silver over a crimson rule */
.pa-flash { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; opacity: 0; }
/* Nothing is drawn over a result card (launch-candidate-18, 2026-11-19). A call-out still up when the match ends (with
   reduced motion it holds until the next move, and the last move has none: Belote's trump sign with its crimson rule sat
   across the score table), the Chkoba cut's layer and a table reaction go with it; the card sits above every layer of
   the felt (Poker's and Blackjack's action bars, effects and banners). */
.pa-result:not([hidden]) { z-index: 20; }
.pa-result:not([hidden]) ~ .pa-flash, .pa-result:not([hidden]) ~ .pa-cut { display: none; }
:has(.pa-result:not([hidden])) > .pa-reaction { display: none; }
.pa-flash span { display: block; padding: 0 1rem; font: 900 clamp(1.6rem, min(9vh, var(--th, 60vh) * .11, var(--tw, 100vw) * .17), 5rem)/1.05 var(--display); letter-spacing: -.02em; color: var(--hb-silver-2); text-align: center; text-shadow: 0 8px 30px rgba(0, 0, 0, .7); }
.pa-flash span::after { content: ""; display: block; width: 1.6em; height: max(3px, .07em); margin: .16em auto 0; border-radius: 99px; background: var(--hb-crimson-2); }
/* 1.5 s, then at rest again (opacity 0, no fill): the table removes the class when it ends */
.pa-flash.on { animation: pa-flash 1.5s var(--hb-ease); }
@keyframes pa-flash { 0% { opacity: 0; transform: scale(.9); } 20% { opacity: 1; transform: scale(1); } 72% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-6%); } }

/* ---------- Demo site integration ---------- */
body.pa-table-open .top, body.pa-table-open .footer, body.pa-table-open .progress, body.pa-table-open #backToGame { display: none !important; }
/* The site's view entrance (style.css `.view`, a 0.5 s fade with a translateY) must never run on the
   section that hosts the app: a transformed ancestor becomes the containing block of the fixed
   full-screen frame, so a table that shows during those 0.5 s (a page opened or reloaded into a
   running match, the "Back to your game" pill) would sit 8 px low and jump when the animation ends
   (§13.2: nothing moves the table during a match). Once the app is mounted, the play view just shows. */
body.pa-mounted .view[data-view="play"] { animation: none; }
/* The lobby note that explains a seat forfeited, auto-played or released while the player was away. */
.pa-note-away { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.pa-note-away .pa-row { display: flex; gap: .5rem; flex-wrap: wrap; }
/* The site's own toasts and confetti (signup welcome) never sit over a table or a phone sheet (§13.2). */
body.pa-table-open #toasts, body.pa-table-open #fxCanvas { display: none !important; }
body.pa-mounted[data-view="play"] #coinsLink { display: none; }
.play-wrap.pa-host { padding: 0; min-height: 0; width: 100%; max-width: none; }

/* ---------- Motion ----------
   Reduced motion, by the system setting or by the app's own switch (.pa-reduce on the app root and
   on the felt): the chkoba mark simply shows until the next move, the cards and sheets just appear. */
@media (prefers-reduced-motion: reduce) {
  .pa-flash.on { animation: none; opacity: 1; }
  .pa-round, .pa-rcard, .pa-panel { animation: none !important; }
}
.pa-felt.pa-reduce .pa-flash.on { animation: none; opacity: 1; }
.pa.pa-reduce :is(.pa-round, .pa-rcard, .pa-panel) { animation: none !important; }

/* ---------- Chkoba match moments (call-outs, the dealer draw, the score sheet, the seats, table talk) ---------- */
/* The call-outs: Chkoba!, El 7ayya!, Bermila! across the whole table, with a heartbeat (two beats,
   then the word holds and lifts away); a violet glow behind it, crimson for the 7 of diamonds,
   warm for the bermila. Never blocks input; at rest again after 1.9 s (the table removes .on). */
.pa-flash::before { content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(124, 58, 237, .38), rgba(124, 58, 237, .12) 55%, transparent 80%); }
.pa-flash[data-kind="hayya"]::before { background: radial-gradient(closest-side, rgba(217, 32, 63, .4), rgba(179, 18, 46, .12) 55%, transparent 80%); }
.pa-flash[data-kind="bermila"]::before { background: radial-gradient(closest-side, rgba(227, 201, 163, .3), rgba(124, 58, 237, .12) 55%, transparent 80%); }
.pa-flash { grid-template-rows: auto auto; align-content: center; }
.pa-flash .pa-call-word { background: linear-gradient(180deg, #fff 10%, var(--hb-silver) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 26px rgba(0, 0, 0, .75)); text-shadow: none; }
.pa-flash[data-kind="hayya"] .pa-call-word { background-image: linear-gradient(180deg, #ffd9df 5%, #f0566e 95%); }
.pa-flash[data-kind="bermila"] .pa-call-word { background-image: linear-gradient(180deg, #fff6e6 5%, var(--hb-warm) 95%); }
.pa-flash[data-kind="hayya"] span::after { background: var(--hb-warm); }
.pa-flash[data-kind="bermila"] span::after { background: var(--hb-violet); }
.pa-call-who { display: block; margin-top: .5rem; color: var(--hb-silver); font: 800 clamp(.8rem, min(2.6vh, var(--th, 60vh) * .035), 1.25rem)/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, .9); }
.pa-flash.on { animation: pa-callout 1.9s var(--hb-ease); }
.pa-flash.on::before { animation: pa-callglow 1.9s var(--hb-ease); }
.pa-flash.on .pa-call-word { animation: pa-callbeat 1.9s var(--hb-ease); }
@keyframes pa-callout { 0% { opacity: 0; } 10% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5%); } }
@keyframes pa-callglow { 0% { opacity: 0; } 12% { opacity: 1; } 22% { opacity: .55; } 30% { opacity: 1; } 75% { opacity: .7; } 100% { opacity: 0; } }
/* lub, dub, then hold: the platform's heartbeat (HBMotion.BEAT) as a scale */
@keyframes pa-callbeat { 0% { transform: scale(.82); } 9% { transform: scale(1.08); } 16% { transform: scale(.98); } 24% { transform: scale(1.05); } 34% { transform: scale(1); } 100% { transform: scale(1); } }
.pa-felt.pa-lite .pa-flash::before { display: none; }
.pa-felt.pa-reduce .pa-flash.on, .pa-felt.pa-reduce .pa-flash.on .pa-call-word { animation: none; opacity: 1; }
.pa-felt.pa-reduce .pa-flash.on::before { animation: none; opacity: .6; }
@media (prefers-reduced-motion: reduce) {
  .pa-flash.on, .pa-flash.on .pa-call-word { animation: none; opacity: 1; }
  .pa-flash.on::before { animation: none; opacity: .6; }
}

/* The dealer draw: a spiral of backs at the middle, every seat's cut under its name. */
.pa-cut { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 8px; background: radial-gradient(closest-side, rgba(21, 15, 34, .78), rgba(10, 6, 18, .45)); }
.pa-cut[hidden] { display: none; }
.pa-cut-box { display: flex; flex-direction: column; align-items: center; gap: .55rem; width: min(560px, 100%); text-align: center; }
.pa-cut-t { margin: 0; font: 900 clamp(1.1rem, 3.4vh, 1.9rem)/1.1 var(--display); color: var(--hb-silver-2); letter-spacing: -.01em; text-shadow: 0 6px 20px rgba(0, 0, 0, .8); }
.pa-cut-line { margin: 0; min-height: 1.3em; color: var(--hb-silver); font-weight: 700; font-size: clamp(.82rem, 2vh, 1rem); }
.pa-cut-spiral { position: relative; width: min(340px, 72%); aspect-ratio: 1.7; }
.pa-cut-back {
  --h: clamp(46px, 9vh, 72px);
  position: absolute; left: calc(50% + var(--x)); top: calc(50% + var(--y)); padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--r)); border-radius: calc(var(--h) * .1);
  animation: pa-cut-in .5s var(--hb-ease) both; animation-delay: calc(var(--i) * 28ms);
  transition: transform .2s var(--hb-ease), filter .2s;
}
.pa-cut-back:hover:not(:disabled), .pa-cut-back:focus-visible { transform: translate(-50%, -62%) rotate(var(--r)) scale(1.06); filter: drop-shadow(0 0 .5rem rgba(155, 92, 255, .7)); }
.pa-cut-back:focus-visible { outline: 2px solid var(--hb-silver); outline-offset: 3px; }
.pa-cut-back:disabled { cursor: default; opacity: .45; }
.pa-cut-back.pa-picked { opacity: 1; transform: translate(-50%, -70%) rotate(0deg) scale(1.12); filter: drop-shadow(0 0 .6rem rgba(155, 92, 255, .85)); z-index: 2; }
@keyframes pa-cut-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--r) - 40deg)) scale(.6); } }
.pa-cut-slots { display: flex; gap: clamp(.5rem, 2vw, 1.2rem); justify-content: center; flex-wrap: wrap; }
.pa-cut-slot { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 4.6rem; padding: .45rem .5rem .4rem; border-radius: 14px; border: 1px solid rgba(207, 199, 230, .16); background: rgba(14, 9, 23, .7); }
.pa-cut-card { --h: clamp(56px, 11vh, 88px); display: grid; place-items: center; width: calc(var(--h) * .7); height: var(--h); border-radius: calc(var(--h) * .1); border: 1px dashed rgba(207, 199, 230, .2); perspective: 600px; }
.pa-cut-card .hb-card { transition: transform .45s var(--hb-ease); }
.pa-cut-card:has(.hb-card) { border-color: transparent; }
.pa-cut-name { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .82rem; color: var(--hb-silver-2); }
.pa-cut-slot.pa-you .pa-cut-name { color: #fff; }
.pa-cut-slot.pa-tied { border-color: rgba(227, 201, 163, .6); }
.pa-cut-slot.pa-dealer { border-color: var(--hb-warm); box-shadow: 0 0 0 2px rgba(227, 201, 163, .35), 0 0 1.4rem -.2rem rgba(227, 201, 163, .55); }
.pa-cut-slot.pa-dealer .pa-cut-name::after { content: " ★"; color: var(--hb-warm); }
.pa-felt.pa-reduce .pa-cut-back, .pa-felt.pa-reduce .pa-cut-card .hb-card { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .pa-cut-back, .pa-cut-card .hb-card { animation: none; transition: none; } }

/* The score sheet: a paper score pad (purple ink, ruled lines, a crimson margin), a tick for the
   side that took each point, the rule behind a line on its icon, the game score in tally marks. */
.pa-round.pa-sheet {
  --ink: #2b1748; --ink-2: #6b5a86; --paper: #f6f1e7; --rule: rgba(43, 23, 72, .12);
  width: min(480px, 100%); color: var(--ink); border: 0; border-radius: 6px 6px 14px 14px; padding: 1rem 1.1rem .9rem 1.6rem;
  background:
    linear-gradient(90deg, transparent 1.05rem, rgba(217, 32, 63, .45) 1.05rem, rgba(217, 32, 63, .45) calc(1.05rem + 1.5px), transparent calc(1.05rem + 1.5px)),
    repeating-linear-gradient(180deg, transparent 0 1.9rem, var(--rule) 1.9rem calc(1.9rem + 1px)),
    linear-gradient(180deg, #fbf7ef, var(--paper));
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .92), 0 2px 0 #e3d9c6, 0 4px 0 #d8ccb5;
}
.pa-sheet h3 { color: var(--ink); font: 900 1.05rem/1.2 var(--display); margin: 0 0 .4rem; }
.pa-sheet-t { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pa-sheet-t th, .pa-sheet-t td { padding: .32rem .35rem; border-bottom: 1px solid var(--rule); text-align: center; vertical-align: middle; }
.pa-sheet-t th[scope="row"] { text-align: start; font-weight: 700; color: var(--ink); white-space: nowrap; }
.pa-sheet-t thead th { font: 800 .74rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-sheet-t thead .pa-col-us { color: var(--ink); }
.pa-sheet-t thead .pa-col-them { color: #a3152e; }
.pa-sheet-r { color: var(--ink-2); }
.pa-rule-btn {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.5rem; margin-inline-end: .45rem; padding: 0; vertical-align: middle;
  border-radius: .45rem; border: 1px solid rgba(43, 23, 72, .25); background: rgba(124, 58, 237, .08); color: var(--ink); cursor: pointer; position: relative;
}
.pa-rule-btn::after { content: "?"; position: absolute; top: -.35rem; inset-inline-end: -.35rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--ink); color: var(--paper); font: 800 .55rem/.8rem var(--display); }
.pa-rule-btn:hover, .pa-rule-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.pa-rule-btn:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }
.pa-rule-ic { font: 800 .72rem/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.pa-rule-row td { padding: .3rem .45rem .5rem; text-align: start; font-size: .8rem; line-height: 1.35; color: var(--ink-2); background: rgba(124, 58, 237, .06); }
.pa-tick { display: inline-block; width: 1.05rem; height: .6rem; border-left: 3px solid #7c3aed; border-bottom: 3px solid #7c3aed; transform: rotate(-48deg) translate(1px, -2px); border-radius: 1px; }
.pa-nomark { color: var(--ink-2); }
.pa-sheet-t tfoot th, .pa-sheet-t tfoot td { border-bottom: 0; }
.pa-sheet-sum td { font: 800 .95rem var(--display); color: var(--ink); }
.pa-sheet-sum { border-top: 2px solid var(--ink); }
.pa-sheet-game th { font-weight: 800; }
.pa-sheet .pa-rtotal { color: var(--ink); font-size: .92rem; margin: .5rem 0 .1rem; }
.pa-sheet .muted { color: var(--ink-2); }
.pa-sheet .pa-reality { color: var(--hb-silver-2); background: #2b2240; }
/* tally marks: four strokes and a fifth across them */
.pa-tally { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: center; max-width: 9.5rem; vertical-align: middle; }
.pa-tg { position: relative; display: inline-flex; gap: .2rem; height: 1.05rem; }
.pa-tg i { display: block; width: 2px; height: 100%; border-radius: 1px; background: var(--ink); transform: rotate(4deg); }
.pa-tg5::after { content: ""; position: absolute; left: -.2rem; right: -.2rem; top: 50%; height: 2px; border-radius: 1px; background: #a3152e; transform: rotate(-24deg); }
.pa-tally-n { font: 800 .78rem var(--display); color: var(--ink-2); }
.pa-felt[data-compact="1"] .pa-round.pa-sheet { padding: .55rem .7rem .55rem 1.4rem; }
.pa-felt[data-compact="1"] .pa-sheet-t th, .pa-felt[data-compact="1"] .pa-sheet-t td { padding: .18rem .3rem; font-size: .78rem; }

/* The seats: bigger medallions, the bot's own, and the dealer's badge. */
.pa-seat .pa-avatar { --av: 40px; font-size: 1.05em; box-shadow: inset 0 0 0 .1em rgba(207, 199, 230, .3), 0 .25em .7em -.2em rgba(0, 0, 0, .8); }
.pa-meline .pa-avatar { --av: 34px; }
.pa-avatar-bot { background: radial-gradient(circle at 35% 30%, #5a3d8f, #2b2240 70%); color: var(--hb-silver-2); }
.pa-felt[data-dense="1"] .pa-seat .pa-avatar { --av: 30px; }
.pa-badge-dealer { border-color: rgba(227, 201, 163, .65); color: var(--hb-warm); }
.pa-badge-dealer::before { content: "★ "; }

/* Table talk: a speech bubble by a bot's pill, for a few seconds. */
.pa-bubble {
  position: absolute; z-index: 3; max-width: 13em; padding: .45em .75em; border-radius: 1em; pointer-events: none;
  background: var(--hb-silver-2); color: #1e1630; font: 700 .86em/1.25 var(--body, inherit); box-shadow: 0 .5em 1.2em -.4em rgba(0, 0, 0, .85);
  animation: pa-bubble 2.8s var(--hb-ease) both;
}
.pa-bubble::after { content: ""; position: absolute; left: 50%; bottom: -.4em; width: .8em; height: .8em; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: .15em; }
.pa-bubble-top::after { bottom: auto; top: -.4em; }
@keyframes pa-bubble { 0% { opacity: 0; transform: translateY(.4em) scale(.9); } 8% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }
.pa-felt.pa-reduce .pa-bubble { animation: none; }

/* The lobby's bot level picker (Chkoba practice). */
.pa-levels { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: 0 0 .6rem; }
.pa-levels-t { font-weight: 700; font-size: .86rem; margin-inline-end: .2rem; }
.pa-level { padding: .3rem .8rem; border-radius: 999px; border: 1px solid rgba(155, 92, 255, .35); background: transparent; color: inherit; font: 700 .82rem var(--display); cursor: pointer; }
.pa-level.on { background: linear-gradient(135deg, #7c3aed, #9b5cff); border-color: transparent; color: #fff; }
.pa-level:focus-visible { outline: 2px solid var(--hb-silver, #cfc7e6); outline-offset: 2px; }

/* Drag by touch or mouse (HBKit.draggable): the pressed element keeps the gesture (no page scroll),
   leaves a dimmed place behind, and a copy follows the finger. */
.pa-felt .hb-draggable { touch-action: none; -webkit-touch-callout: none; }
.pa-felt .hb-dragging { --hb-card-dim: .55; }
.hb-drag-ghost { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)); opacity: .96; transition: none; }
html.hb-is-dragging, html.hb-is-dragging * { cursor: grabbing !important; }

/* The lobby's "Create a table" form (player-app.js hostBlock): rows of chips, the amount field. */
.pa-hostform { display: grid; gap: .55rem; }
.pa-hostform .pa-levels { margin: 0; }
.pa-hostform .pa-levels-t { min-width: 7.5rem; }
.pa-hostform .pa-amount { flex: 0 1 9rem; letter-spacing: normal; text-transform: none; height: 38px; }
.pa-hostform .pa-amounts > .pa-levels { margin: 0; }
.pa-hostform p { margin: 0; }
@media (max-width: 560px) { .pa-hostform .pa-levels-t { min-width: 0; width: 100%; } }

/* The cut at the start of every round (player-table.js renderCut): the deck shuffled in the middle
   of the table, tapped where to cut, parting in two around the card turned up, then Keep or Throw. */
.pa-cut-box.pa-cutting { gap: .7rem; }
.pa-cutdeck { --h: clamp(90px, 17vh, 144px); position: relative; display: inline-block; width: calc(var(--h) * .7); height: var(--h); }
.pa-cutdeck-c { position: absolute; inset: 0; transform: translate(calc(var(--i) * -.6px), calc(var(--i) * -1.4px)); transition: transform .35s var(--hb-ease); }
.pa-cutdeck-c .hb-card { box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.pa-cutdeck.pa-shuffling .pa-cutdeck-c:nth-child(odd) { animation: pa-riffle-l 1.1s var(--hb-ease) infinite; animation-delay: calc(var(--i) * 40ms); }
.pa-cutdeck.pa-shuffling .pa-cutdeck-c:nth-child(even) { animation: pa-riffle-r 1.1s var(--hb-ease) infinite; animation-delay: calc(var(--i) * 40ms); }
@keyframes pa-riffle-l { 0%, 100% { translate: 0 0; } 35% { translate: -58% -6%; rotate: -8deg; } 60% { translate: 0 -2%; rotate: 0deg; } }
@keyframes pa-riffle-r { 0%, 100% { translate: 0 0; } 35% { translate: 58% -6%; rotate: 8deg; } 60% { translate: 0 -2%; rotate: 0deg; } }
.pa-cutdeck-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; filter: drop-shadow(0 0 .7rem rgba(155, 92, 255, .55)); animation: pa-cut-glow 1.4s ease-in-out infinite; }
.pa-cutdeck-btn:focus-visible { outline: 2px solid var(--hb-silver); outline-offset: 6px; }
.pa-cutdeck-btn:disabled { cursor: default; animation: none; }
@keyframes pa-cut-glow { 50% { filter: drop-shadow(0 0 1.3rem rgba(155, 92, 255, .9)); } }
/* Sent: the top half lifts off to the left before the server's answer arrives. */
.pa-cutdeck-btn.pa-parting .pa-cutdeck-c:nth-child(n + 4) { transform: translate(-62%, -18%) rotate(-6deg); }
.pa-cut-split { display: flex; align-items: center; justify-content: center; gap: clamp(.6rem, 2.4vw, 1.4rem); }
.pa-cut-split .pa-half { --h: clamp(70px, 13vh, 112px); }
.pa-cut-split .pa-left { transform: rotate(-7deg); }
.pa-cut-split .pa-right { transform: rotate(6deg); }
.pa-cut-shown { --h: clamp(104px, 20vh, 176px); filter: drop-shadow(0 .8rem 1.6rem rgba(0, 0, 0, .6)); animation: pa-cut-turn .55s var(--hb-ease) both; }
@keyframes pa-cut-turn { from { transform: perspective(700px) rotateY(90deg) scale(.8); opacity: .3; } }
.pa-cut-choose { display: flex; gap: clamp(.8rem, 4vw, 2.4rem); justify-content: center; }
.pa-cut-choose .btn { display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 8.5rem; padding: .55rem 1.1rem; }
.pa-cut-choose .btn small { font-weight: 600; font-size: .74rem; opacity: .8; }
.pa-cut-enough { min-width: 10rem; }
.pa-felt.pa-reduce .pa-cutdeck-c, .pa-felt.pa-reduce .pa-cutdeck-btn, .pa-felt.pa-reduce .pa-cut-shown { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .pa-cutdeck-c, .pa-cutdeck-btn, .pa-cut-shown { animation: none; transition: none; } }
/* The cut sits a little below the far seat's name, so the two never overlap. */
.pa-cut:has(.pa-cutting) { padding: clamp(30px, 6vh, 64px) 8px clamp(40px, 8vh, 80px); }
.pa-cut-box.pa-cutting .pa-cut-line { max-width: 30rem; }

/* ----- The flat table (.pa-flat, the Chkobbeta-style layout the owner asked for on 2026-10-30):
   the camera is straight above, the felt is CSS (our purple, no scene image), the square in the
   middle is the outline the table cards lie in and it lights on my turn, the far hand's backs are
   full cards, and my hand goes grey while it is not my turn. ----- */
.pa-felt.pa-flat, .pa-felt.pa-flat .hb-stage-host, .pa-felt.pa-flat .hb-stage, .pa-felt.pa-flat .hb-stage > .hb-scene {
  background: radial-gradient(ellipse at 50% 42%, #3d1f62 0%, #28143f 50%, #180b2b 100%);
}
.pa-felt.pa-flat .hb-stage > .hb-scene { background-image: none; }
.pa-felt.pa-flat .pa-ohand > .card { --h: 200px; }
.pa-felt.pa-flat .pa-square {
  width: 660px; height: 660px; box-sizing: border-box; border-radius: 42px;
  border: 3px solid rgba(255, 214, 120, .16);
  background: rgba(0, 0, 0, .09);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .16);
  transition: border-color .35s ease, box-shadow .35s ease;
}
.pa-felt.pa-flat.pa-myturn .pa-square { border-color: #ffd166; box-shadow: 0 0 30px rgba(255, 209, 102, .38), inset 0 0 70px rgba(0, 0, 0, .16); }
.pa-felt.pa-flat:not(.pa-myturn) .pa-hand .card { --hb-card-filter: saturate(.3) brightness(.72); }
.pa-felt.pa-flat .pa-hand .card:disabled:not(.chosen) { --hb-card-dim: 1; }
.pa-felt.pa-flat.pa-reduce .pa-square { transition: none; }
/* the corners: an empty pile shows its place as a faint frame, as a card's outline on the felt */
.pa-felt.pa-flat .pa-pile::before {
  content: ''; position: absolute; left: 0; top: 0; width: 140px; height: 200px; box-sizing: border-box;
  border-radius: 14px; border: 2px solid rgba(255, 255, 255, .07); background: rgba(0, 0, 0, .06);
  transform: translateZ(-0.5px);
}
/* the score paper: a small white sheet in its corner (the HUD scales it with the stage) */
.pa-felt.pa-flat .hb-hud > .pa-pad {
  background: linear-gradient(180deg, #fbf7ea, #f1ead6); color: #2b2436; border: 0; border-radius: .35em;
  box-shadow: 0 .25em .9em rgba(0, 0, 0, .45), inset 0 0 0 .07em rgba(0, 0, 0, .06);
  width: 7.2em; padding: .45em .6em .5em;
  transform: rotate(-2deg);
}
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-t { color: #7a7090; }
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-n { color: #3a3150; }
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-us strong { color: #1d6b4a; }
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-them strong { color: #b4182f; }
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-r { color: #8a809c; }
/* The owner's ask (2026-11-12): bigger score numbers. In its corner the paper's numbers are larger
   than the HUD's other text; beside the table (.pa-pad-aside, a landscape window with room at the
   felt's left) it is a big score panel, centred on the felt's height, numbers about 3x the text. The corner paper keeps its width (on a 360 px phone it stands right beside my fan). */
.pa-felt.pa-flat .hb-hud > .pa-pad .pa-pad-row strong { font-size: 1.75em; line-height: 1.05; }
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside {
  width: 13em; padding: .9em 1.1em 1em; gap: .45em; border-radius: .6em;
  box-shadow: 0 .4em 1.6em rgba(0, 0, 0, .5), inset 0 0 0 .07em rgba(0, 0, 0, .06), inset 0 .3em 0 #7c4dff;
}
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside .pa-pad-t { font-size: .9em; letter-spacing: .18em; margin-bottom: .2em; padding-top: .2em; }
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside .pa-pad-row { gap: .5em; padding: .15em 0; border-top: .07em solid rgba(43, 36, 54, .12); }
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside .pa-pad-n { font: 700 1.2em/1.2 var(--display); }
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside .pa-pad-row strong { font-size: 3em; line-height: 1; }
.pa-felt.pa-flat .hb-hud > .pa-pad.pa-pad-aside .pa-pad-r { margin-top: .3em; font-size: .9em; white-space: normal; }
/* a small landscape window (dense stage): the same panel, a little tighter */
.pa-felt.pa-flat[data-dense="1"] .hb-hud > .pa-pad.pa-pad-aside { width: 10.5em; padding: .7em .85em .8em; gap: .3em; }
.pa-felt.pa-flat[data-dense="1"] .hb-hud > .pa-pad.pa-pad-aside .pa-pad-n { font-size: 1.05em; }
.pa-felt.pa-flat[data-dense="1"] .hb-hud > .pa-pad.pa-pad-aside .pa-pad-row strong { font-size: 2.4em; }

/* The round's count on the flat table: the other side's captured cards in the top half of the
   felt, mine in the bottom half (small faces), the category's cards lit and the rest dim; the
   category's name and the two numbers in a dark tag at the middle (HUD); the square fades. */
.pa-felt .pa-count { pointer-events: none; }
.pa-felt .pa-count > .card { --h: 120px; transition: filter .32s var(--hb-ease), opacity .32s var(--hb-ease), box-shadow .32s var(--hb-ease); }
.pa-felt .pa-count > .card.pa-dim { filter: saturate(.2) brightness(.42); opacity: .75; }
.pa-felt .pa-count > .card.hb-card.pa-lit { box-shadow: 0 0 0 3px #ffd166, 0 0 26px 4px rgba(255, 209, 102, .5); }
.pa-felt.pa-counting .pa-square { opacity: .35; box-shadow: none; }
.pa-felt.pa-counting .pa-tcards, .pa-felt.pa-counting .hb-hud > .pa-empty-table { visibility: hidden; }
.pa-felt .hb-hud > .pa-pad { transition: opacity .3s var(--hb-ease); }
.pa-felt.pa-counting .hb-hud > .pa-pad, .pa-felt.pa-counting .hb-hud > .pa-deckn { opacity: 0; }
.pa-felt .hb-hud > .pa-countlabel {
  display: flex; flex-direction: column; align-items: center; gap: .1em; padding: .55em 1.2em .6em; text-align: center;
  border-radius: .7em; background: rgba(10, 6, 18, .78); box-shadow: 0 .6em 1.6em -.5em rgba(0, 0, 0, .9), inset 0 0 0 .07em rgba(255, 209, 102, .35);
  color: var(--hb-silver-2); white-space: nowrap;
}
.pa-felt .hb-hud > .pa-countlabel .pa-count-name { font: 900 1.7em/1.1 var(--display); letter-spacing: .02em; color: #ffd166; text-transform: uppercase; }
.pa-felt .hb-hud > .pa-countlabel .pa-count-sub { font-size: .8em; color: var(--hb-smoke); }
.pa-felt .hb-hud > .pa-countlabel .pa-count-vals { display: flex; align-items: baseline; gap: .5em; margin-top: .15em; font: 800 1.5em/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pa-felt .hb-hud > .pa-countlabel .pa-count-vals i { font-style: normal; color: var(--hb-smoke); }
.pa-felt .hb-hud > .pa-countlabel .pa-count-them { color: var(--team1-ink, #ff6b81); }
.pa-felt .hb-hud > .pa-countlabel .pa-count-me { color: #9be7a8; }
.pa-felt .hb-hud > .pa-countlabel .won { text-shadow: 0 0 .6em currentColor; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: .08em; }
.pa-felt .hb-hud > .pa-countlabel .pa-count-skip { margin-top: .3em; font-size: .72em; color: var(--hb-smoke); }
.pa-felt[data-dense="1"] .hb-hud > .pa-countlabel { padding: .4em .8em .45em; }
.pa-felt[data-dense="1"] .hb-hud > .pa-countlabel .pa-count-name { font-size: 1.35em; }
.pa-felt[data-dense="1"] .hb-hud > .pa-countlabel .pa-count-vals { font-size: 1.2em; }

/* The victory paper on the flat table: the result card as a cream sheet, the winner's name under
   a red stamp. */
.pa-felt.pa-flat .pa-rcard {
  background: linear-gradient(180deg, #fbf7ea, #f1ead6); color: #2b2436; border: 0; border-radius: 8px 8px 16px 16px;
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .92), 0 2px 0 #e3d9c6, 0 4px 0 #d8ccb5;
}
.pa-felt.pa-flat .pa-rcard h2, .pa-felt.pa-flat .pa-rcard .scoreline { color: #2b2436; }
.pa-felt.pa-flat .pa-rcard h2.win::after { background: #c81e3a; }
.pa-felt.pa-flat .pa-rcard .muted { color: #6b6380; }
.pa-felt.pa-flat .pa-ricon .pa-ic { color: #8a809c; }
.pa-felt.pa-flat .pa-ricon.win .pa-ic { color: #c81e3a; }
.pa-felt.pa-flat .pa-rcard .btn-ghost { color: #2b2436; border-color: rgba(43, 36, 54, .35); background: rgba(255, 255, 255, .5); }
.pa-rwinner { display: flex; align-items: center; justify-content: center; gap: .7rem; margin: .1rem 0 .5rem; font-size: 1.05rem; }
.pa-stamp {
  display: inline-block; padding: .12em .5em; border: 3px solid #c81e3a; border-radius: .3em; color: #c81e3a;
  font: 900 .9rem/1.2 var(--display); letter-spacing: .2em; text-transform: uppercase; transform: rotate(-8deg);
  box-shadow: inset 0 0 0 1px rgba(200, 30, 58, .45); opacity: .92;
}
.pa-felt.pa-flat .pa-rcard .pa-stamp { mix-blend-mode: multiply; }

/* The cut on the flat table: one screen, the title in gold capitals over a bigger deck, the
   countdown line under it, the Auto cut button; the other side sees who is cutting. */
.pa-felt.pa-flat .pa-cut { background: radial-gradient(closest-side, rgba(24, 11, 43, .9), rgba(10, 6, 18, .6)); }
.pa-felt.pa-flat .pa-cut-t { color: #ffd166; text-transform: uppercase; letter-spacing: .05em; font-size: clamp(1.1rem, 3.6vh, 2rem); }
.pa-felt.pa-flat .pa-cut-box[data-step="cut"] .pa-cutdeck-btn .pa-cutdeck { --h: clamp(110px, 21vh, 184px); }
.pa-felt.pa-flat .pa-cut-box[data-step="cut"] .pa-cutdeck.pa-shuffling { margin-top: 1.8rem; }
.pa-felt.pa-flat .pa-cut-line { color: var(--hb-silver-2); font-weight: 600; }
.pa-felt.pa-flat .pa-cut-auto { min-width: 9rem; margin-top: .2rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; }


/* ---------- The immersive table (2026-10-31, the flat Rami room the owner asked for) ----------
   On a desktop or a short landscape screen the table alone fills the app, like the club's room:
   the app bar, the status strip and the rail give way. The rail becomes a row of icons at the
   bottom right, the game's buttons a dock at the top right (the cards and the stock are tapped,
   as in the club), a status with weight (a warning, a result) a pill at the top; the side panel
   lies over the table. Phones keep the usual frame. */
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "main";
}
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-bar { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-main { padding: 0; background: #080510; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-felt { border-radius: 0; box-shadow: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-status {
  display: none; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(720px, 90%);
  height: auto; min-height: 0; padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(10, 5, 22, .88); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-status:is([data-kind="warn"], [data-kind="bad"], [data-kind="good"]) { display: flex; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-controls {
  position: absolute; top: 10px; right: 12px; z-index: 6; height: auto; width: auto; max-width: 60%;
  flex-direction: row; align-items: center; justify-content: flex-end; gap: .4rem; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 5, 22, .74); backdrop-filter: blur(6px);
}
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-hint { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-cbtns { flex-direction: row; align-items: center; gap: .35rem; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-controls .btn { --bh: 34px; width: auto; padding: 0 .75rem; font-size: .82rem; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rail {
  display: flex; position: absolute; right: 12px; bottom: 8px; z-index: 6; max-height: none; flex-direction: row; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(10, 5, 22, .74); overflow: visible; backdrop-filter: blur(6px);
}
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn { min-height: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; gap: 0; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn > span { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn .pa-ic { width: 18px; height: 18px; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-panel { position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel-w, 340px); z-index: 7; box-shadow: -10px 0 40px rgba(0, 0, 0, .5); }
/* The immersive table on a phone (the flat Rami room): the bar and the controls stay, the status
   row goes (the table has its own status line) except for a warning, the table runs edge to edge. */
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] { grid-template-rows: calc(var(--bar-h) + var(--sat)) 0 minmax(0, 1fr) auto; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-status { display: none; position: absolute; top: calc(var(--bar-h) + var(--sat) + 8px); left: 50%; transform: translateX(-50%); z-index: 6; max-width: 92%; height: auto; min-height: 0; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(10, 5, 22, .88); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-status:is([data-kind="warn"], [data-kind="bad"], [data-kind="good"]) { display: flex; }
/* Nothing over a result card (launch-candidate-18): the status pill that floats over an immersive table (a notice such as
   "Achievement unlocked") gives way while the card is up, on a phone and on a desk; the card says how the match ended. */
.pa[data-match="1"][data-immersive="1"][data-immersive]:not([data-phone-strip]):has(.pa-result:not([hidden])) .pa-status { display: none; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-main { padding: 0; background: #080510; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-felt { border-radius: 0; box-shadow: none; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-hint { display: none; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] { --ctrl-h: 56px; }
/* The language globe: in the bar on a phone (with the code beside it), on the rail elsewhere */
.pa-langbtn { gap: .2rem; width: auto; padding: 0 .45rem; }
.pa-langbtn .pa-langcode { font: 700 .72rem var(--display); letter-spacing: .06em; }
.pa:not([data-layout="phone"]) .pa-langbtn { display: none; }
/* The language list over the globe and the rail's Language (2026-11-13): an invisible native select covers
   the button, so one tap lists English, Français and العربية; the button keeps its look and place. */
.pa-langwrap { position: relative; display: inline-flex; }
.pa-rail .pa-langwrap { display: flex; flex-direction: column; }
.pa-rail .pa-langwrap > .pa-rbtn { flex: 1; width: 100%; }
.pa-langsel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; padding: 0; margin: 0; appearance: none; }
.pa-langsel:focus-visible + *, .pa-langwrap:has(.pa-langsel:focus-visible) > button { outline: 2px solid var(--violet); outline-offset: 2px; }
.pa:not([data-layout="phone"]) .pa-bar-end > .pa-langwrap { display: none; }
/* In a lobby at short landscape the rail's Language is below the fold: the globe shows in the bar. */
.pa[data-layout="short"][data-match="0"] .pa-bar-end > .pa-langwrap { display: inline-flex; }
.pa[data-layout="short"][data-match="0"] .pa-langbtn { display: inline-grid; }
/* the round badge at the top right sits under the docked buttons: move it to the top left row */
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-felt .pa-thdr { grid-template-columns: auto auto auto minmax(0, 1fr); grid-template-areas: "l c r ."; justify-content: start; gap: .6em; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-felt .pa-thdr-r { justify-self: start; }
/* ---------- The club room (2026-10-31, evening): exactly the club's table ----------
   No badges, no game buttons: the stock and the pile are tapped or dragged, a gold button under
   the slots lays an opening down, the dock keeps only the joker choice. The rail is four small
   icons (sort, rules, sound, screen, language) and a red Leave game at the bottom right. */
.pa-rbtn-leave { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-felt .pa-thdr, .pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-felt .pa-thdr { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-cbtns > :is([data-id="draw"], [data-id="take"], [data-id="discard"], [data-id="lay"], [data-id="cancel"], [data-id="sort"], .pa-leave) { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-controls.pa-nodock { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rail > .pa-rbtn:is([data-id="lobby"], [data-id="buy"], [data-id="history"], [data-id="motion"], [data-id="shortcuts"]) { display: none; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rail-slot { display: contents; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn-leave { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; width: auto; height: 32px; margin-left: 4px; padding: 0 1rem; border-radius: 999px; gap: 0; text-align: center; background: linear-gradient(180deg, #e0355c, #b3173c); color: #fff; box-shadow: 0 4px 14px rgba(230, 57, 94, .35); }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn-leave > span { display: inline; margin: 0 auto; font: 700 .78rem/1 var(--display); letter-spacing: .02em; white-space: nowrap; text-align: center; }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn-leave:hover { filter: brightness(1.08); }
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"][data-immersive] .pa-controls { top: auto; bottom: 64px; right: 12px; }
.pa[data-layout="short"][data-match="1"] .pa-rbtn { width: 30px; height: 30px; }
.pa[data-layout="short"][data-match="1"] .pa-rbtn .pa-ic { width: 15px; height: 15px; }
.pa[data-layout="short"][data-match="1"] .pa-rbtn-leave { height: 30px; width: auto; padding: 0 .75rem; margin-left: 2px; }
.pa[data-layout="short"][data-match="1"] .pa-rbtn-leave > span { font-size: .72rem; }
.pa[data-layout="short"][data-match="1"] .pa-rail { bottom: 4px; right: 8px; }
/* the phone: the dock keeps sort and leave (the rail is away), small */
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-cbtns > :is([data-id="draw"], [data-id="take"], [data-id="discard"], [data-id="lay"], [data-id="cancel"]) { display: none; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] { --ctrl-h: 46px; }
.pa[data-layout="phone"][data-match="1"][data-immersive="1"][data-immersive] .pa-controls .btn { --bh: 32px; padding: 0 .7rem; font-size: .8rem; }

/* a low landscape screen (a phone on its side): the club room's rail shrinks and Leave game is its icon */
@media (max-height: 560px) {
  .pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rail { bottom: 4px; right: 6px; gap: 1px; padding: 2px; }
  .pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn { width: 28px; height: 28px; }
  .pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn .pa-ic { width: 14px; height: 14px; }
  .pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn-leave { width: auto; height: 28px; padding: 0 .65rem; margin-left: 2px; }
  .pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-rbtn-leave > span { font-size: .7rem; }
}

/* ---------- The in-game menu (2026-11-03): one menu at every table ----------
   The owner asked for the same menu in every game. The club room's menu above (rules, the
   table's own button, sound, fullscreen, language and a red Leave game, a row at the bottom
   right) now shows at every table, the club-room games and Chkoba, Ludo and Jacquet alike; the
   game's own dock keeps its game buttons but no Leave. Leave game is its words alone (no X),
   centred in the button. On a phone (no rail) the dock's Leave game is the same red button,
   always the last one in the row, the row centred. */
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]) .pa-cbtns > .pa-leave { display: none; }
/* the tables without the club room keep their bar and dock; the rail's column goes (the menu floats) */
.pa[data-layout="desk"][data-match="1"]:not([data-immersive="1"][data-immersive]),
.pa[data-layout="desk"][data-match="1"]:not([data-immersive="1"][data-immersive]):not([data-panel=""]) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "bar" "status" "main" "controls";
}
.pa[data-layout="desk"][data-match="1"]:not([data-immersive="1"][data-immersive]) .pa-controls { padding-right: calc(340px + var(--sar)); }
.pa[data-layout="desk"][data-match="1"]:not([data-immersive="1"][data-immersive]) .pa-rail { bottom: calc((var(--ctrl-h) - 44px) / 2); }
.pa[data-layout="short"][data-match="1"]:not([data-immersive="1"][data-immersive]) .pa-rail { right: calc(clamp(136px, 22vw, 210px) + var(--sar) + 8px); }
/* a phone: the dock is one centred row in every game (the hint gives way, the status line at the
   top says whose turn it is), Leave game the same red button, last in the row */
.pa[data-layout="phone"][data-match="1"] .pa-controls { justify-content: center; }
.pa[data-layout="phone"][data-match="1"] .pa-hint { display: none; }
.pa[data-layout="phone"][data-match="1"] .pa-cbtns { flex: 0 1 auto; justify-content: center; flex-wrap: nowrap; }
.pa[data-layout="phone"][data-match="1"] .pa-controls .pa-leave {
  order: 99; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  --bh: 34px; padding: 0 1rem; border: 0; border-radius: 999px; background: linear-gradient(180deg, #e0355c, #b3173c); color: #fff;
  font: 700 .8rem/1 var(--display); letter-spacing: .02em; white-space: nowrap; box-shadow: 0 4px 14px rgba(230, 57, 94, .35);
}

/* ---------- Graphics quality (2026-11-04): Low, Medium, High at every table ----------
   public/js/perf-profile.js picks the level (the player's choice, or Auto from the device). High
   draws everything. Medium (.pa-med) keeps the hearts beating and the tables moving but drops the
   blur behind the panels, the sparks and the ripples. Low (.pa-lite, the level once called Lite)
   drops those too, lets no decoration loop (a looping glow or pulse plays once and rests), and the
   games' own Low rules (pulse-motion.css, pulse-stage.css, player-ludo.css, ...) still apply. */
.pa:is(.pa-lite, .pa-med) *, .pa-felt:is(.pa-lite, .pa-med) * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.pa-felt.pa-med .hb-fx > .hb-sparks, .pa-felt.pa-med .hb-fx > .hb-beat-edge { display: none; }
.pa-felt.pa-lite *, .pa-felt.pa-lite *::before, .pa-felt.pa-lite *::after { animation-iteration-count: 1 !important; }
.pa-felt.pa-lite .pa-spin, .pa.pa-lite .pa-spin { animation-iteration-count: infinite !important; }
/* the quality buttons: the rail's (a bolt like the others) and the menu's four choices */
.pa-mquality { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; cursor: default; }
.pa-mquality-t { flex: 1 1 auto; }
.pa-mquality-opts { display: inline-flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.pa-qopt { min-width: 0; padding: .3rem .6rem; border: 0; border-radius: 999px; background: none; color: inherit; font: 600 .78rem/1 var(--display); cursor: pointer; }
.pa-qopt.on { background: linear-gradient(180deg, #8b3dff, #6a1fd6); color: #fff; }
.pa-qopt:focus-visible { outline: 2px solid var(--pink); outline-offset: 1px; }

/* Profile sheet (round B, 2026-11-07) */
.pa-phead { display: flex; align-items: center; gap: .8rem; padding: .4rem 0 .8rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pa-pavatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; font: 800 1.4rem var(--display); }
.pa-pwho { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.pa-pname { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-pwallet { display: flex; flex-direction: column; align-items: flex-end; margin-inline-start: auto; }
.pa-pwallet strong { font: 800 1.3rem var(--display); font-variant-numeric: tabular-nums; }
.pa-pgames { overflow-x: auto; }
.pa-ptable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.pa-ptable th, .pa-ptable td { padding: .4rem .35rem; text-align: end; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.pa-ptable th[scope="row"], .pa-ptable thead th:first-child { text-align: start; white-space: normal; }
.pa-ptable thead th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.pa-ptable tbody tr[data-game="all"] { font-weight: 700; }
.pa-plist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.pa-plist li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 480px) { .pa-ptable { font-size: .82rem; } .pa-ptable th, .pa-ptable td { padding: .35rem .2rem; } }

/* Table chat (round C, 2026-11-07; public/js/player-chat.js). The sheet lives in the app's panel, so
   it sits beside the table on PC and is a bottom sheet on a phone; the button is on the rail (PC) or
   in the top bar (phone). */
.pa:not([data-layout="phone"]) .pa-bar .pa-chatbtn { display: none; }
.pa[data-layout="phone"] .pa-rbtn-chat { display: none; }
.pa-chatbtn, .pa-rbtn-chat { position: relative; }
.pa-chatbtn .pa-chatlbl { display: none; }
.pa-chatico { font-size: 1.05rem; line-height: 1; }
.pa-chatbadge:empty { display: none; }
.pa-chatbadge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink, #ff4d8d); color: #fff; font: 800 .68rem/18px var(--display); text-align: center; }
.pa-chat { display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.pa-chatlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; max-height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.pa-chatmsg { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; padding: .45rem .6rem; border-radius: 12px; background: rgba(255, 255, 255, .05); overflow-wrap: anywhere; }
.pa-chatmsg.pa-mine { background: rgba(155, 92, 255, .16); }
.pa-chatmsg.pa-muted .pa-chattext { color: var(--muted); font-style: italic; }
.pa-chatname { font-size: .82rem; }
/* dir="auto" on the line: it reads in its own direction (its question mark at its own end); it stays aligned as the
   row is, by the row's direction (text-align: match-parent resolves against the line's own direction in Chromium). */
.pa-chattext { flex: 1 1 100%; }
.pa-chatmsg:dir(ltr) > .pa-chattext { text-align: left; }
.pa-chatmsg:dir(rtl) > .pa-chattext { text-align: right; }
.pa-chatacts { display: flex; gap: .6rem; margin-inline-start: auto; }
.pa-linkbtn { background: none; border: 0; padding: .15rem 0; color: var(--muted); font: 600 .74rem var(--body); cursor: pointer; text-decoration: underline; }
.pa-chatreport { display: flex; gap: .4rem; flex: 1 1 100%; align-items: center; flex-wrap: wrap; }
.pa-chatempty { padding: .8rem; text-align: center; }
.pa-emojis { display: flex; flex-wrap: wrap; gap: .3rem; }
.pa-emoji { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 1.15rem; cursor: pointer; }
.pa-emoji:hover { background: rgba(255, 255, 255, .1); }
.pa-chatform { display: flex; gap: .4rem; }
.pa-chatin { flex: 1; min-width: 0; height: 40px; padding: 0 .75rem; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; }
.pa-chatfoot { display: flex; justify-content: space-between; gap: .5rem; min-height: 1.1em; }
.pa-chatnote { margin: 0; font-size: .8rem; }
.pa-reaction { position: absolute; z-index: 40; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; padding: .25rem .5rem; border-radius: 14px; background: rgba(20, 10, 40, .88); border: 1px solid var(--line-strong); animation: pa-react 2.5s ease-out forwards; }
.pa-reaction-e { font-size: 1.6rem; line-height: 1.1; }
.pa-reaction small { font-size: .65rem; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pa-react { 0% { opacity: 0; translate: 0 6px; } 12% { opacity: 1; translate: 0 0; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .pa-reaction { animation: none; } }
.pa.pa-reduce .pa-reaction { animation: none; }
/* An open sheet beside the table during a match on PC (round C, 2026-11-07): the sheet is laid over the
   right side (the rule above), so the main area gives it its width. A table keeps its size (sizeTable
   already keeps the sheet's room while no sheet is open) and moves clear of the sheet; an immersive
   table re-fits to the space left of it. No sheet (the chat, the rules, the menu) covers the play area. */
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"]):not([data-panel=""]):is([data-panel]) .pa-main { margin-inline-end: var(--panel-w, 340px); }
/* The table chat on a phone (round C, 2026-11-07): a bottom sheet over the lower half, the table
   re-fitted above it (the main area gives the sheet its height), so the play area stays in view. */
.pa[data-layout="phone"][data-match="1"][data-panel="chat"] .pa-panel { inset: auto 0 0 0; height: 50dvh; border-radius: 18px 18px 0 0; border-top: 1px solid var(--line-strong); box-shadow: 0 -12px 40px rgba(0, 0, 0, .55); }
.pa[data-layout="phone"][data-match="1"][data-panel="chat"] .pa-main { margin-bottom: max(0px, calc(50dvh - var(--ctrl-h, 62px))); }
.pa[data-layout="phone"][data-match="1"][data-panel="chat"] .pa-chatlist { max-height: calc(50dvh - 230px); }

/* Watching a live game (round E, 2026-11-07; public/js/player-spectate.js) */
.pa-watchbar { position: absolute; z-index: 30; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .55rem; padding: .3rem .4rem .3rem .8rem; border-radius: 999px; background: rgba(10, 5, 22, .9); border: 1px solid var(--line-strong); box-shadow: 0 8px 26px rgba(0, 0, 0, .5); white-space: nowrap; }
.pa[data-layout="phone"] .pa-watchbar { top: auto; bottom: calc(var(--ctrl-h, 62px) + 8px); }
/* Where the bar may not cover a name, a clock or a score (the spectator review, 2026-11-18). The games that take the whole
   desk screen (the header hidden) have a seat's name, a score or the game's own header at the top centre: the bar sits in
   the top-right corner, which the table keeps clear (the table stays left to right in Arabic too). On a tablet held
   upright (the phone layout at 600 px and wider) the bar sits in the controls' row, beside the centred Leave, instead of
   over the bottom seat and the line under the table. A desk page with its header keeps the bar on the header's title;
   phones under 600 px are unchanged. */
.pa[data-match="1"]:is([data-layout="desk"], [data-layout="short"])[data-immersive="1"] .pa-watchbar { left: auto; right: 16px; transform: none; }
@media (min-width: 600px) { .pa[data-layout="phone"] .pa-watchbar { bottom: 6px; left: auto; inset-inline-start: 16px; transform: none; } }
.pa-watchdot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink, #ff4d8d); animation: pa-watchpulse 1.6s ease-in-out infinite; }
@keyframes pa-watchpulse { 50% { opacity: .35; } }
.pa.pa-reduce .pa-watchdot { animation: none; }
.pa-watchn { color: var(--muted); font-size: .82rem; }
.pa-watching .pa-controls .pa-cbtns > :not(.pa-leave) { visibility: hidden; }
.pa-watchlist { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .45rem; }
.pa-watchrow { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem .2rem; border-bottom: 1px dashed var(--line); }
.pa-watchrow .pa-tx-amt { display: flex; align-items: center; gap: .6rem; }
.pa-watchempty { padding: 1rem .2rem; }

/* Achievements and the daily reward on the Profile sheet (round G, 2026-11-07) */
.pa-dailynote { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin: .8rem 0 0; }
.pa-dailynote.pa-ready { border-color: var(--gold, #ffd166); }
.pa-achlist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .45rem; }
.pa-ach { display: flex; gap: .55rem; align-items: flex-start; padding: .5rem .6rem; border-radius: 12px; border: 1px solid var(--line); opacity: .62; }
.pa-ach.pa-got { opacity: 1; border-color: rgba(255, 209, 102, .55); background: rgba(255, 209, 102, .07); }
.pa-ach > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pa-achico { font-size: 1.2rem; line-height: 1.2; color: var(--gold, #ffd166); }
@media (max-width: 480px) { .pa-achlist { grid-template-columns: 1fr; } }

/* A phone on its side (the short layout) during a match (browser suite round, 2026-11-07): the quick-access
   rail sits at the bottom right over the table's corner, so the table leaves the rail's height free below it
   (sizeTable reads the main area's padding); the rail itself is unchanged. An immersive table keeps its
   edge-to-edge room (the rail is laid over its dark margin there). */
.pa[data-layout="short"][data-match="1"]:not([data-immersive="1"][data-immersive]) .pa-main { padding-bottom: calc(40px + var(--sab)); }

/* ---------- Partner mode: the compact top-right casino panel (the B2B brief, 2026-11-07) ---------- */
/* Nickname, balance with its currency (the casino's balance in a seamless environment), the connection
   dot and the lobby button, in one pill; the demo bar keeps its separate pieces (player-app.js). */
.pa-hud {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 3px 0 0; max-width: min(60vw, 420px);
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(155, 92, 255, .08);
}
.pa-hud-info {
  display: inline-flex; align-items: center; gap: .55rem; height: 38px; min-width: 0; padding: 0 .6rem 0 .75rem;
  border: 0; border-radius: 999px 0 0 999px; background: none; color: var(--text); font: 600 .88rem var(--body); cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.pa-hud-info:hover { background: rgba(155, 92, 255, .14); }
.pa-hud-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.pa-hud-money { display: inline-flex; align-items: baseline; gap: .3rem; color: var(--gold); font: 700 1rem var(--display); font-variant-numeric: tabular-nums; }
.pa-hud-cur { font: 600 .68rem var(--body); color: #f5e3b0; letter-spacing: .04em; text-transform: uppercase; }
.pa-hud[data-state="online"] .pa-dot { background: var(--online); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.pa-hud[data-state="offline"] .pa-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 138, .25); }
.pa-hud[data-state="reconnecting"] .pa-dot, .pa-hud[data-state="connecting"] .pa-dot { animation: pa-blink 1s infinite; }
.pa-hud-menu { width: 34px; height: 32px; border-radius: 999px; border-color: transparent; background: rgba(155, 92, 255, .14); }
.pa-hud-menu .pa-ic { width: 22px; height: 22px; stroke-width: 3; }
.pa-hud.bump { animation: bump .6s var(--ease); }
.pa-hud.dip { animation: pa-dip .6s var(--ease); }
.pa[data-layout="phone"] .pa-hud-name { display: none; }
.pa[data-layout="phone"] .pa-hud-info { gap: .4rem; padding: 0 .45rem 0 .6rem; }
.pa[data-layout="phone"] .pa-hud-money { font-size: .9rem; }
/* Short screens in a match: the bar is the narrow left rail, so the panel stacks (as the chip does). */
.pa[data-layout="short"][data-match="1"] .pa-hud { flex-direction: column; height: auto; max-width: none; padding: 3px; gap: 3px; border-radius: 14px; }
.pa[data-layout="short"][data-match="1"] .pa-hud-info { flex-direction: column; height: auto; padding: 4px 2px; gap: 2px; border-radius: 10px; font-size: .72rem; }
.pa[data-layout="short"][data-match="1"] .pa-hud-name { display: none; }
.pa[data-layout="short"][data-match="1"] .pa-hud-money { flex-direction: column; align-items: center; gap: 0; font-size: .8rem; }
[dir="rtl"] .pa-hud-info { border-radius: 0 999px 999px 0; }
/* The nav panel (the menu in partner mode): who plays and their balance at the top, Exit in red last. */
.pa-mwho { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin: 0 0 .9rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(155, 92, 255, .1); }
.pa-mwho strong { font: 700 1rem var(--display); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pa-mwho-bal { margin-left: auto; color: var(--gold); font: 700 1rem var(--display); font-variant-numeric: tabular-nums; }
.pa-mwho-k { flex-basis: 100%; }
[dir="rtl"] .pa-mwho-bal { margin-left: 0; margin-right: auto; }
.pa-mitem-exit { color: var(--danger); }
.pa-mitem-exit:hover { background: rgba(255, 107, 138, .12); }
/* The optional nickname (the B2B brief): the skip under the name form, a quiet text button. */
.pa-nameskip { margin-top: .5rem; padding: .3rem .4rem; border: 0; background: none; color: var(--muted); font: 600 .9rem var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pa-nameskip:hover, .pa-nameskip:focus-visible { color: var(--text); }
.pa-nameskip:disabled { opacity: .5; cursor: default; }

/* The demo site is DEMO only (phase 4 of the B2B plan, 2026-11-07): the DEMO badge beside the credits
   in the bar and in the lobby's note; the credits top up, nothing is bought. */
.pa-demo-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 .5rem; border-radius: 6px;
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; font: 800 .66rem/1 var(--display, inherit); letter-spacing: .14em;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, .35), 0 0 14px rgba(124, 58, 237, .35); text-transform: uppercase; flex: none;
}
.pa-bar .pa-demo-badge { margin-inline-end: -.2rem; }
.pa-bar .pa-demo-badge[hidden] { display: none; }
.pa-kinds-demo .pa-demo-note { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pa-kinds-demo .pa-row { margin-top: .5rem; }
@media (max-width: 560px) { .pa-bar .pa-demo-badge { height: 20px; padding: 0 .4rem; font-size: .6rem; } }

/* ---------- Chat dock (launch round, 2026-11-13; public/js/player-chatdock.js) ---------- */
/* The bottom-left corner (bottom-right in Arabic: inline start), moved up by the script past whatever
   the game draws there and above the on-screen keyboard. Collapsed to a 48px button by default. */
.pa-dock { position: fixed; z-index: 45; inset-inline-start: calc(12px + var(--sal, 0px)); bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.pa-dock[hidden] { display: none; }
.pa-dock > * { pointer-events: auto; }
.pa-dock-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong, rgba(255,255,255,.18)); background: var(--panel-solid, #170f26); color: var(--text); font-size: 1.3rem; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 28px -10px rgba(0,0,0,.8); }
.pa-dock-btn:hover { border-color: var(--violet, #9b5cff); }
.pa-dock-btn:focus-visible { outline: 2px solid var(--violet, #9b5cff); outline-offset: 2px; }
.pa-dock-btn[aria-expanded="true"] { background: var(--grad, #9b5cff); color: #fff; }
.pa-dock-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--pink, #ff4d8d); color: #fff; font: 800 .7rem/20px var(--display); text-align: center; }
.pa-dock-badge[hidden], .pa-dock-badge:empty { display: none; }
.pa-dock-panel { width: min(340px, calc(100vw - 24px)); max-height: min(60dvh, 480px); display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-strong, rgba(255,255,255,.18)); background: var(--panel-solid, #170f26); box-shadow: 0 24px 60px -20px rgba(0,0,0,.9); overflow: hidden; }
.pa-dock-panel[hidden] { display: none; }
.pa-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line, rgba(255,255,255,.1)); }
.pa-dock-title { font: 800 .95rem var(--display); }
.pa-dock-x { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted, #b9a9d9); font-size: 1.5rem; cursor: pointer; }
.pa-dock-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
.pa-dock-body { padding: 10px 12px 12px; overflow: auto; min-height: 0; }
.pa-dock-body .pa-chatlist { max-height: min(34dvh, 300px); }
.pa-dock-body .pa-chatform input { min-height: 44px; }
.pa-dock-body .pa-chatsend { min-height: 44px; }

/* Feel wave 1 (2026-11-13): one short pulse on an existing element (the status line at 5 s left, a seat
   marker); a transform and opacity only, ending where it began. Reduced motion keeps the opacity. */
@keyframes pa-feelpulse { 0% { transform: scale(1); } 18% { transform: scale(1.06); } 40% { transform: scale(1); } 58% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes pa-feelfade { 0%, 100% { opacity: 1; } 30% { opacity: .55; } }
.pa-feelpulse { animation: pa-feelpulse .5s cubic-bezier(0, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .pa-feelpulse { animation: pa-feelfade .5s linear; } }
.pa.pa-reduce .pa-feelpulse { animation: pa-feelfade .5s linear; }
.pa-feelwin { position: absolute; inset: 0; pointer-events: none; z-index: 3; background: radial-gradient(circle at 50% 50%, rgba(155, 92, 255, .28), rgba(155, 92, 255, 0) 58%); opacity: 0; animation: pa-feelwin 1.1s cubic-bezier(0, 0, .2, 1) forwards; }
@keyframes pa-feelwin { 0% { opacity: 0; transform: scale(.85); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .pa-feelwin { animation: pa-feelfade 1s linear forwards; } }
