/* Poncler: card-room palette of oxblood felt, walnut and brass. Single dark theme by design. */
:root {
  color-scheme: dark;
  --room: #140d0b;
  --room-2: #1d1310;
  --panel: #221612;
  --panel-2: #2a1b16;
  --rail-hi: #5b3526;
  --rail-lo: #2a1610;
  --felt: #6e2130;
  --felt-hi: #8a2a3b;
  --felt-deep: #3f0f19;
  --brass: #d4ab5e;
  --brass-dim: #8c6f3c;
  --ivory: #f5efe2;
  --ivory-2: #e3d8c2;
  --ink: #1f1613;
  --text: #efe5d7;
  --muted: #a99183;
  --line: #ffffff17;
  --line-2: #ffffff2a;
  --good: #7cc495;
  --bad: #ef7b80;
  --warn: #e8b04f;
  --chip-red: #b7372f;
  --chip-blue: #2e5a96;
  --chip-black: #2a2422;
  --win: #ecc874;
  --focus: #f0d38a;
  --side-w: 236px;
  --top-h: 64px;
  --display: "Limelight", "Didot", Georgia, serif;
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
}
/* Card faces: two- or four-color, light or dark */
body {
  --face-hi: #fffaf0; --face: var(--ivory); --face-lo: var(--ivory-2); --face-edge: #0000001a; --back-edge: var(--ivory);
  --back-line: #d4ab5e38; --back-1: #7a2232; --back-2: #4a111c; --card-glow: none;
  --back-pattern: repeating-linear-gradient(45deg, var(--back-line) 0 1.5px, transparent 1.5px 6px), repeating-linear-gradient(-45deg, var(--back-line) 0 1.5px, transparent 1.5px 6px);
  --suit-s: #1f1613; --suit-h: #b21f2d; --suit-d: #b21f2d; --suit-c: #1f1613; --suit-j: #6b3fa0;
  --lc-s: var(--ivory); --lc-h: #ef7b80; --lc-d: #ef7b80; --lc-c: var(--ivory); --lc-j: #c9a2ff;
}
body[data-deck="4"] { --suit-d: #1f5fb4; --suit-c: #1c7a3a; --lc-d: #6fb2ff; --lc-c: #5fd38a; }
body[data-face="dark"] {
  --face-hi: #36312e; --face: #272321; --face-lo: #1c1917; --face-edge: #ffffff2b; --back-edge: #2c2725;
  --suit-s: #f2ece0; --suit-h: #ff7276; --suit-d: #ff7276; --suit-c: #f2ece0; --suit-j: #c9a2ff;
}
body[data-face="dark"][data-deck="4"] { --suit-d: #62adff; --suit-c: #55d683; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse 90% 60% at 50% 0%, #2b1914 0%, var(--room) 60%) var(--room);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
.boot { padding: 80px 16px; color: var(--muted); text-align: center; line-height: 2; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wordmark { font-family: var(--display); color: var(--brass); font-weight: 400; letter-spacing: .01em; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); } }
.side {
  display: none; position: sticky; top: 0; height: 100vh; flex-direction: column; gap: 6px;
  padding: 18px 14px 14px; border-right: 1px solid var(--line); background: #120b0acc;
}
@media (min-width: 960px) { .side { display: flex; } }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: auto; height: 32px; }
.side .brand { padding: 2px 8px 18px; }
.side .brand-mark { height: 42px; }
.side .wordmark { font-size: 28px; }
.side nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ivory-2); font-weight: 500;
  border: 1px solid transparent;
}
.nav-link svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav-link:hover { background: #ffffff08; text-decoration: none; }
.nav-link[aria-current="page"] { background: #d4ab5e14; border-color: #d4ab5e3d; color: var(--brass); }
.nav-link[aria-current="page"] svg { color: var(--brass); }
.nav-link .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--chip-red); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.side .spacer { flex: 1; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #ffffff08; border: 1px solid var(--line); }
.side-user .who { min-width: 0; display: grid; }
.side-user .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.side-user .who span { font-size: 12.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); padding: env(safe-area-inset-top, 0px) 16px 0;
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: #140d0bec; backdrop-filter: blur(8px);
}
.top .brand-mark { height: 30px; }
.top .wordmark { font-size: 22px; }
@media (min-width: 960px) { .top .top-brand { display: none; } .top { padding-inline: 28px; } }
@media (max-width: 480px) { .top [data-sound] { display: none; } .top { gap: 8px; } }
.top .grow { flex: 1; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: #d4ab5e14; border: 1px solid #d4ab5e4d; color: var(--brass); font-weight: 600; font-variant-numeric: tabular-nums;
}
.balance-pill svg { width: 16px; height: 16px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ivory-2);
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--chip-red); box-shadow: 0 0 0 2px var(--room); }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 96px; display: grid; gap: 22px; align-content: start; }
@media (min-width: 960px) { .page { padding-inline: 28px; padding-block: 28px 48px; } }
.page.wide { max-width: 1500px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 60ch; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: #120b0af2; border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
@media (min-width: 960px) { .tabbar { display: none; } }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a[aria-current="page"] { color: var(--brass); }
.tabbar a:hover { text-decoration: none; }

/* ---------- Building blocks ---------- */
.panel { background: linear-gradient(#24171380, #1a110ecc); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.panel h2 { font-size: 17px; font-weight: 600; }
.section-title { font-size: 17px; font-weight: 600; margin: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 880px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 11px;
  border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: filter .15s ease, transform .1s ease, opacity .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brass); color: var(--ink); }
.btn.light { background: var(--ivory); color: var(--ink); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover:not(:disabled) { border-color: #ffffff4d; }
.btn.danger { background: transparent; border-color: #ef7b8066; color: var(--bad); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brass); cursor: pointer; font-weight: 600; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: #0d0807; color: var(--text);
  font-size: 15px;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--brass-dim); outline: none; box-shadow: 0 0 0 3px #d4ab5e26; }
.input.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; }
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.error-text { color: var(--bad); font-size: 13.5px; min-height: 1.2em; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.seg label { position: relative; display: grid; gap: 1px; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line-2); text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label b { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg label small { font-size: 11.5px; color: var(--muted); }
.seg label:has(input:checked) { background: var(--brass); border-color: transparent; color: var(--ink); }
.seg label:has(input:checked) small { color: #1f1613b3; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch > span:first-child { display: grid; font-weight: 600; }
.switch small { font-weight: 400; font-size: 13px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { flex: none; position: relative; width: 40px; height: 23px; border-radius: 999px; background: #ffffff26; transition: background .15s ease; }
.track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--ivory); transition: translate .15s ease; }
.switch input:checked + .track { background: var(--brass); }
.switch input:checked + .track::after { translate: 17px 0; }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #0000004d; border: 1px solid var(--line); }
.tabs a, .tabs button { padding: 7px 14px; border-radius: 9px; color: var(--ivory-2); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; }
.tabs a:hover { text-decoration: none; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { background: var(--panel-2); color: var(--brass); box-shadow: inset 0 0 0 1px #d4ab5e33; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ivory-2); white-space: nowrap; }
.pill.good { color: var(--good); border-color: #7cc49566; }
.pill.bad { color: var(--bad); border-color: #ef7b8066; }
.pill.warn { color: var(--warn); border-color: #e8b04f66; }
.pill.brass { color: var(--brass); border-color: #d4ab5e66; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #5b4a42; flex: none; }
.online-dot.on { background: var(--good); box-shadow: 0 0 0 3px #7cc49526; }

.avatar {
  flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; width: var(--s, 36px); height: var(--s, 36px);
  background: var(--felt); color: var(--ivory); font: 700 calc(var(--s, 36px) * .46) / 1 var(--serif); box-shadow: inset 0 0 0 2px #d4ab5e55;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { color: var(--muted); font-size: 13px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 34px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--brass-dim); }
.empty b { color: var(--text); font-size: 16px; }

.stat-tile { display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: #ffffff06; border: 1px solid var(--line); }
.stat-tile .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Toasts */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 960px) { #toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 16px 36px -12px #000; animation: toast-in .25s ease both; }
.toast.bad { border-color: #ef7b8066; }
.toast.good { border-color: #7cc49566; }
.toast a { margin-left: auto; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dialogs */
dialog.modal {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 18px; border: 1px solid #d4ab5e40;
  background: var(--panel); color: var(--text); box-shadow: 0 30px 70px -20px #000;
}
dialog.modal::backdrop { background: #0d0807b8; backdrop-filter: blur(3px); }
.modal-body { display: grid; gap: 16px; padding: 22px; }
.modal-body h2 { font-size: 20px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(320px, calc(100vw - 32px)); display: grid; gap: 4px; padding: 8px;
  border-radius: 14px; background: var(--panel); border: 1px solid #d4ab5e40; box-shadow: 0 24px 48px -12px #000;
}
.menu button, .menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.menu button:hover, .menu a:hover { background: #ffffff0d; text-decoration: none; }
.menu .sel { color: var(--brass); font-weight: 600; }
.menu-title { padding: 6px 10px 4px; }
.notif { display: grid; gap: 2px; padding: 9px 10px; border-radius: 9px; }
.notif.unread { background: #d4ab5e12; }
.notif small { color: var(--muted); }

/* Test-mode banner on payment screens */
.test-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #e8b04f12; border: 1px dashed #e8b04f66; color: var(--ivory-2); font-size: 14px; }
.test-banner b { color: var(--warn); }
.test-banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--warn); }

/* ---------- Public pages ---------- */
.public { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.public-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px; max-width: 1180px; width: 100%; margin: 0 auto; }
.public-top .wordmark { font-size: 28px; }
.public-top .brand-mark { height: 38px; }
.landing { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 64px; display: grid; gap: 56px; }
.hero { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }
.hero h1 { font-family: var(--display); color: var(--brass); font-weight: 400; font-size: clamp(56px, 9vw, 120px); line-height: .9; }
.hero .lede { margin-top: 18px; max-width: 40ch; font-size: clamp(17px, 1.6vw, 20px); color: var(--ivory-2); }
.hero .row { margin-top: 26px; }
.fan { position: relative; --cw: clamp(62px, 8vw, 100px); width: calc(var(--cw) * 3.3); height: calc(var(--cw) * 1.8); margin-inline: auto; }
.fan .card {
  position: absolute; bottom: 0; left: calc(var(--i) * var(--cw) * .56); transform-origin: 50% 130%;
  rotate: calc(var(--off) * 7deg); translate: 0 calc(max(var(--off), calc(var(--off) * -1)) * 7px);
  box-shadow: 0 10px 24px -6px #000c, inset 0 0 0 1px #0000001a;
  transition: rotate .35s cubic-bezier(.2, .8, .2, 1), translate .35s cubic-bezier(.2, .8, .2, 1), scale .25s ease, box-shadow .25s ease;
}
/* Hovering the hand fans it wider; the card under the pointer lifts and straightens. */
.fan:hover .card { rotate: calc(var(--off) * 11deg); translate: calc(var(--off) * 14px) calc(max(var(--off), calc(var(--off) * -1)) * 10px); }
.fan .card:hover { z-index: 5; rotate: 0deg; translate: calc(var(--off) * 14px) -26px; scale: 1.08; box-shadow: 0 22px 36px -10px #000e, 0 0 0 2px var(--brass); }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature { padding: 18px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.feature b { font-size: 16px; }
.feature p { color: var(--muted); font-size: 14.5px; }
.auth-wrap { display: grid; place-items: center; padding: 24px 16px 64px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; padding: 28px; border-radius: 20px; background: linear-gradient(#2a1b16, #1a110e); border: 1px solid #d4ab5e40; box-shadow: 0 30px 60px -30px #000; }
.auth-card h1 { font-size: 26px; }
.auth-logo { height: 54px; width: auto; }
.auth-card .alt { text-align: center; color: var(--muted); font-size: 14px; }

/* PIN lock */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.lock-card { display: grid; justify-items: center; gap: 14px; text-align: center; width: min(380px, 100%); }
.lock-logo { height: 84px; width: auto; }
.lock-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #d4ab5e1f; border: 1px solid #d4ab5e55; color: var(--brass); }
.lock-icon svg { width: 26px; height: 26px; }
.pin-boxes { display: flex; gap: 8px; }
.pin-boxes input { width: 46px; height: 58px; text-align: center; font-size: 24px; font-weight: 700; border-radius: 12px; border: 1px solid var(--line-2); background: #0d0807; }
.pin-boxes input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px #d4ab5e33; }

/* ---------- Dashboard ---------- */
.balance-card {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding: 24px; border-radius: 20px; border: 1px solid #d4ab5e40;
  background: radial-gradient(ellipse 80% 120% at 0% 0%, var(--sc-1, #8a2a3b), var(--sc-2, var(--felt)) 45%, var(--sc-3, var(--felt-deep)));
  color: var(--sc-ink, var(--text));
}
/* The Elo box takes the colours of your stats card design */
.balance-card .eyebrow, .balance-card [style*="--ivory-2"] { color: color-mix(in srgb, var(--sc-ink, #f5efe2) 80%, transparent) !important; }
.balance-card::after { border-color: color-mix(in srgb, var(--sc-accent, #d4ab5e) 35%, transparent) !important; }
.balance-card::after { content: ""; position: absolute; inset: 10px; border: 1px solid #d4ab5e33; border-radius: 14px; pointer-events: none; }
.balance-card .big { font-size: clamp(32px, 5vw, 46px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; }
.balance-card .row { position: relative; z-index: 1; }
.feedback-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }

/* ---------- Lobby ---------- */
.table-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.table-card { display: grid; gap: 12px; padding: 18px; border-radius: 16px; background: linear-gradient(#26181480, #1a110ecc); border: 1px solid var(--line); }
.table-card.practice { background: radial-gradient(ellipse 90% 100% at 100% 0%, #3f0f19, #1a110e 70%); border-color: #d4ab5e40; }
.table-card h3 { font-size: 18px; }
.table-card .meta { display: grid; gap: 3px; color: var(--muted); font-size: 13.5px; }
.table-card .meta b { color: var(--ivory-2); font-weight: 600; }
.seat-bar { display: flex; gap: 3px; }
.seat-bar i { flex: 1; height: 5px; border-radius: 3px; background: #ffffff1a; }
.seat-bar i.on { background: var(--brass); }
.face-stack { display: flex; }
.face-stack .avatar { --s: 26px; margin-left: -6px; box-shadow: 0 0 0 2px var(--room), inset 0 0 0 2px #d4ab5e55; }
.face-stack .avatar:first-child { margin-left: 0; }

/* ---------- Wallet ---------- */
.coin-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.address-box { display: grid; gap: 16px; align-items: center; }
@media (min-width: 640px) { .address-box { grid-template-columns: 180px minmax(0, 1fr); } }
.qr { width: 180px; max-width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--ivory); padding: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.address { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; word-break: break-all; padding: 12px; border-radius: 10px; background: #0d0807; border: 1px solid var(--line-2); }
.steps { display: grid; gap: 10px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; color: var(--ivory-2); }
.steps li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #d4ab5e1f; color: var(--brass); font-weight: 700; font-size: 13px; }

/* ---------- Stats ---------- */
.elo-card { display: grid; gap: 14px; padding: 22px; border-radius: 20px; border: 1px solid #d4ab5e40; background: linear-gradient(160deg, #2c1b16, #170f0c); }
.elo-card .big { font-size: clamp(30px, 4.5vw, 42px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chart { width: 100%; height: 150px; display: block; }
.chart .grid line { stroke: #ffffff14; }
.chart text { fill: var(--muted); font: 11px var(--sans); }
.achievements { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.achv { display: grid; grid-template-columns: 38px 1fr; gap: 2px 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff05; }
.achv .medal { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #ffffff0f; color: var(--muted); }
.achv .medal svg { width: 18px; height: 18px; }
.achv b { font-size: 14.5px; }
.achv small { color: var(--muted); font-size: 12.5px; }
.achv.done { border-color: #d4ab5e55; background: #d4ab5e0d; }
.achv.done .medal { background: var(--brass); color: var(--ink); }

/* ---------- Chat ---------- */
.chat-layout { display: grid; gap: 14px; min-height: 0; }
@media (min-width: 880px) { .chat-layout { grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 150px); min-height: 460px; } }
.threads { display: grid; align-content: start; gap: 4px; overflow-y: auto; }
.thread { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--text); }
.thread:hover { background: #ffffff08; text-decoration: none; }
.thread[aria-current="page"] { background: #d4ab5e14; box-shadow: inset 0 0 0 1px #d4ab5e3d; }
.club-avatar { background: var(--felt); }
.club-avatar img { width: 62%; height: auto; object-fit: contain; }
.thread .grow { min-width: 0; flex: 1; }
.thread .sub { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: flex; flex-direction: column; min-height: 420px; padding: 0; overflow: hidden; }
.convo-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 80%; }
.msg .bubble { padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: #ffffff0d; border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg .bubble small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: #d4ab5e1f; border-color: #d4ab5e40; border-radius: 14px 14px 4px 14px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- Events ---------- */
.event { display: grid; gap: 14px; grid-template-columns: 84px minmax(0, 1fr); align-items: start; }
.event-date { display: grid; justify-items: center; padding: 10px 6px; border-radius: 14px; background: var(--felt); border: 1px solid #d4ab5e40; }
.event-date b { font-family: var(--serif); font-size: 30px; line-height: 1; }
.event-date span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-2); }

/* ---------- Practice setup ---------- */
.opp-list { display: grid; gap: 8px; }
.opp { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff05; cursor: pointer; }
.opp input { position: absolute; opacity: 0; pointer-events: none; }
.opp .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--felt); color: var(--ivory); font: 700 18px var(--serif); box-shadow: inset 0 0 0 2px #d4ab5e55; }
.opp.game .av { border-radius: 9px; height: 34px; font-size: 13px; }
.opp .nm { font-weight: 600; }
.opp .nm small { margin-left: 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.opp .ds { color: var(--muted); font-size: 13px; }
.opp .tick { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #ffffff40; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--ink); }
.opp.game .tick { border-radius: 50%; }
.opp:has(input:checked) { border-color: var(--brass-dim); background: #d4ab5e12; }
.opp:has(input:checked) .tick { background: var(--brass); border-color: transparent; }
.opp:has(input:checked) .tick::after { content: "\2713"; }
.opp:not(:has(input:checked)) .av { filter: grayscale(1) opacity(.5); }
.opp:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.deck-preview { display: flex; gap: 6px; --cw: 40px; }
.deck-preview .card { animation: none; }
.rankings ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 22px; }
.rankings li { display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; padding-block: 11px; border-top: 1px solid var(--line); }
.rankings .n { grid-row: span 2; color: var(--brass); font-weight: 600; }
.rankings .t { font-weight: 600; }
.rankings .ex { font-size: 14px; display: flex; gap: 6px; }

/* ---------- Shop and Design ---------- */
.shop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.shop-item { display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: 16px; background: linear-gradient(#26181480, #1a110ecc); border: 1px solid var(--line); }
.shop-item h3 { font-size: 17px; }
.shop-item .price { font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; }
.shop-item .btn { justify-self: start; }
.design-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.design-opt { display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: #ffffff05; border: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.design-opt:hover { border-color: var(--line-2); }
.design-opt.selected { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.design-opt.locked .design-preview { filter: saturate(.75) brightness(.85); }
.design-opt .pill svg { width: 12px; height: 12px; }
.design-hero { display: grid; place-items: center; padding: 22px; }
/* A miniature table with a few cards, coloured by the design variables set on the element */
.design-preview { width: 100%; }
.mini-rail { position: relative; aspect-ratio: 2.1 / 1; border-radius: 999px; padding: 6%; background: radial-gradient(ellipse at 50% 0%, var(--trail-hi), var(--trail-lo) 72%); box-shadow: inset 0 1px 0 #ffffff1f, 0 10px 24px -12px #000; }
.mini-felt { position: relative; height: 100%; border-radius: 999px; display: grid; place-items: center; overflow: hidden;
  background: var(--tpattern), radial-gradient(ellipse 70% 62% at 50% 42%, var(--tfelt-hi), var(--tfelt) 52%, var(--tfelt-deep) 100%); box-shadow: inset 0 0 0 1px var(--tline), inset 0 6px 18px #0007; }
.mini-cards { display: flex; gap: 4%; --cw: 14%; width: 100%; justify-content: center; }
.design-preview.sm .mini-cards { --cw: 30px; gap: 3px; }
.design-preview.md .mini-cards { --cw: 38px; gap: 4px; }
.design-preview.lg { max-width: 640px; }
.design-preview.lg .mini-cards { --cw: clamp(40px, 9vw, 72px); gap: 8px; }
.mini-cards .card { animation: none; }

.mini-cards.backs .card:nth-child(1) { rotate: -10deg; }
.mini-cards.backs .card:nth-child(3) { rotate: 10deg; }
.mini-cards.backs .card + .card { margin-left: calc(var(--cw) * -.35); }
.look-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px; }
.look-btn:hover .mini-rail { box-shadow: inset 0 1px 0 #ffffff1f, 0 0 0 2px #d4ab5e66, 0 10px 24px -12px #000; }
.opt-actions { gap: 6px; }

/* Deck inspector */
dialog.modal.wide { width: min(1040px, calc(100vw - 24px)); }
.inspect { display: grid; gap: 12px; }
.inspect-tools { gap: 10px; }
.inspect-stage {
  border-radius: 22px; padding: 22px 14px 26px; display: grid; gap: 22px; justify-items: center; overflow: hidden;
  background: var(--tpattern), radial-gradient(ellipse 80% 70% at 50% 35%, var(--tfelt-hi), var(--tfelt) 55%, var(--tfelt-deep));
  box-shadow: inset 0 0 0 2px var(--tline), inset 0 10px 40px #0008;
}
/* The hero fan sweeps open, and spreads further on hover */
.inspect-fan { position: relative; height: calc(var(--cw) * 1.55); width: 100%; --cw: clamp(64px, 11vw, 112px); }
.inspect-fan .card {
  position: absolute; left: calc(50% - var(--cw) / 2); bottom: 0; transform-origin: 50% 120%;
  rotate: var(--r); translate: var(--tx) 0; box-shadow: 0 12px 26px -8px #000c, inset 0 0 0 1px var(--face-edge);
  animation: fan-in .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d) * 90ms);
  transition: rotate .35s ease, translate .35s ease;
}
.inspect-fan:hover .card { rotate: calc(var(--r) * 1.5); translate: calc(var(--tx) * 1.35) -8px; }
@keyframes fan-in { from { opacity: 0; transform: translateX(calc(var(--tx) * -1)) rotate(calc(var(--r) * -1)) scale(.8); } to { opacity: 1; transform: none; } }
/* The full deck is dealt face down, then turned over in a wave */
.inspect-deck { display: grid; gap: 10px; justify-items: center; width: 100%; --cw: clamp(30px, 5.2vw, 52px); }
.inspect-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; }
.inspect-row .flip + .flip { margin-left: calc(var(--cw) * -.28); }
.flip {
  position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); perspective: 700px; flex: none;
  animation: deal-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d) * 14ms);
  transition: translate .2s ease, scale .2s ease;
}
.flip:hover { translate: 0 -10px; scale: 1.14; z-index: 3; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .6s cubic-bezier(.3, .7, .3, 1); transition-delay: calc(var(--d) * 12ms); }
.inspect.faces .flip-inner { transform: rotateY(0deg); }
.flip .card { position: absolute; inset: 0; animation: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .f-back { transform: rotateY(180deg); }
@keyframes deal-in { from { opacity: 0; transform: translateY(-36px) rotate(-8deg) scale(.7); } to { opacity: 1; transform: none; } }
/* Card back inspection: one back per deck; hover turns it over */
.inspect-backs { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; --cw: clamp(70px, 12vw, 120px); }
.inspect-backs figure { margin: 0; display: grid; gap: 8px; justify-items: center; }
.inspect-backs figcaption { font-size: 13px; font-weight: 600; color: var(--ivory); }
.inspect-backs .flip { cursor: pointer; }
.inspect-backs .flip-inner { transition-delay: 0s; }
.inspect-backs .flip:hover { translate: 0 -6px; scale: 1.04; }
.inspect-backs .flip:hover .flip-inner { transform: rotateY(0deg); }

/* Stats card export */
.stats-card canvas { width: 100%; height: auto; display: block; border-radius: 18px; box-shadow: 0 24px 50px -24px #000; }

/* Cards in text */
.lc { font-weight: 700; color: var(--lc-s); white-space: nowrap; }
.lc.s1 { color: var(--lc-h); }
.lc.s2 { color: var(--lc-d); }
.lc.s3 { color: var(--lc-c); }
.lc.sj { color: var(--lc-j); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Icons inside list rows (profile links and similar) */
.list-item > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }

/* Avatars: picker in Settings and bust previews in the Shop */
.avatar-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.avatar-opt { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 14px; border: 1px solid var(--line); background: #ffffff05; color: var(--text); cursor: pointer; font: inherit; }
.avatar-opt:hover { border-color: var(--line-2); }
.avatar-opt.selected { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.avatar-opt b { font-size: 13px; text-align: center; }
.avatar-opt small { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.avatar-opt small svg { width: 12px; height: 12px; }
.avatar-opt.selected small { color: var(--good); }
.avatar-opt.locked .bust-frame img { filter: saturate(.6) brightness(.8); }
.bust-frame { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #8a2a3b, #3f0f19); box-shadow: inset 0 0 0 2px #d4ab5e44; }
.bust-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-show { display: grid; place-items: end center; height: 150px; border-radius: 14px; overflow: hidden;
  background: var(--tpattern), radial-gradient(ellipse 80% 90% at 50% 70%, var(--tfelt-hi), var(--tfelt) 55%, var(--tfelt-deep)); box-shadow: inset 0 0 0 1px var(--tline); }
.avatar-show img { height: 140px; width: auto; filter: drop-shadow(0 8px 12px #0009); transition: transform .25s ease; }
.shop-item:hover .avatar-show img { transform: translateY(-4px) scale(1.04); }
.design-hero { position: relative; }
.hero-bust { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: clamp(70px, 12vw, 120px); height: auto; filter: drop-shadow(0 8px 12px #000a); pointer-events: none; }

/* Game graphics and controls don't highlight blue when clicked, double-clicked or dragged.
   Chat messages, the hand history and form fields stay selectable. */
body { -webkit-tap-highlight-color: transparent; }
.stage, .controls, .card, .chip, .seg, .tabs, .btn, .icon-btn, .balance-pill, .brand, .avatar, .bust-frame, .avatar-opt, .avatar-show,
.design-preview, .design-opt, .look-btn, .fan, .inspect-stage, .inspect-tools, .mini-cards, .table-card .seat-bar, .face-stack,
.nav-link, .tabbar, .presets, .gchat-quick, .shop-item .price, .deck-preview, .pin-boxes, .event-date, .achv .medal {
  -webkit-user-select: none; user-select: none;
}
.controls input, .gchat-list, .history-pane, .messages { -webkit-user-select: text; user-select: text; }
img, svg { -webkit-user-drag: none; }

/* Group chat icon: up to four member avatars in a little grid */
.group-avatar { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); }
.group-avatar img { width: 100%; height: 100%; object-fit: cover; }
.group-avatar img:only-child { grid-column: span 2; }

/* ---------- Elo, playing style and leaderboard ---------- */
.elo-facts { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 22px; color: var(--muted); font-size: 14px; }
.elo-facts b { color: var(--text); font-variant-numeric: tabular-nums; }
.style-groups { margin-top: 16px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.style-group h3 { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin: 0 0 6px; }
.style-group ul { list-style: none; margin: 0; padding: 0; display: grid; }
.style-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.style-group li:first-child { border-top: 0; }
.st-name { display: grid; min-width: 0; }
.st-name small { color: var(--muted); font-size: 12.5px; }
.st-val { display: grid; justify-items: end; align-content: start; }
.st-val b { font-size: 17px; font-variant-numeric: tabular-nums; }
.st-val small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.st-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: #ffffff12; overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 4px; background: var(--brass); }
.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; }
.leaderboard li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 10px; }
.leaderboard li:first-child { border-top: 0; }
.leaderboard li.me { background: #d4ab5e12; }
.leaderboard .rank { width: 28px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.leaderboard li:nth-child(-n+3) .rank { color: var(--brass); }
.leaderboard a.grow { flex: 1; min-width: 0; display: grid; color: inherit; text-decoration: none; }
.leaderboard a.grow small { color: var(--muted); font-size: 13px; }
.leaderboard .elo { font-size: 18px; font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; }
.balance-pill svg { color: var(--brass); }

/* ---------- Checkout and Poncler Pro ---------- */
.checkout { margin-top: 14px; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #ffffff08; border: 1px solid var(--line); }
.checkout-total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.checkout .link-btn { justify-self: start; }
.pro-hero { display: grid; gap: 22px; padding: 26px; border-radius: 20px; border: 1px solid #d4ab5e55; background: radial-gradient(ellipse 80% 100% at 100% 0%, #3f0f19, #1a110e 70%); }
@media (min-width: 900px) { .pro-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.pro-hero h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.pro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pro-list li { display: flex; gap: 12px; align-items: flex-start; }
.pro-list svg { flex: none; width: 20px; height: 20px; color: var(--brass); margin-top: 2px; }
.pro-side { display: grid; gap: 16px; }
.pro-sample { pointer-events: none; }
.pro-state { justify-items: start; gap: 10px; }
.pro-state p { margin: 0; }
.pro-price b { font-size: 30px; }
.pill svg { width: 12px; height: 12px; }
.switch.locked { opacity: .65; }
.switch.locked svg { width: 13px; height: 13px; vertical-align: -1px; }
.stat-tile small { font-size: 12px; }
.flag { display: inline-block; vertical-align: -1px; border-radius: 2px; box-shadow: 0 0 0 1px #0006; object-fit: cover; flex: none; }
.name-with-flag { display: inline-flex; align-items: center; gap: 6px; }
.profile-card canvas { width: 100%; max-width: 520px; height: auto; display: block; border-radius: 18px; box-shadow: 0 24px 50px -24px #000; }

/* Results: chips or big blinds */
.unit-seg { margin-left: auto; grid-auto-columns: 64px; gap: 4px; }
.unit-seg label { padding: 5px 6px; }
.unit-seg label b { font-size: 13px; }
.unit-note { font-size: 12.5px; margin: 10px 0 0; }

/* Unread counters: header chat and bell, the Chat links and conversations */
.icon-btn .count, .nav-link .count, .tabbar .count, .thread .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--chip-red, #c8443e); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; letter-spacing: 0; font-variant-numeric: tabular-nums;
  box-sizing: border-box; text-align: center; overflow: visible;
  box-shadow: 0 0 0 2px var(--room); pointer-events: none;
}
.icon-btn .count { position: absolute; top: 1px; right: -3px; }
.nav-link .count { margin-left: auto; box-shadow: none; }
.tabbar a { position: relative; }
.tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); }
.thread .count { flex: none; box-shadow: none; }
.icon-btn .count[hidden], .nav-link .count[hidden], .tabbar .count[hidden] { display: none; }

.icon-btn.small-icon { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.small-icon svg { width: 16px; height: 16px; }
.icon-btn[data-remove]:hover { color: var(--bad); border-color: #ef7b8066; }

/* History: pick a game, then a hand */
.rp-step { margin: 2px 4px 8px; }
.rp-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 6px 10px 6px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--brass); font: inherit; font-weight: 600; cursor: pointer; }
.rp-back:hover { background: #ffffff08; }
.rp-back svg { width: 16px; height: 16px; }
.rp-game-head.rp-picked { cursor: default; }
.replay-view.idle [data-rp-table], .replay-view.idle .rp-controls, .replay-view.idle .rp-bottom { display: none; }
.rp-idle { display: none; }
.replay-view.idle .rp-idle { display: grid; justify-items: center; gap: 6px; padding: 72px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 16px; }
.rp-idle svg { width: 34px; height: 34px; color: var(--brass); margin-bottom: 4px; }
.rp-idle b { color: var(--text); font-size: 17px; }

/* Phone header: Elo, chat, bell and avatar on one line (sound stays in Settings) */
.balance-pill { white-space: nowrap; }
@media (max-width: 480px) { .top [data-sound] { display: none; } }
.top .icon-btn, .top .balance-pill { flex: none; }

/* Results: the blinds played */
.blinds-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--ivory-2); }
.blinds-line svg { width: 16px; height: 16px; color: var(--brass); flex: none; margin-top: 2px; }

/* Friend requests */
.count-pill { padding: 2px 9px; border-radius: 999px; background: var(--chip-red, #c8443e); color: #fff; font-size: 12px; font-weight: 700; }
#requests { scroll-margin-top: 80px; }

/* Chat: names and avatars open profiles; direct messages need friendship */
.convo-name { color: var(--text); text-decoration: none; font-weight: 700; }
.convo-name:hover, .msg-name:hover { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
.convo-avatar, .convo-head .face-stack a { display: inline-flex; border-radius: 50%; }
.msg-name { color: inherit; text-decoration: none; }
.composer.locked { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.composer.locked svg { width: 18px; height: 18px; color: var(--brass); flex: none; }

/* Game overview (invitations and invite links) */
.ov-page { max-width: 920px; }
.ov { display: grid; gap: 22px; }
.ov-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ov-head h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); }
.ov-head p { margin: 0; }
.ov-pills { gap: 6px; justify-content: center; }
.ov-from { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.ov-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ov-fact { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff05; }
.ov-fact small { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ov-fact b { font-size: 16px; }
.ov-fact span { font-size: 12.5px; color: var(--muted); }
.ov-cols { display: grid; gap: 22px; }
@media (min-width: 760px) { .ov-cols { grid-template-columns: 1.3fr 1fr; } }
.ov-cols h2 { font-size: 17px; margin: 0 0 8px; }
.ov-rules p { margin: 0 0 10px; color: var(--ivory-2); line-height: 1.5; }
.ov-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.ov-actions p { margin: 0 auto 0 0; }
.invite-card { border-color: #d4ab5e66; }
.invite-card .ov-from { font-size: 13.5px; }

/* ---------- Ranks ---------- */
.rank-bronze { --rk-1: #cf8e57; --rk-2: #6b3a17; --rk-ink: #e0a273; }
.rank-silver { --rk-1: #dfe5ec; --rk-2: #5b6676; --rk-ink: #d6dde6; }
.rank-gold { --rk-1: #f3cd5f; --rk-2: #7a5410; --rk-ink: #f1c75a; }
.rank-ic { flex: none; filter: drop-shadow(0 1px 1px #0008); }
.rank-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 5px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--rk-ink); border: 1px solid color-mix(in srgb, var(--rk-1) 45%, transparent); background: color-mix(in srgb, var(--rk-1) 10%, transparent); vertical-align: middle; white-space: nowrap; }
.rank-badge.bare { padding: 0; border: 0; background: none; }
.rank-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rank-progress .rp-bar { flex: 1 1 120px; max-width: 260px; height: 6px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.rank-progress .rp-bar i { display: block; height: 100%; border-radius: 3px; background: var(--rk-1); }
.rank-progress small { font-size: 12.5px; color: var(--ivory-2); }
.balance-pill .rank-ic { width: 18px; height: 18px; }
@media (max-width: 480px) { .balance-pill .pro-crown { display: none; } }
.rank-ladder { display: grid; gap: 6px; margin: 4px 0 6px; }
.rank-ladder div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.rank-ladder div.on { font-weight: 700; }

/* Game page: Info and Settings */
.tool-btn svg { width: 17px; height: 17px; }
@media (max-width: 560px) { .tool-btn span { display: none; } .tool-btn { padding-inline: 9px; } }
.paused-pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--brass); }
.settings-panel { display: grid; gap: 14px; }
.settings-panel h3 { margin: 6px 0 -4px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.locked-row { width: 100%; text-align: left; border: 1px dashed var(--line-2); border-radius: 12px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.locked-row small { display: block; color: var(--muted); font-size: 12.5px; }
.info-ov { gap: 14px; }
.rank-progress { flex-wrap: nowrap; }
.rank-progress .rp-bar { flex: 1 1 140px; min-width: 50px; }
.rank-progress small { white-space: nowrap; }

.rank-diamond { --rk-1: #a9e8f8; --rk-2: #1d6680; --rk-ink: #b8eefb; }
.rank-progress.unranked { --rk-1: #d4ab5e; }
.unranked-badge { color: var(--ivory-2); border-color: var(--line-2); background: #ffffff08; padding-left: 7px; }
.unranked-badge svg { width: 14px; height: 14px; }
.rank-progress .rp-top { font-weight: 700; color: var(--rk-ink, var(--ivory-2)); }
.balance-pill.unranked { color: var(--ivory-2); }
@media (max-width: 480px) { .top-brand .wordmark { display: none; } }

.side-rank { display: flex; align-items: center; gap: 14px; }
.side-rank b { display: block; font-size: 22px; color: var(--rk-ink); }
.side-rank span { font-size: 13.5px; color: var(--ivory-2); }
.side-split { height: 1px; background: var(--line); margin: 6px 0; }
.card-side .rank-progress { margin-top: 0; flex-wrap: wrap; }
.lb-top { font-size: 12px; min-width: 64px; text-align: right; }

.events-link { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; padding-block: 14px; }
.events-link > svg { width: 22px; height: 22px; color: var(--brass); }
.events-link small { display: block; color: var(--muted); font-size: 13px; }
.events-link:hover { border-color: var(--line-2); }

.more-designs { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.more-designs svg { width: 15px; height: 15px; }
#member-card { scroll-margin-top: 80px; }

/* Free and Pro comparison */
.compare th.c, .compare td.c { text-align: center; width: 90px; }
.compare th.c svg { width: 15px; height: 15px; color: var(--brass); vertical-align: -2px; }
.cmp-yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #7cc49522; color: var(--good); }
.cmp-yes svg { width: 15px; height: 15px; stroke-width: 2.4; }
.cmp-no { color: var(--muted); font-size: 15px; opacity: .7; }
.compare .pro-row td:first-child { font-weight: 600; }
.pro-state .btn + .btn { margin-top: 0; }

/* Help */
.help-page { max-width: 980px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: var(--room, #170f0c); }
.help-toc a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ivory-2); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.help-toc a:hover { color: var(--brass); border-color: #d4ab5e66; }
.help-sec { scroll-margin-top: 130px; display: grid; gap: 12px; }
.help-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.help-sec h2 svg { width: 22px; height: 22px; color: var(--brass); }
.help-sec p { margin: 0; line-height: 1.55; }
.help-steps, .help-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.help-card { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #ffffff05; }
.help-card h3 { margin: 0; font-size: 16px; }
.help-card .btn { justify-self: start; margin-top: 4px; }
.help-ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.help-rank { display: grid; justify-items: center; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rk-1) 40%, transparent); background: color-mix(in srgb, var(--rk-1) 7%, transparent); }
.help-rank b { color: var(--rk-ink); font-size: 16px; }
.help-rank span { font-size: 13px; color: var(--ivory-2); }
.help-you { padding: 10px 14px; border-radius: 12px; background: #ffffff08; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #ffffff04; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 8px; color: var(--ivory-2); }
.help-form { display: grid; gap: 12px; max-width: 640px; }
.help-form textarea { resize: vertical; min-height: 120px; }
.side-rank + .rank-progress > .rank-badge, .side-rank + .rank-progress > .rp-top { display: none; }

/* Elo menu: an icon before every entry */
[data-elo-menu] a { justify-content: flex-start; }
[data-elo-menu] a svg { width: 17px; height: 17px; flex: none; color: var(--brass); }
[data-elo-menu] .rank-progress { flex-wrap: wrap; row-gap: 8px; }
[data-elo-menu] .rank-progress small { white-space: normal; flex-basis: 100%; }

.rank-cards { display: grid; gap: 6px; margin-top: 4px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-2); }
.rank-cards > span { font-size: 13px; }
.rank-card-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.rank-card-locked { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ivory-2); }
.rank-card-locked > svg:last-child { width: 13px; height: 13px; opacity: .7; }

/* Modal close button (top right) */
.modal.has-x .modal-body { position: relative; }
.modal.has-x .modal-body > h2 { padding-right: 44px; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #00000033; color: var(--ivory-2); cursor: pointer; }
.modal-x:hover { color: var(--text); border-color: var(--line-2); }
.modal-x svg { width: 18px; height: 18px; }

/* My stats: Personal style, like the player pop-up */
.style-panel .style-top { display: grid; gap: 12px; justify-items: start; margin: 4px 0 14px; }
.style-panel .pc-hud { width: min(420px, 100%); height: 32px; margin: 0; }
.style-panel .pc-hud .hud-seg { font-size: 15px; }
.style-panel .pc-hud .hud-seg small { font-size: 9px; }
.style-panel .hud-read { margin: 0; width: 100%; }
@media (min-width: 900px) { .style-panel .pc-streets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Shop: promotions carousel */
.promo-carousel { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid #d4ab5e44;
  background: radial-gradient(ellipse 120% 140% at 0% 0%, #7a2232, #3f0f19 55%, #1c0d0b); box-shadow: 0 18px 40px -24px #000; }
.promo-viewport { overflow: hidden; }
.promo-track { display: flex; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .promo-track { transition: none; } }
.promo-slide { flex: 0 0 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 30px 64px 46px; min-height: 250px; }
@media (max-width: 760px) { .promo-slide { grid-template-columns: 1fr; padding: 22px 22px 46px; } .promo-look { max-width: 320px; } }
.promo-text { display: grid; gap: 10px; justify-items: start; }
.promo-text h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
.promo-text p { margin: 0; color: var(--ivory-2); max-width: 46ch; line-height: 1.5; }
.promo-badge { padding: 4px 12px; border-radius: 999px; background: var(--brass); color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.promo-look { justify-self: center; width: 100%; max-width: 380px; }
.promo-shields { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.promo-icon { display: grid; place-items: center; height: 170px; color: var(--brass); }
.promo-icon svg { width: 110px; height: 110px; stroke-width: 1.2; }
.promo-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 1px solid #ffffff2e; background: #00000055; color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.promo-arrow:hover { background: #00000088; }
.promo-arrow.prev { left: 12px; } .promo-arrow.next { right: 12px; }
@media (max-width: 760px) { .promo-arrow { top: auto; bottom: 8px; transform: none; } }
.promo-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 8px; }
.promo-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: #ffffff55; cursor: pointer; transition: width .2s ease, background .2s ease; }
.promo-dots button[aria-selected="true"] { width: 24px; border-radius: 5px; background: var(--brass); }
.price.promo s { color: var(--muted); font-weight: 500; margin-right: 4px; }
.price.promo { color: var(--good); font-weight: 700; }

/* Design: your setup on top, tabs below */
.setup-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.setup-tile { display: grid; gap: 4px; align-content: start; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: #ffffff05; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.setup-tile:hover { border-color: #d4ab5e88; transform: translateY(-1px); }
.setup-tile.on { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.setup-tile .st-look { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #00000033; margin-bottom: 4px; }
.setup-tile .st-look > * { width: 100%; }
.setup-tile b { font-size: 14px; }
.setup-tile small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px; max-width: 136px; margin: 0 auto; padding: 10px 0; }
.setup-chips .piles { display: inline-flex; }
.setup-bust { display: grid; place-items: end center; height: 100%; }
.setup-bust img { width: 72%; height: auto; max-height: 100%; object-fit: contain; }
.design-tabs { display: grid; gap: 16px; scroll-margin-top: 80px; }
.tabs-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #00000033; }
.tabs-row button { flex: 1 1 auto; padding: 8px 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 14px var(--sans, inherit); cursor: pointer; }
.tabs-row button[aria-selected="true"] { background: var(--panel-2, #2a1f1b); color: var(--brass); box-shadow: inset 0 0 0 1px #d4ab5e33; }

/* Friends: search (with suggestions) and Invite at the top right */
.friends-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-search { position: relative; width: min(340px, 100%); }
.user-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.user-search .input { padding-left: 38px; }
.search-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; display: grid; gap: 2px; padding: 6px; max-height: 420px; overflow-y: auto;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel, #1e1613); box-shadow: 0 18px 40px -16px #000; min-width: 300px; }
.search-drop .list-item { padding: 8px 10px; border-radius: 10px; }
.search-drop .list-item:hover { background: #ffffff08; }
.search-drop .sub, [data-search-page] .sub { display: block; }
.drop-all { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--brass); font: 600 13.5px var(--sans, inherit); cursor: pointer; text-align: left; }
.drop-all kbd { font: 600 11px var(--sans, inherit); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.invite-box { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; }
.invite-box .qr { width: 170px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: #f5efe2; padding: 8px; }
.invite-box .qr svg { width: 100%; height: auto; }
@media (max-width: 560px) { .invite-box { grid-template-columns: 1fr; justify-items: center; } .user-search { width: 100%; } }

.avatar-now { display: flex; align-items: center; gap: 14px; }
.pro-settings h2 { display: flex; align-items: center; gap: 8px; }
.pro-settings h2 svg { width: 20px; height: 20px; color: var(--brass); }

/* Design: decks and card backs on their own, without the table */
.design-preview.cards-only .cards-stage { aspect-ratio: 2.1 / 1; display: grid; place-items: center; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 30%, #ffffff0d, #00000033 75%); border: 1px solid var(--line); }
.look-btn:hover .cards-stage { border-color: #d4ab5e88; }
.setup-tile .cards-stage { border: 0; background: none; aspect-ratio: auto; height: 100%; }
.setup-tile .design-preview.cards-only { height: 100%; display: grid; }
.friends-tools { flex-wrap: nowrap; }
@media (max-width: 560px) { .friends-tools { flex-wrap: wrap; } }

/* Shop: search, filters and sorting */
.shop-tools { display: grid; gap: 10px; padding: 14px 16px; scroll-margin-top: 80px; }
.shop-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.shop-search { position: relative; flex: 1 1 260px; }
.shop-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.shop-search .input { padding-left: 38px; }
.shop-sort { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.shop-sort select { width: auto; min-width: 170px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ivory-2); font: 600 13px var(--sans, inherit); cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--brass); border-color: transparent; color: var(--ink); }
.shop-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.shop-empty { padding: 30px; text-align: center; display: grid; gap: 8px; justify-items: center; }

/* Cards-only previews never grow past their box, so the fan stays centred */
.design-preview.cards-only { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.design-preview.cards-only .cards-stage, .design-preview.cards-only .mini-cards { min-width: 0; width: 100%; }
.design-tabs > h2 { margin: 0; }

/* Header avatar menu */
.me-btn { display: grid; place-items: center; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.me-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.me-menu { min-width: 220px; right: 0; }
.me-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.me-menu-head b { display: block; }
.me-menu-head small { color: var(--muted); font-size: 12.5px; }
[data-me-menu] a, [data-me-menu] button { justify-content: flex-start; width: 100%; font: inherit; }
[data-me-menu] svg { width: 17px; height: 17px; flex: none; color: var(--brass); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.notif-all { justify-content: center !important; color: var(--brass) !important; font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px !important; margin-top: 4px; }

/* Chat page: Messages and Notifications tabs */
.chat-tabs { display: inline-flex; width: auto; }
.chat-tabs a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.chat-tabs a[aria-current="page"] { background: var(--panel-2, #2a1f1b); color: var(--brass); box-shadow: inset 0 0 0 1px #d4ab5e33; }
.notif-list .list-item { color: inherit; text-decoration: none; }
.notif-list .list-item.unread { background: #d4ab5e10; border-left: 3px solid var(--brass); }
.notif-list .list-item > svg { width: 18px; height: 18px; color: var(--brass); flex: none; }

.style-panel .style-top { justify-items: center; text-align: center; gap: 8px; }
.style-panel .style-top > .avatar { box-shadow: 0 0 0 2px #d4ab5e55, 0 10px 24px -10px #000; }
.style-panel .style-name { font-size: 18px; }
.style-panel .hud-read { max-width: 560px; text-align: left; }

.threads .chat-tabs { display: flex; width: 100%; margin-bottom: 8px; }
.threads .chat-tabs a { flex: 1; justify-content: center; padding: 8px 6px; }
.threads .chat-tabs svg { width: 16px; height: 16px; }
.notif-panel { align-self: start; }

/* Header chat preview */
.chat-menu { width: min(360px, calc(100vw - 24px)); right: 0; }
.chat-prev { display: flex !important; align-items: center; gap: 10px; justify-content: flex-start !important; }
.chat-prev .grow { min-width: 0; display: grid; }
.chat-prev b { font-size: 14px; }
.chat-prev .grow small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-prev.unread .grow small { color: var(--text); }
.chat-prev .cp-side { display: grid; justify-items: end; gap: 3px; flex: none; }
.chat-prev .cp-side small { font-size: 11px; color: var(--muted); }
.chat-prev .count { position: static; box-shadow: none; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chip-red, #c8443e); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.notif-list .title, .notif-list .sub { display: block; }

/* My stats: the guide to every figure */
.stat-guide { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.stat-guide > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brass); }
.stat-guide > summary svg { width: 17px; height: 17px; }
.stat-guide > p { margin: 10px 0 4px; font-size: 13.5px; max-width: 80ch; }
.stat-guide h3 { margin: 16px 0 8px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.guide-card { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff05; font-size: 13.5px; }
.guide-card p { margin: 0; line-height: 1.5; color: var(--ivory-2); }
.guide-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.guide-card li { display: grid; grid-template-columns: 40px 1fr; gap: 6px; color: var(--ivory-2); line-height: 1.4; }
.guide-card li span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.guide-card .guide-you { color: var(--text); }

/* Cards-only previews size the cards to the box, so five always fit */
.design-preview.cards-only .cards-stage { container-type: inline-size; }
.design-preview.cards-only .mini-cards { --cw: min(15.5cqi, 64px); gap: 1.6cqi; }
.design-preview.cards-only .mini-cards.backs { --cw: min(24cqi, 74px); }

/* Bottom menu: Play in the centre, raised */
.tabbar a.tab-play { color: var(--ink); }
.tabbar a.tab-play svg { width: 26px; height: 26px; padding: 11px; box-sizing: content-box; margin-top: -24px; border-radius: 50%;
  background: var(--brass); color: var(--ink); box-shadow: 0 0 0 4px var(--room, #170f0c), 0 8px 18px -6px #000; }
.tabbar a.tab-play span { color: var(--muted); }
.tabbar a.tab-play[aria-current="page"] span { color: var(--brass); }

/* Phones: shortcuts on the home screen to pages outside the header and bottom menu */
.more-links { display: none; }
@media (max-width: 959px) {
  .more-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .more-links a { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; border: 1px solid var(--line); background: #ffffff05; color: var(--ivory-2); font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; }
  .more-links a:hover { border-color: #d4ab5e66; }
  .more-links svg { width: 22px; height: 22px; color: var(--brass); }
}

.leave-penalty { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #ef7b8014; border: 1px solid #ef7b8044; color: var(--ivory-2); }
.leave-penalty svg { width: 18px; height: 18px; color: var(--bad); flex: none; margin-top: 1px; }
.practice-start { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
