/* Hallmark · shape: app screen · genre: playful · theme: custom · idea: "a coinflip floor anyone who has used one reads at a glance, player against player, pot in the middle" · vibe: "friendly, quick, familiar Roblox trading floor" · redesign: full
 * paper: oklch(16.5% 0.018 265) · accent: oklch(56.5% 0.23 354), the Baddies pink of the coin · display: Plus Jakarta Sans · body: Plus Jakarta Sans
 * nav: a top bar with three tabs, the wallet and the player; chat in a left panel that becomes a drawer under 68.75rem; a bottom bar under 48rem · signature: the flip card, two players face off over the pot with each side's coin on their avatar · states: loading, empty, error, full
 * axes: dark/grotesk-sans/chromatic-pink · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P3 H5 E4 S4 R4 V4 · weakest: P, the user asked for the category's familiar floor over a novel one, so the argument is clarity: one row tells you who, what, how much and what to do */
/* Hallmark · dropped #sideUser, #hdrAvatar, #sideUserName, #sideUserMeta, #headerCrumb · the user found the sidebar hard to navigate; the top bar's player chip and active tab now carry the same facts */
/* Hallmark · reworded "Coin Flips" to "Coinflip" · the user asked for the category's own names; the tab and the page head now match */
/* Hallmark · reworded "Recent" to "Recent flips" · the tagline under it was cut, so the head now carries the noun */
/* Hallmark · answered F4 · the wallet button is the site-wide money action every coinflip floor keeps in its top bar; Create flip stays the one page action */
/* Hallmark · answered F5 · the pink disc holds a step numeral in the provably fair steps, no icon sits in it */
/* Hallmark · answered F7 · the pills are live status chips and a progress track, the rank tag and the vs marker, all small states the category reads as pills */
/* Hallmark · waive 72 · the chat body scrolls inside the panel, so messages above its fold measure past the aside's top edge · the chat keeps padded rows, only scrolled-off history is clipped */
@import url("./tokens.css?v=90");
@import url("./base.css");

/* ---------- document ---------- */
html { background: var(--color-paper); }
body { min-height: 100dvh; font-weight: 500; }
a { text-decoration: none; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
input, select { color: var(--color-ink); }
h1, h2, h3 { color: var(--color-ink); font-weight: 800; letter-spacing: var(--tracking-display); line-height: 1.15; max-width: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-paper-4); border-radius: var(--radius-pill); border: 2px solid var(--color-paper-2); }

.muted, .faint { color: var(--color-muted); }
.mono { font-family: var(--font-mono); }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }
.row { display: flex; align-items: center; gap: var(--space-xs); }
.pos { color: var(--color-win); }
.neg { color: var(--color-loss); }
.stack-xs { margin-top: var(--space-xs); }
.stack-md { margin-top: var(--space-md); }
.ta-right { text-align: right; }
.pcoin { display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -0.14em; }
.card { background: var(--color-paper-2); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }

/* ---------- controls ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  height: 40px; padding: 0 var(--space-md);
  border: 0; border-radius: var(--radius-md);
  background: var(--color-paper-4); color: var(--color-ink);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; line-height: 1;
  white-space: nowrap; user-select: none;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn::after { content: ""; position: absolute; inset: -2px 0; }
.btn:hover:not(:disabled) { background: var(--color-rule-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-deep); }
.btn-dark { background: var(--color-paper-4); color: var(--color-ink); }
.btn-ghost { background: transparent; color: var(--color-ink-2); box-shadow: inset 0 0 0 1px var(--color-rule-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--color-paper-3); color: var(--color-ink); }
.btn-success { background: var(--color-win); color: oklch(17% 0.035 155); }
.btn-success:hover:not(:disabled) { background: oklch(73% 0.16 155); }
.btn-outline-success { background: transparent; color: var(--color-win); box-shadow: inset 0 0 0 1px var(--color-win); }
.btn-outline-success:hover:not(:disabled) { background: var(--color-win-soft); }
.btn-outline-primary { background: transparent; color: var(--color-accent-text); box-shadow: inset 0 0 0 1px var(--color-accent); }
.btn-outline-primary:hover:not(:disabled) { background: var(--color-accent-soft); }
.btn-sm { height: 32px; padding: 0 var(--space-sm); border-radius: var(--radius-sm); font-size: var(--text-xs); }
.btn-sm::after { inset: -6px 0; }
.btn-lg { height: 44px; padding: 0 var(--space-lg); font-size: var(--text-md); }
.btn-lg::after { inset: 0; }
.btn-block { display: flex; width: 100%; }
.btn-block + .btn-block { margin-top: var(--space-xs); }

.link-btn {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 0; border: 0; background: none;
  color: var(--color-accent-text); font-size: var(--text-sm); font-weight: 700;
  transition: color var(--dur-micro) var(--ease-out);
}
.link-btn:hover { color: var(--color-ink); text-decoration: underline; text-underline-offset: 0.2em; }
.link-btn:active { color: var(--color-ink-2); }
.link-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }

.icon-btn {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.icon-btn:hover { background: var(--color-paper-4); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.seg {
  display: inline-flex; flex-wrap: wrap; gap: var(--space-2xs); padding: var(--space-2xs);
  background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-md);
}
.seg button {
  height: 32px; padding: 0 var(--space-sm);
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-muted);
  font-size: var(--text-sm); font-weight: 700; white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.seg button:hover { color: var(--color-ink); }
.seg button:active { transform: translateY(1px); }
.seg button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.seg button.active { background: var(--color-paper-4); color: var(--color-ink); }

.input {
  display: block; width: 100%; height: 44px; padding: 0 var(--space-sm);
  border: 1px solid var(--color-field); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink);
  font-size: var(--text-md);
}
.input::placeholder { color: var(--color-muted); }
.input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.field-label { display: block; margin: 0 0 var(--space-xs); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; }
.input + .field-label { margin-top: var(--space-md); }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Beachday";
  src: url("fonts/beachday/beachday.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky-nav);
  height: 64px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: var(--space-lg);
  padding: 0 var(--space-lg);
  background: var(--color-paper-2);
  border-bottom: 1px solid var(--color-rule);
}
.brand { display: flex; align-items: center; gap: var(--space-xs); flex: none; color: var(--color-ink); }
.brand:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: var(--radius-sm); }
.brand-mark { width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); object-fit: contain; }
.wordmark, .foot-brand { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; white-space: nowrap; text-transform: uppercase; }
.wordmark { font-size: 1.35rem; color: var(--color-white); }
.wordmark span { color: var(--color-white); }

.top-nav { position: relative; align-self: stretch; justify-self: start; display: flex; align-items: stretch; gap: 2px; min-width: 0; padding-left: 18px; }
.top-nav::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 26px; background: var(--color-rule-strong); }
.top-nav a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  color: var(--color-muted); font-size: 12px; font-weight: 800; white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}
.top-nav a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--color-accent);
  opacity: 0; transform: scaleX(0.5);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.top-nav a:hover { color: var(--color-ink); }
.top-nav a:active { color: var(--color-ink-2); }
.top-nav a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -6px; border-radius: var(--radius-md); }
.top-nav a.active { color: var(--color-ink); }
.top-nav a.active::after { opacity: 1; transform: none; }

.header-right { position: relative; margin-left: 0; justify-self: end; display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.wallet-box {
  height: 44px; display: flex; align-items: center; gap: var(--space-sm);
  padding: 0 var(--space-2xs) 0 var(--space-sm);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3);
  cursor: pointer;
}
.wallet-balance { display: flex; align-items: center; gap: var(--space-xs); }
.wallet-balance img { width: 20px; height: 20px; }
.wallet-balance span { font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.wallet-btn {
  position: relative; height: 32px; padding: 0 var(--space-sm);
  border: 0; border-radius: var(--radius-sm);
  background: var(--color-accent); color: var(--color-accent-ink);
  font-size: var(--text-sm); font-weight: 700;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.wallet-btn::after { content: ""; position: absolute; inset: -6px 0; }
.wallet-btn:hover { background: var(--color-accent-deep); }
.wallet-btn:active { transform: translateY(1px); }
.wallet-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.profile-chip {
  height: 44px; flex: none; display: flex; align-items: center; gap: var(--space-xs);
  padding: 0 var(--space-sm) 0 var(--space-2xs);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); text-align: left;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.profile-chip:hover { background: var(--color-paper-4); }
.profile-chip:active { transform: translateY(1px); }
.profile-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pchip-login-icon { display: none; width: 18px; height: 18px; flex: none; }
.pchip-login-icon svg { width: 100%; height: 100%; display: block; }
.profile-chip.is-logged-out {
  height: 40px; gap: 8px; padding: 0 15px;
  border-color: transparent; border-radius: 10px;
  background: var(--color-accent); color: var(--color-accent-ink);
}
.profile-chip.is-logged-out:hover { background: var(--color-accent-deep); }
.profile-chip.is-logged-out .pchip-login-icon { display: grid; place-items: center; }
.profile-chip.is-logged-out .pchip-av { display: none; }
.profile-chip.is-logged-out .pchip-copy { gap: 0; }
.profile-chip.is-logged-out .pchip-copy b { font-size: var(--text-sm); font-weight: 800; }
.profile-chip.is-logged-out .pchip-copy small { display: none; }
.pchip-av { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--color-paper-4); }
.pchip-av img { width: 100%; height: 100%; object-fit: cover; }
.pchip-copy { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; line-height: 1.1; }
.pchip-copy b { font-size: var(--text-sm); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip-copy small { color: var(--color-muted); font-size: var(--text-xs); }
/* profile settings dropdown */
.profile-menu {
  position: absolute; top: calc(100% + 20px); right: 0; z-index: calc(var(--z-sticky-nav) + 4);
  width: min(320px, calc(100vw - 24px)); padding: 10px;
  border: 1px solid var(--color-rule-strong); border-radius: 14px;
  background: var(--color-paper-2); box-shadow: var(--shadow-pop);
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--color-rule); }
.profile-menu-identity { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-menu-identity b { color: var(--color-ink); font-size: var(--text-sm); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-identity small { color: var(--color-muted); font-size: var(--text-xs); }
.profile-menu-section { padding: 8px 0 4px; }
.profile-menu-label { display: block; padding: 4px 8px 7px; color: var(--color-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.profile-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.profile-switch:hover { background: var(--color-paper-3); }
.profile-switch-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-switch-copy b { color: var(--color-ink); font-size: 12px; font-weight: 800; }
.profile-switch-copy small { color: var(--color-muted); font-size: 10px; line-height: 1.35; }
.profile-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.profile-switch-track { position: relative; width: 36px; height: 20px; flex: none; border: 1px solid var(--color-rule-strong); border-radius: 999px; background: var(--color-paper-4); transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
.profile-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-muted); transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.profile-switch input:checked + .profile-switch-track { border-color: var(--color-accent); background: var(--color-accent); }
.profile-switch input:checked + .profile-switch-track::after { transform: translateX(16px); background: var(--color-accent-ink); }
.profile-switch input:focus-visible + .profile-switch-track { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.profile-switch input:disabled + .profile-switch-track { opacity: .55; }
.profile-menu-links { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--color-rule); }
.profile-menu-links a, .profile-menu-links button {
  display: flex; align-items: center; min-height: 36px; padding: 0 8px;
  border: 0; border-radius: 8px; background: none;
  color: var(--color-ink-2); font-family: inherit; font-size: 12px; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer;
}
.profile-menu-links a:hover, .profile-menu-links button:hover { background: var(--color-paper-3); color: var(--color-ink); }
@media (max-width: 30rem) {
  .profile-menu { width: min(300px, calc(100vw - 20px)); }
}

.chat-toggle { display: none; }
.chat-unread { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-paper-3); }

/* ---------- layout ---------- */
.app-shell { display: grid; grid-template-columns: minmax(280px, 25%) minmax(0, 1fr); min-height: calc(100dvh - 64px); }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px var(--space-xl) var(--space-2xl); flex: 1; min-width: 0; }
main:focus { outline: none; }

/* ---------- chat ---------- */
.sidebar {
  position: sticky; top: 64px; z-index: var(--z-raised);
  height: calc(100dvh - 64px);
  display: flex; flex-direction: column;
  background: var(--color-paper-2); color: var(--color-ink);
  border-right: 1px solid var(--color-rule);
}
.side-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head {
  flex: none; display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--color-rule);
}
.chat-title { font-size: var(--text-md); font-weight: 800; letter-spacing: 0; }
.chat-live {
  margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-2xs); height: 24px; padding: 0 var(--space-xs);
  border-radius: var(--radius-pill); background: var(--color-win-soft); color: var(--color-win);
  font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.chat-close { display: none; }
.chat-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-sm);
}
.chat-msg {
  width: 100%; display: flex; align-items: flex-start; gap: var(--space-xs);
  padding: var(--space-xs); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-ink); text-align: left;
  font-family: inherit; font-size: var(--text-sm); line-height: 1.4;
}
.chat-profile-trigger { cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.chat-profile-trigger:hover { background: var(--color-paper-3); box-shadow: inset 2px 0 0 var(--color-accent); }
.chat-profile-trigger:active { background: var(--color-paper-4); }
.chat-profile-trigger:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.chat-msg .ravatar.xs { width: 32px; height: 32px; }
.chat-msg-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3xs); }
.chat-name { display: inline-flex; align-items: center; gap: var(--space-2xs); max-width: 100%; color: var(--color-white); font-size: var(--text-xs); font-weight: 800; }
.chat-username { min-width: 0; overflow-wrap: anywhere; color: var(--color-white); }
.chat-title-emoji { flex: none; font-size: var(--text-sm); line-height: 1; }
.chat-name.title-risk_taker .chat-username, .earned-title.title-risk_taker .earned-title-name {
  color: transparent; background: linear-gradient(90deg, #FF4D4D, #8B0F2B);
  -webkit-background-clip: text; background-clip: text;
}
.chat-name.title-lucky_one .chat-username, .earned-title.title-lucky_one .earned-title-name {
  color: transparent; background: linear-gradient(90deg, #2ECC71, #0B6B3A);
  -webkit-background-clip: text; background-clip: text;
}
.chat-name.title-all_in .chat-username, .earned-title.title-all_in .earned-title-name {
  color: transparent;
  background: linear-gradient(90deg, #FF4FD8, #C36BFF, #7B2FF7, #FF4FD8);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  animation: all-in-shine 4.5s linear infinite;
}
.chat-name.title-all_in .chat-username { filter: drop-shadow(0 0 6px rgba(255, 79, 216, 0.45)); }
.chat-name.title-all_in .chat-title-emoji {
  animation: all-in-emoji 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 79, 216, 0.65));
}
.earned-title.title-all_in { animation: all-in-glow 3.2s ease-in-out infinite; }
@keyframes all-in-shine { to { background-position: -220% center; } }
@keyframes all-in-emoji {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-3px) rotate(8deg); }
}
@keyframes all-in-glow {
  0%, 100% { box-shadow: 0 0 16px -8px rgba(255, 79, 216, 0.45); }
  50% { box-shadow: 0 0 22px -6px rgba(255, 79, 216, 0.75); }
}
.chat-text { color: var(--color-ink-2); overflow-wrap: anywhere; min-width: 0; }
.chat-msg.system { justify-content: center; }
.chat-msg.system .chat-text { color: var(--color-muted); font-size: var(--text-xs); }
.chat-form {
  flex: none; display: flex; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--color-rule);
}
.chat-input-wrap { position: relative; flex: 1; min-width: 0; }
.chat-input-wrap input {
  width: 100%; height: 40px; padding: 0 var(--space-xl) 0 var(--space-sm);
  border: 1px solid var(--color-field); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-sm);
}
.chat-input-wrap input::placeholder { color: var(--color-muted); }
.chat-input-wrap input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.chat-emoji {
  position: absolute; right: var(--space-2xs); top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted);
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.chat-emoji:hover { color: var(--color-ink); background: var(--color-paper-4); }
.chat-emoji:active { color: var(--color-ink-2); }
.chat-emoji:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; }
.chat-send {
  height: 40px; padding: 0 var(--space-md); flex: none;
  border: 0; border-radius: var(--radius-md);
  background: var(--color-accent); color: var(--color-accent-ink);
  font-size: var(--text-sm); font-weight: 700;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.chat-send:hover { background: var(--color-accent-deep); }
.chat-send:active { transform: translateY(1px); }
.chat-send:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.chat-send:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- avatars and coins ---------- */
.ravatar {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--color-paper-4);
}
.ravatar img { width: 100%; height: 100%; object-fit: cover; }
.ravatar.md { width: 44px; height: 44px; }
.ravatar.sm { width: 28px; height: 28px; }
.ravatar.xs { width: 24px; height: 24px; }
.ravatar.empty { background: transparent; border: 2px dashed var(--color-rule-strong); color: var(--color-muted); font-size: var(--text-lg); font-weight: 800; }
.roblox-pfp { background-size: cover; background-position: center; background-repeat: no-repeat; }
.ravatar.winner-ring { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 4px var(--color-win); }

.coin-badge {
  position: relative; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  font-size: var(--text-sm); font-weight: 800; line-height: 1;
}
.coin-badge.heads { background: var(--color-coin-heads); color: var(--color-paper); }
.coin-badge.tails { background: var(--color-coin-tails); color: var(--color-ink); box-shadow: inset 0 0 0 2px var(--color-rule-strong); }
.coin-badge.sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.coin-badge.xs { width: 22px; height: 22px; font-size: var(--text-xs); border: 2px solid var(--color-paper-2); }
.coin-badge.xs.tails { box-shadow: none; }

/* ---------- loading ---------- */
.boot { display: flex; flex-direction: column; gap: var(--space-xs); }
.skel { border-radius: var(--radius-card); background: var(--color-paper-2); animation: pulse 1.4s var(--ease-in-out) infinite alternate; }
.skel-head { height: 44px; width: min(360px, 70%); margin-bottom: var(--space-md); border-radius: var(--radius-md); }
.skel-row { height: 72px; }
@keyframes pulse { to { opacity: 0.5; } }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); margin-bottom: var(--space-lg); }
.page-head h1 { font-size: var(--text-2xl); }
.head-stats { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.stat-chip {
  height: 32px; display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap;
}
.stat-chip b { color: var(--color-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.page-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.inventory-actions .btn { min-height: 42px; }

/* ---------- lobby ---------- */
.lobby-page { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lobby-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary-card {
  display: grid; gap: 2px; min-width: 0;
  padding: 11px 14px; border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  background: var(--color-paper-2);
}
.summary-label { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.summary-value { display: flex; align-items: center; gap: 6px; color: var(--color-ink); font-size: var(--text-md); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.summary-value .pcoin { width: 14px; height: 14px; }
.summary-card small { color: var(--color-muted); font-size: 10.5px; }
.lobby-toolbar { margin-bottom: 10px; }
.lobby-actions { display: flex; align-items: center; gap: 12px; }
.lobby-actions .btn { height: 40px; }
.flip-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-sm); }

.flip-list { display: flex; flex-direction: column; gap: var(--space-xs); container-type: inline-size; }
.flip-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 136px 88px;
  grid-template-areas: "avatar items stats act";
  align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
}
.flip-row.has-result {
  grid-template-columns: 112px minmax(0, 1fr) 48px 136px 88px;
  grid-template-areas: "avatar items result stats act";
}
.flip-row.rolling { border-color: var(--color-accent-deep); }

.flip-avatar { grid-area: avatar; display: flex; align-items: center; justify-content: flex-start; gap: var(--space-md); min-width: 0; }
.flip-ring { position: relative; display: inline-grid; width: 48px; height: 48px; flex: none; border-radius: 50%; }
.flip-ring .ravatar { width: 100%; height: 100%; border-radius: 50%; }
.flip-profile { padding: 0; border: 0; background: transparent; cursor: pointer; }
.flip-profile:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.flip-ring--idle { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-rule-strong); }
.flip-ring--win { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 4px var(--color-win); }
.flip-ring--lost { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-rule-strong); }
.coin-badge.row-coin { width: 48px; height: 48px; font-size: var(--text-md); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.coin-badge.row-coin.heads { background: var(--color-coin-heads); color: var(--color-paper); }
.coin-badge.row-coin.tails { background: var(--color-coin-tails); color: var(--color-ink); }
.flip-result { grid-area: result; display: flex; align-items: center; justify-content: center; }
.flip-result:empty { display: none; }

.flip-items { grid-area: items; display: flex; align-items: center; justify-content: flex-start; gap: var(--space-xs); min-width: 0; overflow: hidden; padding-left: 16px; border-left: 1px solid var(--color-rule); }
.flip-item-thumb { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--color-paper-3); border: 1px solid var(--color-rule); display: grid; place-items: center; overflow: hidden; }
.flip-item-thumb img { width: 36px; height: 36px; object-fit: contain; }
.flip-item-thumb.flip-item-more { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 800; background: var(--color-accent-soft); color: var(--color-accent-text); border-color: var(--color-accent); }

.flip-stats { grid-area: stats; display: flex; flex-direction: column; align-items: flex-end; justify-self: end; gap: var(--space-2xs); text-align: right; min-width: 0; padding-left: 16px; border-left: 1px solid var(--color-rule); }
.flip-pot { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flip-pot .pcoin { width: 16px; height: 16px; }
.flip-range { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }

.flip-actions { grid-area: act; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: var(--space-xs); }
.flip-actions .btn { width: 100%; min-height: 36px; font-size: var(--text-xs); padding: var(--space-2xs) var(--space-sm); }
.row-timer-btn {
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.row-timer-btn:hover { filter: brightness(1.18); }
.row-timer-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.row-timer { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.row-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rt-track { fill: none; stroke: var(--color-paper-4); stroke-width: 6; }
.rt-progress {
  fill: none; stroke: var(--color-win); stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 120ms linear;
}
.row-timer b {
  position: relative; z-index: 1; color: var(--color-ink);
  font-size: var(--text-sm); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}

@container (max-width: 40rem) {
  .flip-row, .flip-row.has-result {
    grid-template-columns: auto minmax(0, 1fr) 88px;
    gap: var(--space-sm);
  }
  .flip-row { grid-template-areas: "avatar items act" "stats stats stats"; }
  .flip-row.has-result { grid-template-areas: "avatar items act" "result stats stats"; }
  .flip-items { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-left: 0; border-left: 0; }
  .flip-stats { align-items: flex-start; justify-self: start; text-align: left; padding-left: 0; border-left: 0; }
}

.empty-state {
  padding: var(--space-xl) var(--space-lg); text-align: center;
  background: var(--color-paper-2); border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-card);
  color: var(--color-muted); font-size: var(--text-md);
}
.empty-state b { display: block; margin-bottom: var(--space-2xs); color: var(--color-ink); font-size: var(--text-lg); }
.empty-state .btn { margin-top: var(--space-md); }

.recent-section { margin-top: var(--space-2xl); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-sm); }
.section-head h2, .history-head h2 { font-size: var(--text-section); }
.recent-list { display: flex; flex-direction: column; gap: var(--space-xs); padding: 0 var(--space-md); container-type: inline-size; }
.recent-row {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) 136px 88px;
  grid-template-areas: "players items stats act";
  align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.recent-row:hover { border-color: var(--color-rule-strong); }
.recent-row.has-result {
  grid-template-columns: 150px minmax(0, 1fr) 48px 136px 88px;
  grid-template-areas: "players items result stats act";
}
.recent-players { grid-area: players; display: flex; align-items: center; justify-content: flex-start; gap: var(--space-xs); min-width: 0; }
.recent-ring-btn { position: relative; display: inline-grid; width: 48px; height: 48px; flex: none; border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 50%; }
.recent-vs {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--color-rule); border-radius: 50%; background: var(--color-paper);
  color: var(--color-muted); font-size: 11px; font-weight: 800;
}
.recent-side-coin {
  position: absolute; left: -5px; bottom: -3px; z-index: 4;
  width: 22px; height: 22px; display: block; overflow: hidden;
  border: 2px solid var(--color-paper-2); border-radius: 50%; background: var(--color-paper-2);
}
.recent-side-coin .coin-badge { width: 100%; height: 100%; font-size: 9px; }
.recent-ring-btn .ravatar { width: 100%; height: 100%; border-radius: 50%; }
.recent-ring-btn.recent-ring--idle { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-rule-strong); }
.recent-ring-btn.recent-ring--win { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 4px var(--color-win); }
.recent-ring-btn.recent-ring--lost { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-rule-strong); }
.recent-ring-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.recent-result { grid-area: result; display: flex; align-items: center; justify-content: center; }
.recent-result:empty { display: none; }
.recent-items { grid-area: items; display: flex; align-items: center; gap: var(--space-xs); min-width: 0; overflow: hidden; }
.recent-items .flip-item-thumb { width: 48px; height: 48px; }
.recent-items .flip-item-thumb img { width: 36px; height: 36px; }
.recent-items .flip-item-more { font-size: var(--text-xs); }
.recent-stats { grid-area: stats; display: flex; flex-direction: column; align-items: flex-end; justify-self: end; gap: var(--space-2xs); text-align: right; min-width: 0; }
.recent-pot { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-pot .pcoin { width: 16px; height: 16px; }
.recent-range { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-act { grid-area: act; display: flex; align-items: center; justify-content: flex-end; }
.recent-act .btn { width: 100%; min-height: 36px; font-size: var(--text-xs); padding: var(--space-2xs) var(--space-sm); }
.recent-empty { padding: var(--space-lg) 0; color: var(--color-muted); font-size: var(--text-sm); }

@container (max-width: 40rem) {
  .recent-row, .recent-row.has-result {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-sm);
  }
  .recent-row { grid-template-areas: "players items act" "stats stats stats"; }
  .recent-row.has-result { grid-template-areas: "players items act" "result stats stats"; }
  .recent-items { overflow-x: auto; scrollbar-width: none; }
  .recent-stats { align-items: flex-start; justify-self: start; text-align: left; }
}

/* ---------- items ---------- */
.inv-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-2);
  color: var(--color-muted); font-size: var(--text-sm);
}
.inv-note b { color: var(--color-ink); }
.inv-note .link-btn { margin-left: auto; }
.page .inv-note { margin-bottom: var(--space-md); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: var(--space-sm); }
.item-card {
  display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0;
  padding: var(--space-sm);
  background: var(--color-paper-2); color: var(--color-ink);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
}
.item-img { height: 128px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--color-paper-3); }
.item-img img { max-width: 80%; max-height: 104px; width: auto; object-fit: contain; }
.item-name { font-size: var(--text-md); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); }
.item-val { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.item-action {
  position: relative; height: 36px; margin-top: var(--space-2xs);
  border: 0; border-radius: var(--radius-sm);
  background: var(--color-paper-4); color: var(--color-ink);
  font-size: var(--text-sm); font-weight: 700;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.item-action::after { content: ""; position: absolute; inset: -4px 0; }
.item-action:hover { background: var(--color-accent); color: var(--color-accent-ink); }
.item-action:active { background: var(--color-accent-deep); color: var(--color-accent-ink); transform: translateY(1px); }
.item-action:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.item-action:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- profile ---------- */
.profile-banner { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-lg); padding: var(--space-lg); margin-bottom: var(--space-md); }
.profile-avatar-wrap { flex: none; }
.ravatar.xl { width: 88px; height: 88px; box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-accent); }
.profile-identity { min-width: 0; display: flex; flex-direction: column; gap: var(--space-xs); }
.profile-identity h1 { font-size: var(--text-2xl); overflow-wrap: break-word; }
.profile-joined { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.profile-rank {
  height: 24px; display: inline-flex; align-items: center; padding: 0 var(--space-xs);
  border-radius: var(--radius-pill); background: var(--color-paper-4);
  color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 800;
}
.profile-rank.regular { color: var(--color-tier-rare); }
.profile-rank.high { color: var(--color-tier-legendary); }
.profile-rank.whale { background: var(--color-accent-soft); color: var(--color-accent-text); }
.profile-title-list, .user-profile-titles { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.earned-title {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  min-height: 26px; padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-3); color: var(--color-white);
  font-size: var(--text-xs); font-weight: 800; line-height: 1.2;
}
.earned-title > span:first-child { flex: none; }
.profile-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.profile-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-md); }
.profile-stat-card {
  display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-paper-2); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-card);
}
.profile-stat-card > span { color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.profile-stat-card b { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-xl); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-stat-card b.pos { color: var(--color-win); }
.profile-stat-card b.neg { color: var(--color-loss); }

.profile-history { padding: var(--space-md) var(--space-lg) var(--space-xs); }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding-bottom: var(--space-xs); }
.history-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.history-table th {
  padding: var(--space-xs) var(--space-md); text-align: left; white-space: nowrap;
  color: var(--color-muted); font-size: var(--text-xs); font-weight: 700;
  border-bottom: 1px solid var(--color-rule);
}
.history-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-rule); vertical-align: middle; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.history-table th:first-child, .history-table td:first-child { padding-left: 0; }
.history-table th:last-child, .history-table td:last-child { padding-right: 0; }
.history-table .ta-right { text-align: right; }
.history-type { font-weight: 700; }
.history-id { color: var(--color-muted); font-family: var(--font-mono); font-size: var(--text-xs); }
.history-date { color: var(--color-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-amount { display: inline-flex; align-items: center; gap: var(--space-2xs); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-amount.pos { color: var(--color-win); }
.history-amount.neg { color: var(--color-loss); }
.history-amount.zero { color: var(--color-muted); }
.history-empty { padding: var(--space-xl) 0; text-align: center; color: var(--color-muted); }

/* ---------- chat user profile card ---------- */
.profile-card-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.user-profile-card { display: grid; gap: var(--space-lg); }
.user-profile-head { display: flex; align-items: center; gap: var(--space-md); min-width: 0; }
.user-profile-avatar { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--color-paper-3), 0 0 0 4px var(--color-accent); }
.user-profile-identity { min-width: 0; display: grid; gap: var(--space-3xs); }
.user-profile-identity h3 { overflow-wrap: anywhere; font-size: var(--text-xl); }
.profile-popup-kicker { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.user-profile-handle { color: var(--color-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.user-profile-titles { min-height: 26px; }
.profile-no-titles { color: var(--color-muted); font-size: var(--text-sm); }
.user-profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.user-profile-stats > div { min-width: 0; display: grid; gap: var(--space-2xs); padding: var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-3); }
.user-profile-stats span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.user-profile-stats b { display: inline-flex; align-items: center; gap: var(--space-2xs); min-width: 0; font-size: var(--text-md); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.user-profile-stats b.pos { color: var(--color-win); }
.user-profile-stats b.neg { color: var(--color-loss); }

/* All In display name: the chat shimmer, on profile names. */
.all-in-name {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #FF4FD8, #C36BFF, #7B2FF7, #FF4FD8);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  animation: all-in-shine 4.5s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 79, 216, 0.4));
}
.all-in-name-emoji {
  display: inline-block;
  font-size: 0.8em;
  line-height: 1;
  vertical-align: 0.08em;
  animation: all-in-emoji 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 7px rgba(255, 79, 216, 0.65));
}

/* ---------- dialogs ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-lg);
  background: var(--color-scrim);
}
.modal-root.show { display: flex; animation: fade var(--dur-short) var(--ease-out); }
.modal-root.show.closing { pointer-events: none; animation: fadeOut 160ms var(--ease-in) forwards; }
.modal-root.closing .modal { animation: modalOut 160ms var(--ease-in) forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px); } }
.modal {
  width: 100%; max-width: 600px; max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-paper-2); color: var(--color-ink);
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-card);
  animation: modalIn var(--dur-short) var(--ease-out);
}
.modal.wide, .modal.wallet { max-width: 860px; }
.modal.narrow { max-width: 440px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } }
.modal-head, .wallet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}
.modal-head h2, .wallet-head h2 { font-size: var(--text-xl); }
.modal-title { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); min-width: 0; }
.status-pill {
  height: 24px; display: inline-flex; align-items: center; padding: 0 var(--space-xs);
  border-radius: var(--radius-pill); background: var(--color-paper-4);
  color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 800;
}
.status-pill.open { background: var(--color-win-soft); color: var(--color-win); }
.status-pill.rolling { background: var(--color-accent-soft); color: var(--color-accent-text); }
.modal-x {
  position: relative; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm);
  background: var(--color-paper-3); color: var(--color-ink-2);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.modal-x::after { content: ""; position: absolute; inset: -4px; }
.modal-x:hover { background: var(--color-paper-4); color: var(--color-ink); }
.modal-x:active { transform: translateY(1px); }
.modal-x:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-lg); }
.modal-foot, .wallet-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-rule);
  background: var(--color-paper-2);
}
.foot-total { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.foot-total b { display: block; margin-top: var(--space-3xs); color: var(--color-ink); font-size: var(--text-xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.modal-foot .row { gap: var(--space-xs); flex-wrap: wrap; justify-content: flex-end; }
.modal p.small { margin: 0 0 var(--space-sm); color: var(--color-ink-2); font-size: var(--text-md); line-height: 1.6; max-width: 60ch; }
.modal p.small:last-child { margin-bottom: 0; }

/* side picker */
.side-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.side-option {
  height: 56px; display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 0 var(--space-md);
  border: 2px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink);
  font-size: var(--text-md);
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.side-option:hover { border-color: var(--color-rule-strong); }
.side-option:active { transform: translateY(1px); }
.side-option:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.side-option.active { border-color: var(--color-accent); background: var(--color-accent-soft); }
.side-option img { width: 32px; height: 32px; flex: none; border-radius: 50%; }
.side-letter {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  overflow: hidden; border-radius: 50%;
  font-family: var(--font-display); font-size: 16px; font-weight: 900; line-height: 1;
}
.side-letter img { width: 100%; height: 100%; display: block; object-fit: cover; }
.side-letter.heads { background: var(--color-coin-heads); color: var(--color-white); }
.side-letter.tails { background: var(--color-coin-tails); color: var(--color-ink); box-shadow: inset 0 0 0 2px var(--color-rule-strong); }
.side-option.active .side-letter { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 4px var(--color-accent); }
.create-find { margin-top: var(--space-md); }
.create-find .field-label { margin-bottom: var(--space-xs); }
.create-find .input { width: 100%; height: 42px; }
.create-modal .pick-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); max-height: none; overflow: visible; }
.create-modal .pick-card { min-height: 134px; align-items: center; text-align: center; background: var(--color-paper-2); }
.create-modal .pick-img { width: 100%; height: 72px; }
.create-modal .pick-img img { max-height: 66px; max-width: 88px; }
.create-modal .pick-name {
  width: 100%; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-align: center; font-size: var(--text-sm); line-height: 1.2; white-space: normal;
}
.create-modal .pick-val { justify-content: center; }
.create-modal .modal-body { -webkit-overflow-scrolling: touch; }

.picker-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin: var(--space-lg) 0 var(--space-xs); }
.join-col .picker-head { margin-top: var(--space-sm); }
.ph-label { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; }
.ph-actions { display: flex; gap: var(--space-xs); }

.pick-grid, .wallet-item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr));
  gap: var(--space-xs); max-height: 320px; overflow-y: auto; padding: var(--space-3xs);
}
.pick-card, .w-item {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: var(--space-2xs);
  padding: var(--space-xs);
  border: 2px solid transparent; border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); text-align: left;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.pick-card:hover, .w-item:hover { border-color: var(--color-rule-strong); }
.pick-card:active, .w-item:active { transform: translateY(1px); }
.pick-card:focus-visible, .w-item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pick-card:disabled, .w-item:disabled { opacity: 0.55; cursor: not-allowed; }
.pick-card.selected, .w-item.selected { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pick-test {
  position: absolute; top: var(--space-2xs); left: var(--space-2xs); z-index: 1;
  padding: 2px 5px; border-radius: 4px;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: 8px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.2;
}
.pick-card.selected::after, .w-item.selected::after {
  content: "✓"; position: absolute; top: var(--space-2xs); right: var(--space-2xs);
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--color-accent); color: var(--color-accent-ink); font-size: var(--text-xs); font-weight: 800;
}
.pick-img, .w-item-img { height: 64px; display: grid; place-items: center; }
.pick-img img, .w-item-img img { max-height: 56px; max-width: 100%; width: auto; object-fit: contain; }
.pick-name, .w-item-name { display: block; color: var(--color-ink-2); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-val, .w-item-val { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; }

.bet-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2xs);
  margin-top: var(--space-md); padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-3); border-radius: var(--radius-md);
}
.bet-summary > div { min-width: 0; }
.bet-summary span { display: block; color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.bet-summary b { display: inline-flex; align-items: center; gap: var(--space-2xs); margin-top: var(--space-2xs); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bet-summary b.pos { color: var(--color-win); }
.bet-summary b.neg { color: var(--color-loss); }

.cover-box { margin-top: var(--space-md); }
.cover-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.cover-head b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.cover-bar { height: 8px; margin-top: var(--space-xs); overflow: hidden; border-radius: var(--radius-pill); background: var(--color-paper-4); }
.cover-bar i { display: block; width: 100%; height: 100%; border-radius: var(--radius-pill); background: var(--color-accent); transform: scaleX(0); transform-origin: left center; transition: transform var(--dur-short) var(--ease-out); }
.cover-note { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.cover-note.over { color: var(--color-warn); }
.cover-note.ready { color: var(--color-win); }

.join-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.join-col { min-width: 0; padding-right: var(--space-lg); }
.join-col + .join-col { padding: 0 0 0 var(--space-lg); border-left: 1px solid var(--color-rule); }
.join-col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-rule); }
.jc-side { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-md); font-weight: 800; }
.jc-side img { width: 24px; height: 24px; border-radius: 50%; }
.join-player { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0 var(--space-xs); }
.join-player b { font-size: var(--text-md); }
.join-items { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.stake-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.stake-row img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.sr-name { flex: 1; min-width: 0; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-val { font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.join-total { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.join-total b { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.seed-hash { margin-top: var(--space-xs); color: var(--color-muted); font-family: var(--font-mono); font-size: var(--text-xs); word-break: break-all; }
.join-your-items .pick-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); max-height: 240px; }
.join-empty { padding: var(--space-lg) var(--space-xs); text-align: center; color: var(--color-muted); font-size: var(--text-sm); }
.join-empty.tall { padding: var(--space-xl) var(--space-xs); }

/* Join coinflip: inventory first, like the reference flow. */
.modal.join-modal {
  width: min(1100px, 100%); max-width: 1100px;
  height: min(820px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px);
}
.modal.join-modal .modal-head { align-items: flex-start; padding: var(--space-md) var(--space-md) var(--space-sm) var(--space-lg); }
.join-title-wrap { min-width: 0; display: grid; gap: var(--space-3xs); }
.join-title-wrap h2 { font-size: var(--text-xl); }
.join-title-wrap > span { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.join-toolbar {
  flex: none; display: grid; grid-template-columns: minmax(260px, 1fr) 180px 180px;
  gap: var(--space-sm); align-items: end; padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-rule); background: var(--color-paper-2);
}
.join-toolbar .field-label { margin-bottom: var(--space-xs); }
.join-toolbar .input { height: 42px; font-size: var(--text-sm); font-weight: 700; }
.join-stake-summary {
  flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px;
  padding: var(--space-sm) var(--space-lg); border-bottom: 1px solid var(--color-rule); background: var(--color-paper-2);
}
.join-stake-summary > div { min-width: 0; display: grid; align-content: start; gap: var(--space-3xs); padding: var(--space-xs) var(--space-sm); }
.join-stake-summary span { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.join-stake-summary span small { display: block; margin-top: 2px; font-size: 9px; letter-spacing: 0; text-transform: none; }
.join-stake-summary b { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-ink); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.join-stake-summary > div > small { color: var(--color-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.join-stake-summary .positive, .view-meta .positive { color: var(--color-win); }
.join-stake-summary .negative, .view-meta .negative { color: var(--color-loss); }
.join-stake-summary .neutral, .view-meta .neutral { color: var(--color-muted); }
.join-inventory { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-md) var(--space-lg) var(--space-lg); background: var(--color-paper); }
.join-pick-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); max-height: none; gap: var(--space-sm); padding: 0; }
.join-pick-grid .pick-card { min-height: 138px; align-items: center; text-align: center; background: var(--color-paper-2); }
.join-pick-grid .pick-img { width: 100%; height: 76px; }
.join-pick-grid .pick-img img { max-height: 66px; max-width: 82px; }
.join-pick-grid .pick-name { width: 100%; text-align: center; }
.join-pick-grid .pick-card.selected { border-color: var(--color-win); background: var(--color-win-soft); }
.join-pick-grid .pick-card.selected::after { background: var(--color-win); color: oklch(17% 0.035 155); }
.join-pick-grid .pick-card.over-limit { opacity: 0.42; cursor: not-allowed; filter: saturate(0.55); }
.join-pick-grid .pick-card.over-limit:hover { border-color: transparent; }
.join-modal-foot { min-height: 82px; }
.join-cover-status { min-width: 180px; margin-right: auto; display: grid; gap: var(--space-3xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.join-cover-status b { color: var(--color-ink); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.join-cover-status small { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.join-cover-status small.ready { color: var(--color-win); }
.join-cover-status small.over { color: var(--color-warn); }
.join-actions { display: flex; align-items: center; gap: var(--space-sm); }
.join-actions .btn { min-height: 46px; padding-inline: var(--space-lg); }
.join-auto { position: relative; }
.new-badge { position: absolute; left: -9px; top: -9px; z-index: 1; padding: 3px 6px; border-radius: 5px; background: var(--color-paper); color: var(--color-accent-text); font-size: 9px; line-height: 1; transform: rotate(-40deg); }
.join-empty.tall { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm); }
.join-empty.tall > b { color: var(--color-ink); font-size: var(--text-2xl); }
.join-empty.tall > span { color: var(--color-muted); }
.join-empty.tall .btn { margin-top: var(--space-sm); }

/* Create coinflip: same shell and rhythm as the join flow. */
.modal.create-modal {
  width: min(1100px, 100%); max-width: 1100px;
  height: min(820px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px);
}
.create-toolbar { grid-template-columns: minmax(240px, 1fr) 230px 150px; }
.create-side-wrap .field-label { display: block; margin-bottom: var(--space-xs); }
.side-pick--compact { gap: var(--space-xs); }
.side-pick--compact .side-option {
  height: 42px; gap: var(--space-xs); padding: 0 var(--space-xs);
  border-width: 1px; border-radius: var(--radius-sm); font-size: var(--text-xs);
}
.side-pick--compact .side-letter { width: 24px; height: 24px; font-size: 11px; }
.create-select { display: flex; align-items: flex-end; }
.create-select .btn { width: 100%; min-height: 42px; font-size: var(--text-sm); }
.create-inventory .picker-head { margin: 0 0 var(--space-sm); }
.create-inventory .join-pick-grid { padding: 0; }
.create-stake-status b { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.create-stake-status small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.create-stake-status .pcoin { width: 14px; height: 14px; }
.create-foot .join-actions .btn { min-height: 46px; padding-inline: var(--space-lg); }

.view-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg);
  margin-top: var(--space-lg); padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-3); border-radius: var(--radius-md);
  color: var(--color-ink-2); font-size: var(--text-sm);
}
.view-meta > span { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.view-meta b { color: var(--color-muted); }

/* settled flip: compact result first, full stake details behind View Flip */
.flip-result-heading > div:first-child { min-width: 0; }
.flip-result-heading p { margin: var(--space-3xs) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.flip-result-actions { display: flex; align-items: center; gap: var(--space-xs); flex: none; }
.flip-result-body { padding: var(--space-xl) var(--space-lg); }
.flip-result-duel { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); align-items: center; gap: var(--space-md); }
.flip-result-player {
  position: relative; min-width: 0; display: grid; justify-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-xs); border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--color-ink);
}
.flip-result-player:hover { background: var(--color-paper-3); }
.flip-result-player:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.flip-result-player .ravatar { width: 68px; height: 68px; }
.flip-result-player > b { max-width: 100%; overflow-wrap: anywhere; font-size: var(--text-md); text-align: center; }
.flip-result-total { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.flip-result-win-mark { position: absolute; top: 0; right: 12%; color: var(--color-win); }
.flip-result-coin { display: grid; justify-items: center; gap: var(--space-xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: 800; }
.flip-result-coin img { width: 72px; height: 72px; border-radius: 50%; }

.modal .inv-note { margin-bottom: var(--space-md); }

.fair-block { display: flex; gap: var(--space-md); padding: var(--space-sm) 0; }
.fair-block + .fair-block { border-top: 1px solid var(--color-rule); }
.fair-ico {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: var(--text-sm); font-weight: 800; line-height: 1;
}
.fair-copy { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.fair-copy b { font-size: var(--text-md); }
.fair-copy > span { color: var(--color-muted); font-size: var(--text-sm); }
.fair-copy .mono { color: var(--color-ink-2); overflow-wrap: anywhere; }
.divider { height: 0; margin: var(--space-md) 0; border-top: 1px solid var(--color-rule); }
.verify-out { margin-top: var(--space-sm); }
.verify-out:empty { display: none; }
.seed-line { margin-top: var(--space-sm); color: var(--color-muted); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.6; word-break: break-all; }
.seed-line b { color: var(--color-ink); }

/* wallet */
.wallet-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-lg); }
.warn-banner {
  display: flex; flex-direction: column; gap: var(--space-3xs);
  margin-bottom: var(--space-md); padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-warn); border-radius: var(--radius-md);
  background: var(--color-warn-soft); color: var(--color-ink-2);
  font-size: var(--text-sm);
}
.warn-banner b { color: var(--color-warn); font-size: var(--text-sm); }
.wallet-stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); margin-bottom: var(--space-md); align-items: stretch; }
.wallet-card { display: flex; flex-direction: column; gap: var(--space-3xs); padding: var(--space-sm) var(--space-md); min-width: 0; background: var(--color-paper-3); color: var(--color-ink); border-radius: var(--radius-md); }
.wallet-card b { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-card span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.wallet-toolbar { display: flex; align-items: center; gap: var(--space-xs); }
.w-search { flex: 1; min-width: 0; display: flex; }
.w-search input {
  flex: 1; min-width: 0;
  width: 100%; height: 40px; padding: 0 var(--space-sm);
  border: 1px solid var(--color-field); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-md);
}
.w-search input::placeholder { color: var(--color-muted); }
.w-search input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.w-sort {
  height: 40px; min-width: 140px; padding: 0 var(--space-sm);
  border: 1px solid var(--color-field); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-sm); font-weight: 700;
}
.w-sort:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.w-sort:disabled { opacity: 0.55; cursor: not-allowed; }
.w-game {
  height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 var(--space-sm); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-xs); font-weight: 800; white-space: nowrap;
}
.wallet-meta { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-sm) 0; }
.wm { display: flex; align-items: baseline; gap: var(--space-xs); }
.wm span { color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.wm b { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.w-plus { margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: var(--radius-md); background: var(--color-accent); color: var(--color-accent-ink); }
.w-plus:hover { background: var(--color-accent-deep); }
.w-plus:active { transform: translateY(1px); }
.w-plus:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wallet-item-grid { max-height: 340px; }
.wallet-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
  padding: var(--space-xl) var(--space-md); text-align: center;
  border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-card);
}
.wallet-empty b { font-size: var(--text-lg); }
.wallet-empty span { color: var(--color-muted); font-size: var(--text-sm); }
.wallet-empty .btn { margin-top: var(--space-xs); }
.selectall {
  height: 40px; padding: 0 var(--space-md);
  border: 0; border-radius: var(--radius-md);
  background: var(--color-paper-4); color: var(--color-ink);
  font-size: var(--text-sm); font-weight: 700;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.selectall:hover { background: var(--color-rule-strong); }
.selectall:active { transform: translateY(1px); }
.selectall:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wallet-action {
  height: 40px; padding: 0 var(--space-md);
  display: inline-flex; align-items: center; gap: var(--space-xs);
  border: 0; border-radius: var(--radius-md);
  background: var(--color-accent); color: var(--color-accent-ink);
  font-size: var(--text-sm); font-weight: 700; white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.wallet-action:hover:not(:disabled) { background: var(--color-accent-deep); }
.wallet-action:active:not(:disabled) { transform: translateY(1px); }
.wallet-action:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wallet-action:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- coin overlay ---------- */
.coin-layer {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-lg);
  background: var(--color-scrim);
}
.coin-layer.show { display: flex; animation: fade var(--dur-short) var(--ease-out); }
.coin-panel {
  position: relative;
  width: 100%; max-width: 440px; max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: var(--space-lg);
  background: var(--color-paper-2); color: var(--color-ink); text-align: center;
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-card);
}
.coin-x { position: absolute; top: var(--space-sm); right: var(--space-sm); z-index: 1; }
.coin-eyebrow { color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.coin-stage { perspective: 900px; display: flex; justify-content: center; margin: var(--space-lg) 0; }
.coin3d { width: 136px; height: 136px; position: relative; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(0.2, 0.75, 0.2, 1); }
.coin3d .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; overflow: hidden; }
.coin3d .face img { width: 100%; height: 100%; }
.coin3d .back { transform: rotateY(180deg); }
.coin3d.spinning { animation: coinspin 0.55s linear infinite; }
@keyframes coinspin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.coin-title { font-size: var(--text-3xl); font-weight: 800; letter-spacing: var(--tracking-display); line-height: 1.05; }
.coin-spin-timer { display: flex; justify-content: center; margin: calc(-1 * var(--space-sm)) auto var(--space-xs); }
.coin-spin-timer:empty { display: none; }
.coin-versus { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; }
.coin-versus .ravatar { width: 32px; height: 32px; }
.coin-versus .v { color: var(--color-muted); font-size: var(--text-xs); font-weight: 800; }
.coin-pot { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.cp-label { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.cp-label > span { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.cp-label > span:last-child { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.coin-pot-items { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: center; }
.coin-item {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs);
  border-radius: var(--radius-pill); background: var(--color-paper-3);
  color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700;
}
.coin-item img { width: 24px; height: 24px; object-fit: contain; }
.coin-result { margin-top: var(--space-md); font-size: var(--text-lg); font-weight: 800; }
.coin-result:empty, .coin-sub:empty, .coin-actions:empty { display: none; }
.coin-result.win { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); background: var(--color-win-soft); color: var(--color-win); }
.coin-result.loss { color: var(--color-loss); }
.coin-sub { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.coin-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-lg); }
.coin-actions .btn { flex: 1; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-xs); pointer-events: none; }
.toast {
  max-width: 360px; padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md);
  background: var(--color-paper-3); color: var(--color-ink);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-sm); line-height: 1.4;
  animation: toastIn var(--dur-short) var(--ease-out);
  pointer-events: auto;
}
.toast b { font-weight: 800; }
.toast.bad { border-color: var(--color-loss); background: var(--color-paper-3); color: var(--color-ink); box-shadow: inset 0 0 0 999px var(--color-loss-soft), var(--shadow-pop); }
.toast.out { animation: toastOut var(--dur-short) var(--ease-in) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--color-rule); }
.foot-inner {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
}
.foot-left { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); color: var(--color-muted); font-size: var(--text-sm); }
.foot-brand { color: var(--color-ink); font-size: var(--text-md); }
.foot-links { display: flex; align-items: center; gap: var(--space-md); }
.foot-links a, .foot-links button {
  min-height: 32px; display: inline-flex; align-items: center;
  padding: 0; border: 0; background: none;
  color: var(--color-muted); font-size: var(--text-sm); font-weight: 700;
  transition: color var(--dur-micro) var(--ease-out);
}
.foot-links a:hover, .foot-links button:hover { color: var(--color-ink); }
.foot-links a:active, .foot-links button:active { color: var(--color-ink-2); }
.foot-links a:focus-visible, .foot-links button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- sign-up page ---------- */
.signup-page {
  width: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 18px;
}
.signup-page .signup-terms { font-size: 0.8125rem; line-height: 1.55; }
.signup-page .field-label { margin-bottom: 6px; font-size: 0.8125rem; }
.signup-page .field-checkbox { gap: 10px; font-size: 0.8125rem; line-height: 1.45; }
.signup-page .signup-fields { gap: 10px; }
.signup-page .signup-captcha { gap: 6px; padding: 2px 0; }
.signup-page .hcaptcha-slot { min-height: 74px; }
.signup-page .input {
  height: 42px;
  border-color: var(--color-rule);
  background: var(--color-paper);
  font-size: var(--text-sm);
  transition: border-color var(--dur-micro) var(--ease-out);
}
.signup-page .input:hover { border-color: var(--color-rule-strong); }
.signup-page .input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.signup-page #lgGo {
  height: 44px;
  font-size: var(--text-sm);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.signup-page #lgGo:disabled {
  opacity: 1;
  background: var(--color-paper-3);
  color: var(--color-muted);
  box-shadow: inset 0 0 0 1px var(--color-rule);
  cursor: not-allowed;
}
.signup-page #lgGo:not(:disabled) {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.signup-page #lgGo:not(:disabled):hover { background: var(--color-accent-deep); }
@media (max-width: 40rem) {
  .signup-page { gap: 14px; }
  .signup-page .input { height: 46px; font-size: var(--text-md); }
  .signup-page #lgGo { height: 46px; }
}
.signup-kicker { font-size: var(--text-xl); font-weight: 800; color: var(--color-ink); margin: 0; }
.signup-warning {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--color-rule);
  border-left: 1px solid color-mix(in oklab, var(--color-warn) 55%, var(--color-rule-strong));
  border-radius: 8px;
  background: color-mix(in oklab, var(--color-warn) 4.5%, var(--color-paper-2));
}
.signup-warning-icon {
  width: 14px; height: 14px; flex: none; margin-top: 1px;
  color: color-mix(in oklab, var(--color-warn) 78%, var(--color-muted));
}
.signup-warning p {
  margin: 0; color: var(--color-ink-2);
  font-size: 0.8125rem; line-height: 1.48; text-wrap: pretty;
}
.signup-warning strong { color: var(--color-ink); font-weight: 700; }
.signup-terms {
  font-size: var(--text-sm); color: var(--color-muted); line-height: 1.65;
  margin: 0;
}
.signup-terms a { color: var(--color-accent); text-decoration: underline; }
.signup-terms a:hover { color: var(--color-accent-deep); }
.login-head { align-items: center; }
.login-head-copy { display: grid; gap: 2px; min-width: 0; }
.login-head-copy h2 { margin: 0; font-size: var(--text-lg); }
.login-giveaway {
  display: grid; gap: 3px; padding: 12px;
  border: 1px solid var(--color-accent); border-radius: var(--radius-md);
  background: var(--color-accent-soft);
}
.login-giveaway b { color: var(--color-ink); font-size: var(--text-sm); font-weight: 800; }
.login-giveaway span { color: var(--color-ink-2); font-size: var(--text-xs); line-height: 1.4; }
.login-giveaway small { color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 700; }

.login-referral-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3);
}
.login-referral-card > div { display: grid; gap: 1px; min-width: 0; }
.login-referral-card b { color: var(--color-ink); font-size: var(--text-sm); }
.login-referral-card span { color: var(--color-muted); font-size: 0.8125rem; line-height: 1.4; }
.login-referral-icon {
  width: 48px; height: 48px; flex: none; padding: 5px; object-fit: contain;
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  background: var(--color-paper-2);
}
.login-referral-loading { color: var(--color-muted); font-size: var(--text-sm); }
.signup-fields { display: flex; flex-direction: column; gap: var(--space-sm); }
.field-checkbox {
  display: flex; align-items: flex-start; gap: var(--space-xs);
  font-size: var(--text-sm); color: var(--color-ink); cursor: pointer;
}
.field-checkbox input { margin-top: 0.15em; }
.signup-captcha { display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); padding: var(--space-sm) 0; }
.hcaptcha-slot { min-height: 78px; display: flex; justify-content: center; align-items: center; }
.hcaptcha-slot > div { min-width: 303px; }
.captcha-note {
  margin: 0; font-size: var(--text-xs); color: var(--color-muted); text-align: center;
}
.captcha-note[hidden] { display: none; }

/* ---------- group verification step ---------- */
.group-step {
  display: flex; flex-direction: column; gap: var(--space-xs);
  padding: var(--space-md); border-radius: var(--radius-md);
  background: var(--color-paper-2); border: 1px solid var(--color-rule);
}
.group-step[hidden] { display: none; }
.group-step-title { margin: 0; font-size: var(--text-lg); font-weight: 800; color: var(--color-ink); letter-spacing: -0.02em; }
.group-step-copy { margin: 0; font-size: var(--text-sm); color: var(--color-muted); line-height: 1.6; }
.group-step-copy b { color: var(--color-ink); font-weight: 800; }
.group-step-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-2xs); }
.group-step-actions .btn { flex: 1 1 160px; justify-content: center; }
.group-step-actions .btn[hidden] { display: none; }
.group-step-status { margin: 0; font-size: var(--text-xs); color: var(--color-accent-text); font-weight: 700; }
.group-step-status::before { content: "◌ "; }
.field-checkbox a { color: var(--color-accent); text-decoration: underline; }
.signup-foot {
  font-size: var(--text-sm); color: var(--color-muted); text-align: center;
  margin-top: var(--space-xs);
}
.signup-foot .link-btn { color: var(--color-accent); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.signup-foot .link-btn:hover { color: var(--color-accent-deep); }

/* ---------- terms page ---------- */
.terms-page {
  display: flex; flex-direction: column; gap: var(--space-md);
  max-width: 700px;
}
.terms-kicker { font-size: var(--text-lg); font-weight: 800; color: var(--color-accent-text); margin: 0; }
.terms-body { font-size: var(--text-sm); color: var(--color-ink); line-height: 1.7; margin: 0 0 var(--space-sm) 0; }
.terms-body b { color: var(--color-ink); }
.terms-small { font-size: var(--text-xs); color: var(--color-muted); margin: 0 0 var(--space-sm) 0; }
.terms-h3 { font-size: var(--text-md); font-weight: 800; color: var(--color-ink); margin: var(--space-md) 0 var(--space-xs) 0; }
.terms-list { margin: 0 0 var(--space-sm) 0; padding-left: var(--space-md); color: var(--color-ink); }
.terms-list li { margin-bottom: var(--space-2xs); line-height: 1.6; }

/* Butterfly / bird ambience on the side of the signup modal */
.signup-amble {
  position: absolute; top: 0; right: 0; bottom: 0; width: 120px;
  pointer-events: none; overflow: hidden;
  opacity: 0.5;
}
.signup-amble .critter {
  position: absolute; width: 16px; height: 16px;
  background: var(--color-accent);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flutter 4s ease-in-out infinite;
}
.signup-amble .critter:nth-child(2) { left: 40px; top: 60px; animation-delay: 1s; background: var(--color-accent-deep); animation-duration: 5s; }
.signup-amble .critter:nth-child(3) { left: 80px; top: 140px; animation-delay: 2s; background: #ff6b9d; animation-duration: 4s; }
.signup-amble .critter:nth-child(4) { left: 20px; top: 220px; animation-delay: 0.5s; background: #a3e635; animation-duration: 6s; }
.signup-amble .critter:nth-child(5) { left: 100px; top: 300px; animation-delay: 3s; background: #60a5fa; animation-duration: 4.5s; }
@keyframes flutter {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translate(20px, -120px) rotate(12deg); opacity: 0; }
}

/* ---------- narrower screens ---------- */
.mobile-nav, .chat-backdrop { display: none; }

/* under 68.75rem the chat leaves the page and opens as a drawer */
@media (max-width: 68.75rem) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; height: 100dvh;
    width: min(340px, 92%); z-index: calc(var(--z-modal) - 10);
    transform: translateX(-102%);
    box-shadow: var(--shadow-pop);
    transition: transform var(--dur-short) var(--ease-out), visibility 0s linear var(--dur-short);
  }
  .js .sidebar { visibility: hidden; }
  body.chat-open .sidebar { transform: none; visibility: visible; transition: transform var(--dur-short) var(--ease-out), visibility 0s linear 0s; }
  .chat-close {
    display: grid; place-items: center; width: 36px; height: 36px; flex: none;
    border: 0; border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2);
  }
  .chat-close:hover { background: var(--color-paper-4); color: var(--color-ink); }
  .chat-close:active { transform: translateY(1px); }
  .chat-close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
  .chat-live { margin-left: 0; }
  .chat-head .chat-close { margin-left: auto; }
  .chat-backdrop {
    display: block; position: fixed; inset: 0; z-index: calc(var(--z-modal) - 15);
    background: var(--color-scrim); opacity: 0; pointer-events: none;
    transition: opacity var(--dur-short) var(--ease-out);
  }
  body.chat-open .chat-backdrop { opacity: 1; pointer-events: auto; }
  .chat-toggle { display: grid; }
}

/* under 48rem the tabs move to a bottom bar */
@media (max-width: 48rem) {
  .topbar { gap: var(--space-sm); padding: 0 var(--space-md); }
  .top-nav { display: none; }
  .header-right { gap: var(--space-xs); }
  .wallet-btn { display: none; }
  .wallet-box { padding-right: var(--space-sm); }
  main { padding: var(--space-lg) var(--space-md) var(--space-3xl); }
  .foot-inner { padding: var(--space-lg) var(--space-md) var(--space-3xl); }

  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky-nav);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: var(--space-xs) var(--space-xs) calc(var(--space-xs) + env(safe-area-inset-bottom));
    background: var(--color-paper-2);
    border-top: 1px solid var(--color-rule);
  }
  .mobile-nav a, .mobile-nav button {
    height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3xs);
    border: 0; border-radius: var(--radius-md); background: none;
    color: var(--color-muted); font-size: var(--text-xs); font-weight: 700;
    transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
  }
  .mobile-wallet { flex: 1 1 auto; justify-self: stretch; height: 44px; }
  .mobile-wallet svg { width: 22px; height: 22px; }
  .mobile-nav a:hover { color: var(--color-ink); }
  .mobile-nav a:active { color: var(--color-ink-2); }
  .mobile-nav a:focus-visible, .mobile-nav button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
  .mobile-nav a.active { color: var(--color-accent-text); background: var(--color-accent-soft); }
  .mobile-nav .mobile-create { width: 48px; margin: 0 auto; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-ink); }
  .mobile-nav .mobile-create:active { transform: translateY(1px); }

  .page-head h1 { font-size: var(--text-xl); }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .btn { width: 100%; }
  .inventory-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
  .inventory-actions #itemsCreate { grid-column: 1 / -1; }
  .profile-actions { margin-left: 0; width: 100%; }
  .profile-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-table th:nth-child(2), .history-table td:nth-child(2) { display: none; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-img { height: 96px; }
  .item-img img { max-height: 80px; }

  .modal-root { padding: 0; align-items: flex-end; }
  .modal { max-height: 92dvh; border-bottom: 0; border-radius: var(--radius-card) var(--radius-card) 0 0; }
  .modal.wallet { height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .modal.join-modal { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .modal-head, .wallet-head { padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md); }
  .modal-body, .wallet-scroll { padding: var(--space-md); }
  .modal-foot { align-items: stretch; flex-direction: column; }
  .modal-foot .row { justify-content: stretch; }
  .modal-foot .row .btn { flex: 1 1 auto; }
  .modal-foot, .wallet-foot { padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + env(safe-area-inset-bottom)); }
  .wallet-toolbar { flex-wrap: wrap; }
  .w-search { flex: 1 1 100%; }
  .w-sort { flex: 1; }
  .wallet-item-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); max-height: none; }
  .bet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-sm); }
  .join-grid { grid-template-columns: minmax(0, 1fr); }
  .join-col { padding: 0 0 var(--space-md); }
  .join-col + .join-col { padding: var(--space-md) 0 0; border-left: 0; border-top: 1px solid var(--color-rule); }
  .join-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--space-md); }
  .join-search-wrap { grid-column: 1 / -1; }
  .join-stake-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--space-xs) var(--space-md); }
  .join-stake-summary > div { padding: var(--space-xs); }
  .join-inventory { padding: var(--space-md); }
  .join-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .join-modal-foot { min-height: 0; align-items: stretch; flex-direction: column; }
  .join-cover-status { width: 100%; margin-right: 0; }
  .join-actions { width: 100%; }
  .join-actions .btn { flex: 1 1 0; }
  .toasts { left: var(--space-md); right: var(--space-md); bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .coin-panel { padding: var(--space-md); }
  .coin3d { width: 116px; height: 116px; }
}
@media (max-width: 30rem) {
  .pchip-copy { display: none; }
  .profile-chip { padding: 0 var(--space-2xs); }
  .profile-chip.is-logged-out { padding: 0 12px; }
  .profile-chip.is-logged-out .pchip-copy { display: flex; }
  .wordmark { display: none; }
}

/* ---------- trade bot: linking, deposits, withdrawals ---------- */
.trade-panel {
  display: grid; gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-paper-2);
}
.trade-panel-head { display: grid; gap: var(--space-3xs); }
.trade-panel-head h3 {
  margin: 0; color: var(--color-ink);
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800;
  letter-spacing: var(--tracking-display);
}
.tp-kicker {
  color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800;
}
.trade-copy { margin: 0; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.65; max-width: 62ch; }
.trade-copy b { color: var(--color-ink); }
.trade-hint { margin: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; }

.link-row { display: flex; gap: var(--space-xs); align-items: stretch; }
.link-row .rbx-input { flex: 1 1 auto; min-width: 0; height: 44px; }
.link-row .btn { flex: none; height: 44px; }

.trade-steps { display: grid; gap: var(--space-xs); margin: 0; padding: 0; list-style: none; counter-reset: trade-step; }
.trade-steps li {
  position: relative; padding-left: 30px;
  color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.6;
}
.trade-steps li::before {
  counter-increment: trade-step; content: counter(trade-step);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: var(--text-xs); font-weight: 800;
}
.trade-steps a { color: var(--color-accent-text); font-weight: 700; text-decoration: none; }
.trade-steps a:hover { text-decoration: underline; }
.trade-steps-inline { grid-auto-flow: column; gap: var(--space-md); margin-top: var(--space-2xs); }
.trade-steps-inline span { padding: 0; color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.trade-steps-inline span::before { display: none; }

.trade-account {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm);
  padding-top: var(--space-sm); border-top: 1px solid var(--color-rule);
  font-size: var(--text-sm);
}
.ta-name { color: var(--color-ink-2); }
.ta-name b { color: var(--color-ink); }
.ta-meta { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.admin-page .card { padding: var(--space-lg); }
.admin-target { max-width: 420px; }
.admin-actions { align-items: center; }
.admin-actions #adminItem { flex: 1 1 240px; min-width: 0; }
.admin-actions #adminQty { width: 88px; flex: none; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-md); }
.btn-danger { background: #dc3f4f; color: var(--color-white); }
.btn-danger:hover:not(:disabled) { background: #bd2f40; }
@media (max-width: 48rem) {
  .admin-stats-grid { grid-template-columns: 1fr; }
  .admin-target { max-width: none; }
}

.trade-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.trade-actions a.btn { text-decoration: none; }
.trade-panel-success { border-color: var(--color-accent-soft); box-shadow: inset 0 0 0 1px var(--color-accent-soft); }

.joiner-row { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: 6px; }
.joiner-row:last-child { margin-bottom: 0; }
.joiner-link {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
  font-size: var(--text-xs); color: var(--color-muted); text-decoration: underline;
}
.intent-list { margin-bottom: var(--space-md); }
.intent-list .picker-head { margin-top: 0; }
.intent-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm); margin-bottom: var(--space-xs);
  border: 1px solid var(--color-accent-soft); border-radius: var(--radius-md);
  background: var(--color-accent-soft);
}
.ir-main { display: grid; gap: 1px; min-width: 0; }
.intent-row__hold { margin-top: 2px; max-width: 100%; overflow-wrap: anywhere; font-size: var(--text-xs); font-style: italic; color: #ff9f0a; line-height: 1.35; }
.ir-main b { color: var(--color-ink); font-size: var(--text-sm); }
.ir-main span { color: var(--color-ink-2); font-size: var(--text-xs); }
.ir-side { flex: none; color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 30rem) {
  .dep-hero { align-items: flex-start; }
  .dep-bot .ravatar { width: 48px; height: 48px; }
  .dep-bot-meta b { font-size: var(--text-md); }
  .dep-timer { text-align: left; }
  .dep-timer .dep-clock { font-size: var(--text-xl); }
  .dep-actions .btn { flex: 1 1 100%; }
  .dep-window { padding: var(--space-md); }
  .trade-panel { padding: var(--space-md); }
  .trade-panel-head h3 { font-size: var(--text-lg); }
  .link-row { flex-wrap: wrap; }
  .link-row .rbx-input { flex: 1 1 100%; }
  .link-row .btn { width: 100%; }
  .trade-steps-inline { grid-auto-flow: row; gap: var(--space-2xs); }
  .trade-actions .btn { flex: 1 1 auto; }
}

.wallet-trade-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); margin-bottom: var(--space-sm); }
.wallet-trade-row .btn { height: 42px; }
.inv-note > span { line-height: 1.55; }

.join-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm, 8px);
  font-size: 12.5px; line-height: 1.3;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
}
.join-badge b { font-weight: 800; }
.join-badge.is-on { color: #d7ffe4; background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.35); }
.join-badge.is-off { color: #ffd9d9; background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.35); }
.jb-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.join-badge.is-on .jb-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0.7); animation: jbPulse 1.8s infinite; }
.join-badge.is-off .jb-dot { background: #ef4444; }
@keyframes jbPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ---------- deposit window (3-minute join trade) ---------- */
.dep-loading {
  display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-muted); font-size: var(--text-sm); font-weight: 700;
}
.dep-window[hidden], .dep-done[hidden], .dep-closed[hidden] { display: none !important; }
.dep-window {
  position: relative; overflow: hidden;
  display: grid; gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
}
.dep-glow { display: none; }
.dep-hero { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); }
.dep-bot { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.dep-bot .ravatar { width: 56px; height: 56px; box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 4px var(--color-accent-soft); }
.dep-bot-meta { display: grid; gap: 2px; min-width: 0; }
.dep-bot-meta b { color: var(--color-ink); font-size: var(--text-lg); font-weight: 800; line-height: 1.1; }
.dep-online { display: inline-flex; align-items: center; gap: 5px; color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.dep-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-win); box-shadow: 0 0 0 3px var(--color-win-soft); }
.dep-timer { display: grid; gap: 2px; margin-left: auto; text-align: right; }
.dep-timer > span { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.dep-retry {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-accent-soft);
  color: var(--color-ink-2); font-size: var(--text-xs); line-height: 1.55;
}
.dep-retry b { color: var(--color-accent-text); }
.dep-modal-body { padding: var(--space-md); }
.dep-head { align-items: center; }
.dep-top { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.dep-kicker {
  color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800;
}
.dep-clock {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: clamp(1.6rem, 4.4vw, 2.2rem); font-weight: 800; line-height: 1;
  color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.dep-window.is-urgent .dep-clock { color: var(--color-loss, #ef4444); animation: depPulse 1s steps(2, end) infinite; }
.dep-window.is-urgent .dep-bar > i { background: var(--color-loss, #ef4444); }
@keyframes depPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.dep-bar {
  position: relative; height: 6px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--color-rule);
}
.dep-bar > i {
  display: block; height: 100%; width: 100%; transform-origin: left center;
  background: var(--color-accent);
  transition: transform 0.12s linear, background-color 0.3s ease;
}
.dep-call {
  position: relative; margin: 0;
  color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.6;
}
.dep-call b { color: var(--color-ink); font-weight: 800; }
.dep-call b#depCallClock { color: var(--color-accent-text); font-variant-numeric: tabular-nums; }
.dep-status {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm, 8px);
  color: #ffe1ec; font-size: 12.5px; line-height: 1.35; font-weight: 600;
  background: rgba(233, 64, 145, 0.10); border: 1px solid rgba(233, 64, 145, 0.35);
}
.dep-status .jb-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(233, 64, 145, 0.65);
  animation: depDot 1.6s infinite;
}
.dep-status.is-live { color: #d7ffe4; background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.35); }
.dep-status.is-live .jb-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: jbPulse 1.8s infinite; }
@keyframes depDot {
  0% { box-shadow: 0 0 0 0 rgba(233, 64, 145, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(233, 64, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(233, 64, 145, 0); }
}
.dep-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.dep-actions a.btn { text-decoration: none; }
.btn-live { background: #22c55e; color: #04170a; }
.btn-live:hover:not(:disabled) { background: #16a34a; }
.dep-steps { gap: 6px; }
.dep-steps li { font-size: var(--text-xs); line-height: 1.55; }
.dep-account {
  padding-top: var(--space-sm); border-top: 1px solid var(--color-rule);
  color: var(--color-muted); font-size: var(--text-xs); font-weight: 700;
}
.dep-account b { color: var(--color-ink); }

.dep-done {
  display: grid; gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--color-win); border-radius: var(--radius-card);
  background: var(--color-paper-2);
}
.dep-done-head { display: flex; align-items: center; gap: var(--space-sm); }
.dep-check {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(34, 197, 94, 0.16); color: #22c55e;
  font-size: 18px; font-weight: 800;
}
.dep-done-copy { display: grid; gap: 2px; }
.dep-done-copy b { color: var(--color-ink); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; }
.dep-done-copy span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.dep-drop {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: var(--space-xs);
  max-height: 260px; overflow-y: auto; padding-right: 2px;
}
.dep-drop-item {
  display: grid; gap: 4px; justify-items: center; text-align: center;
  padding: var(--space-xs);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-2);
}
.dd-img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm, 8px); background: rgba(255, 255, 255, 0.04); overflow: hidden; }
.dd-img img { width: 82%; height: 82%; object-fit: contain; }
.dd-name { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; line-height: 1.3; }
.dd-val { color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800; font-variant-numeric: tabular-nums; }
.dep-done-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm);
  padding-top: var(--space-sm); border-top: 1px solid var(--color-rule);
}
.dep-done-total span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.dep-done-total b { color: var(--color-win); font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.dep-done-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.dep-closed {
  display: grid; gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-paper-2);
}
.dep-closed .trade-panel-head h3 { font-size: var(--text-lg); }

@media (max-width: 30rem) {
  .dep-window, .dep-done, .dep-closed { padding: var(--space-md); }
  .dep-actions .btn, .dep-done-actions .btn { flex: 1 1 auto; }
  .dep-drop { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---------- consistent interaction polish ---------- */
button, .wallet-box { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(.btn, .icon-btn, .wallet-btn, .profile-chip, .chat-send, .chat-close, .modal-x, .selectall, .wallet-action, .item-action, .side-option, .w-plus):not(:disabled) {
  transform-origin: center;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out), filter var(--dur-micro) var(--ease-out);
}
:where(.btn, .icon-btn, .wallet-btn, .profile-chip, .chat-send, .wallet-action, .item-action, .side-option):hover:not(:disabled) {
  filter: brightness(1.045); box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
}
:where(.btn, .icon-btn, .wallet-btn, .profile-chip, .chat-send, .chat-close, .modal-x, .selectall, .wallet-action, .item-action, .side-option, .w-plus):active:not(:disabled) {
  transform: translateY(1px) scale(0.985); box-shadow: none;
}
button:disabled { opacity: 0.48; filter: saturate(0.55); cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.pick-card.is-locked { cursor: not-allowed; }
.pick-card.is-locked, .pick-card.is-locked:active { opacity: 0.62; transform: none; box-shadow: none; }
.item-cd {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  margin-left: var(--space-2xs); padding: 0 var(--space-2xs); height: 18px;
  border-radius: var(--radius-pill); background: #7a3b2c; color: var(--color-white);
  font-size: 9px; font-weight: 800;
}
.w-item.is-locked { cursor: not-allowed; }
.w-item.is-locked { opacity: 0.62; }
.w-item.is-locked .w-item-name { color: var(--color-muted); }
button[aria-busy="true"], button[aria-busy="true"]:disabled { cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 13px; height: 13px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.mobile-nav :is(a, button):active { transform: scale(0.97); }

/* ---------- responsive fit and touch targets ---------- */
@media (max-width: 80rem) and (min-width: 68.76rem) {
  main { padding-inline: var(--space-lg); }
  .topbar { gap: var(--space-lg); }
}
@media (max-width: 48rem) {
  .topbar { padding-left: max(var(--space-md), env(safe-area-inset-left)); padding-right: max(var(--space-md), env(safe-area-inset-right)); }
  .chat-send, .chat-close { min-height: 44px; }
  .chat-form { padding: var(--space-sm); }
  .chat-body { padding: var(--space-xs); }
  .sidebar { padding-top: env(safe-area-inset-top); }
  .user-profile-stats b { font-size: var(--text-sm); }
  .profile-history { padding-inline: var(--space-md); }
  .history-table { min-width: 420px; }
}
@media (max-width: 30rem) {
  .brand { gap: var(--space-2xs); }
  .wordmark { display: block; font-size: var(--text-md); }
  /* profile chip remains available on mobile */
  .header-right { min-width: 0; }
  .wallet-box { max-width: 96px; }
  .wallet-balance span { overflow: hidden; text-overflow: ellipsis; }
  .profile-banner { gap: var(--space-md); padding: var(--space-md); }
  .profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-actions .btn { width: 100%; padding-inline: var(--space-xs); }
  .profile-stat-row { gap: var(--space-xs); }
  .profile-stat-card { padding: var(--space-sm); }
  .user-profile-head { gap: var(--space-sm); }
  .user-profile-avatar { width: 60px; height: 60px; }
  .user-profile-stats > div { padding: var(--space-xs); }
  .hcaptcha-slot { max-width: 100%; overflow: hidden; }
  .hcaptcha-slot > div { min-width: 0; transform: scale(0.88); }
  .flip-result-heading { align-items: flex-start; }
  .flip-result-heading h2 { font-size: var(--text-lg); }
  .flip-result-actions { gap: var(--space-2xs); }
  .flip-result-body { padding: var(--space-md); }
  .flip-result-duel { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: var(--space-2xs); }
  .flip-result-player { padding-inline: 0; }
  .flip-result-player .ravatar { width: 56px; height: 56px; }
  .flip-result-coin img { width: 52px; height: 52px; }
  .flip-result-win-mark { right: 2%; }
}

/* ---------- community identity, streaks, tipping, and admin controls ---------- */
.staff-chip, .flame-chip, .mini-title {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-height: 20px; padding: 0 7px; border-radius: var(--radius-pill);
  font-size: 10px; font-style: normal; font-weight: 800; line-height: 1; white-space: nowrap;
}
.staff-chip {
  color: var(--staff-color); border: 1px solid color-mix(in oklab, var(--staff-color) 62%, transparent);
  background: color-mix(in oklab, var(--staff-color) 14%, transparent);
}
.staff-chip.staff-glow { box-shadow: 0 0 0 1px var(--staff-color); }
.staff-chip.staff-gradient { border-color: transparent; color: var(--color-paper); background: var(--staff-color); }
.staff-chip.staff-owner { background: var(--staff-color); color: var(--color-paper); border-color: transparent; }
.flame-chip {
  color: #ffb35c; border: 1px solid rgba(255, 146, 55, .34); background: rgba(255, 111, 38, .12);
  font-variant-numeric: tabular-nums;
}
.flame-chip.flame-3, .flame-chip.flame-4, .flame-chip.flame-5 {
  color: #ffd27c; box-shadow: inset 0 0 8px rgba(255, 123, 28, .25), 0 0 8px rgba(255, 93, 22, .18);
}
.flame-chip.flame-4, .flame-chip.flame-5 { animation: flamePulse 2.2s ease-in-out infinite; }
@keyframes flamePulse { 50% { filter: brightness(1.32); box-shadow: 0 0 11px rgba(255, 93, 22, .34); } }
.mini-title { min-width: 20px; padding: 0 5px; background: var(--color-paper-4); }
.mini-title.title-risk_taker { color: #FF4D4D; background: linear-gradient(90deg, #FF4D4D, #8B0F2B); -webkit-background-clip: text; background-clip: text; }
.mini-title.title-lucky_one { color: #2ECC71; background: linear-gradient(90deg, #2ECC71, #0B6B3A); -webkit-background-clip: text; background-clip: text; }
.mini-title.title-all_in { color: #b565d8; }
.player-cosmetics {
  position: absolute; z-index: 3; left: 50%; bottom: -7px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 2px; max-width: 96px;
  pointer-events: none;
}
.player-cosmetics .staff-chip, .player-cosmetics .flame-chip, .player-cosmetics .mini-title {
  min-height: 16px; padding: 0 4px; font-size: 11px; border-width: 1px;
}
.recent-ring-btn { position: relative; }
.flip-result-tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2xs); }
.flip-result-tags .earned-title { font-size: 11px; }
.coin-player-name { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.user-profile-cosmetics { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); min-height: 22px; }
.user-tip { display: grid; gap: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-rule); }
.tip-panel { display: grid; gap: var(--space-sm); padding: var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-3); }
.tip-panel[hidden] { display: none; }
.tip-limit { margin: 0; padding: 0; border: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.4; }
.tip-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); }
.tip-head b { color: var(--color-ink); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--space-xs); max-height: 260px; overflow-y: auto; padding: 1px; }
.tip-grid .pick-card { min-height: 96px; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.admin-tabs { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: var(--radius-pill); background: var(--color-paper-3); }
.admin-tab { min-height: 34px; padding: 0 var(--space-md); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-muted); font: inherit; font-size: var(--text-sm); font-weight: 800; cursor: pointer; }
.admin-tab.active { background: var(--color-accent); color: var(--color-accent-ink); }
.admin-search { flex: 1 1 280px; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.admin-search .input { flex: 1 1 170px; min-width: 0; }
.admin-target-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.admin-check-row { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; }
.admin-testmode {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
  margin-bottom: var(--space-md);
}
.admin-testmode-copy { min-width: 0; }
.admin-testmode { align-items: flex-start; flex-wrap: wrap; }
.admin-testmode-account { display: grid; gap: var(--space-2xs); margin-top: var(--space-xs); max-width: 360px; }
.admin-testmode-account .field-label { margin: 0; }
.admin-testmode-account .input { height: 38px; }
.admin-testmode-copy h2 { margin: 0 0 4px; font-size: var(--text-lg); }
.admin-testmode-copy .trade-copy { margin: 0; }
.admin-toggle {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px;
  color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 800; cursor: pointer;
}
.admin-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.admin-toggle-track {
  position: relative; width: 44px; height: 24px; flex: none; border-radius: var(--radius-pill);
  background: var(--color-paper-4); box-shadow: inset 0 0 0 1px var(--color-rule-strong);
  transition: background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.admin-toggle-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-ink-2);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.admin-toggle input:checked + .admin-toggle-track { background: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.admin-toggle input:checked + .admin-toggle-track::after { transform: translateX(20px); background: var(--color-accent-ink); }
.admin-toggle input:focus-visible + .admin-toggle-track { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.admin-check-row label { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.admin-reason { grid-column: span 2; }
.ban-list { display: grid; gap: var(--space-xs); }
.ban-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-sm); padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3);
}
.ban-copy { min-width: 0; display: grid; gap: 2px; }
.ban-copy b { overflow-wrap: anywhere; font-size: var(--text-sm); }
.ban-copy span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; overflow-wrap: anywhere; }
.ban-copy small { color: var(--color-ink-2); font-size: var(--text-xs); overflow-wrap: anywhere; }
.ban-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-left: auto; }
.ban-appeal-input { width: 100%; height: auto; min-height: 112px; padding: var(--space-sm); resize: vertical; line-height: 1.45; }
.admin-history { display: grid; gap: var(--space-3xs); color: var(--color-muted); font-size: var(--text-xs); }
.admin-history b { color: var(--color-ink-2); font-size: var(--text-sm); }
.admin-history span { overflow-wrap: anywhere; }
.admin-flip-list { padding: 0; overflow-x: auto; }
.admin-flip-row { display: grid; grid-template-columns: 42px 130px 86px minmax(190px, 1fr) minmax(110px, .55fr) 150px 66px; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--color-rule); font-size: var(--text-sm); }
.admin-flip-row:first-child { border-top: 0; }
.admin-flip-row:not(.admin-flip-head):hover { background: var(--color-paper-2); }
.admin-flip-head { padding-block: var(--space-xs); background: var(--color-paper-2); color: var(--color-muted); font-size: 10px; font-weight: 800; }
.admin-flip-rank { color: var(--color-muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-flip-value { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-flip-status { font-size: 10px; font-weight: 800; }
.admin-flip-status.open { color: var(--color-accent-text); }
.admin-flip-status.done { color: var(--color-win); }
.admin-flip-status.rolling { color: var(--color-warn); }
.admin-flip-status.cancelled { color: var(--color-muted); }
.admin-flip-players { display: grid; gap: 2px; min-width: 0; }
.admin-flip-players b, .admin-flip-players small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-flip-players b { color: var(--color-ink); }
.admin-flip-players small { color: var(--color-muted); font-size: var(--text-xs); }
.admin-flip-winner, .admin-flip-date { color: var(--color-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.admin-flip-action { display: flex; justify-content: flex-end; }
.admin-flip-view-title { display: grid; gap: 2px; min-width: 0; }
.admin-flip-view-title h2 { font-size: var(--text-lg); }
.admin-flip-view-title span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.admin-flip-view-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); color: var(--color-ink-2); font-size: var(--text-xs); }
.admin-flip-view-meta span { display: inline-flex; align-items: center; gap: 4px; }
.admin-flip-view-meta b { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.admin-flip-view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.admin-flip-view-side { display: grid; align-content: start; gap: var(--space-sm); min-width: 0; padding: var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
.admin-flip-view-side.is-winner { border-color: var(--color-win); box-shadow: inset 0 0 0 1px var(--color-win-soft); }
.admin-flip-view-side-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.admin-flip-view-side-head > span:first-child { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.admin-flip-view-side-head b { color: var(--color-ink); font-size: var(--text-md); }
.admin-flip-win { margin-left: auto; padding: 2px 6px; border-radius: 4px; background: var(--color-win); color: oklch(17% 0.035 155); font-size: 9px; font-weight: 800; }
.admin-flip-view-items { display: grid; gap: 0; }
.admin-flip-view-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-xs); padding: 4px 0; border-top: 1px solid var(--color-rule); }
.admin-flip-view-item:first-child { border-top: 0; }
.admin-flip-view-item img { width: 28px; height: 28px; object-fit: contain; }
.admin-flip-view-item span { overflow: hidden; color: var(--color-ink-2); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.admin-flip-view-item small { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.admin-flip-view-item b { display: inline-flex; align-items: center; gap: 2px; color: var(--color-ink); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-flip-view-empty { padding: var(--space-sm) 0; color: var(--color-muted); font-size: var(--text-sm); }
.admin-flip-view-total { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding-top: var(--space-xs); border-top: 1px solid var(--color-rule); color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.admin-flip-view-total b { display: inline-flex; align-items: center; gap: 2px; color: var(--color-ink); font-size: var(--text-md); font-variant-numeric: tabular-nums; }
.admin-tax-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.admin-tax-head h2 { margin: 0; }
.admin-tax-head .trade-copy { margin: var(--space-2xs) 0 0; max-width: 64ch; }
.admin-tax-total { display: grid; gap: 2px; text-align: right; color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.admin-tax-total b { display: inline-flex; align-items: center; gap: 2px; color: var(--color-ink); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-referral-create { grid-template-columns: minmax(140px, 190px) auto; align-items: end; }
.referral-create-action { display: flex; align-items: flex-end; }
.admin-wave-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.admin-wave-cell { display: grid; gap: 2px; padding: var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-3); }
.admin-wave-cell span { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.admin-wave-cell b { color: var(--color-ink); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .admin-wave-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-tax-rate { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-sm); }
.admin-tax-rate .field-label { margin: 0; }
.admin-tax-rate .input { width: 120px; }
.admin-tax-switch { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 42px; color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.admin-tax-switch input { width: 18px; height: 18px; accent-color: var(--color-accent); }
.admin-tax-items { max-height: 360px; overflow-y: auto; }
.admin-tax-empty { padding: var(--space-md); border: 1px dashed var(--color-rule); border-radius: var(--radius-md); color: var(--color-muted); font-size: var(--text-sm); text-align: center; }
.admin-tax-ledger-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; border-top: 1px solid var(--color-rule); color: var(--color-muted); font-size: var(--text-xs); }
.admin-tax-ledger-row:first-child { border-top: 0; }
.admin-tax-ledger-row b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.admin-tax-ledger-row small { color: var(--color-warn); }
.admin-tax-ledger-row.is-claim b { color: var(--color-win); }

@media (max-width: 48rem) {
  .admin-toolbar { align-items: stretch; }
  .admin-search { flex-basis: 100%; }
  .admin-reason { grid-column: 1 / -1; }
  .admin-flip-head { display: none; }
  .admin-flip-row { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 4px; padding: var(--space-sm); }
  .admin-flip-players { grid-column: 2 / 3; }
  .admin-flip-winner, .admin-flip-date { display: none; }
  .admin-flip-action { grid-column: 3; grid-row: 2; align-self: end; }
  .admin-flip-view-grid { grid-template-columns: 1fr; }
  .admin-tax-ledger-row { display: flex; flex-wrap: wrap; gap: 4px var(--space-sm); }
  .admin-tax-ledger-row > span:first-child { flex-basis: 100%; font-size: 10px; }
  .admin-tax-ledger-row > b { margin-left: auto; }
  .tip-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .player-cosmetics { bottom: -5px; }
}

/* ---------- crawlable public documents ---------- */
.static-body { min-height: 100vh; background: var(--color-paper); }
.static-page { width: min(860px, calc(100% - 32px)); margin: clamp(36px, 8vw, 88px) auto; }
.static-doc {
  padding: clamp(24px, 5vw, 56px); border: 1px solid var(--color-rule);
  border-radius: var(--radius-card); background: var(--color-paper-2);
}
.static-doc h1 { margin: 0 0 var(--space-lg); font-size: clamp(32px, 6vw, 54px); line-height: 1.04; letter-spacing: -.045em; }
.static-doc h2 { margin: var(--space-xl) 0 var(--space-sm); font-size: var(--text-lg); }
.static-doc p, .static-doc li { color: var(--color-ink-2); font-size: var(--text-md); line-height: 1.75; }
.static-doc ul { padding-left: 1.2em; }
.static-doc a { color: var(--color-accent-text); font-weight: 700; }
.static-kicker { margin-bottom: var(--space-sm) !important; color: var(--color-accent-text) !important; font-size: var(--text-xs) !important; font-weight: 800; }
.static-code { padding: var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper); color: var(--color-ink) !important; font-family: var(--font-mono); font-size: var(--text-sm) !important; white-space: pre-wrap; }
.static-note { margin-top: var(--space-xl); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); color: var(--color-muted) !important; font-size: var(--text-sm) !important; }
.static-body .topbar { max-width: 1100px; margin: 0 auto; }
.static-body .foot { margin-top: 0; }

/* ---------- play-only test items ---------- */
.test-warning {
  display: grid; gap: var(--space-2xs); margin: var(--space-sm) 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid color-mix(in oklab, var(--color-warn) 48%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--color-warn) 10%, var(--color-paper-3));
  color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.45;
}
.test-warning[hidden] { display: none; }
.test-warning b { color: var(--color-warn); font-size: var(--text-sm); }
.test-warning span { color: var(--color-ink-2); }
.test-warning label {
  display: inline-flex; align-items: flex-start; gap: var(--space-xs);
  margin-top: var(--space-2xs); color: var(--color-ink); font-weight: 700; cursor: pointer;
}
.test-warning input { margin-top: 3px; accent-color: var(--color-accent); }
@media (max-width: 30rem) {
  .test-warning { padding: var(--space-sm); }
}

/* ---------- phone-first flip creation and item selection ---------- */
@media (max-width: 48rem) {
  .modal.create-modal {
    width: 100%; height: 100dvh; max-height: 100dvh;
    border: 0; border-radius: 0;
  }
  .modal.create-modal .modal-head {
    align-items: flex-start;
    padding: max(var(--space-sm), env(safe-area-inset-top)) var(--space-sm) var(--space-sm) var(--space-md);
  }
  .create-modal .modal-x { width: 44px; height: 44px; }
  .join-toolbar .input { font-size: 16px; }
  .create-toolbar { padding: var(--space-md); }
  .create-toolbar .side-pick--compact { gap: var(--space-xs); }
  .side-pick--compact .side-option { min-height: 46px; height: 46px; gap: 6px; padding: 0 var(--space-xs); }
  .side-pick--compact .side-letter { width: 26px; height: 26px; font-size: 12px; }
  .create-select .btn { min-height: 46px; }
  .create-inventory { padding: var(--space-md); }
  .create-foot {
    flex-direction: column; align-items: stretch;
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  }
  .create-foot .create-stake-status { width: 100%; margin-right: 0; }
  .create-foot .join-actions { width: 100%; }
  .create-foot .join-actions .btn { flex: 1 1 0; min-height: 48px; }

  .join-toolbar .input { min-height: 46px; }
  .join-pick-grid .pick-card { min-height: 152px; padding: var(--space-sm); }
  .join-pick-grid .pick-img { height: 84px; }
  .join-pick-grid .pick-img img { max-height: 74px; max-width: 100px; }
  .join-pick-grid .pick-name {
    min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal; font-size: var(--text-xs); line-height: 1.25;
  }
  .join-inventory { -webkit-overflow-scrolling: touch; }
  .join-actions .btn { min-height: 48px; }
}

@media (max-width: 30rem) {
  .modal.create-modal .modal-head { padding-left: var(--space-sm); }
  .create-modal .side-option b { font-size: var(--text-sm); }
  .create-modal .pick-card { min-height: 140px; }
  .create-modal .pick-name { font-size: 11px; }
  .create-modal .create-foot { flex-wrap: wrap; }
  .create-modal .create-foot #createSubmit { flex: 1 1 100%; width: 100%; order: 2; }
  .create-modal .create-foot .foot-total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); width: 100%; }
  .create-modal .create-foot .foot-total b { margin-top: 0; font-size: var(--text-xl); }
}

/* ---------- profile privacy ---------- */
.profile-privacy {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
  margin-bottom: var(--space-md); padding: var(--space-md) var(--space-lg);
}
.profile-privacy-copy { display: grid; gap: var(--space-2xs); min-width: 0; }
.profile-privacy-copy b { color: var(--color-ink); font-size: var(--text-md); }
.profile-privacy-copy span { color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
.profile-privacy-toggle { flex: none; align-items: center; gap: var(--space-xs); font-weight: 700; }
.referral-item-preview {
  width: fit-content; display: inline-flex; align-items: center; gap: var(--space-xs);
  margin-top: var(--space-2xs); padding: 5px 10px 5px 6px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3);
}
.referral-item-preview img { width: 38px; height: 38px; flex: none; object-fit: contain; }
.referral-item-preview b { color: var(--color-ink); font-size: var(--text-sm); }
.referral-item-preview > span { color: var(--color-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.tutorial-offer { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-xl); }
.tutorial-offer-mark, .tutorial-mark {
  flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--color-rule-strong); background: var(--color-paper-3);
  color: var(--color-accent-text); font-family: var(--font-display);
}
.tutorial-offer-mark { width: 58px; height: 58px; font-size: var(--text-2xl); font-weight: 800; }
.tutorial-body { display: flex; flex-direction: column; gap: var(--space-lg); padding: var(--space-xl); }
.tutorial-mark { width: 86px; height: 86px; font-size: var(--text-2xl); font-weight: 800; }
.tutorial-dots { display: flex; align-items: center; gap: var(--space-xs); }
.tutorial-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-paper-4); }
.tutorial-dots span.active { width: 22px; border-radius: var(--radius-pill); background: var(--color-accent); }
@media (max-width: 40rem) {
  .tutorial-offer, .tutorial-body { padding: var(--space-lg); }
  .tutorial-offer { align-items: flex-start; }
}
.profile-privacy-toggle input { width: 18px; height: 18px; accent-color: var(--color-accent); }
@media (max-width: 48rem) {
  .profile-privacy { align-items: flex-start; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); }
  .profile-privacy-toggle { width: 100%; }
}

/* ---------- fairness clarity ---------- */
.fairness-note {
  margin: var(--space-sm) 0 0;
  padding: var(--space-xs) var(--space-sm);
  border-left: 2px solid var(--color-win);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-win-soft);
  color: var(--color-ink-2);
  font-size: var(--text-xs);
  line-height: 1.5;
  font-weight: 700;
}
.join-modal > .fairness-note { margin: 0; padding: var(--space-xs) var(--space-lg); border-radius: 0; border-left-width: 3px; }
@media (max-width: 48rem) {
  .join-modal > .fairness-note { padding: var(--space-xs) var(--space-md); }
}

/* ---------- chat replies ---------- */
.chat-msg-row { position: relative; width: 100%; }
.chat-msg-row .chat-msg { padding-right: 26px; }
.chat-reply-action {
  position: absolute; right: 4px; top: 7px;
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--color-muted); font-size: 13px; line-height: 1;
  opacity: 0; cursor: pointer;
  transition: opacity var(--dur-micro), background-color var(--dur-micro), color var(--dur-micro);
}
.chat-msg-row:hover .chat-reply-action { opacity: 1; }
.chat-reply-action:hover { background: var(--color-paper-4); color: var(--color-ink); }
.chat-reply-action:focus-visible { opacity: 1; outline: 2px solid var(--color-focus); outline-offset: 1px; }
.chat-reply-ref {
  display: flex; align-items: stretch; gap: var(--space-xs);
  min-width: 0; margin: 1px 0 2px;
  color: var(--color-muted); font-size: var(--text-xs); line-height: 1.35;
}
.chat-reply-ref > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-ref b { color: var(--color-accent-text); font-weight: 700; }
.chat-reply-bar {
  flex: none; display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-top: 1px solid var(--color-rule); background: var(--color-paper-3);
}
.chat-reply-bar[hidden] { display: none; }
.chat-reply-bar > .chat-reply-accent { width: 2px; height: 28px; flex: none; border-radius: 2px; background: var(--color-accent); }
.chat-reply-copy { min-width: 0; display: grid; gap: 1px; }
.chat-reply-copy small { color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.chat-reply-copy small b { color: var(--color-accent-text); font-weight: 700; }
.chat-reply-copy > span { overflow: hidden; color: var(--color-ink-2); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-cancel {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; margin-left: auto;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted);
}
.chat-reply-cancel:hover { background: var(--color-paper-4); color: var(--color-ink); }
@media (hover: none) { .chat-reply-action { opacity: 0.65; } }

/* ---------- view flip ---------- */
.modal.view-flip-modal {
  width: min(960px, 100%); max-width: 960px;
  height: auto; max-height: calc(100dvh - 48px);
  background: var(--color-paper-2); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-card);
}
.view-flip-modal .vf-head {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}
.vf-head-title { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); min-width: 0; }
.vf-head-title h2 { margin: 0; font-size: var(--text-xl); letter-spacing: var(--tracking-display); }
.vf-id {
  min-width: 0; overflow: hidden; color: var(--color-muted);
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  text-overflow: ellipsis; white-space: nowrap;
}
.vf-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-lg) var(--space-lg) var(--space-md); }
.vf-duel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: clamp(16px, 5vw, 48px);
  max-width: 760px; margin: 0 auto; padding: 6px 0 2px;
}
.vf-player { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.vf-avatar-wrap { position: relative; width: 112px; height: 112px; flex: none; }
.vf-avatar {
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
  box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-rule-strong);
  transition: box-shadow var(--dur-micro) var(--ease-out);
}
.vf-avatar .ravatar { width: 100%; height: 100%; border-radius: 50%; }
.vf-avatar:hover { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-accent); }
.vf-player.is-active .vf-avatar,
.vf-player.is-winner .vf-avatar { box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-win); }
.vf-avatar-empty {
  display: block; width: 100%; height: 100%;
  border: 1px dashed var(--color-rule-strong); border-radius: 50%; background: var(--color-paper-3);
}
.vf-side-coin {
  position: absolute; left: -10px; bottom: 0; z-index: 1;
  width: 42px; height: 42px; display: block; overflow: hidden;
  border: 4px solid var(--color-paper-2); border-radius: 50%; background: var(--color-paper-2);
}
.vf-side-coin img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.vf-name {
  max-width: 200px; overflow: hidden;
  color: var(--color-ink); font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em;
  text-overflow: ellipsis; white-space: nowrap;
}
.vf-player--joining .vf-name { color: var(--color-muted); font-weight: 600; }
.vf-center { display: grid; place-items: center; }
.vf-vs {
  width: 62px; height: 62px; display: grid; place-items: center;
  border: 1px solid var(--color-rule); border-radius: 50%;
  background: var(--color-paper); color: var(--color-muted);
  font-size: var(--text-sm); font-weight: 800;
}
.vf-seed {
  display: flex; align-items: center; justify-content: center; gap: var(--space-xs);
  width: fit-content; max-width: 100%; margin: var(--space-lg) auto var(--space-md);
  padding: 7px 14px; overflow: hidden;
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper);
  color: var(--color-muted); font-size: var(--text-xs); font-weight: 600;
  text-overflow: ellipsis; white-space: nowrap;
}
.vf-hash { color: var(--color-ink-2); font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; }
.vf-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); max-width: 820px; margin: 0 auto; }
.vf-col { min-width: 0; display: flex; flex-direction: column; gap: var(--space-xs); }
.vf-summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-3);
  color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums;
}
.vf-summary b { display: inline-flex; align-items: center; gap: 5px; color: var(--color-ink); font-size: var(--text-md); font-weight: 700; white-space: nowrap; }
.vf-item-list {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  max-height: 258px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--color-rule-strong) transparent;
}
.vf-item-list::-webkit-scrollbar { width: 6px; }
.vf-item-list::-webkit-scrollbar-thumb { background: var(--color-rule-strong); border-radius: var(--radius-pill); }
.vf-item-card {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 60px; padding: 8px 12px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper);
}
.vf-item-card > img { width: 40px; height: 40px; object-fit: contain; }
.vf-item-name { min-width: 0; overflow: hidden; color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vf-item-value { display: inline-flex; align-items: center; gap: 4px; color: var(--color-ink); font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vf-item-value .pcoin { width: 14px; height: 14px; flex: none; }
.vf-item-card--empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--color-muted); font-size: var(--text-sm); }
.vf-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-xs); padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--color-rule); }
.vf-foot .btn { min-height: 38px; padding: 0 16px; }
.vf-foot .btn-danger { margin-right: auto; }
.vf-flip-coin { width: 92px; height: 92px; display: grid; place-items: center; }
.vf-flip-coin .coin3d { width: 88px; height: 88px; }
.vf-flip-coin--settled img { width: 92px; height: 92px; object-fit: contain; border-radius: 50%; animation: vfCoinIn 320ms var(--ease-out) both; }
@keyframes vfCoinIn { from { opacity: 0.2; transform: scale(0.82) rotate(-8deg); } }
.vf-cancel-note { margin-right: auto; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; line-height: 1.4; }
@media (max-width: 40rem) {
  .modal.view-flip-modal { width: 100%; height: auto; max-height: calc(100dvh - 8px); border-radius: var(--radius-card); }
  .view-flip-modal .vf-head { padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md); }
  .vf-head-title h2 { font-size: var(--text-lg); }
  .vf-id { display: none; }
  .vf-body { padding: var(--space-md) var(--space-sm) var(--space-sm); }
  .vf-duel { gap: 8px; max-width: none; }
  .vf-avatar-wrap { width: 84px; height: 84px; }
  .vf-side-coin { width: 32px; height: 32px; left: -7px; border-width: 3px; }
  .vf-name { max-width: 110px; font-size: var(--text-sm); }
  .vf-vs { width: 44px; height: 44px; font-size: 11px; }
  .vf-flip-coin { width: 72px; height: 72px; }
  .vf-flip-coin .coin3d, .vf-flip-coin--settled img { width: 70px; height: 70px; }
  .vf-seed { margin: var(--space-md) auto var(--space-sm); font-size: 11px; }
  .vf-hash { font-size: var(--text-xs); }
  .vf-breakdown { grid-template-columns: 1fr; gap: var(--space-sm); }
  .vf-summary { min-height: 42px; padding: 8px 12px; font-size: var(--text-xs); }
  .vf-summary b { font-size: var(--text-sm); }
  .vf-item-list { max-height: 168px; }
  .vf-item-card { min-height: 52px; padding: 7px 10px; grid-template-columns: 34px minmax(0, 1fr) auto; }
  .vf-item-card > img { width: 34px; height: 34px; }
  .vf-item-name, .vf-item-value { font-size: var(--text-xs); }
  .vf-foot { padding: var(--space-xs) var(--space-sm); }
  .vf-foot .btn { flex: 1; min-height: 38px; }
  .vf-cancel-note { font-size: 11px; }
}

/* ---------- deposit window: sleek floor style ---------- */
.dep-head { align-items: center; padding: 16px 20px; }
.dep-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dep-head-title .ravatar { width: 36px; height: 36px; flex: none; box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-accent-soft); }
.dep-head-title > div { min-width: 0; display: grid; gap: 1px; }
.dep-head-title h2 { margin: 0; font-size: var(--text-xl); }
.dep-head-title span { color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; }
.dep-head .modal-x { display: none; }
.dep-window {
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: 16px;
  box-shadow: none;
  padding: 20px;
}
.dep-glow { display: none; }
.dep-hero { gap: 14px; }
.dep-bot .ravatar { width: 52px; height: 52px; box-shadow: 0 0 0 2px var(--color-paper-2), 0 0 0 3px var(--color-accent-soft); }
.dep-bot-meta b { font-size: 17px; }
.dep-kicker { font-size: 10px; }
.dep-timer > span { font-size: 10px; text-transform: none; color: var(--color-muted); }
.dep-clock { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.dep-bar { height: 5px; background: var(--color-paper-4); border: 0; }
.dep-bar > i { background: var(--color-accent); }
.dep-status { background: var(--color-paper-3); border: 1px solid var(--color-rule); color: var(--color-ink-2); border-radius: 8px; font-weight: 500; }
.dep-status .jb-dot { background: var(--color-accent); box-shadow: none; animation: none; }
.dep-status.is-live { background: var(--color-win-soft); border-color: color-mix(in oklab, var(--color-win) 40%, transparent); color: var(--color-ink); }
.dep-actions .btn { min-height: 42px; }
.dep-retry {
  border: 0; border-left: 2px solid var(--color-accent);
  border-radius: 6px; background: var(--color-paper-3);
  color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5;
  padding: 9px 12px;
}
.dep-retry b { color: var(--color-accent-text); }
.dep-steps li { color: var(--color-muted); }
.dep-account { border-top: 1px solid var(--color-rule); }
.dep-done, .dep-closed {
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: 16px;
  box-shadow: none;
  padding: 20px;
}
.dep-done { border-color: color-mix(in oklab, var(--color-win) 35%, var(--color-rule)); }
@media (max-width: 40rem) {
  .dep-head { padding: 12px 14px; }
  .dep-head-title .ravatar { width: 32px; height: 32px; }
  .dep-window, .dep-done, .dep-closed { padding: 14px; }
  .dep-clock { font-size: 28px; }
}

/* active flip coin in the view center */
.vf-flip-coin { width: 118px; height: 118px; display: grid; place-items: center; }
.vf-flip-coin .coin3d { width: 112px; height: 112px; }
.vf-flip-coin--settled img { width: 118px; height: 118px; object-fit: contain; border-radius: 50%; }
.vf-cancel-note { margin-right: auto; color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; line-height: 1.4; }
@media (max-width: 40rem) {
  .vf-flip-coin { width: 92px; height: 92px; }
  .vf-flip-coin .coin3d, .vf-flip-coin--settled img { width: 88px; height: 88px; }
  .vf-cancel-note { font-size: 11px; }
}

/* ---------- emoji picker ---------- */
.emoji-picker {
  flex: none; display: flex; flex-direction: column; max-height: 300px;
  border-top: 1px solid var(--color-rule); background: var(--color-paper-2);
}
.emoji-picker[hidden] { display: none; }
.emoji-picker-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--color-rule);
}
.emoji-picker-head b { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; }
.emoji-close { width: 26px; height: 26px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted); font-size: 17px; line-height: 1; }
.emoji-close:hover { background: var(--color-paper-4); color: var(--color-ink); }
.emoji-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 9px 2px; scroll-behavior: smooth; }
.emoji-group { padding: 6px 0 3px; }
.emoji-group-title { display: block; padding: 0 2px 6px; color: var(--color-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; }
.emoji-grid button {
  width: 100%; aspect-ratio: 1; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent;
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: background-color 100ms, transform 100ms;
}
.emoji-grid button:hover { background: var(--color-paper-4); }
.emoji-grid button:active { transform: scale(0.96); }
.emoji-tabs {
  flex: none; display: flex; align-items: center; justify-content: space-around;
  height: 38px; padding: 0 8px; border-top: 1px solid var(--color-rule); background: var(--color-paper-3);
}
.emoji-tabs button {
  width: 34px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; font-size: 16px; opacity: 0.6; cursor: pointer;
}
.emoji-tabs button:hover, .emoji-tabs button.active { opacity: 1; background: var(--color-paper-4); }
.chat-emoji.is-open { color: var(--color-accent-text); background: var(--color-accent-soft); }

/* ---------- chat tip row ---------- */
.chat-tip {
  display: flex; align-items: center; gap: 8px; margin: 4px 6px; padding: 8px 10px;
  border: 1px solid var(--color-accent-soft); border-radius: 9px; background: var(--color-accent-soft);
  color: var(--color-ink-2); font-size: 11.5px; line-height: 1.4;
}
.chat-tip-avatars { display: flex; flex: none; align-items: center; }
.chat-tip-avatars .ravatar { width: 23px; height: 23px; border-radius: 6px; box-shadow: 0 0 0 2px var(--color-paper-2); }
.chat-tip-avatars .ravatar + .ravatar { margin-left: -5px; }
.chat-tip-copy { min-width: 0; display: grid; gap: 1px; }
.chat-tip-copy > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tip-copy b { color: var(--color-ink); font-weight: 700; }
.chat-tip-meta { display: inline-flex; align-items: center; gap: 3px; color: var(--color-muted); font-size: 10px; }
.chat-tip time { flex: none; margin-left: auto; color: var(--color-muted); font-size: 9px; opacity: 0.7; }

/* ---------- admin bot controls ---------- */
.admin-bot-flip {
  display: grid; grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.6fr) auto;
  align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--color-rule);
}
.admin-bot-flip:first-of-type { border-top: 0; }
.abf-main { display: grid; gap: 2px; min-width: 0; }
.abf-main b { color: var(--color-ink); font-size: var(--text-sm); }
.abf-main .mono { overflow: hidden; color: var(--color-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.abf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; color: var(--color-muted); font-size: var(--text-xs); }
.admin-bot-row {
  display: grid; grid-template-columns: 34px minmax(140px, 0.8fr) minmax(0, 1.2fr);
  align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--color-rule);
}
.admin-bot-row:first-of-type { border-top: 0; }
.admin-bot-avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 800;
}
@media (max-width: 48rem) {
  .admin-bot-flip { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-bot-flip .abf-meta { grid-column: 1 / -1; }
  .admin-bot-row { grid-template-columns: 30px minmax(0, 1fr); }
  .admin-bot-row .abf-meta { grid-column: 2; }
  .emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.flip-item-extra { align-self: center; margin-left: 10px; color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }
.recent-items .flip-item-extra { font-size: var(--text-xs); }

/* ---------- signup verification: site-styled modal ---------- */
.modal.login-modal {
  width: min(100%, 760px); max-width: 760px;
  height: auto; max-height: calc(100dvh - 32px);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-card);
  color: var(--color-ink);
  font-family: var(--font-body);
}
.login-photo-head {
  align-items: center;
  padding: 16px 20px 16px 24px;
  border-bottom: 1px solid var(--color-rule);
}
.login-photo-title { display: grid; gap: 4px; min-width: 0; }
.login-photo-title h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.025em; }
.login-photo-body {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; align-content: start; gap: 18px;
  padding: 28px 40px 32px;
}
.login-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-rule);
  border-left: 2px solid var(--color-warn);
  border-radius: 8px;
  background: color-mix(in oklab, var(--color-warn) 4.5%, var(--color-paper-2));
  color: var(--color-ink-2); font-size: 14px; line-height: 1.55;
}
.login-alert-icon { width: 19px; height: 19px; flex: none; margin-top: 1px; color: color-mix(in oklab, var(--color-warn) 82%, var(--color-muted)); }
.login-sub { margin: 0; color: var(--color-ink-2); font-size: 15px; line-height: 1.55; }
.login-referral-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-3);
}
.login-referral-card > div { display: grid; gap: 1px; min-width: 0; }
.login-referral-card b { color: var(--color-ink); font-size: var(--text-sm); }
.login-referral-card span { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.4; }
.login-referral-icon {
  width: 44px; height: 44px; flex: none; padding: 5px; object-fit: contain;
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  background: var(--color-paper-2);
}
.login-referral-loading { color: var(--color-muted); font-size: var(--text-sm); }
.login-fields { display: grid; gap: 10px; }
.login-label { display: block; margin: 0; color: var(--color-ink-2); font-size: 14px; font-weight: 700; }
.login-input {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  background: var(--color-paper); color: var(--color-ink);
  font-size: 15px; font-family: var(--font-body);
  outline: none;
  transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.login-input::placeholder { color: var(--color-muted); }
.login-input:hover { border-color: var(--color-rule-strong); }
.login-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.login-terms {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 2px;
  color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.5; cursor: pointer;
}
.login-terms input {
  appearance: none; width: 18px; height: 18px; flex: none; margin: 0;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--color-field); border-radius: 4px; background: var(--color-paper);
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.login-terms input:checked { background: var(--color-accent); border-color: var(--color-accent); }
.login-terms input:checked::after {
  content: ""; width: 8px; height: 4px;
  border-left: 2px solid var(--color-accent-ink); border-bottom: 2px solid var(--color-accent-ink);
  transform: rotate(-45deg) translateY(-1px);
}
.login-terms a { color: var(--color-accent-text); text-decoration: none; }
.login-terms a:hover { text-decoration: underline; }
.login-captcha {
  min-height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 0;
}
.login-captcha[hidden] { display: none; }
.login-captcha .hcaptcha-slot { min-height: 0; width: 100%; display: flex; justify-content: center; }
.login-captcha .captcha-note { margin: 0; color: var(--color-muted); font-size: var(--text-xs); text-align: center; }
.login-verify {
  width: 100%; height: 54px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-accent); color: var(--color-accent-ink);
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}
.login-verify:hover:not(:disabled) { background: var(--color-accent-deep); border-color: var(--color-accent-deep); }
.login-verify:active:not(:disabled) { transform: translateY(1px); }
.login-verify:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.login-verify:disabled {
  opacity: 1; cursor: not-allowed;
  background: var(--color-paper-3); border-color: var(--color-rule);
  color: var(--color-muted);
}
.login-verify[aria-busy="true"]:disabled {
  opacity: 0.82; background: var(--color-accent-deep); border-color: var(--color-accent-deep);
  color: var(--color-accent-ink); cursor: progress;
}
.login-notice { min-height: 0; margin: 0; color: var(--color-accent-text); font-size: var(--text-xs); text-align: center; line-height: 1.4; }
.login-notice:empty { display: none; }
.login-modal .group-step { margin-top: 0; }
@media (max-width: 40rem) {
  .modal.login-modal {
    width: 100%; max-width: 100%; max-height: 100dvh;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
  .login-photo-head { padding: 14px 14px 14px 18px; }
  .login-photo-title h2 { font-size: var(--text-lg); }
  .login-photo-body { gap: 16px; padding: 20px 18px 22px; }
  .login-input { height: 50px; font-size: 16px; }
  .login-verify { height: 50px; }
}

@media (max-width: 48rem) {
  .lobby-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .lobby-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .lobby-actions .btn { width: 100%; }
}

@media (max-width: 56rem) {
  .top-nav { display: none; }
}

/* ---------- recent flips modal ---------- */
.rf-list { display: flex; flex-direction: column; gap: 8px; }
.rf-row {
  display: grid; grid-template-columns: 34px minmax(150px, 1.15fr) minmax(0, auto) auto auto;
  grid-template-areas: "side who items value state";
  align-items: center; gap: 14px; width: 100%;
  padding: 10px 12px; text-align: left;
  background: var(--color-paper-2); color: var(--color-ink);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.rf-row:hover { border-color: var(--color-rule-strong); background: var(--color-paper-3); }
.rf-row:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.rf-side { grid-area: side; display: grid; place-items: center; }
.rf-coin { width: 34px; height: 34px; }
.rf-who { grid-area: who; display: grid; gap: 2px; min-width: 0; }
.rf-opp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rf-opp .ravatar { width: 30px; height: 30px; }
.rf-opp b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); font-weight: 800; }
.rf-empty-av { background: var(--color-paper-4); }
.rf-who small { color: var(--color-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-items { grid-area: items; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.rf-thumb {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--color-rule); background: var(--color-paper-3);
  overflow: hidden;
}
.rf-thumb img { width: 22px; height: 22px; object-fit: contain; }
.rf-thumb.rf-more { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent-text); font-size: 10px; font-weight: 800; }
.rf-value { grid-area: value; display: inline-flex; align-items: center; gap: 5px; color: var(--color-ink); font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-value .pcoin { width: 14px; height: 14px; }
.rf-state {
  grid-area: state; justify-self: end; min-width: 58px; padding: 4px 9px; text-align: center;
  border-radius: var(--radius-pill); font-size: 10px; font-weight: 800;
}
.rf-state.open { background: var(--color-paper-4); color: var(--color-ink-2); }
.rf-state.rolling { background: var(--color-accent-soft); color: var(--color-accent-text); }
.rf-state.won { background: var(--color-win-soft); color: var(--color-win); }
.rf-state.lost { background: var(--color-loss-soft); color: var(--color-loss); }

@media (max-width: 48rem) {
  .rf-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: "side who state" "side items value";
    row-gap: 8px; column-gap: 10px;
  }
  .rf-side { align-self: start; }
  .rf-coin { width: 30px; height: 30px; }
  .rf-items { justify-content: flex-start; }
  .rf-value { justify-self: end; }
}

/* ---------- admin site values ---------- */
.admin-values-card { display: grid; gap: var(--space-md); }
.admin-values-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-lg); }
.admin-values-intro h2 { margin: 0 0 4px; font-size: var(--text-lg); }
.admin-values-intro .trade-copy { margin: 0; max-width: 720px; }
.admin-values-intro .inv-note { flex: none; text-align: right; }
.admin-values-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  max-height: 62vh; overflow: auto; padding-right: 4px;
}
.admin-value-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; min-width: 0;
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
  background: var(--color-paper-2);
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.admin-value-row.changed { border-color: var(--color-accent); background: var(--color-accent-soft); }
.admin-value-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-value-name img { width: 28px; height: 28px; flex: none; object-fit: contain; }
.admin-value-name > span { display: grid; gap: 1px; min-width: 0; }
.admin-value-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); font-size: var(--text-sm); font-weight: 700; }
.admin-value-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); font-size: 10px; }
.admin-value-field { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.admin-value-field .pcoin { width: 12px; height: 12px; }
.admin-value-field .input {
  width: 92px; height: 34px; padding: 0 8px; text-align: right;
  font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums;
}
.admin-values-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }

@media (max-width: 60rem) {
  .admin-values-list { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .admin-values-intro { flex-direction: column; gap: var(--space-sm); }
  .admin-values-intro .inv-note { text-align: left; }
}
.admin-value-row[hidden] { display: none; }

/* ---------- wallet modal · join/create layout ---------- */
.modal.wallet {
  width: min(1100px, 100%); max-width: 1100px;
  height: min(820px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px);
}
.modal.wallet .wallet-head { align-items: flex-start; padding: var(--space-md) var(--space-md) var(--space-sm) var(--space-lg); }
.modal.wallet .wallet-toolbar {
  display: grid; grid-template-columns: minmax(240px, 1fr) 180px auto;
  align-items: end;
}
.wallet-transfer-actions { display: flex; align-items: center; gap: var(--space-xs); }
.wallet-transfer-actions .btn { height: 42px; }
.wallet-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wallet-inventory { background: var(--color-paper); }
.wallet-picker-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.wallet-picker-head .ph-label { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.wallet-picker-head .ph-label b { color: var(--color-ink); }
.wallet-pick-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.wallet-pick-grid .pick-card.selected { border-color: var(--color-accent); background: var(--color-accent-soft); }
.wallet-pick-grid .pick-card.selected::after { background: var(--color-accent); color: var(--color-accent-ink); }
.wallet-safety { margin-top: var(--space-md); padding-top: var(--space-sm); border-top: 1px solid var(--color-rule); font-size: 11px; line-height: 1.5; }
.wallet-foot .join-cover-status { min-width: 200px; }

@media (max-width: 48rem) {
  .modal.wallet .wallet-toolbar { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
  .wallet-transfer-actions { width: 100%; }
  .wallet-transfer-actions .btn { flex: 1 1 0; }
  .wallet-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wallet-pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (max-width: 48rem) {
  .modal.wallet { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
}

/* ---------- wallet · responsive sidebar redesign ---------- */
.wallet-shell {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "side main" "foot main";
}
.wallet-side {
  grid-area: side; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-paper-2); border-right: 1px solid var(--color-rule);
}
.wallet-controls { display: grid; gap: 10px; }
.wallet-control-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.wallet-control-row .input, .wallet-control-row .btn { height: 42px; }
.wallet-sort { min-width: 0; }
.wallet-stats { display: grid; gap: 8px; }
.wallet-stat {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm);
  min-width: 0; padding: 10px 12px;
  border: 1px solid var(--color-rule); border-radius: 10px; background: var(--color-paper-3);
}
.wallet-stat span { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.wallet-stat b { display: inline-flex; align-items: center; gap: 4px; color: var(--color-ink); font-size: var(--text-md); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-stat b .pcoin { width: 14px; height: 14px; }
.wallet-side-note { margin: 0; color: var(--color-muted); font-size: 11px; line-height: 1.55; }
.wallet-side-note b { color: var(--color-ink-2); }

.wallet-main { grid-area: main; min-height: 0; display: flex; flex-direction: column; background: var(--color-paper); }
.wallet-main-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: 14px 20px 10px;
  color: var(--color-muted); font-size: 10px; font-weight: 800;
}
.wallet-main-head b { color: var(--color-accent-text); font-size: 10px; font-weight: 800; }
.wallet-grid-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 20px; }
.wallet-pick-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.wallet-pick-grid .pick-card {
  min-height: 150px; padding: 10px;
  border: 1px solid var(--color-rule); border-radius: 12px;
  background: var(--color-paper-2);
  box-shadow: 0 1px 0 var(--color-shadow);
  transition: transform var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.wallet-pick-grid .pick-card:hover { border-color: var(--color-rule-strong); }
.wallet-pick-grid .pick-img { width: 100%; height: 80px; }
.wallet-pick-grid .pick-img img { max-height: 70px; max-width: 88px; }
.wallet-pick-grid .pick-name { width: 100%; min-height: 2.5em; color: var(--color-ink); font-size: 12.5px; line-height: 1.25; text-align: left; }
.wallet-pick-grid .pick-val { color: var(--color-ink-2); font-size: var(--text-xs); }
.wallet-pick-grid .pick-card.selected { border-color: var(--color-accent); background: var(--color-accent-soft); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.wallet-pick-grid .pick-card.selected::after { top: 8px; right: 8px; background: var(--color-accent); color: var(--color-accent-ink); }
.wallet-pick-grid .pick-card.is-locked { opacity: 0.5; }

.wallet-foot {
  grid-area: foot; display: grid; gap: 10px;
  padding: var(--space-md);
  border-top: 1px solid var(--color-rule); background: var(--color-paper-2);
}
.wallet-selected { display: grid; gap: 2px; min-width: 0; }
.wallet-selected > span { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.wallet-selected b { display: inline-flex; align-items: center; gap: 4px; color: var(--color-ink); font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.wallet-selected b .pcoin { width: 15px; height: 15px; }
.wallet-selected small { color: var(--color-muted); font-size: 10px; font-weight: 700; }
.wallet-foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wallet-foot-actions .btn { min-height: 42px; padding-inline: 10px; font-size: var(--text-sm); }

@media (max-width: 48rem) {
  .wallet-shell { display: flex; flex-direction: column; }
  .wallet-side {
    order: 0; flex: none; overflow: visible;
    gap: 10px; padding: 12px 14px;
    border-right: 0; border-bottom: 1px solid var(--color-rule);
  }
  .wallet-controls { gap: 8px; }
  .wallet-control-row { grid-template-columns: minmax(0, 1fr) auto; }
  .wallet-control-row .input, .wallet-control-row .btn { height: 40px; }
  .wallet-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .wallet-stat { display: grid; gap: 2px; padding: 7px 9px; min-width: 0; }
  .wallet-stat span { overflow: hidden; text-overflow: ellipsis; font-size: 8px; letter-spacing: 0.03em; white-space: nowrap; }
  .wallet-stat b { font-size: 13px; white-space: nowrap; }
  .wallet-stat b .pcoin { width: 11px; height: 11px; }
  .wallet-side-note { display: none; }
  .wallet-main { order: 1; flex: 1; }
  .wallet-main-head { padding: 10px 14px 8px; }
  .wallet-grid-wrap { padding: 0 14px 14px; }
  .wallet-pick-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .wallet-pick-grid .pick-card { min-height: 134px; padding: 8px; }
  .wallet-pick-grid .pick-img { height: 64px; }
  .wallet-pick-grid .pick-img img { max-height: 58px; }
  .wallet-pick-grid .pick-name { font-size: 11.5px; }
  .wallet-foot {
    order: 2; position: sticky; bottom: 0; z-index: 3;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-rule-strong);
    background: color-mix(in oklab, var(--color-paper-2) 94%, transparent);
    backdrop-filter: blur(14px);
  }
  .wallet-selected { flex: none; min-width: 0; }
  .wallet-selected small { display: none; }
  .wallet-selected b { font-size: var(--text-md); }
  .wallet-foot-actions { flex: 1; max-width: 300px; }
  .wallet-foot-actions .btn { min-height: 40px; padding-inline: 8px; font-size: 12px; }
}

@media (max-width: 48rem) {
  .wallet-foot { flex-direction: row; align-items: center; }
  .wallet-foot-actions { flex: 0 0 auto; display: flex; gap: 8px; max-width: none; }
  .wallet-foot-actions .btn { min-height: 40px; padding-inline: 12px; }
}
.admin-values-sort { flex: 0 1 160px; }

/* ---------- player profile popup ---------- */
.user-profile-card { gap: 14px; }
.user-profile-hero {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-rule); border-radius: 16px;
  background: var(--color-paper-2);
}
.user-profile-avatar {
  width: 76px; height: 76px;
  box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 4px var(--color-accent);
}
.user-profile-identity { min-width: 0; display: grid; gap: 3px; }
.user-profile-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.user-profile-name-line h3 { overflow-wrap: anywhere; font-size: var(--text-xl); line-height: 1.05; }
.user-profile-handle { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; overflow-wrap: anywhere; }
.user-profile-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-profile-streak {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 28px; padding: 4px 10px;
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-3); color: var(--color-ink);
}
.user-profile-streak-icon { font-size: 14px; line-height: 1; }
.user-profile-streak b { font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.user-profile-streak > span:not(.user-profile-streak-icon) { color: var(--color-muted); font-size: 10px; font-weight: 800; }
.user-profile-streak small { margin-left: 2px; padding-left: 7px; border-left: 1px solid var(--color-rule); color: var(--color-muted); font-size: 10px; font-weight: 700; }
.user-profile-titles { min-height: 0; gap: 6px; }
.user-profile-titles:empty { display: none; }
.user-profile-stats { gap: 8px; }
.user-profile-stats > div { padding: 12px 14px; border-radius: 12px; background: var(--color-paper-2); }
.user-profile-stats b { font-size: var(--text-lg); }
@media (max-width: 30rem) {
  .user-profile-hero { padding: 12px; gap: 12px; }
  .user-profile-avatar { width: 64px; height: 64px; }
  .user-profile-name-line h3 { font-size: var(--text-lg); }
  .user-profile-stats b { font-size: var(--text-md); }
}
.modal.profile-modal { max-width: 600px; }
@media (max-width: 48rem) {
  .modal.profile-modal { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
}

/* streak tiers: normal fire / purple flame / white crystal flame */
.flame-chip .flame-glyph { display: inline-block; line-height: 1; }
.flame-tier-1 { color: #ffb35c; border-color: rgba(255, 146, 55, .34); background: rgba(255, 111, 38, .12); }
.flame-tier-1 .flame-glyph { filter: saturate(1.15) brightness(1.05); }
.flame-tier-2 {
  color: #d9a6ff; border-color: rgba(190, 112, 255, .55); background: rgba(143, 63, 230, .18);
  box-shadow: inset 0 0 8px rgba(169, 92, 255, .22), 0 0 9px rgba(143, 63, 230, .2);
}
.flame-tier-2 .flame-glyph { filter: hue-rotate(252deg) saturate(1.9) brightness(1.12); }
.flame-tier-3 {
  color: var(--color-white); border-color: rgba(255, 255, 255, .72); background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 9px rgba(255, 255, 255, .32), 0 0 12px rgba(255, 255, 255, .28);
  animation: crystalChip 2.4s ease-in-out infinite;
}
.flame-tier-3 .flame-glyph { filter: grayscale(1) brightness(2.6) drop-shadow(0 0 3px rgba(255, 255, 255, .95)); animation: crystalGlyph 2.4s ease-in-out infinite; }
@keyframes crystalChip {
  50% { box-shadow: inset 0 0 11px rgba(255, 255, 255, .45), 0 0 18px rgba(255, 255, 255, .42); }
}
@keyframes crystalGlyph {
  50% { filter: grayscale(1) brightness(3.4) drop-shadow(0 0 8px rgba(255, 255, 255, 1)); transform: translateY(-1px) scale(1.05); }
}
/* 100+ wins: a moving rainbow chip */
.flame-tier-4 {
  color: #fff; border: 1px solid transparent;
  background:
    linear-gradient(var(--color-paper-3), var(--color-paper-3)) padding-box,
    linear-gradient(90deg, #ff4d4d, #ffb347, #ffe066, #4ade80, #38bdf8, #a855f7, #ff4fd8, #ff4d4d) border-box;
  background-size: 100% 100%, 150% 100%;
  background-position: 0 0, 0 0;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.2), 0 0 16px rgba(255, 79, 216, 0.55);
  animation: rainbowChip 4s linear infinite, rainbowGlow 2.4s ease-in-out infinite;
}
.flame-tier-4 .flame-num {
  color: transparent;
  background: linear-gradient(90deg, #ff4d4d, #ffb347, #ffe066, #4ade80, #38bdf8, #a855f7, #ff4fd8, #ff4d4d);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  animation: rainbowText 3s linear infinite;
  font-weight: 900;
}
.flame-tier-4 .flame-glyph { color: #fff; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.95)); }
@keyframes rainbowChip { to { background-position: 0 0, -150% 0; } }
@keyframes rainbowText { to { background-position: -200% center; } }
@keyframes rainbowGlow {
  0%, 100% { box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.2), 0 0 16px rgba(255, 79, 216, 0.55); }
  50% { box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.32), 0 0 24px rgba(56, 189, 248, 0.7); }
}

/* ---------- chat streak flame aura ---------- */
.chat-streak .chat-msg {
  position: relative; isolation: isolate; border-radius: 9px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--chat-fire-a) 6%, transparent), transparent 72%);
  box-shadow: 0 6px 18px -12px var(--chat-fire-glow);
}
.chat-streak .chat-msg::before {
  content: ""; position: absolute; z-index: -1;
  left: -3px; right: -3px; bottom: -6px; height: 82%;
  border-radius: 12px;
  background:
    radial-gradient(45% 80% at 12% 105%, var(--chat-fire-a), transparent 70%),
    radial-gradient(50% 90% at 38% 112%, var(--chat-fire-b), transparent 72%),
    radial-gradient(48% 85% at 64% 110%, var(--chat-fire-a), transparent 72%),
    radial-gradient(42% 75% at 90% 105%, var(--chat-fire-b), transparent 70%);
  filter: blur(9px) saturate(1.25);
  opacity: .75;
  transform-origin: 50% 100%;
  animation: chatFlameLick 1.8s ease-in-out infinite alternate;
  pointer-events: none;
}
.chat-streak .chat-msg::after {
  content: ""; position: absolute; z-index: -1;
  left: 4%; right: 4%; bottom: -9px; height: 50%;
  background:
    radial-gradient(18% 70% at 10% 100%, var(--chat-fire-b), transparent 70%),
    radial-gradient(16% 85% at 27% 100%, var(--chat-fire-a), transparent 74%),
    radial-gradient(20% 75% at 46% 100%, var(--chat-fire-b), transparent 72%),
    radial-gradient(17% 90% at 64% 100%, var(--chat-fire-a), transparent 74%),
    radial-gradient(18% 70% at 82% 100%, var(--chat-fire-b), transparent 72%);
  filter: blur(4px) saturate(1.35);
  opacity: .7;
  mix-blend-mode: screen;
  animation: chatFlameTongues 1.25s ease-in-out infinite;
  pointer-events: none;
}
.chat-streak .chat-msg > * { position: relative; z-index: 1; }
.chat-streak .chat-reply-action { z-index: 2; }
.chat-streak-1 {
  --chat-fire-a: rgba(255, 88, 0, .62);
  --chat-fire-b: rgba(255, 184, 64, .5);
  --chat-fire-glow: rgba(255, 88, 0, .24);
}
.chat-streak-2 {
  --chat-fire-a: rgba(157, 77, 255, .58);
  --chat-fire-b: rgba(224, 179, 255, .48);
  --chat-fire-glow: rgba(157, 77, 255, .28);
}
.chat-streak-2 .chat-msg::before,
.chat-streak-2 .chat-msg::after { animation-duration: 1.5s; }
.chat-streak-3 {
  --chat-fire-a: rgba(255, 255, 255, .62);
  --chat-fire-b: rgba(170, 225, 255, .52);
  --chat-fire-glow: rgba(255, 255, 255, .3);
}
.chat-streak-3 .chat-msg {
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), transparent 72%);
  animation: chatCrystalGlow 2.2s ease-in-out infinite;
}
.chat-streak-3 .chat-msg::before,
.chat-streak-3 .chat-msg::after { animation-duration: 1.15s; filter: blur(6px) saturate(1.4) brightness(1.25); }
@keyframes chatFlameLick {
  0% { transform: translateY(2px) scale(1, .94); opacity: .55; }
  45% { transform: translateY(-1px) skewX(2deg) scale(1.03, 1.08); opacity: .85; }
  100% { transform: translateY(-3px) skewX(-2deg) scale(.98, 1.04); opacity: .65; }
}
@keyframes chatFlameTongues {
  0%, 100% { transform: translateY(1px) scaleX(.98); opacity: .55; }
  35% { transform: translateY(-4px) scaleX(1.04); opacity: .85; }
  70% { transform: translateY(-2px) scaleX(.99); opacity: .7; }
}
@keyframes chatCrystalGlow {
  50% { box-shadow: 0 6px 22px -10px var(--chat-fire-glow), inset 0 0 14px rgba(255, 255, 255, .06); }
}

/* active-fire movement for chat streaks */
.chat-streak .chat-msg { animation: chatFlameBox 1.7s ease-in-out infinite; }
.chat-streak .chat-msg::before {
  mix-blend-mode: screen;
  animation: chatFireDance 0.9s ease-in-out infinite alternate;
  will-change: transform, opacity, filter;
}
.chat-streak .chat-msg::after {
  animation: chatFireTongues 0.65s ease-in-out infinite;
  will-change: transform, opacity;
}
.chat-streak-2 .chat-msg::before { animation-duration: .78s; }
.chat-streak-2 .chat-msg::after { animation-duration: .55s; }
.chat-streak-3 .chat-msg::before { animation-duration: .6s; }
.chat-streak-3 .chat-msg::after { animation-duration: .42s; }
@keyframes chatFlameBox {
  50% { box-shadow: 0 10px 26px -10px var(--chat-fire-glow); }
}
@keyframes chatFireDance {
  0% { transform: translateY(2px) scale(1, .93) skewX(0); opacity: .52; filter: blur(8px) saturate(1.35) brightness(1.05); }
  35% { transform: translateY(-5px) scale(1.05, 1.14) skewX(4deg); opacity: .96; filter: blur(7px) saturate(1.8) brightness(1.28); }
  70% { transform: translateY(-2px) scale(.98, 1.03) skewX(-3deg); opacity: .72; filter: blur(8px) saturate(1.5) brightness(1.12); }
  100% { transform: translateY(-7px) scale(1.02, 1.09) skewX(2deg); opacity: .5; filter: blur(9px) saturate(1.3) brightness(1); }
}
@keyframes chatFireTongues {
  0% { transform: translateY(1px) scale(.96, .9); opacity: .45; }
  30% { transform: translateY(-6px) scale(1.06, 1.16) skewX(3deg); opacity: .95; }
  60% { transform: translateY(-2px) scale(.99, 1.04) skewX(-4deg); opacity: .7; }
  100% { transform: translateY(-8px) scale(1.03, 1.1) skewX(1deg); opacity: .4; }
}

/* ---------- Games dropdown ---------- */
.nav-games { position: relative; display: flex; align-items: stretch; }
.nav-games-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border: 0; background: none;
  color: var(--color-muted); font-family: inherit; font-size: 12px; font-weight: 800;
  white-space: nowrap; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.nav-games-btn:hover { color: var(--color-ink); }
.nav-games-btn.active { color: var(--color-ink); }
.nav-games-btn::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--color-accent);
  opacity: 0; transform: scaleX(.5);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.nav-games-btn.active::after { opacity: 1; transform: none; }
.games-chevron { opacity: .7; transition: transform var(--dur-micro) var(--ease-out); }
.nav-games-btn[aria-expanded="true"] .games-chevron { transform: rotate(180deg); }
.games-menu {
  position: absolute; top: calc(100% + 8px); left: 8px; z-index: calc(var(--z-sticky-nav) + 2);
  min-width: 214px; padding: 6px;
  border: 1px solid var(--color-rule-strong); border-radius: 12px;
  background: var(--color-paper-2); box-shadow: var(--shadow-pop);
}
.games-menu[hidden] { display: none; }
.games-menu a {
  display: flex; align-items: center; gap: 10px; min-height: 46px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--color-ink); font-size: var(--text-sm); font-weight: 700;
  text-decoration: none;
}
.games-menu a::after { display: none; }
.games-menu a:hover { background: var(--color-paper-3); }
.games-menu a.active { background: var(--color-accent-soft); color: var(--color-accent-text); }
.games-menu small { margin-left: auto; color: var(--color-muted); font-size: 10px; font-weight: 600; }
.mobile-games-menu {
  position: fixed; left: var(--space-md); right: var(--space-md); top: auto;
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: var(--z-sticky-nav);
  width: auto; min-width: 0;
}
@media (max-width: 56rem) {
  .nav-games { display: none; }
}
@media (max-width: 48rem) {
  .mobile-nav .mobile-games { font: inherit; }
}

/* bet notification badge */
.bet-badge {
  position: absolute; z-index: 2; top: 2px; right: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; background: #ff2f92; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 2px var(--color-paper-2);
  pointer-events: none;
}
.bet-badge[hidden] { display: none; }
.mobile-nav .mobile-games .bet-badge { top: 2px; right: calc(50% - 24px); }
.mobile-nav .mobile-games { position: relative; }
.games-menu-title { display: block; padding: 7px 10px 5px; color: var(--color-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mobile-games-menu .games-menu-title { padding-top: 4px; }

/* ---------- chat giveaways ---------- */
.chat-input-wrap input { padding-right: 74px; }
.chat-gift {
  position: absolute; right: calc(var(--space-2xs) + 34px); top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted);
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.chat-gift:hover { color: var(--color-accent-text); background: var(--color-paper-4); }
.chat-gift:active { color: var(--color-accent-text); }
.chat-gift:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; }
.giveaway-tray {
  flex: none; display: flex; flex-direction: column; gap: var(--space-xs);
  max-height: 232px; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--space-sm) var(--space-md) 0;
}
.giveaway-tray[hidden] { display: none; }
.gw-card {
  display: grid; gap: 8px; padding: 10px;
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md);
  background: var(--color-paper-3);
}
.gw-card.is-done { opacity: .82; }
.gw-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gw-head .ravatar { width: 32px; height: 32px; flex: none; }
.gw-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gw-who b { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-who span { color: var(--color-muted); font-size: 10px; font-weight: 600; }
.gw-who time { color: var(--color-accent-text); font-variant-numeric: tabular-nums; font-weight: 800; }
.gw-count { margin-left: auto; flex: none; color: var(--color-muted); font-size: 10px; font-weight: 700; }
.gw-items { display: flex; flex-wrap: wrap; gap: 5px; }
.gw-item {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 7px 3px 4px; border-radius: 999px;
  background: var(--color-paper-4); color: var(--color-ink-2);
  font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gw-item img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.gw-item span { overflow: hidden; text-overflow: ellipsis; }
.gw-more { padding: 3px 8px; color: var(--color-muted); }
.gw-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gw-requirement { color: var(--color-muted); font-size: 10px; font-weight: 700; }
.gw-value { color: var(--color-ink); font-size: 11px; font-weight: 800; }
.gw-btn { min-height: 30px; padding: 0 12px; font-size: 11px; }
.gw-winner { color: var(--color-ink); font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-winner.muted { color: var(--color-muted); font-weight: 600; }

/* giveaway modal */
.modal.giveaway-modal {
  width: min(620px, 100%); max-width: 620px;
  max-height: 90vh;
}
.modal.giveaway-modal .modal-head {
  flex: none; position: relative; z-index: 3;
  background: var(--color-paper-2);
}
.gw-title { display: grid; gap: 2px; }
.gw-eyebrow {
  color: var(--color-accent-text); font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.gw-modal-body {
  display: flex; flex-direction: column; gap: 16px;
  min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: 16px 20px 20px; overscroll-behavior: contain;
}
.gw-modal-body::-webkit-scrollbar { width: 8px; }
.gw-modal-body::-webkit-scrollbar-track { background: transparent; }
.gw-modal-body::-webkit-scrollbar-thumb {
  background: var(--color-rule-strong); border-radius: 999px;
  border: 2px solid var(--color-paper-2);
}
.gw-modal-body { scrollbar-width: thin; scrollbar-color: var(--color-rule-strong) transparent; }
.gw-lead { margin: 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
.gw-field { display: grid; gap: 8px; }
.gw-help { margin: 0; color: var(--color-muted); font-size: 11px; line-height: 1.45; }
.gw-picker-shell { display: flex; flex-direction: column; gap: 8px; flex: none; }
.gw-picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 2;
  padding: 2px 0 6px; background: var(--color-paper-2);
}
.gw-picker-head .field-label { margin: 0; }
.gw-picker-head small { color: var(--color-muted); font-size: 10px; font-weight: 700; }
.gw-picker {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; height: clamp(280px, 42vh, 360px); min-height: 280px;
  grid-auto-rows: max-content;
  align-content: start; overflow-y: auto; overflow-x: hidden;
  padding: 2px 6px 4px 2px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--color-rule-strong) transparent;
}
.gw-picker::-webkit-scrollbar { width: 8px; }
.gw-picker::-webkit-scrollbar-track { background: transparent; }
.gw-picker::-webkit-scrollbar-thumb {
  background: var(--color-rule-strong); border-radius: 999px;
  border: 2px solid var(--color-paper-2);
}
.gw-pick {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-width: 0; min-height: 0; padding: 8px; cursor: pointer;
  border: 2px solid transparent; border-radius: 12px;
  background: var(--color-paper-3); color: var(--color-ink); text-align: left;
  transition: border-color var(--dur-micro) var(--ease-out),
    background-color var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}
.gw-pick:hover { border-color: var(--color-rule-strong); transform: translateY(-1px); }
.gw-pick:active { transform: translateY(0); }
.gw-pick:focus-visible {
  outline: 2px solid var(--color-focus); outline-offset: 2px;
}
.gw-pick-img {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1;
  flex: none; padding: 8px; border-radius: 8px; background: var(--color-paper-2);
}
.gw-pick-img img {
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
}
.gw-pick-copy { display: grid; gap: 1px; min-width: 0; }
.gw-pick-copy b {
  font-size: 11px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gw-pick-copy small {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--color-muted); font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.gw-check {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--color-rule-strong);
  background: var(--color-paper-2); color: transparent;
  font-size: 12px; font-weight: 900; line-height: 1;
  transition: background-color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.gw-pick.selected {
  border-color: var(--color-accent); background: var(--color-accent-soft);
  box-shadow: 0 0 0 1px var(--color-accent), 0 0 18px var(--color-accent-soft);
}
.gw-pick.selected .gw-check {
  border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink);
}
.gw-pick.selected .gw-check::after { content: "✓"; }
.gw-empty {
  grid-column: 1 / -1; display: grid; place-items: center; gap: 4px;
  min-height: 180px; color: var(--color-muted); font-size: 12px; font-weight: 700;
  border: 1px dashed var(--color-rule); border-radius: 12px;
}
.gw-skeleton {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.gw-skeleton-card {
  aspect-ratio: .76; border-radius: 12px;
  background: linear-gradient(100deg, var(--color-paper-3) 20%, var(--color-paper-4) 40%, var(--color-paper-3) 60%);
  background-size: 220% 100%; animation: gw-shimmer 1.2s linear infinite;
}
@keyframes gw-shimmer { to { background-position: -220% 0; } }
.gw-money-field {
  display: flex; align-items: center; gap: 8px; min-height: 46px;
  padding: 0 12px; border: 1px solid var(--color-rule); border-radius: 12px;
  background: var(--color-paper-3);
  transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.gw-money-field:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.gw-money-icon { display: inline-flex; flex: none; opacity: .9; }
.gw-money-field .input {
  flex: 1; min-width: 0; height: 44px; padding: 0;
  border: 0; background: transparent; box-shadow: none;
  font-size: var(--text-md); font-weight: 800;
}
.gw-money-field .input:focus { outline: 0; box-shadow: none; }
.gw-durations {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  padding: 4px; border: 1px solid var(--color-rule); border-radius: 12px;
  background: var(--color-paper-3);
}
.gw-duration {
  min-width: 0; padding: 9px 4px; border: 0; border-radius: 8px;
  background: transparent; color: var(--color-muted);
  font-family: inherit; font-size: 11px; font-weight: 800; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.gw-duration:hover { color: var(--color-ink); }
.gw-duration:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.gw-duration.active {
  background: var(--color-accent); color: var(--color-accent-ink);
}
.gw-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; border: 1px solid var(--color-rule); border-radius: 12px;
  background: var(--color-paper-3);
}
.gw-summary span { display: grid; gap: 1px; color: var(--color-muted); font-size: 11px; font-weight: 700; }
.gw-summary span small { color: var(--color-muted); font-size: 10px; font-weight: 700; }
.gw-summary b { display: inline-flex; align-items: center; gap: 4px; color: var(--color-ink); font-size: 15px; font-weight: 800; }
.gw-lock-check {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid var(--color-rule); border-radius: 12px;
  background: var(--color-paper-3); color: var(--color-muted);
  font-size: 11px; line-height: 1.5; cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.gw-lock-check:hover { border-color: var(--color-rule-strong); }
.gw-lock-check:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.gw-lock-check:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.gw-lock-check input { margin: 2px 0 0; flex: none; accent-color: var(--color-accent); }
.gw-lock-check b { color: var(--color-ink); font-weight: 800; }
.gw-captcha {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 74px; padding: 2px 0; overflow: hidden;
}
.gw-captcha .hcaptcha-slot { display: flex; justify-content: center; width: 100%; max-width: 100%; min-height: 0; }
.gw-captcha .hcaptcha-slot iframe { max-width: 100% !important; }
.gw-captcha .captcha-note { margin: 0; text-align: center; }
.gw-foot { justify-content: flex-end; padding: 0; border-top: 0; }
.gw-submit { min-height: 46px; padding-inline: 24px; }
.gw-submit:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 520px) { .gw-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 720px) { .gw-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 30rem) {
  .gw-modal-body { padding: 12px 16px 16px; }
  .gw-picker { height: min(45vh, 340px); min-height: 260px; }
  .gw-submit { width: 100%; }
  .gw-foot { justify-content: stretch; }
  .giveaway-tray { max-height: 190px; }
}
/* ---------- partner placements ---------- */
.partners-strip {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: var(--space-sm) var(--space-xl) 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs);
}
.partners-strip[hidden] { display: none; }
.partners-label { color: var(--color-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.partner-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px;
  padding: 3px 10px 3px 4px; border: 1px solid var(--color-rule); border-radius: 999px;
  background: var(--color-paper-2); color: var(--color-ink-2);
  font-size: 11px; font-weight: 700; text-decoration: none;
}
.partner-chip:hover { border-color: var(--color-rule-strong); color: var(--color-ink); }
.partner-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.partner-chip:not(:has(img)) { padding-left: 10px; }
.partner-spot {
  display: flex; align-items: center; gap: var(--space-md);
  margin: 0 0 var(--space-sm); padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--color-paper-3), var(--color-paper-2));
}
.partner-spot-logo { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.partner-spot-mark {
  width: 46px; height: 46px; display: grid; place-items: center; flex: none;
  border-radius: 10px; background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: 18px; font-weight: 800;
}
.partner-spot-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.partner-spot-copy > span { color: var(--color-accent-text); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.partner-spot-copy b { font-size: var(--text-md); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partner-spot-copy small { color: var(--color-muted); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partner-spot-btn { margin-left: auto; flex: none; min-height: 34px; padding: 0 14px; font-size: 11px; }
.partner-logos { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-sm) 0 var(--space-lg); }
.partner-logo-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border: 1px solid var(--color-rule); border-radius: 999px;
  background: var(--color-paper-2); color: var(--color-ink); font-size: 12px; font-weight: 700; text-decoration: none;
}
.partner-logo-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
@media (max-width: 48rem) {
  .partners-strip { padding: var(--space-sm) var(--space-md) 0; }
  .partner-spot { align-items: flex-start; flex-wrap: wrap; }
  .partner-spot-btn { margin-left: 0; width: 100%; }
  .partner-spot-copy small { white-space: normal; }
}

/* admin partners */
.admin-partner-form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md);
  align-items: end;
}
.admin-partner-wide { grid-column: span 2; }
.admin-partner-check { min-height: 40px; }
.admin-partner-create { display: flex; align-items: end; }
.admin-partner-create .btn { width: 100%; }
.admin-partner-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  gap: var(--space-sm) var(--space-md); align-items: center;
  padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule);
}
.admin-partner-row:last-child { border-bottom: 0; }
.admin-partner-id { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.admin-partner-logo { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; }
.admin-partner-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 68.75rem) {
  .admin-partner-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-partner-row { grid-template-columns: minmax(0, 1fr); }
  .admin-partner-actions { justify-content: flex-start; }
}
@media (max-width: 40rem) {
  .admin-partner-form { grid-template-columns: minmax(0, 1fr); }
  .admin-partner-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-name.title-all_in .chat-username, .chat-name.title-all_in .chat-title-emoji,
  .earned-title.title-all_in, .all-in-name, .all-in-name-emoji { animation: none; }
}

/* ---------- profile v2 ---------- */
.profile-page.profile-v2 {
  --page: var(--color-paper);
  --card: var(--color-paper-2);
  --stripe: var(--color-paper-3);
  --border: var(--color-rule);
  --text: var(--color-ink);
  --muted: var(--color-muted);
  --muted-dim: color-mix(in oklab, var(--color-muted) 78%, var(--color-paper));
  --accent: var(--color-accent);
  --rank: var(--color-accent-text);
  width: 100%; max-width: 1045px; margin: 0 auto;
  display: grid; gap: 24px; padding: 0;
  background: var(--page); color: var(--text);
  border: 0; border-radius: 0;
}
.profile-v2 *, .profile-v2 *::before, .profile-v2 *::after { box-sizing: border-box; }

.profile-v2 .pf-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.profile-v2 .pf-left { display: flex; align-items: center; gap: 32px; min-width: 0; }
.profile-v2 .pf-avatar {
  width: 144px; height: 144px; flex: none; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--page);
  box-shadow: none; object-fit: cover;
}
.profile-v2 .pf-identity {
  min-width: 0; display: flex; flex-direction: column; gap: 6px;
  line-height: 1.5; padding-bottom: 24px;
}
.profile-v2 .pf-identity h1 {
  margin: 0; color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.5;
  letter-spacing: 0;
}
.profile-v2 .pf-rankline {
  display: flex; align-items: center; gap: 6px;
  color: var(--rank); font-size: 16px; font-weight: 500; line-height: 1.5;
}
.profile-v2 .pf-rank { color: var(--rank); }
.profile-v2 .pf-title-emoji {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  font-size: 18px; line-height: 1;
}
.profile-v2 .pf-discord {
  height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 16px;
  border: 1px solid var(--accent); border-radius: 6px;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  cursor: pointer;
}
.profile-v2 .pf-discord svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.profile-v2 .pf-discord:hover { background: color-mix(in oklab, var(--color-accent) 20%, transparent); }
.profile-v2 .pf-discord:disabled { opacity: .55; cursor: not-allowed; }
.profile-v2 .pf-discord:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.profile-v2 .pf-referral {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 4px;
}
.profile-v2 .pf-referral > div { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.profile-v2 .pf-referral > div > b { color: var(--text); font-weight: 600; }
.profile-v2 .pf-referral-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.profile-v2 .pf-referral-item img { width: 28px; height: 28px; object-fit: contain; }
.profile-v2 .pf-referral-item b { font-weight: 600; }
.profile-v2 .pf-referral .pf-discord { height: 40px; }

.profile-v2 .pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.profile-v2 .pf-stat {
  height: 86px; min-width: 0; padding: 16px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
}
.profile-v2 .pf-stat-value {
  display: flex; align-items: center; gap: 6px;
  color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.profile-v2 .pf-stat-value b { font-weight: 700; overflow-wrap: anywhere; }
.profile-v2 .pf-stat-value .pcoin { width: 21px; height: 16px; flex: none; object-fit: contain; }
.profile-v2 .pf-stat > span { display: block; margin: 0; color: var(--muted); font-size: 16px; font-weight: 500; line-height: 1.5; }

.profile-v2 .pf-history {
  background: var(--card); border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.profile-v2 .pf-table-wrap { overflow-x: auto; }
.profile-v2 .pf-table { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; }
.profile-v2 .pf-table th {
  height: 48px; padding: 0 0 0 16px; text-align: left; vertical-align: middle;
  background: var(--card); color: var(--muted-dim);
  font-size: 14px; font-weight: 500; border: 0;
}
.profile-v2 .pf-table td {
  height: 52px; padding: 0 0 0 16px; vertical-align: middle;
  color: var(--text); font-size: 14px; border: 0;
}
.profile-v2 .pf-table th:nth-child(1) { width: 18.9%; }
.profile-v2 .pf-table th:nth-child(2) { width: 37.5%; }
.profile-v2 .pf-table th:nth-child(3) { width: 28.5%; }
.profile-v2 .pf-table th:nth-child(4) { width: 15.1%; }
.profile-v2 .pf-table tbody tr:nth-child(odd) { background: var(--stripe); }
.profile-v2 .pf-table tbody tr:nth-child(even) { background: transparent; }
.profile-v2 .pf-type { font-weight: 600; color: var(--text); }
.profile-v2 .pf-id { font-weight: 400; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-v2 .pf-date { font-weight: 400; color: var(--text); white-space: nowrap; }
.profile-v2 .pf-amount {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums;
}
.profile-v2 .pf-amount .pcoin { width: 18px; height: 14px; flex: none; object-fit: contain; }
.profile-v2 .pf-amount.pos { color: var(--color-win); }
.profile-v2 .pf-amount.neg, .profile-v2 .pf-amount.zero { color: var(--muted); }
.profile-v2 .pf-empty { padding: 26px 16px; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .profile-page.profile-v2 { gap: 24px; padding: 0 16px; }
  .profile-v2 .pf-header { gap: 16px; }
  .profile-v2 .pf-left { gap: 16px; }
  .profile-v2 .pf-avatar { width: 96px; height: 96px; }
  .profile-v2 .pf-identity { padding-bottom: 0; }
  .profile-v2 .pf-stats { grid-template-columns: 1fr; gap: 16px; }
  .profile-v2 .pf-stat { height: 86px; }
}

/* ---------- bot joiner / inventory scan ---------- */
.dep-modal-body { width: 100%; }
.bj-window { width: 100%; max-width: 680px; margin: 0 auto; display: grid; gap: 20px; }
.bj-scan { display: grid; gap: 20px; }
.bj-timer { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--color-muted); font-size: 14px; font-weight: 500; }
.bj-timer b { color: var(--color-ink); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bj-bot { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--color-paper-3); border: 1px solid var(--color-rule); border-radius: 10px; }
.bj-bot .ravatar { width: 56px; height: 56px; flex: none; }
.bj-bot-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.bj-bot-copy b { color: var(--color-ink); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.bj-bot-copy span { color: var(--color-muted); font-size: 14px; font-weight: 400; }
.bj-profile {
  flex: none; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; border: 1px solid var(--color-accent); border-radius: 6px;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.bj-profile:hover { background: color-mix(in oklab, var(--color-accent) 22%, transparent); }
.bj-profile:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bj-actions.is-single { grid-template-columns: 1fr; }
.bj-button {
  min-width: 0; height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1; text-decoration: none;
  cursor: pointer;
}
.bj-button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.bj-button-icon { display: inline-flex; flex: none; }
.bj-join { background: var(--color-accent); color: var(--color-accent-ink); }
.bj-join:hover { background: var(--color-accent-deep); }
.bj-add { background: var(--color-paper-3); border-color: var(--color-rule); color: var(--color-ink); }
.bj-add:hover { background: var(--color-paper-4); }
.bj-added { background: var(--color-accent); color: var(--color-accent-ink); }
.bj-added:hover { background: var(--color-accent-deep); }
.bj-added:disabled { opacity: .6; cursor: wait; }
.bj-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 8px; border-radius: 6px;
  background: rgba(0, 0, 0, .22); color: currentColor;
  font-size: 12px; font-weight: 600;
}
.bj-add .bj-badge { background: var(--color-paper-2); color: var(--color-muted); }
.bj-error {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; align-items: start;
  gap: 14px; padding: 16px; padding-bottom: 22px; overflow: hidden;
  background: var(--color-loss-soft); border: 1px solid var(--color-loss); border-radius: 10px;
}
.bj-error[hidden] { display: none; }
.bj-error-mark {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px;
  background: rgba(0, 0, 0, .18); color: var(--color-loss); font-size: 20px; font-weight: 600;
}
.bj-error-copy { min-width: 0; display: grid; gap: 4px; }
.bj-error-copy b { color: var(--color-ink); font-size: 18px; font-weight: 600; }
.bj-error-copy span { color: var(--color-ink-2); font-size: 14px; font-weight: 400; line-height: 1.45; }
.bj-error-close {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--color-muted); cursor: pointer;
}
.bj-error-close:hover { background: rgba(0, 0, 0, .18); color: var(--color-ink); }
.bj-error-close:focus-visible { outline: 2px solid var(--color-loss); outline-offset: 2px; }
.bj-error-bar { position: absolute; left: 0; bottom: 0; width: 55%; height: 3px; background: var(--color-loss); }
.bj-hidden { display: none; }
.bj-foot { display: flex; justify-content: center; }
.bj-cancel { padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--color-muted); font-family: inherit; font-size: 14px; cursor: pointer; }
.bj-cancel:hover { color: var(--color-ink); background: var(--color-paper-3); }
.bj-cancel:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (max-width: 560px) {
  .bj-actions { grid-template-columns: 1fr; }
  .bj-bot { flex-wrap: wrap; }
  .bj-profile { margin-left: 70px; }
  .bj-error { grid-template-columns: 36px minmax(0, 1fr) 32px; gap: 10px; }
  .bj-error-mark { width: 36px; height: 36px; }
}
