/* ==========================================================================
   MM2ROLL — shell stylesheet (design per docs/frame-*.png, tokens per §5)
   ========================================================================== */

/* ==========================================================================
   v66 SELF-HOSTED FONTS (public/fonts/*.woff2) — no external font CDN.
   Inter = body/UI · Chakra Petch = display/headings/hero numbers ·
   JetBrains Mono = wallet addresses / provably-fair hashes. font-display:swap.
   ========================================================================== */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:swap; src:url('/fonts/inter-800.woff2') format('woff2'); }
@font-face { font-family:'Chakra Petch'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/chakra-600.woff2') format('woff2'); }
@font-face { font-family:'Chakra Petch'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/chakra-700.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/jbmono-500.woff2') format('woff2'); }

/* display / heading helper — Chakra Petch, used for page titles, modal h2s,
   hero numbers & section heads (applied to concrete selectors in the restyle
   block at the foot of this file). */
:root { --font-display: 'Chakra Petch', 'Inter', system-ui, sans-serif; }

:root {
  /* ===== RESTORED Aug-9 palette (older system): blue identity + BLUE money
     buttons + soft green + gold + red on near-black. v66 token NAMES kept &
     remapped so the whole var()-driven sheet reverts at once (no undefined vars). ===== */

  /* surfaces */
  --bg: #05070f;
  --bg-2: #070b16;
  --panel: #0c1120;
  --panel-2: #0e1428;
  --bubble: #121a2e;
  --surface-hover: #141b30;
  --line: #1a2138;
  --hairline: rgba(255, 255, 255, .04);

  /* ACTION / MONEY — Aug-9 money buttons were BLUE (not green) */
  --accent: #2f7bf6;
  --accent-bright: #4c9aff;
  --accent-deep: #1e5fd0;
  --accent-glow: rgba(47, 123, 246, .5);
  --accent-ink: #ffffff;
  --green: #35c46f;
  --green-glow: rgba(53, 196, 111, .5);

  /* BRAND / IDENTITY / HEADS — blue */
  --violet: #2f7bf6;
  --violet-bright: #4c9aff;
  --violet-deep: #2563eb;
  --violet-glow: rgba(47, 123, 246, .5);
  --blue: #2f7bf6;
  --blue-2: #2563eb;
  --blue-text: #4c9aff;

  /* CURRENCY — gold */
  --gold: #f0a21d;
  --gold-2: #ffb020;
  --gold-deep: #d88a0e;
  --gold-bright: #ffb020;
  --gold-glow: rgba(240, 162, 29, .5);

  /* LOSS / DANGER — red */
  --red: #e14b4b;
  --red-deep: #b3232b;
  --red-glow: rgba(225, 75, 75, .5);

  /* info / provably-fair */
  --cyan: #22d3ee;

  /* text */
  --text: #ffffff;
  --muted: #828ca6;
  --muted-2: #5c6584;

  --r-panel: 12px;
  --r-row: 10px;
  --r-btn: 8px;
  --r-chip: 6px;

  /* tier tints — Aug-9 rarity ramp */
  --tier-chroma: #ff4fd8;
  --tier-ancient: #ff3b3b;
  --tier-godly: #ffb020;
  --tier-legendary: #c084fc;
  --tier-rare: #4c9aff;
  --tier-uncommon: #35c46f;
  --tier-common: #8a93b0;
  --tier-vintage: #f97316;
  --tier-unique: #22d3ee;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(34, 222, 121, .38); color: #fff; }

[hidden] { display: none !important; }

img { max-width: 100%; }

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

input {
  font-family: inherit;
  color: var(--text);
}

code { font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; }

/* thin dark scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2440; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #273154; }
* { scrollbar-width: thin; scrollbar-color: #1c2440 transparent; }

/* generic icon sizing */
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }
.rc  { width: 26px; height: 26px; flex: none; }        /* round coin svg */
.dec { font-style: normal; opacity: .55; }             /* dimmed decimals */

/* ==========================================================================
   APP GRID  —  topbar / (chat | subnav+main | sidenav)
   ========================================================================== */

#app {
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr) 250px;
  /* v-next: the subnav row is gone — its links/socials merged into the top bar,
     so the layout is just [top bar] over [main | sidenav]. */
  grid-template-rows: 88px minmax(0, 1fr);
  height: 100vh;
}

/* v-next: the top bar sits over the MAIN column only; BOTH side rails (chat left,
   sidenav right) run FULL height, flush to the very top — symmetric. */
.topbar  { grid-area: 1 / 2 / 2 / 3; }
#chat    { grid-area: 1 / 1 / 3 / 2; }   /* FULL height (banner flush at the very top) */
#main    { grid-area: 2 / 2 / 3 / 3; overflow-y: auto; }
#sidenav { grid-area: 1 / 3 / 3 / 4; overflow-y: auto; }   /* FULL height, like the chat */

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--r-btn);
  color: #fff;
  transition: filter .15s, transform .08s, box-shadow .15s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(1.13); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
/* v-next: a LOCKED join button (stake not within ±5%) — reads red, not just dim */
.btn.is-locked {
  background: linear-gradient(180deg, #3a2230, #291720) !important;
  color: #ff9a9a !important;
  box-shadow: inset 0 0 0 1px rgba(240, 69, 74, .4) !important;
  opacity: 1;
  cursor: not-allowed;
}

/* v66: the MONEY button — acid-green gradient, inset top-highlight, drop glow.
   Class name stays .btn--blue (app.js/server.js reference it) though it is green. */
.btn--blue {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25),
              0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
              0 6px 18px -4px var(--accent-glow);
}
.btn--gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: #1a1206;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28),
              0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent),
              0 6px 18px -4px var(--gold-glow);
}
.btn--ghost {
  background: var(--bubble);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover { color: var(--text); filter: none; background: var(--surface-hover); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 40%, var(--line)); }
.btn--fair {
  background: color-mix(in srgb, var(--cyan) 14%, var(--bubble));
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 34%, transparent);
  font-size: 12px;
  padding: 9px 16px;
}
.btn--fair:hover { color: #bff4ff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 55%, transparent), 0 0 16px -3px rgba(34, 211, 238, .5); }
.btn--sm   { padding: 6px 20px; font-size: 12px; }
.btn--caps { text-transform: uppercase; letter-spacing: .04em; }

/* ===== Admin-toggled neon BUTTON GLOW (html.glow-btns) — the colour follows
   each button's own accent. Off by default; flipped from Admin → Settings. ===== */
html.glow-btns .btn        { box-shadow: 0 0 16px 1px var(--violet-glow); transition: box-shadow .18s ease, filter .18s ease; }
html.glow-btns .btn--blue,
html.glow-btns .btn--green,
html.glow-btns .btn--wallet{ box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 18px 1px var(--accent-glow); }
html.glow-btns .btn--gold  { box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 0 18px 1px var(--gold-glow); }
html.glow-btns .btn--bot   { box-shadow: 0 0 18px 1px var(--violet-glow); }
html.glow-btns .btn--rblx  { box-shadow: 0 0 16px 1px rgba(226, 35, 26, .50); }
html.glow-btns .btn--fair  { box-shadow: 0 0 16px 1px rgba(34, 211, 238, .55); }
html.glow-btns .btn--ghost { box-shadow: inset 0 0 0 1px var(--line), 0 0 12px 1px rgba(139, 149, 178, .28); }
html.glow-btns .btn:hover  { filter: brightness(1.06); }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-btn);
  background: var(--bubble);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color .15s, background .15s, transform .08s;
  flex: none;
}
.icon-btn:hover  { color: var(--text); background: #1a2440; }
.icon-btn:active { transform: scale(.94); }

/* subtle keyboard focus — acid-green accent ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* small round-coin filter buttons */
.coin-filter {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: transform .12s, filter .15s;
  opacity: .95;
}
.coin-filter .rc { width: 40px; height: 40px; }
.coin-filter:hover { transform: translateY(-1px); filter: brightness(1.15); }
.coin-filter:active { transform: scale(.94); }
.coin-filter[aria-pressed="true"] { filter: drop-shadow(0 0 10px var(--violet-glow)) drop-shadow(0 0 4px var(--violet)); }
#filter-t[aria-pressed="true"]   { filter: drop-shadow(0 0 10px rgba(255, 176, 32, .85)); }

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  /* v-next: the bar spans the MAIN column only now (sidenav is its own full-height
     rail), so its content lines up with the row bubbles below with a simple inset
     equal to the row padding — left edge at the Coinflip coin, right edge where
     the bubbles end. */
  padding-left: 20px;
  padding-right: 34px;
  z-index: 20;
  position: relative;
}
/* v9.9 three action zones: [brand][left: deposit+withdraw] · center chip · [right: wallet][user] */
#brand { flex: none; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar__left { margin-left: 0; }   /* v-next: alignment handled by .topbar padding-left */

#brand, .login-brand {
  font-style: italic;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -.5px;
  user-select: none;
  white-space: nowrap;
}
#brand { padding-left: 20px; display: flex; align-items: center; }
/* v9.6: image wordmark replaces the text brand (transparent PNG, 1342×443). */
.brand-logo { height: 36px; width: auto; display: block; }
.brand-logo--login { height: 64px; width: auto; display: block; margin: 0 auto 8px; }
.brand-mm2 { color: #fff; }
.brand-roll {
  background: linear-gradient(105deg, #8fbaff 0%, var(--blue) 45%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 6px; /* keep italic overhang visible */
}

.topbar__center {
  flex: 1 1 auto;        /* v9.9: grows to fill the middle so the chip stays centered */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;          /* v5: allow the chips to shrink instead of overflowing */
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 0 8px;
}
.topbar__center > * { min-width: 0; }
.topbar__center .btn { flex: none; white-space: nowrap; }

/* v6: the ONLY navbar value — total $ of the items you own (no spendable balance) */
.balance-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 11px 16px;
  font-weight: 800;
  font-size: 14px;
  min-width: 0;          /* v5: shrink, never wrap/overlap */
  overflow: hidden;
}
#balance-usd { white-space: nowrap; color: #fff; font-size: 14px; font-weight: 800; }
.balance-chip .ico--inv { width: 17px; height: 17px; color: var(--muted); }
.balance-chip__label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.me-text { text-align: right; line-height: 1.25; }
#me-name  { display: block; font-weight: 800; font-size: 13px; }
#me-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--red);
  object-fit: cover;
  background: var(--bubble);
}
.notif-dot {
  position: absolute;
  right: 7px; bottom: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
/* v-next: the bell dot shows ONLY when there is a notification (an in-progress
   deposit/withdraw); the dropdown lists them with a Continue action. */
.notif-dot { display: none; }
#notif-btn.has-notif .notif-dot { display: block; }
.tb-notif { position: relative; flex: none; }
.tb-menu--notif { right: 0; min-width: 320px; max-width: min(360px, calc(100vw - 24px)); }
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-empty { padding: 12px 10px; color: var(--muted, #8a93ad); font-size: 13px; text-align: center; }
.notif-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--panel, #101a30); border: 1px solid var(--line, #223a5e); }
.notif-item__ico { flex: none; font-size: 18px; line-height: 1; }
.notif-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item__title { font-size: 13px; font-weight: 800; }
.notif-item__sub { font-size: 11.5px; color: var(--muted, #8a93ad); }
.notif-item__btn { flex: none; background: var(--blue, #2f7bf6); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 800; font-size: 12px; cursor: pointer; }
.notif-item__btn:hover { filter: brightness(1.08); }
/* the resume bar's hide (✕) button */
.pending-bar__hide { flex: none; width: 26px; height: 26px; border-radius: 7px; background: transparent; border: 1px solid var(--line, #223a5e); color: var(--muted, #8a93ad); font-size: 13px; line-height: 1; cursor: pointer; }
.pending-bar__hide:hover { color: #fff; border-color: var(--muted, #8a93ad); }

/* ==========================================================================
   TOPBAR v10 REDESIGN — clean crypto-casino bar (adapted, no Games/Rewards)
   LEFT: logo + Home · CENTER: balance pill (▾) + Deposit + Wallet ·
   RIGHT: Marketplace + bell + user dropdown
   ========================================================================== */

.topbar__left  { gap: 12px; }
.topbar__right { gap: 12px; }
/* v10: let the balance-pill dropdown escape the centre zone (was clipped by the
   old overflow:hidden that guarded the shrinking balance-chip) */
.topbar__center { overflow: visible; }

/* ---- v-next: the top bar is Home ▾ · Deposit · Withdraw (left) + a flexible
   spacer + the balance / wallet / marketplace / bell / user cluster (right). The
   Rules / Provably Fair / … links + socials now live in the SITE FOOTER. ---- */
.topbar__left { flex: 0 1 auto; min-width: 0; }
.topbar__spacer { flex: 1 1 auto; min-width: 10px; }
/* The bar now lives in the (narrower) MAIN column. On tighter desktops shed the
   least-important width: Marketplace label → icon, then the notifications bell. */
@media (max-width: 1399px) {
  .tb-market > span { display: none; }
  .tb-market { padding-left: 12px; padding-right: 12px; }
  .tb-market .ico { width: 18px; height: 18px; }
}
@media (max-width: 1320px) { #notif-btn { display: none; } }
#brand { padding-left: 20px; display: inline-flex; align-items: center; text-decoration: none; }
/* v12c: desktop — the MM2ROLL logo lives in the full-height chat banner (top-left),
   so the topbar drops its own brand (re-shown <=1100px where the chat is a drawer). */
#brand { display: none; }

/* LEFT — "Home" text nav (icon + label) */
.tb-nav {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-btn);
  color: var(--muted); font-weight: 800; font-size: 13px;
  background: transparent; white-space: nowrap;
  transition: color .15s, background .15s;
}
.tb-nav .ico { width: 17px; height: 17px; }
.tb-nav:hover, .tb-nav.is-active { color: #fff; background: var(--bubble); }

/* v-next — Home is a games dropdown (mirrors the balance/user dropdown chassis) */
.tb-games { position: relative; flex: none; }
.tb-nav__chev { width: 12px !important; height: 12px !important; color: var(--muted-2); transition: transform .15s; margin-left: -1px; }
.tb-nav[aria-expanded="true"] { color: #fff; background: var(--bubble); }
.tb-nav[aria-expanded="true"] .tb-nav__chev { transform: rotate(180deg); }
.tb-menu--games { left: 0; min-width: 210px; }
.tb-menu__coin { border-radius: 50%; object-fit: cover; }
.tb-menu__label { font-weight: 800; }

/* CENTER — balance pill */
/* v12c: pill flows in the centre cluster [Deposit][Withdraw][pill][Wallet]
   (the topbar now sits over the main area only, so absolute-centering it would
   overlap the buttons — it flows instead). */
.tb-balance { position: relative; flex: none; }
.tb-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-btn); padding: 8px 12px 8px 11px;
  font-weight: 800; font-size: 14px; color: #fff; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.tb-pill:hover { border-color: #2a3757; background: #131c33; }
.tb-pill[aria-expanded="true"] { border-color: var(--blue); background: #131c33; }
.tb-pill__coin { width: 20px; height: 20px; flex: none; }
.tb-pill__val { font-size: 14px; font-weight: 800; }
.tb-pill__chev { width: 14px; height: 14px; color: var(--muted-2); transition: transform .15s; }
.tb-pill[aria-expanded="true"] .tb-pill__chev { transform: rotate(180deg); }

/* shared dropdown chassis (balance + user menus) */
.tb-menu {
  position: absolute; top: calc(100% + 8px); z-index: 60;
  min-width: 244px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}
.tb-menu--bal  { left: 50%; transform: translateX(-50%); }
.tb-menu--user { right: 0; }
.tb-menu__head, .tb-menu__sub {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted-2);
}
.tb-menu__head { padding: 6px 8px 8px; }
.tb-menu__sub  { padding: 12px 8px 6px; }
.tb-menu__sep  { height: 1px; background: var(--line); margin: 6px 4px; }

/* balance breakdown rows */
.tb-bal-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.tb-bal-row__coin { width: 22px; height: 22px; flex: none; border-radius: 50%; }
.tb-bal-row__coin--sym {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bubble); color: var(--muted); font-size: 8.5px; font-weight: 800;
  border: 1px solid var(--line); text-transform: uppercase;
}
.tb-bal-row__name  { font-weight: 800; font-size: 13px; color: #fff; margin-right: auto; }
.tb-bal-row__chain { color: var(--muted-2); font-weight: 700; font-size: 11px; }
.tb-bal-row__amt   { font-weight: 800; font-size: 13px; color: #fff; }
/* v9.9: per-coin USD estimate + a Total row in the balance breakdown */
.tb-bal-row__usd   { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.tb-bal-row--total { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--line); }
.tb-bal-row--total .tb-bal-row__name { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tb-bal-row__usd--total { color: var(--gold-2, #ffb020); font-weight: 800; font-size: 14px; margin-left: auto; }
.tb-bal-crypto { display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; }
.tb-bal-note { color: var(--muted); font-size: 12px; padding: 8px; }
.tb-menu__cta {
  display: block; width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px;
  background: var(--bubble); color: #cfe0ff; font-weight: 800; font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--line); text-align: center;
  transition: background .15s, color .15s;
}
.tb-menu__cta:hover { background: #1a2440; color: #fff; }

/* RIGHT — marketplace + user block */
.tb-market .ico { width: 16px; height: 16px; }

.tb-user { position: relative; flex: none; }
.tb-userbtn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .15s, background .15s;
}
.tb-userbtn:hover { border-color: #2a3757; background: #131c33; }
.tb-userbtn[aria-expanded="true"] { border-color: var(--blue); background: #131c33; }
#me-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--blue); object-fit: cover; background: var(--bubble); flex: none;
}
.tb-userbtn__name {
  font-weight: 800; font-size: 13px; color: #fff;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-userbtn__chev { width: 13px; height: 13px; color: var(--muted-2); transition: transform .15s; }
.tb-userbtn[aria-expanded="true"] .tb-userbtn__chev { transform: rotate(180deg); }

/* user menu items */
.tb-menu__item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px; border-radius: 10px;
  color: var(--muted); font-weight: 700; font-size: 13px; text-align: left;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tb-menu__item .ico { width: 17px; height: 17px; flex: none; color: var(--muted-2); }
.tb-menu__item:hover { background: var(--bubble); color: #fff; }
.tb-menu__item:hover .ico { color: #fff; }
.tb-menu__item--admin, .tb-menu__item--admin .ico { color: var(--gold-2); }
.tb-menu__item--danger:hover { background: rgba(240, 69, 74, .14); color: #ff9a9a; }
.tb-menu__item--danger:hover .ico { color: #ff9a9a; }

/* ==========================================================================
   SUBNAV
   ========================================================================== */

.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(26, 33, 56, .6);
  min-width: 0;
}
.subnav__links { display: flex; gap: 26px; min-width: 0; }
.subnav__link {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
  transition: color .15s;
}
.subnav__link:hover { color: #fff; }

.subnav__right { display: flex; align-items: center; gap: 18px; }

.subnav__socials { display: flex; align-items: center; gap: 14px; }
.social { color: var(--muted-2); display: inline-flex; transition: color .15s, transform .12s; }
.social .ico { width: 16px; height: 16px; }
.social:hover { color: #fff; transform: translateY(-1px); }

/* ==========================================================================
   SITE FOOTER (v-next) — Rules / Provably Fair / … links + socials, at the
   bottom of the scrolling main content (moved out of the top bar).
   ========================================================================== */
.site-footer {
  margin-top: 40px;
  padding: 24px 8px 40px;   /* generous bottom room so the socials/legal never sit flush against the viewport edge */
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 26px;
}
.site-footer__socials { gap: 20px; }
.site-footer__socials .social { padding: 4px; }   /* bigger hit area so nothing looks clipped */
.site-footer__socials .social .ico { width: 18px; height: 18px; display: block; }
.site-footer__legal {
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  max-width: 640px;
  line-height: 1.5;
}

/* ==========================================================================
   CHAT SIDEBAR
   ========================================================================== */

#chat {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

/* — messages — */
#chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
#chat-list:empty::before {
  content: "No messages yet — say hi!";
  display: block;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  padding: 30px 0;
}

.chat-msg { display: flex; gap: 9px; animation: msg-in .25s ease-out both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.chat-msg__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #26334f;   /* lighter disc so dark Roblox headshots still pop */
  flex: none;
  margin-top: 1px;
  /* v12: stronger contrast — a brighter ring + drop shadow lift the pfp off the dark chat */
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px rgba(150, 130, 255, .45), 0 2px 8px rgba(0, 0, 0, .5);
}
.chat-msg__body { min-width: 0; flex: 1 1 auto; }
.chat-msg__head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
/* v12 level badge — a REAL games-played level (server-computed). */
.chat-msg__level {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 17px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  color: #04140c;
  background: linear-gradient(180deg, #4ee08a, #2fb768);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 3px rgba(0, 0, 0, .35);
}
.chat-msg__name {
  color: #e8ecf7; font-size: 12.5px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-msg__text {
  background: var(--bubble);
  border-radius: 11px;
  border-top-left-radius: 4px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cdd5ea;
  overflow-wrap: break-word;
  word-break: break-word;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}
/* @mention highlight inside message text */
.chat-mention {
  color: var(--blue-text);
  font-weight: 700;
  background: rgba(47, 123, 246, .14);
  border-radius: 4px;
  padding: 0 3px;
}
/* system / giveaway announcement message — gold accent bubble */
.chat-msg--system .chat-msg__name { color: var(--gold-2); }
.chat-msg--system .chat-msg__text {
  background: linear-gradient(180deg, rgba(255, 176, 32, .15), rgba(255, 176, 32, .07));
  box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .28);
  color: #f5e2bf;
}

/* ==========================================================================
   v12 GIVEAWAY CARD (top of #chat)
   ========================================================================== */
.gw-card {
  margin: 10px 12px 4px;
  padding: 12px 13px 14px;
  background: linear-gradient(180deg, #101a30, #0b1122);
  border: 1px solid #22345c;
  border-radius: var(--r-panel);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
  animation: msg-in .3s ease-out both;
}
.gw-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--blue-text));
  opacity: .9;
}
.gw-card__head { display: flex; align-items: center; gap: 8px; }
.gw-card__title {
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-text);
}
.gw-card__live, .gw-card__done {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
}
.gw-card__live { color: var(--muted); }
.gw-card__done { color: var(--gold-2); }
.gw-card__row {
  display: flex; align-items: stretch; gap: 10px;
  margin-top: 8px;
}
.gw-card__left { display: flex; flex-direction: column; gap: 9px; min-width: 0; flex: 1 1 auto; }
.gw-card__item {
  font-size: 14.5px; font-weight: 800; color: #fff;
  line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gw-card__join {
  align-self: flex-start;
  height: 32px; padding: 0 22px;
  border-radius: var(--r-btn);
  font-size: 13px; font-weight: 800;
}
.gw-card__join.is-joined {
  background: var(--bubble); color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(34, 222, 121, .4);
  cursor: default;
}
.gw-card__won { font-size: 13px; font-weight: 800; color: var(--gold-2); line-height: 1.3; }
.gw-card__thumb {
  flex: none;
  width: 66px; height: 66px;
  border-radius: 10px;
  background: #060a14;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.gw-card__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.gw-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.gw-card__time { color: var(--blue-text); font-variant-numeric: tabular-nums; }
.gw-card__bar {
  margin-top: 8px;
  height: 4px; border-radius: 3px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.gw-card__bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-text));
  border-radius: 3px;
  transition: width 1s linear;
}
.gw-card--ended::before { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.gw-card--ended .gw-card__bar > i { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

/* — v-next crypto RAIN — the REAL coin logo (public/img/crypto/*.svg) beside
   every amount; unlisted coins get a brand-colored glyph chip fallback — */
.crypto-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  color: #fff; font-weight: 900; font-size: 10px; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  vertical-align: middle;
}
.crypto-ico--img { background: transparent !important; box-shadow: none; object-fit: contain; }
.gw-coin { width: 16px; height: 16px; flex: none; }
/* big rain thumb: scale the glyph fallback up too */
.gw-card__thumb--rain .crypto-ico:not(.crypto-ico--img) { font-size: 20px; }
/* real coin icon in the balance dropdown + wallet lists */
.tb-bal-row__coin.crypto-ico { width: 22px; height: 22px; font-size: 11px; }
.wallet-row__ico { flex: none; }
.wallet-row__ico.crypto-ico { width: 20px; height: 20px; font-size: 11px; }
/* v-next: rain shows an approximate $ value under the crypto amount */
.gw-rain__usd { display: block; font-size: 11px; font-weight: 700; color: var(--muted, #828ca6); margin-top: 3px; }

/* v-next: the topbar $ pill — a generic crypto (stacked-coins) symbol + the $ total.
   The pill now lives in its own flex CENTER zone (see .topbar__center) so it sits
   centered between the left (Home/Deposit/Withdraw) and right (Marketplace/bell/user)
   clusters and can never overlap either. The Wallet button was removed — the wallet
   is reached via this pill's dropdown → "Open wallet". */
.tb-pill { padding: 8px 13px 8px 11px; gap: 7px; }
.tb-pill__crypto { width: 18px; height: 18px; flex: none; display: block; }
/* Deposit/Withdraw are back to their normal size and must NEVER shrink/hide, so
   the left cluster keeps its natural width. Marketplace keeps its text on wide
   desktops (>=1600, where it fits); on narrower ones it drops to an icon so
   Deposit + Withdraw still fit the main column. */
.topbar__left { flex: 0 0 auto; }
@media (max-width: 1599px) {
  .tb-market > span { display: none; }
  .tb-market { padding-left: 13px; padding-right: 13px; }
  .tb-market .ico { width: 19px; height: 19px; }
}
/* LIVE rain: the staked coin+amount + the coin thumbnail */
.gw-card--rain.gw-card--ended::before { background: linear-gradient(90deg, #3fb6ff, #7ad0ff); }
.gw-rain__stake {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 17px; font-weight: 800; color: #fff;
  padding: 5px 12px; border-radius: 999px;
  background: #060a14; border: 1px solid var(--line);
}
.gw-rain__stake .gw-coin { width: 18px; height: 18px; }
.gw-card__thumb--rain { background: radial-gradient(circle at 50% 40%, #17233f, #060a14); }
.gw-card__thumb--rain .gw-coin { width: 40px; height: 40px; }
/* ENDED rain result card (matches rain.png) */
.gw-rain__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800; color: #fff;
}
.gw-rain__wx { font-size: 17px; line-height: 1; }
.gw-rain__sub { margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.gw-rain__sub b { color: var(--blue-text); }
.gw-rain__total {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 11px 0 12px;
  padding: 6px 14px; border-radius: 999px;
  background: #060a14; border: 1px solid var(--line);
  font-size: 16px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
}
.gw-rain__total .gw-coin { width: 18px; height: 18px; }
.gw-rain__list { display: flex; flex-direction: column; gap: 9px; }
.gw-rain__row { display: flex; align-items: center; gap: 10px; }
.gw-rain__av {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%; object-fit: cover;
  background: #121a2e; border: 1px solid var(--line);
}
.gw-rain__name {
  flex: 1 1 auto; min-width: 0;
  font-size: 13.5px; font-weight: 800; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gw-rain__amt {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  font-size: 13px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
}
.gw-rain__more { margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* — composer — */
.chat-composer {
  margin: 10px 12px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 10px;
}
#chat-input {
  width: 100%;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px 12px;
}
#chat-input::placeholder { color: var(--muted-2); }
#chat-input:focus { outline: none; }
.chat-composer__row { display: flex; align-items: center; gap: 6px; }
.chat-mini {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  border-radius: var(--r-chip);
  transition: color .15s;
}
.chat-mini .ico { width: 16px; height: 16px; }
.chat-mini:hover { color: var(--text); }
.chat-send {
  margin-left: auto;
  width: 42px; height: 34px;
  padding: 0;
  border-radius: var(--r-btn);
}
.chat-send .ico { width: 16px; height: 16px; }

/* — footer — */
.chat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 12px;
}
.online { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.online b { color: #fff; font-size: 12px; }
.rules-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--r-chip);
  transition: color .15s, background .15s;
}
.rules-btn .ico { width: 14px; height: 14px; }
.rules-btn:hover { color: #fff; background: var(--bubble); }

/* ==========================================================================
   SIDENAV (right)
   ========================================================================== */

#sidenav {
  /* v-next: full height like the chat — the Main/Marketplace tabs sit in the top
     band, roughly level with the top bar (padding-top ≈ centers them in 88px). */
  padding: 26px 14px 20px;
  border-left: 1px solid rgba(26, 33, 56, .5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidenav__tabs {
  display: flex;
  background: var(--panel);
  border-radius: var(--r-btn);
  padding: 4px;
  gap: 4px;
}
.tab {
  flex: 1;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.tab:hover { color: #fff; }
.tab.is-active {
  background: linear-gradient(180deg, var(--violet-bright), var(--violet-deep));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2),
              0 0 0 1px color-mix(in srgb, var(--violet) 30%, transparent),
              0 4px 14px -3px var(--violet-glow);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-row);
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-align: left;
  transition: color .15s, background .15s;
}
.nav-item .ico { width: 17px; height: 17px; }
.nav-item .rc--nav { width: 20px; height: 20px; }
.nav-item:hover { color: #fff; background: rgba(18, 26, 46, .8); }
.nav-item:active { transform: scale(.98); }
/* Reference boxes only the Home row + group header rows; items sit on the page
   background and the active item gets a plain darker pill + thin blue LEFT bar. */
.nav-item.is-active {
  position: relative;
  background: #0f1830;
  color: var(--blue-text);
  box-shadow: none;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--blue);
}
.nav-item[data-nav="home"] { background: var(--panel); border-radius: 10px; color: #fff; }
.ico--home { color: var(--blue); }
.nav-item:hover .ico--home { color: var(--blue); }

.sidenav__group {
  background: none;
  border-radius: var(--r-panel);
  padding: 0;
}
.sidenav__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 4px;
}
.ico--chev.up { transform: rotate(180deg); width: 14px; height: 14px; color: var(--muted-2); }

/* ==========================================================================
   MAIN — coinflip lobby
   ========================================================================== */

#main {
  padding: 26px 34px 60px;
  min-width: 0;
}

.main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
#page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.ico--title { width: 30px; height: 30px; }

.main-head__tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hv-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  min-width: 110px;
}
.hv-btn {
  background: var(--bubble);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  transition: color .15s, background .15s, transform .08s;
}
.hv-btn:hover { color: #fff; background: #1a2440; }
.hv-btn:active { transform: scale(.95); }
.hv-btn--max {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 12px -3px var(--accent-glow);
}
.hv-btn--max:hover { filter: brightness(1.1); background: linear-gradient(180deg, var(--accent-bright), var(--accent)); }

/* — auto-fill (quick value match) — v5: subtle blue-tinted helper pill.
   Reads as a helper next to Max/Clear, never competes with the primary
   Create/Join button. */
.hv-btn--auto {
  background: rgba(47, 123, 246, .14);
  border: 1px solid rgba(47, 123, 246, .42);
  color: #c9b6ff;
}
.hv-btn--auto:hover {
  filter: none;
  color: #e3d8ff;
  background: rgba(47, 123, 246, .24);
  border-color: rgba(47, 123, 246, .6);
}
.auto-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bubble);
  border-radius: var(--r-btn);
  padding: 0 8px;
  height: 32px;
}
.auto-wrap__pfx { color: var(--muted-2); font-size: 12px; font-weight: 800; }
.auto-input {
  width: 68px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 4px;
  outline: none;
}
.auto-input::placeholder { color: var(--muted-2); font-weight: 600; }
.auto-input::-webkit-outer-spin-button, .auto-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auto-input { -moz-appearance: textfield; }
#join-auto { margin-left: auto; }

/* — games list — */
#games-list { display: flex; flex-direction: column; gap: 13px; }
#games-list:empty::before {
  content: "No active coinflips — hit Create Game to start one.";
  display: block;
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 700;
  padding: 90px 0;
  border: 1px dashed #1c2440;
  border-radius: var(--r-panel);
}

/* — row — */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 12px 16px 12px 22px;
  background: var(--panel);
  border-radius: var(--r-row);
  overflow: hidden;
  animation: row-in .35s ease-out both;
  animation-delay: var(--d, 0s);
}
@keyframes row-in { from { opacity: 0; transform: translateY(14px); } }

.row--h { background: linear-gradient(90deg, rgba(47, 123, 246, .12), rgba(47, 123, 246, 0) 34%), var(--panel); }
.row--t { background: linear-gradient(90deg, rgba(255, 176, 32, .12), rgba(255, 176, 32, 0) 34%), var(--panel); }

.row__bar {
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: var(--blue);
}
.row--t .row__bar { background: var(--gold); }

.row__avatar, .row__opp {
  position: relative;
  width: 58px; height: 58px;
  flex: none;
}
.row__avatar img, .row__opp img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--ring, var(--blue));
  background: var(--bubble);
}
.row__opp-q {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bubble);
  /* v9 D7: the empty slot wears the SIDE it represents (dashed = still open) */
  border: 2.5px dashed var(--ring, #222b47);
  color: var(--muted-2);
  font-size: 21px;
  font-weight: 800;
}
.row__opp img:not([hidden]) ~ .row__opp-q { display: none; }

.row__badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.row__badge .rc { width: 20px; height: 20px; }
/* creator badge shows the creator side; opponent badge the other side */
.row--h .row__avatar .rc--t,          .row--t .row__avatar .rc--h,
.row--h .row__opp .rc--h,             .row--t .row__opp .rc--t { display: none; }

.row__vs { color: #dfe6f5; display: flex; flex: none; }
.row__vs .ico { width: 22px; height: 22px; }

/* result coin is the largest element in the row — bigger than the 58px avatars */
.row__result-coin { display: flex; flex: none; }
.row__result-coin .rc { width: 66px; height: 66px; }
/* which face landed: .row--coin-h / -t / -edge on .row */
.row__result-coin .rc--h, .row__result-coin .rc--t, .row__result-coin .rc--edge { display: none; }
.row--coin-h .row__result-coin .rc--h,
.row--coin-t .row__result-coin .rc--t,
.row--coin-edge .row__result-coin .rc--edge { display: block; }
.row--coin-h .row__result-coin { filter: drop-shadow(0 0 12px rgba(91, 157, 255, .55)); }
.row--coin-t .row__result-coin { filter: drop-shadow(0 0 12px rgba(255, 176, 32, .55)); }

.row__items {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.row__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 17px;
  background: var(--bubble);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

/* v9 D7: .row__value lives INSIDE the labeled stake box now — it IS the label */
.row__value {
  display: flex;
  flex-direction: column;
  align-items: center;      /* v-next: STAKE label centered over the coin+value */
  text-align: center;
  gap: 3px;
  flex: none;
}
.row__value-label {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.row__value-amt {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px;
}
.row__value-amt b { font-weight: 800; }
.ico--gun { width: 16px; height: 16px; color: var(--muted-2); }

.row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: none;
  /* v-next: was a FIXED width:208px — with only [Join][eye] that fit, but when
     the CALL BOT (+ Cancel) buttons are inserted the content overflowed LEFT out
     of the box and painted over the stake weapon thumbs. min-width keeps the
     Join column aligned across normal rows, while letting the actions cluster
     GROW to fit Call Bot + Cancel so the stake shrinks instead of being covered. */
  min-width: 208px;
}
.row__join, .row__callbot { padding: 11px 22px; }
/* keep Call Bot compact so the actions cluster stays tidy next to the stake */
.row__callbot { padding: 11px 16px; white-space: nowrap; }
.row__eye { width: 42px; height: 42px; }
.row--resolved .row__join, .row--resolved .row__callbot { display: none; }

/* item thumbs (rows + modals) — tint via --tier */
.item-thumb {
  --tier: #b0c3d9;
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* neutral dark disc; the tier color only whispers as a soft glow */
  background: radial-gradient(circle at 50% 40%, #151129, #0a0e1c 75%);
  border: 1px solid color-mix(in srgb, var(--tier) 14%, var(--line));
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--tier) 30%, transparent),
              inset 0 0 12px color-mix(in srgb, var(--tier) 8%, transparent);
}
.item-thumb img {
  width: 76%; height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
}
.item-thumb--sm { width: 46px; height: 46px; }

/* ==========================================================================
   MODAL CHASSIS
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open, .modal.open, .modal.show, .modal.active { display: flex; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 10, .8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }

.modal__panel {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 1px 0 var(--hairline);
  padding: 22px 24px;
  max-width: calc(100vw - 40px);
  max-height: 92vh;
  overflow-y: auto;
  animation: modal-in .16s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal__head h2 {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
}
.modal__x {
  width: 32px; height: 32px;
  font-size: 13px;
  font-weight: 800;
}
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}
.modal__foot-btns { display: flex; gap: 10px; }

/* ==========================================================================
   LOGIN MODAL
   ========================================================================== */

.modal__panel--login { width: 380px; text-align: center; padding: 34px 30px 28px; }
.login-brand { font-size: 30px; margin-bottom: 6px; }
.login-sub { color: var(--muted-2); font-size: 12px; font-weight: 600; margin-bottom: 24px; }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: #0d1326;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 123, 246, .18);
}

#login-err {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  margin: 2px 0 10px;
}
.login-actions { display: flex; gap: 10px; }
.login-actions .btn { flex: 1; padding: 12px 0; }

/* ==========================================================================
   V2 — AUTH TABS · VERIFY BANNER · ADMIN LINK · FAUCET
   ========================================================================== */

/* — admin link — */
.admin-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--r-btn);
  background: rgba(157, 92, 240, .14);
  border: 1px solid rgba(157, 92, 240, .45);
  color: #c9a6ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.admin-link:hover { background: rgba(157, 92, 240, .28); color: #fff; }

/* — faucet cooldown state — */
#faucet-btn.is-cooldown[disabled] {
  opacity: .82;
  filter: none;
  cursor: default;
  background: linear-gradient(180deg, #263352, #1b2540);
  box-shadow: none;
  color: var(--muted);
}

/* — verify banner (top of main) — */
.verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(255, 176, 32, .16), rgba(255, 176, 32, .04) 60%), var(--panel);
  border: 1px solid rgba(255, 176, 32, .4);
  border-radius: var(--r-row);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.verify-banner .ico { width: 20px; height: 20px; color: var(--gold-2); flex: none; }
.verify-banner__text { font-size: 12.5px; font-weight: 600; color: #e6ddc9; flex: 1; min-width: 0; line-height: 1.5; }
.verify-banner__text b { color: #fff; font-weight: 800; }
#verify-email { color: var(--gold-2); font-weight: 700; }
.verify-banner .btn { flex: none; }
.verify-banner #resend-verify[disabled] { opacity: .55; }

/* — auth tabs + panels — */
.auth-tabs {
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 10px 4px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.auth-tab:hover { color: #fff; }
.auth-tab.is-active {
  background: linear-gradient(180deg, var(--violet-bright), var(--violet-deep));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2),
              0 4px 12px -3px var(--violet-glow);
}
.auth-panel { display: block; }
.auth-panel[hidden] { display: none; }

.btn--block { width: 100%; padding: 13px 0; }

.field__hint {
  display: block;
  min-height: 13px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
  margin-top: 5px;
  text-align: left;
}
.field__hint.is-bad  { color: var(--red); }
.field__hint.is-good { color: var(--green); }
.field input.is-bad { border-color: var(--red); }

#reg-err { min-height: 18px; color: var(--red); font-size: 12px; font-weight: 700; margin: 2px 0 10px; }

.auth-resend {
  display: block;
  width: 100%;
  text-align: center;
  margin: -2px 0 12px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
}
.auth-resend:hover { color: #fff; }
.auth-fineprint { margin-top: 12px; color: var(--muted-2); font-size: 10.5px; font-weight: 600; text-align: center; }

@media (max-width: 1100px) {
  /* v10: hide the centre balance pill on tighter widths (breakdown stays
     reachable via the Wallet button) — mirrors the old balance-chip rule */
  .tb-balance { display: none; }
}
@media (max-width: 1180px) {
  /* reclaim space before things get tight: Home becomes icon-only */
  .tb-nav span { display: none; }
  .tb-nav { padding: 9px 11px; }
}
@media (max-width: 880px) {
  .admin-link { display: none; }
  #faucet-btn { padding: 10px 12px; font-size: 11px; }
}

/* ==========================================================================
   CREATE / JOIN MODALS
   ========================================================================== */

.modal__panel--pick { width: 590px; }

.side-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.side-pick__label { color: var(--muted); font-size: 12px; font-weight: 800; margin-right: auto; }
.side-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: var(--r-btn);
  background: var(--bubble);
  border: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: border-color .15s, color .15s, background .15s, transform .08s;
}
.side-chip .rc { width: 26px; height: 26px; }
.side-chip:hover { color: #fff; }
.side-chip:active { transform: scale(.96); }
#side-h.is-active { border-color: var(--blue); color: #fff; background: #1c1636; box-shadow: 0 0 14px rgba(47, 123, 246, .25); }
#side-t.is-active { border-color: var(--gold); color: #fff; background: #2b2010; box-shadow: 0 0 14px rgba(255, 176, 32, .25); }

.pick-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pick-sub__label { color: var(--muted-2); font-size: 12px; font-weight: 700; }
.pick-sub__helpers { display: flex; gap: 8px; }
.pick-sub__helpers .hv-btn { padding: 7px 14px; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(99px, 1fr));
  gap: 10px;
  max-height: 340px;
  min-height: 140px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(7, 11, 22, .5);
  border-radius: var(--r-row);
}
.inv-grid:empty::before {
  content: "No items yet — deposit MM2 items to play.";
  grid-column: 1 / -1;
  align-self: center;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  padding: 40px 10px;
}

/* v-next: shared Worth / A–Z sort toggle. First row of every item grid; spans
   the full width and sticks to the top so it stays reachable while scrolling.
   The box-shadow masks the grid's top padding as cells scroll underneath. */
.pick-sort {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px 7px;
  background: var(--panel);
  box-shadow: 0 -5px 0 var(--panel);
  border-bottom: 1px solid var(--line);
}
.pick-sort__label {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pick-sort__btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 12px;
  border-radius: 999px;
  transition: color .12s, background .12s, border-color .12s;
}
.pick-sort__btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
}
.pick-sort__btn.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.inv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 9px;
  background: #0d1326;
  border: 2px solid transparent;
  border-radius: var(--r-row);
  transition: border-color .12s, background .12s, transform .08s;
  text-align: center;
  min-width: 0;
}
.inv-item:hover { background: #111a33; transform: translateY(-1px); }
.inv-item:active { transform: scale(.96); }
.inv-item.is-selected {
  border-color: var(--blue);
  background: #1c1636;
  box-shadow: 0 0 12px rgba(47, 123, 246, .28);
}
.inv-item .item-thumb { width: 52px; height: 52px; }
.inv-item__name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-item.is-selected .inv-item__name { color: #fff; }
.inv-item__val { font-size: 11px; font-weight: 800; color: var(--gold-2); }

/* v9.8: the small "~$N" mm2values reference line under item tiles.
 * INFO ONLY (mm2values units, not real USD — the ~ signals approximate);
 * deliberately muted + tiny so it never competes with names/prices. */
.item-val {
  display: flex;                 /* v-next: coin icon + k/m value on one line */
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13.5px;             /* v-next: bigger — the coin value is the point */
  font-weight: 900;
  line-height: 1.2;
  color: var(--gold-2, #ffb020); /* coins read gold */
  letter-spacing: .01em;
  white-space: nowrap;
}
.item-val__coin { width: 14px; height: 14px; flex: none; display: inline-block; vertical-align: middle; }
/* v-next: the coin icon next to the SELECTED item COUNT is misleading (it's not a
   value) — drop it, "Selected N items" stands alone. */
.sel-total .coin-r { display: none; }
/* v-next: search boxes in the create / join pickers */
.pick-sub__helpers .dep-search { width: 150px; }
.join-search-row { margin: 2px 0 8px; }
.join-search-row .dep-search { width: 100%; }
/* bigger coin where the value is a headline number (join target + game-modal total) */
#join-target .item-val__coin, .gm__total .item-val__coin { width: 15px; height: 15px; margin-right: 3px; vertical-align: -2px; }
.join-target__per { font-size: 11px; font-weight: 700; color: var(--muted-2, #5c6584); margin-left: 4px; }
.join-target__range { font-size: 12px; font-weight: 800; color: var(--muted, #828ca6); margin-left: 6px; }
.join-target__range::before { content: '· '; color: var(--muted-2, #5c6584); }
.item-val--inline { /* row layouts (game-modal item lists): sits at the right edge */
  display: inline-flex;
  flex: none;
  margin-left: 8px;
  align-self: center;
}

.sel-total {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}
.sel-total__label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.sel-usd { color: var(--muted-2); font-size: 12px; font-weight: 700; }

.join-target {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bubble);
  border-radius: var(--r-row);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.join-target__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#join-target { font-size: 17px; font-weight: 800; color: var(--gold-2); }
.join-hint { flex-basis: 100%; color: var(--muted-2); font-size: 11.5px; font-weight: 600; }
.join-hint.is-bad { color: var(--red); }

/* ==========================================================================
   GAME MODAL — the frame-modal design
   ========================================================================== */

.modal__panel--game {
  width: 905px;
  padding: 30px 30px 20px;
  /* radial spotlight top-center + faint 40px grid (per frames) */
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(47, 123, 246, .32), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(120, 140, 190, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(120, 140, 190, .05) 39px 40px),
    linear-gradient(180deg, #0a101f, #080c18);
  overflow-x: hidden;
}
/* face-based tint: client toggles .gm--h / .gm--t / .gm--edge on #game-modal */
#game-modal.gm--t .modal__panel--game {
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(255, 176, 32, .30), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(190, 160, 120, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(190, 160, 120, .05) 39px 40px),
    linear-gradient(180deg, #0f0d18, #0a0914);
}
#game-modal.gm--edge .modal__panel--game {
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(160, 165, 180, .22), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(150, 155, 175, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(150, 155, 175, .05) 39px 40px),
    linear-gradient(180deg, #0c0e15, #090a10);
}

#gm-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(18, 26, 46, .7); }

.gm__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  margin-bottom: 26px;
}

.gm__player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 26px;
}
.gm__avatar-wrap { display: block; }
.gm__player img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3.5px solid var(--ring, var(--blue));
  background: var(--bubble);
  box-shadow: 0 0 24px rgba(0, 0, 0, .5);
}
.gm__id { display: flex; align-items: center; gap: 8px; }
#gm-l-name, #gm-r-name { font-size: 15px; font-weight: 800; }

.gm__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}

#gm-status {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  min-height: 20px;
}

/* — 3-face 3D coin — */
.coin3d {
  width: 190px;
  height: 190px;
  perspective: 900px;
  flex: none;
}
.coin3d__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.coin3d__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coin3d__face svg { width: 100%; height: 100%; }
.coin3d__face--h {
  transform: rotateY(0deg) translateZ(8px);
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .5));
}
.coin3d__face--t {
  transform: rotateY(180deg) translateZ(8px);
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .5));
}
/* colored glow only as a landing/win burst (.land added by the client on land) */
.coin3d.land .coin3d__face--h {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .5)) drop-shadow(0 0 26px rgba(91, 157, 255, .55));
}
.coin3d.land .coin3d__face--t {
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .5)) drop-shadow(0 0 26px rgba(255, 176, 32, .55));
}
.coin3d__face--edge {
  inset: auto;
  left: 50%;
  top: 0;
  width: 16px;
  height: 100%;
  margin-left: -8px;
  border-radius: 8px;
  backface-visibility: visible;
  transform: rotateY(90deg);
  background: linear-gradient(90deg, #6f7688, #cfb469 30%, #8a8f9c 50%, #cfb469 70%, #6f7688);
  box-shadow: 0 0 18px rgba(207, 180, 105, .35);
}

/* static poses (client sets on #gm-coin) */
.coin3d.face-h    .coin3d__inner { transform: rotateY(0deg); }
.coin3d.face-t    .coin3d__inner { transform: rotateY(180deg); }
.coin3d.face-edge .coin3d__inner { transform: rotateY(90deg); }

/* spin scaffolding — client adds .spin-h / .spin-t / .spin-edge to #gm-coin.
   3.2s ease-out, >=6 full turns, ends on the landed face (edge: 90deg + wobble) */
.coin3d.spin-h .coin3d__inner {
  animation: coin-spin-h 3.2s cubic-bezier(.15, .85, .25, 1) forwards;
}
.coin3d.spin-t .coin3d__inner {
  animation: coin-spin-t 3.2s cubic-bezier(.15, .85, .25, 1) forwards;
}
.coin3d.spin-edge .coin3d__inner {
  animation: coin-spin-edge 3.4s cubic-bezier(.15, .85, .25, 1) forwards;
}
@keyframes coin-spin-h {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(2160deg); }   /* 6 turns -> H */
}
@keyframes coin-spin-t {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(2340deg); }   /* 6.5 turns -> T */
}
@keyframes coin-spin-edge {
  0%   { transform: rotateY(0deg); }
  82%  { transform: rotateY(2262deg); }   /* overshoot past the rim… */
  90%  { transform: rotateY(2242deg); }   /* …wobble back… */
  96%  { transform: rotateY(2254deg); }
  100% { transform: rotateY(2250deg); }   /* …rest on the edge (90deg) */
}

/* landing squash bounce (client adds .land after the spin) */
.coin3d.land { animation: coin-land .5s cubic-bezier(.3, 1.6, .4, 1); }
@keyframes coin-land {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.12, .86); }
  65%  { transform: scale(.95, 1.06); }
  100% { transform: scale(1); }
}

/* — stat bars — */
.gm__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 14px;
}
.gm__stat {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(13, 19, 38, .9);
  border: 1px solid rgba(26, 33, 56, .8);
  border-radius: var(--r-btn);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
}
.ico--clover { width: 18px; height: 18px; color: var(--green); }
.gm__total { margin-left: auto; color: var(--gold-2); font-weight: 800; }

/* — item lists — */
.gm__lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.gm__items {
  list-style: none;
  background: rgba(9, 13, 26, .6);
  border: 1px solid rgba(26, 33, 56, .55);
  border-radius: var(--r-row);
  padding: 4px 14px;
  min-height: 248px;
  max-height: 290px;
  overflow-y: auto;
}
.gm__items:empty::before {
  content: "No items yet";
  display: block;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  padding: 104px 0;
}
.gm-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 2px;
}
.gm-item + .gm-item { border-top: 1px solid rgba(26, 33, 56, .45); }
.gm-item__name {
  font-size: 14px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-item__val {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-2);
  flex: none;
}

/* — footer — */
.gm__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
#gm-created { color: var(--muted-2); font-size: 12px; font-weight: 700; }

/* ==========================================================================
   FAIRNESS MODAL
   ========================================================================== */

.modal__panel--fair { width: 540px; }
.fair-explain {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 18px;
}
.fair-explain b { color: #fff; }
.fair-explain code {
  background: var(--bubble);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--blue-text);
}
.fair-fields { display: flex; flex-direction: column; gap: 8px; }
.fair-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: baseline;
  background: rgba(13, 19, 38, .7);
  border-radius: var(--r-btn);
  padding: 10px 12px;
}
.fair-field dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fair-field dd { min-width: 0; }
.fair-field code {
  display: block;
  font-size: 11px;
  color: #cdd5ea;
  word-break: break-all;
  line-height: 1.5;
}

/* ==========================================================================
   HISTORY MODAL
   ========================================================================== */

.modal__panel--history { width: 640px; }
#history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}
#history-list:empty::before {
  content: "No resolved games yet — go flip something.";
  display: block;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
  padding: 70px 0;
}
.hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(13, 19, 38, .7);
  border-radius: var(--r-btn);
  padding: 11px 14px;
}
.hist-row .rc { width: 28px; height: 28px; }
.hist-row__date { color: var(--muted-2); font-size: 11.5px; font-weight: 700; width: 108px; flex: none; }
.hist-row__vs {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-row__value { font-size: 13.5px; font-weight: 800; flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: var(--r-chip);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  flex: none;
}
.badge--win  { background: rgba(34, 222, 121, .16); color: var(--green); }
.badge--loss { background: rgba(240, 69, 74, .16);  color: var(--red); }
.badge--edge { background: rgba(255, 176, 32, .16); color: var(--gold-2); }

/* ==========================================================================
   TOAST / FX / SHAKE / FLASH
   ========================================================================== */

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  max-width: 340px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--r-row);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  display: none;
}
#toast.is-open, #toast.open, #toast.show, #toast.active {
  display: block;
  animation: toast-in .22s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
}
#toast.toast--gold  { border-left-color: var(--gold); }
#toast.toast--green { border-left-color: var(--green); }
#toast.toast--red   { border-left-color: var(--red); }

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 400;
  pointer-events: none;
}

/* EDGE screen shake (client adds body.shake for 600ms) */
body.shake { animation: shake .6s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(5px, -2px); }
  30%, 50%, 70% { transform: translate(-9px, 3px); }
  40%, 60% { transform: translate(9px, -3px); }
}

/* white flash helper (client adds body.flash, removes after ~500ms) */
body.flash::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 350;
  pointer-events: none;
  animation: flash-out .45s ease-out forwards;
}
@keyframes flash-out { from { opacity: .85; } to { opacity: 0; } }

/* ==========================================================================
   RESPONSIVE-ISH
   ========================================================================== */

@media (max-width: 1100px) {
  #app { grid-template-columns: 0 minmax(0, 1fr) 250px; }
  #chat { display: none; }
  #brand { display: flex; }   /* chat is a drawer here → the topbar shows the logo again */
  #main { padding: 22px 22px 50px; }
  /* tablet: the full-height sidenav rail is a wide-desktop look — here the bar
     takes the full width again and the sidenav drops below it, so the (now
     narrower) main column isn't crammed with the whole bar. */
  .topbar  { grid-area: 1 / 2 / 2 / 4; padding-left: 22px; padding-right: 20px; }
  #sidenav { grid-area: 2 / 3 / 3 / 4; padding-top: 14px; }
}

@media (max-width: 880px) {
  #app { grid-template-columns: 0 minmax(0, 1fr) 0; }
  #sidenav { display: none; }
  .subnav { padding: 0 18px; }
  .subnav__socials { display: none; }
  .me-text { display: none; }
  .row__value-label { display: none; }
  .row__actions { width: auto; }
  .modal__panel--game { padding: 22px 16px 16px; }
  .gm__stats, .gm__lists { gap: 12px; }
  .gm__player img { width: 72px; height: 72px; }
  .coin3d { width: 140px; height: 140px; }
}

/* ==========================================================================
   V3 — LOGIN WITH ROBLOX (public-bio verification sub-flow in #auth-modal)
   ========================================================================== */

/* — divider between local auth and the Roblox button — */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* — the "Login with Roblox" button — */
.btn--rblx {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(180deg, #232936, #151a26);
  border: 1px solid #38415a;
  color: #fff;
}
.btn--rblx:hover {
  background: linear-gradient(180deg, #2b3244, #1a2030);
  border-color: #4a5677;
  filter: none;
}
.btn--rblx .ico--rblx { width: 15px; height: 15px; color: #fff; flex: none; }

/* — sub-flow chrome — */
#rblx-flow { text-align: left; }
.rblx-back {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 14px;
}
.rblx-back:hover { color: #fff; }
.rblx-step { display: block; text-align: left; }
.rblx-step[hidden] { display: none; }
.rblx-fineprint {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}
#rblx-err { min-height: 18px; color: var(--red); font-size: 12px; font-weight: 700; margin: 2px 0 10px; }

/* — step 2: "Is this you?" card — */
.rblx-question { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 14px; text-align: center; }
.rblx-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.rblx-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: #0d1326;
  flex: none;
  object-fit: cover;
}
.rblx-card__names { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rblx-card__display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  min-width: 0;
}
.rblx-card__display > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rblx-verified {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #5b9dff;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rblx-card__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rblx-btns { display: flex; gap: 10px; }
.rblx-btns .btn { flex: 1; padding: 12px 0; }

/* — step 3: phrase + status — */
.rblx-instruct { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; line-height: 1.45; }
.rblx-phrase-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; }
#rblx-phrase {
  flex: 1;
  display: block;
  min-width: 0;
  background: #0d1326;
  border: 1px dashed #2c3b63;
  border-radius: var(--r-btn);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--blue-text);
  word-break: break-word;
  user-select: all;
  -webkit-user-select: all;
}
.rblx-copy { flex: none; align-self: center; }
.rblx-copy.is-copied { color: var(--green); border-color: var(--green); }
.rblx-profile-link {
  display: block;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  margin-bottom: 12px;
}
.rblx-profile-link:hover { color: #fff; }
.rblx-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.rblx-status.is-wait { color: var(--gold-2); }
.rblx-status.is-ok   { color: var(--green); }
.rblx-status.is-err  { color: var(--red); }
.rblx-spinner {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--blue-text);
  animation: rblx-spin .8s linear infinite;
  display: inline-block;
}
@keyframes rblx-spin { to { transform: rotate(360deg); } }
.rblx-expiry { font-size: 10.5px; font-weight: 700; color: var(--muted-2); margin-bottom: 10px; }
#rblx-check { margin-top: 6px; }
#rblx-restart { margin-top: 8px; }
#rblx-check[disabled], #rblx-lookup-btn[disabled], #rblx-yes[disabled] { opacity: .6; cursor: default; }

/* — v7 email 6-digit code step — */
#code-flow { text-align: left; }
.code-lead {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 16px;
  text-align: center;
}
.code-dest { color: var(--blue-text); font-weight: 800; word-break: break-word; }
.code-input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: .42em;
  padding-right: 0;
  text-indent: .42em; /* balance the trailing letter-spacing so digits look centred */
}
#code-err { min-height: 18px; color: var(--red); font-size: 12px; font-weight: 700; margin: 2px 0 10px; }
#code-resend { margin: 12px auto 0; display: block; }
#code-resend[disabled] { opacity: .55; cursor: default; }
#code-submit[disabled] { opacity: .6; cursor: default; }

/* ==========================================================================
   V5 — TEAM COINFLIP (1v1 / 2v2 / 3v3 / 4v4)
   ========================================================================== */

/* — create modal: mode chips — */
.mode-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
}
.mode-pick__label { color: var(--muted); font-size: 12px; font-weight: 800; margin-right: auto; }
.mode-chip {
  padding: 8px 15px;
  border-radius: var(--r-btn);
  background: var(--bubble);
  border: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: border-color .15s, color .15s, background .15s, transform .08s;
}
.mode-chip:hover { color: #fff; }
.mode-chip:active { transform: scale(.96); }
.mode-chip.is-active {
  border-color: var(--blue);
  color: #fff;
  background: #1c1636;
  box-shadow: 0 0 10px rgba(47, 123, 246, .22);
}
.mode-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 600;
  margin: -6px 0 10px;
}

/* — join modal: team choice — */
.join-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bubble);
  border-radius: var(--r-row);
  padding: 10px 16px;
  margin-bottom: 12px;
}
.join-team-row__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: auto;
}
.team-chip {
  padding: 8px 15px;
  border-radius: var(--r-btn);
  background: var(--panel);
  border: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s, transform .08s;
}
.team-chip:hover { color: #fff; }
.team-chip:active { transform: scale(.96); }
#join-team-a.is-active {
  border-color: var(--blue);
  color: #fff;
  background: #1c1636;
  box-shadow: 0 0 10px rgba(47, 123, 246, .22);
}
#join-team-b.is-active {
  border-color: var(--gold);
  color: #fff;
  background: #2b2010;
  box-shadow: 0 0 10px rgba(255, 176, 32, .22);
}

/* — lobby rows: mode badge + stacked team avatars — */
.row__mode {
  flex: none;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  color: var(--blue-text);
  background: rgba(47, 123, 246, .12);
  border: 1px solid rgba(47, 123, 246, .35);
  border-radius: 6px;
  padding: 3px 7px;
  min-width: 34px;      /* every NvN badge same width so rows align */
  text-align: center;
}
.row--t .row__mode {
  color: var(--gold-2);
  background: rgba(255, 176, 32, .12);
  border-color: rgba(255, 176, 32, .35);
}
.row__stack {
  display: flex;
  align-items: center;
  flex: none;
}
.row__stack-av, .row__slot-open {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-left: -8px;
  background: var(--bubble);
  flex: none;
}
.row__stack > :first-child { margin-left: -4px; }
.row__stack-av {
  object-fit: cover;
  border: 2px solid var(--panel);
}
.row__slot-open {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #222b47;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
}

/* — game modal: team rosters inside the item lists — */
.gm-team-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px 7px;
}
.gm-team-player + .gm-team-player,
.gm-item + .gm-team-player { border-top: 1px solid rgba(26, 33, 56, .45); }
.gm-team-player__av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bubble);
  border: 2px solid var(--line);
  flex: none;
}
.gm-team-player__name {
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-team-player__val {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-2);
  flex: none;
}
.gm-team-player--open { color: var(--muted-2); }
.gm-team-player--open .gm-team-player__name { font-weight: 700; color: var(--muted-2); }
.gm-team-player__plus {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px dashed #222b47;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted-2);
  flex: none;
}
/* the team's items sit slightly indented under each player header */
.gm-team-player ~ .gm-item .item-thumb--sm { margin-left: 4px; }

/* winning team's list gets a lasting highlight on resolve */
.gm__items.is-winner {
  border-color: rgba(34, 222, 121, .55);
  box-shadow: 0 0 18px -4px rgba(34, 222, 121, .4);
}

/* — winner payouts under the coin — */
.gm-payouts {
  width: 100%;
  max-width: 320px;
  background: rgba(13, 19, 38, .92);
  border: 1px solid rgba(34, 222, 121, .35);
  border-radius: var(--r-btn);
  padding: 10px 12px;
  font-size: 12px;
}
.gm-payouts__title {
  color: var(--green);
  font-weight: 900;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.gm-payouts__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-weight: 700;
}
.gm-payouts__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-payouts__val { color: var(--green); font-weight: 800; flex: none; }

/* ==========================================================================
   V6 — MM2ROLL: sections · items-only · clearer team UI · per-slot Add Bot
   ========================================================================== */

/* — main sections (Coinflip / Jackpot / Marketplace / Profile share #main) — */
.app-section { min-width: 0; }
.soon-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px dashed #1c2440;
  border-radius: var(--r-panel);
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 30px;
}

/* — game modal: readable N/M players pill next to TEAM A/B — */
.gm-team-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(47, 123, 246, .14);
  border: 1px solid rgba(47, 123, 246, .4);
  color: var(--blue-text);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.gm-team-count.is-full {
  background: rgba(34, 222, 121, .12);
  border-color: rgba(34, 222, 121, .4);
  color: var(--green);
}

/* — team roster (v6 rework): each slot is a clear card-row inside the list — */
.gm__items--team { padding: 8px 10px; max-height: 340px; }
.gm__items--team .gm-team-player {
  background: rgba(18, 26, 46, .75);
  border: 1px solid rgba(26, 33, 56, .8);
  border-radius: var(--r-btn);
  padding: 8px 10px;
  margin: 8px 0 4px;
}
.gm__items--team .gm-team-player + .gm-team-player,
.gm__items--team .gm-item + .gm-team-player { border-top: 1px solid rgba(26, 33, 56, .8); }
.gm__items--team .gm-item { padding: 7px 4px 7px 12px; }
.gm-team-player__slot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 123, 246, .16);
  color: var(--blue-text);
  font-size: 10px;
  font-weight: 900;
}
.gm-team-player--open {
  border-style: dashed !important;
  border-color: #2a3352 !important;
  background: rgba(10, 15, 30, .55) !important;
}
.gm-team-player__addbot {
  margin-left: auto;
  flex: none;
  padding: 6px 12px;
  border-radius: var(--r-btn);
  background: rgba(255, 176, 32, .14);
  border: 1px solid rgba(255, 176, 32, .45);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .15s, color .15s, transform .08s;
}
.gm-team-player__addbot:hover { background: rgba(255, 176, 32, .28); color: #fff; }
.gm-team-player__addbot:active { transform: scale(.95); }
.gm-team-player--open .gm-team-player__name { margin-right: 8px; }

/* team-mode value chip under each roster header */
.gm-team-player__val { font-size: 12.5px; }

/* — Add Bot modal reuses the pick chassis; slightly narrower. It opens ON TOP
   of the game modal, so it stacks above the shared .modal z-index — */
#addbot-modal { z-index: 120; }
#addbot-modal .modal__panel--pick { width: 540px; }
#addbot-modal .inv-grid { max-height: 300px; }

/* ==========================================================================
   V6 — JACKPOT (lobby cards, the wheel, deposit picker, fairness)
   ========================================================================== */

/* — lobby — */
#jp-list { display: flex; flex-direction: column; gap: 13px; }

.jp-empty {
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 700;
  padding: 90px 0;
  border: 1px dashed #1c2440;
  border-radius: var(--r-panel);
}

.jp-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 12px 16px 12px 22px;
  background: linear-gradient(90deg, rgba(255, 176, 32, .10), rgba(255, 176, 32, 0) 34%), var(--panel);
  border-radius: var(--r-row);
  overflow: hidden;
  cursor: pointer;
  animation: row-in .35s ease-out both;
}
.jp-card__bar {
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.jp-card__pot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 108px;
  flex: none;
}
.jp-card__pot-val { font-size: 18px; font-weight: 800; color: var(--gold-2); }
.jp-card__pot-label { font-size: 10.5px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }

.jp-card__entries {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.jp-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: none;
  width: 46px;
}
.jp-slot__av {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--blue);
  background: var(--bubble);
}
.jp-slot__pct { font-size: 10px; font-weight: 800; }
.jp-slot--open { justify-content: flex-start; }
.jp-slot__plus {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px dashed #222b47;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 15px;
  font-weight: 800;
}
.jp-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: none;
}

/* — recent spins strip under the lobby — */
#jp-recent-wrap { margin-top: 26px; }
.jp-recent__title {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}
#jp-recent { display: flex; flex-direction: column; gap: 8px; }
.jp-recent__row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bubble);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s;
}
.jp-recent__row:hover { background: #172037; }
.jp-recent__date { color: var(--muted-2); font-weight: 600; width: 118px; flex: none; }
.jp-recent__chip { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.jp-recent__who {
  flex: 1;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jp-recent__val { font-weight: 800; color: var(--text); flex: none; }

/* — round modal (same dark spotlight framing as the coinflip game modal) — */
.modal__panel--jackpot {
  width: 1080px;
  padding: 20px 22px 14px;
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(255, 176, 32, .26), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(190, 160, 120, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(190, 160, 120, .05) 39px 40px),
    linear-gradient(180deg, #0d0c16, #090812);
  overflow-x: hidden;
}
#jp-modal.jp--win .modal__panel--jackpot {
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(34, 222, 121, .26), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(120, 190, 150, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(120, 190, 150, .05) 39px 40px),
    linear-gradient(180deg, #0a1116, #080d11);
}
#jp-modal.jp--house .modal__panel--jackpot {
  background:
    radial-gradient(560px 300px at 50% -40px, rgba(160, 165, 180, .22), transparent 72%),
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(150, 155, 175, .05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(150, 155, 175, .05) 39px 40px),
    linear-gradient(180deg, #0c0e15, #090a10);
}
#jp-modal .jp-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(18, 26, 46, .7); }

/* ── LEFT: live-chat column (the ONE global chat is relocated in here) ── */
.jp-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(9, 13, 26, .55);
  border: 1px solid rgba(26, 33, 56, .6);
  border-radius: 16px;
  overflow: hidden;
}
.jp-chat__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 10px;
  font-size: 12px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid rgba(26, 33, 56, .5);
}
.jp-chat__head .ico { width: 15px; height: 15px; color: var(--blue-text); }
.jp-chat__mount { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.jp-chat__mount > #chat-list { flex: 1 1 auto; min-height: 0; }
.jp-chat__mount > .chat-composer { margin: 8px 10px; }
.jp-chat__mount > .chat-foot { padding: 4px 12px 10px; }

/* ── CENTER: players list header ── */
.jp-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 12px; }
.jp-center__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800; letter-spacing: -.3px;
  padding-right: 40px;
}
.jp-center__gem {
  width: 15px; height: 15px; border-radius: 4px; transform: rotate(45deg);
  background: linear-gradient(135deg, #8fbaff, #5b9dff);
  box-shadow: 0 0 12px rgba(91, 157, 255, .6);
  flex: none;
}
.jp-center__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jp-players { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: var(--text); }
.jp-players__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.jp-pot-total { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--gold-2); }
.jp-pot-total .coin-r { width: 18px; height: 18px; }

.jp-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;   /* players | wheel (chat removed) */
  gap: 20px;
  align-items: stretch;
  height: min(560px, 74vh);   /* definite height → inner columns scroll, not inflate */
}

/* ── RIGHT: the donut wheel ── */
.jp-wheel-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.jp-wheel-wrap {
  position: relative;
  width: 360px;
  height: 360px;
  max-width: 100%;
  flex: none;
}
.jp-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* arcs painted by the client via conic-gradient */
  background: conic-gradient(#1c2440 0deg 360deg);
  will-change: transform;
}
/* donut: mask out the inner 60% of the radius → a thick colored ring.
   The 60% inner radius is mirrored in app.js (JP_RING_AVATAR_FRAC) so the
   rim avatars land on the band's centerline. */
.jp-wheel--donut {
  border: 0;
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 60%, #000 60.5%);
          mask: radial-gradient(circle closest-side, transparent 0 60%, #000 60.5%);
  box-shadow: 0 0 0 2px rgba(9, 13, 26, .9), 0 18px 55px rgba(0, 0, 0, .6);
}
/* v9.9: NO idle rotation — a static wheel keeps each rim avatar sitting on the
   colored segment it belongs to (the avatar overlay does not rotate). */
.jp-wheel.is-idle { animation: none; }
@keyframes jp-idle { to { transform: rotate(360deg); } }

.jp-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 0; height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 24px solid #eef3ff;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6));
}
.jp-pointer::after {
  content: "";
  position: absolute;
  left: -7px;
  top: -26px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #eef3ff;
}

/* avatars resting on the ring (static — a rim legend; not rotated by the spin) */
.jp-avatars { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.jp-av {
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #5b9dff;
  background: var(--bubble);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .55);
}

.jp-hub {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #131c33, #0a0f1d 78%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  text-align: center;
}
.jp-hub__coin { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(255, 176, 32, .4)); }
.jp-hub__pot {
  font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.5px; line-height: 1.05;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jp-hub__label { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 3px; }
.jp-hub__max { color: var(--muted); font-size: 12.5px; font-weight: 800; }
.jp-hub__items { margin-top: 6px; }

.jp-status {
  font-size: 13.5px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  min-height: 18px;
}
.jp-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}
.jp-actions__join { width: 100%; padding: 13px; font-size: 14px; }

/* — legacy side-count pill (kept for the hidden #jp-entry-count element) — */
.jp-side__count {
  background: rgba(47, 123, 246, .14);
  border: 1px solid rgba(47, 123, 246, .4);
  color: var(--blue-text);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 800;
}

/* ── CENTER: player cards ── */
.jp-entries {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 2px 4px 2px 0;
}
.jp-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 22, 41, .72);
  border: 1px solid rgba(36, 46, 78, .6);
  transition: opacity .3s, box-shadow .3s, border-color .2s;
}
.jp-entry__avwrap { position: relative; flex: none; }
.jp-entry__av {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--seg, var(--line));
  background: var(--bubble);
  box-shadow: 0 0 0 2px rgba(9, 13, 26, .8), 0 0 14px -2px var(--seg, transparent);
  display: block;
}
.jp-entry__idcol { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.jp-entry__id { display: flex; align-items: center; gap: 7px; min-width: 0; }
.jp-entry__name {
  font-size: 14px;
  font-weight: 800;
  color: #eaf1ff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jp-entry__bot {
  flex: none;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--muted-2);
  border: 1px solid #2a3352;
  border-radius: 4px;
  padding: 1px 5px;
}
.jp-thumbs { display: flex; align-items: center; gap: 4px; }
.jp-thumb {
  width: 22px; height: 22px;
  border-radius: 6px;
  object-fit: cover;
  background: #0c1226;
  border: 1px solid rgba(36, 46, 78, .7);
  flex: none;
}
.jp-thumb-more {
  font-size: 10px; font-weight: 800; color: var(--muted);
  background: #0c1226; border: 1px solid rgba(36, 46, 78, .7);
  border-radius: 6px; padding: 3px 6px;
  flex: none;
}
.jp-entry__right { display: flex; align-items: center; gap: 8px; flex: none; }
.jp-entry__stat { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; order: 1; }
.jp-entry__pct { font-size: 14px; font-weight: 800; color: var(--gold-2); }
.jp-entry__val { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.jp-entry__val .coin-r { width: 15px; height: 15px; }
.jp-entry__val b { color: #cdd5ea; font-weight: 800; }
.jp-entry__eye { width: 30px; height: 30px; color: var(--muted-2); order: 2; }
.jp-entry__eye:hover:not(:disabled) { color: var(--text); }
.jp-entry__eye:disabled { opacity: .35; cursor: default; }

.jp-entry--you { border-color: rgba(91, 157, 255, .55); background: rgba(24, 38, 72, .6); }

/* slim open-slot + house rows */
.jp-entry--open {
  padding: 9px 14px;
  background: transparent;
  border: 1px dashed rgba(36, 46, 78, .6);
  color: var(--muted-2);
}
.jp-entry--open .jp-entry__name { color: var(--muted-2); font-weight: 700; font-size: 12.5px; }
.jp-entry__plus {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px dashed #2a3352;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted-2);
  flex: none;
}
.jp-entry--house {
  padding: 9px 14px;
  background: rgba(92, 32, 51, .16);
  border: 1px dashed rgba(240, 69, 74, .35);
}
.jp-entry--house .jp-entry__chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.jp-entry__items { flex: 1; color: var(--muted-2); font-size: 11px; font-weight: 700; }
.jp-entry__name--house { color: var(--red); letter-spacing: .08em; flex: none; font-size: 12.5px; }
.jp-entry__pct--house { color: var(--red); flex: none; font-size: 12px; font-weight: 800; }

/* resolve: winner glows, everyone else dims */
.jp-entries.is-done .jp-entry { opacity: .4; }
.jp-entries.is-done .jp-entry.is-winner {
  opacity: 1;
  border-color: var(--green);
  box-shadow: 0 0 0 1.5px var(--green), 0 0 22px -4px rgba(34, 222, 121, .6);
  background: rgba(34, 222, 121, .1);
}
#jp-modal.jp--house .jp-entries.is-done .jp-entry--house { opacity: 1; box-shadow: 0 0 0 1.5px var(--red), 0 0 18px -2px rgba(240, 69, 74, .4); }

.jp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(26, 33, 56, .5);
}
#jp-created { color: var(--muted-2); font-size: 12px; font-weight: 700; }

/* — deposit picker + fairness stack above the round modal — */
#jp-pick-modal { z-index: 120; }
#jp-fair-modal { z-index: 130; }
#jp-pick-modal .inv-grid { max-height: 300px; }
#jp-pick-info { font-size: 14px; font-weight: 800; color: var(--gold-2); }

/* — fairness segments table — */
.jp-fair-segs__title {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.jp-fair-segs { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow-y: auto; }
.jp-fair-seg {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bubble);
  border-radius: var(--r-btn);
  padding: 7px 10px;
  font-size: 12px;
}
.jp-fair-seg__chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.jp-fair-seg__name {
  font-weight: 800;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jp-fair-seg__band { flex: none; color: var(--blue-text); font-size: 11px; background: rgba(7, 11, 22, .6); border-radius: 5px; padding: 2px 7px; }
.jp-fair-seg__val { flex: none; color: var(--muted); font-size: 11px; font-weight: 700; }

/* — responsive: drop the chat column, then stack players/wheel — */
@media (max-width: 1120px) {
  .modal__panel--jackpot { width: auto; }
  .jp-body { grid-template-columns: minmax(0, 1fr) 340px; }
  .jp-chat { display: none; }            /* chat stays in the sidebar/drawer (app.js won't relocate it) */
}
@media (max-width: 820px) {
  .jp-body { grid-template-columns: 1fr; height: auto; }
  .jp-wheel-zone { order: -1; }          /* wheel on top when stacked */
  .jp-entries { flex: none; max-height: 320px; }
}
@media (max-width: 880px) {
  .modal__panel--jackpot { padding: 20px 14px 12px; }
}
@media (max-width: 480px) {
  .jp-wheel-wrap { width: 288px; height: 288px; }
  .jp-hub { width: 172px; height: 172px; }
  .jp-hub__pot { font-size: 25px; }
  .jp-av { width: 30px; height: 30px; border-width: 2px; }
  .jp-card { flex-wrap: wrap; }
  .jp-card__actions { width: 100%; justify-content: flex-start; }
}

/* ==========================================================================
   V6 — PROFILE · MARKETPLACE · INFO PAGES (§6/§7/§8, profile-market)
   ========================================================================== */

/* — clickable player identities (names/avatars that open a public profile) — */
.plink { cursor: pointer; }
span.plink:hover, .chat-msg__name.plink:hover, .gm-team-player__name.plink:hover,
.jp-entry__name.plink:hover, #gm-l-name.plink:hover, #gm-r-name.plink:hover {
  color: var(--blue-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
img.plink { transition: filter .15s, transform .12s; }
img.plink:hover { filter: brightness(1.25); transform: translateY(-1px); }
.row__avatar.plink:hover, .row__opp.plink:hover, .jp-slot.plink:hover { filter: brightness(1.2); }

/* — static (read-only) grid cells: browsable, never selectable — */
.inv-item--static { cursor: default; }
.inv-item--static:hover { background: #0d1326; transform: none; }

/* — public profile modal + own-profile section share the .pf-* pieces — */
#profile-modal { z-index: 140; }   /* stacks above game/jackpot modals */
.modal__panel--profile { width: 720px; }
.pf-body { min-height: 120px; }

.pf-head {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, rgba(47, 123, 246, .10), rgba(47, 123, 246, 0) 55%), var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 18px 22px;
  margin-bottom: 14px;
}
.pf-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue);
  background: var(--bubble);
  flex: none;
}
.pf-id { flex: 1; min-width: 0; }
.pf-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.pf-name__text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-you {
  flex: none;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--blue-text);
  background: rgba(47, 123, 246, .16);
  border: 1px solid rgba(47, 123, 246, .45);
  border-radius: 999px;
  padding: 2px 8px;
}
.pf-joined { color: var(--muted-2); font-size: 12px; font-weight: 700; margin-top: 5px; }
.pf-worth { text-align: right; flex: none; }
.pf-worth b { display: block; font-size: 21px; font-weight: 800; color: var(--gold-2); }
.pf-worth span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.pf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.pf-stat {
  background: rgba(13, 19, 38, .7);
  border: 1px solid rgba(26, 33, 56, .8);
  border-radius: var(--r-btn);
  padding: 12px 14px;
  min-width: 0;
  overflow: hidden;   /* v12d: keep the label text inside the card frame */
}
.pf-stat b {
  display: block;
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-stat span {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.25;
  white-space: normal;        /* v12d: wrap the label so it never spills the frame */
  overflow-wrap: anywhere;
}

.pf-inv-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 800;
}
.pf-inv-count { color: var(--muted-2); font-size: 11.5px; font-weight: 700; }
.pf-body .pf-inv-grid { max-height: 300px; }
#profile-root .pf-inv-grid { max-height: 520px; }

/* — v10: own-profile "Account Settings" edit affordance (in .pf-head) — */
.pf-edit { flex: none; align-self: center; white-space: nowrap; }

/* ==========================================================================
   ACCOUNT SETTINGS MODAL (v10 — email / password / Roblox link)
   ========================================================================== */

#settings-modal { z-index: 150; }   /* stacks above the profile modal (140) */
#settings-modal .settings-panel { width: 560px; }
.aset-body {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aset-block {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 18px;
}
.aset-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue-text);
  margin: 0 0 10px;
}
.aset-current {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.aset-current b { color: var(--text, #fff); font-weight: 800; }
.aset-note {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 10px;
}
.aset-err {
  min-height: 16px;
  color: var(--red, #f0454a);
  font-size: 12.5px;
  font-weight: 700;
  margin: 2px 0 6px;
}
.aset-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.aset-btns .btn { flex: none; }
.aset-linked {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(34, 222, 121, .08);
  border: 1px solid rgba(34, 222, 121, .4);
  border-radius: var(--r-btn);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
}
.aset-linked .ico { width: 18px; height: 18px; flex: none; }
.aset-linked b { font-weight: 800; }

@media (max-width: 720px) {
  #settings-modal .settings-panel { width: 100%; }
  .aset-body { max-height: 74vh; }
  .aset-btns .btn { flex: 1 1 auto; }
}

/* — marketplace scaffold (§6) — */
.pm-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 26px 28px;
  margin-bottom: 22px;
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 140px at 88% 0%, rgba(255, 176, 32, .12), transparent 70%),
    linear-gradient(120deg, rgba(47, 123, 246, .14), rgba(47, 123, 246, 0) 55%),
    var(--panel);
  overflow: hidden;
}
.pm-cta__badge {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--gold-2);
  background: rgba(255, 176, 32, .14);
  border: 1px solid rgba(255, 176, 32, .45);
  border-radius: 999px;
  padding: 3px 10px;
}
.pm-cta__title { font-size: 21px; font-weight: 900; letter-spacing: -.3px; }
.pm-cta__sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  max-width: 560px;
}
.pm-cta .btn { margin-top: 6px; }

.pm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pm-toolbar__title { font-size: 14px; font-weight: 800; }
.pm-count { color: var(--muted-2); font-size: 11.5px; font-weight: 700; }
.pm-search {
  margin-left: auto;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  width: 230px;
  max-width: 100%;
}
.pm-search::placeholder { color: var(--muted-2); }
.pm-search:focus { border-color: rgba(47, 123, 246, .6); outline: none; }
#market-root .pm-grid { max-height: 560px; }

/* — info modal: Rules / Provably Fair / TOS / AML / Support (§8) — */
#info-modal { z-index: 150; }      /* readable on top of anything */
.modal__panel--info { width: 620px; }
.info-body {
  max-height: 64vh;
  overflow-y: auto;
  padding-right: 6px;
}
.info-body h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--blue-text);
  margin: 16px 0 8px;
}
.info-body h3:first-child { margin-top: 0; }
.info-body p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 10px;
}
.info-body ul {
  margin: 2px 0 14px;
  padding-left: 20px;
}
.info-body li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 7px;
}
.info-body li::marker { color: var(--blue); }
.info-actions { margin-top: 14px; }

@media (max-width: 720px) {
  .pf-head { flex-wrap: wrap; }
  .pf-worth { text-align: left; }
  .pm-search { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   DEPOSIT MODAL (v8 — trade real MM2 items to the site bot)
   ========================================================================== */

#deposit-modal .modal__panel--pick { width: 620px; }

.dep-lead {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 12px;
}
.dep-warn {
  background: rgba(240, 69, 74, .1);
  border: 1px solid var(--red);
  border-left: 4px solid var(--red);
  border-radius: var(--r-row);
  color: #ffd7d7;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.55;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.dep-warn b { color: #fff; }
.dep-err { min-height: 16px; color: var(--red); font-size: 12px; font-weight: 700; margin: 4px 0; }

.dep-search {
  width: 200px;
  padding: 8px 12px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.dep-search:focus { outline: none; border-color: var(--blue); }
.dep-search::placeholder { color: var(--muted-2); }

.dep-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1c1636;
  border: 1px solid var(--blue);
  border-radius: var(--r-chip);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
}
.dep-chip__x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 2px;
}
.dep-chip__x:hover { color: var(--red); }

.dep-grid { max-height: 300px; }
.dep-grid:empty::before { content: "Loading the weapon catalog…"; }

.dep-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 26px 6px;
}
.dep-loading .rblx-spinner { margin-top: 0; }

.dep-bot-card {
  background: var(--bubble);
  border-radius: var(--r-row);
  padding: 14px 16px;
  margin-bottom: 6px;
}
.dep-bot-found { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.dep-bot-found b { color: var(--green); }
.dep-instr {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.9;
}
.dep-instr b { color: #fff; }
.dep-instr a { color: var(--blue-text); font-weight: 700; word-break: break-all; }
.dep-instr-note { margin: 0; color: var(--muted-2); font-size: 11.5px; font-weight: 600; }
.dep-instr-note b { color: var(--gold-2); }

/* v-next deposit search step — orange verify banner + clean bot ROW
   (scoped to #dep-* / .dep-verify so the withdraw modal's shared .dep-bot-card
   keeps its original look). */
.dep-verify {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: linear-gradient(180deg, rgba(255, 176, 32, .16), rgba(255, 176, 32, .05));
  border: 1px solid rgba(255, 176, 32, .55);
  border-radius: var(--r-row);
  color: #ffd9a0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.dep-verify__ico {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1206;
  font-size: 13px;
  font-weight: 900;
}

/* the bot-card wrapper is now just a group; the row inside carries the frame */
#dep-bot-card { background: transparent; padding: 0; margin-bottom: 2px; }
.dep-botrow {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  padding: 10px 12px;
}
.dep-botrow__av { position: relative; flex: none; width: 40px; height: 40px; }
.dep-botrow__av img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #121a2e;
  display: block;
}
.dep-botrow__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid var(--panel);
  box-shadow: 0 0 6px rgba(34, 222, 121, .8);
}
.dep-botrow__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.dep-botrow__join {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 9px 22px;
  border-radius: var(--r-btn);
  background: linear-gradient(180deg, #43d47f, #29b866);
  color: #062015;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 222, 121, .3);
  transition: filter .15s, transform .1s;
}
.dep-botrow__join:hover { filter: brightness(1.08); }
.dep-botrow__join:active { transform: scale(.97); }
.dep-botrow__join.is-disabled { opacity: .5; pointer-events: none; }
.dep-botrow__foot {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.dep-result-title { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.dep-result-title.is-ok { color: var(--green); }
.dep-result-title.is-err { color: var(--red); }
.dep-result-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.dep-received { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.dep-recv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bubble);
  border-radius: var(--r-row);
  padding: 8px 12px;
}
.dep-recv-row img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.dep-recv-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}
.dep-recv-badge {
  flex: none;
  color: var(--gold-2);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dep-recv-badge.is-credited { color: var(--green); }
.dep-recv-badge.is-failed { color: var(--red, #ff5a5a); }
.dep-recv-badge.is-recorded { color: var(--gold-2); text-transform: none; letter-spacing: normal; }
.dep-recv-badge .item-val__coin { width: 12px; height: 12px; vertical-align: -2px; margin-right: 2px; }
#dep-credited { max-height: 220px; margin: 8px 0 14px; }
.dep-step .modal__foot { margin-top: 14px; }

/* ==========================================================================
   WITHDRAW MODAL (v8 — the site bot SENDS the user real MM2 items)
   Reuses the .dep-* components above (wd-* ids); only the shell needs a rule.
   ========================================================================== */

#withdraw-modal .modal__panel--pick { width: 620px; }

@media (max-width: 880px) {
  #deposit-btn, #withdraw-btn { padding: 10px 12px; font-size: 11px; }
  .dep-search { width: 150px; }
}

/* ==========================================================================
   v9 D6 — trade-settle status badges (deposit/withdraw 'unconfirmed' state:
   the confirm call died but the in-game trade may have completed; the server
   harvester settles it exactly-once, the Check-status button polls it)
   ========================================================================== */

.status-badge {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status-badge--unconfirmed {
  color: var(--gold-2);
  border: 1px solid rgba(255, 176, 32, .55);
  background: rgba(255, 176, 32, .12);
}

/* ==========================================================================
   v9 D1 — CRYPTO WALLET MODAL (phase A). Amounts are rendered from base-unit
   strings by app.js (pure string math) — this is layout only.
   ========================================================================== */

.btn--wallet {
  background: linear-gradient(180deg, #22de79, #23a558);
  color: #06130b;
}
.btn--wallet:hover { filter: brightness(1.08); }

.wallet-panel { max-width: 560px; width: min(560px, calc(100vw - 24px)); }

/* segmented control — one framed track, borderless equal-width pills */
.wallet-tabs {
  display: flex;
  gap: 4px;
  margin: 2px 0 16px;
  padding: 4px;
  background: var(--bg-2, #070b16);
  border: 1px solid var(--line, #1a2138);
  border-radius: 10px;
}
.wallet-tab {
  flex: 1;
  text-align: center;
  background: transparent;
  border: 0;
  color: var(--muted, #828ca6);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .14s, background .14s;
}
.wallet-tab:hover { color: #cfd6e6; }
.wallet-tab.is-active {
  color: #fff;
  background: rgba(47, 123, 246, .18);
  box-shadow: inset 0 0 0 1px rgba(47, 123, 246, .55);
}

.wallet-body { min-height: 240px; }
.wallet-view { display: flex; flex-direction: column; gap: 7px; }

.wallet-label {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-2, #5c6584);
  margin-top: 12px;
}
.wallet-view > .wallet-label:first-child { margin-top: 0; }

.wallet-select, .wallet-input {
  background: var(--bubble, #121a2e);
  border: 1px solid var(--line, #1a2138);
  border-radius: 8px;
  color: var(--text, #fff);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 13px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.wallet-input::placeholder { color: var(--muted-2, #5c6584); }
.wallet-select:focus, .wallet-input:focus {
  outline: none;
  border-color: var(--blue, #2f7bf6);
  box-shadow: 0 0 0 3px rgba(47, 123, 246, .18);
}

/* custom chevron on the asset selects (CSP-safe: CSS-drawn, no data URI) */
.wallet-select-wrap { position: relative; display: block; }
.wallet-select-wrap .wallet-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  cursor: pointer;
}
.wallet-select-wrap::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted, #828ca6);
  border-bottom: 2px solid var(--muted, #828ca6);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.wallet-note { font-size: 12px; color: var(--muted, #828ca6); line-height: 1.5; }
/* the network-fee / min line reads as a tidy info box under the amount field */
#wallet-wd-fee:not(:empty) {
  background: var(--bubble, #121a2e);
  border: 1px solid var(--line, #1a2138);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 2px;
}
#wallet-wd-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 13.5px;
}
.wallet-err { font-size: 12.5px; font-weight: 700; color: var(--red, #f0454a); min-height: 16px; }

.wallet-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  background: var(--bubble, #121a2e);
  border: 1px dashed var(--blue, #2f7bf6);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--blue-text, #4c9aff);
  user-select: all;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bubble, #121a2e);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.wallet-row__coin { font-weight: 900; min-width: 46px; }
.wallet-row__chain { color: var(--muted-2, #5c6584); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-row__amt { font-weight: 800; }
/* v-next: amount + rough ≈$ estimate, stacked & right-aligned */
.wallet-row__vals { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; margin-left: auto; }
.wallet-row__usd { color: var(--muted-2, #5c6584); font-weight: 700; font-size: 10.5px; }
.wallet-pos { color: var(--green, #22de79); }
.wallet-neg { color: var(--red, #f0454a); }

.wallet-status {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line, #1a2138);
  color: var(--muted, #828ca6);
}
.wallet-status--credited, .wallet-status--confirmed, .wallet-status--sent { color: var(--green, #22de79); border-color: rgba(34, 222, 121, .5); }
.wallet-status--pending, .wallet-status--detected, .wallet-status--processing { color: var(--gold-2, #ffb020); border-color: rgba(255, 176, 32, .5); }
.wallet-status--failed, .wallet-status--rejected, .wallet-status--canceled, .wallet-status--orphaned { color: var(--red, #f0454a); border-color: rgba(240, 69, 74, .5); }

.wallet-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.wallet-dep-out { display: flex; flex-direction: column; gap: 8px; }

/* PHASE A deposit QR — WHITE tile: scanners need light quiet-zone + contrast
   regardless of the site theme. The SVG scales inside the fixed tile. */
.wallet-qr {
  align-self: center;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  line-height: 0;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}
.wallet-qr img { width: 180px; height: 180px; max-width: 58vw; display: block; }

@media (max-width: 640px) {
  .wallet-panel { width: calc(100vw - 16px); }
  .wallet-tabs { flex-wrap: wrap; }
}

/* ==========================================================================
   MARKETPLACE (v9 D2) — directory cards, item page rows, sell/buy modals.
   Reuses the wallet-* form classes; everything below is mk-* only.
   ========================================================================== */

/* --- v9.9 stat header: 4 cards fed by REAL /api/market/stats --- */
.mk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.mk-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 15px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--line, #1a2138);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .014), rgba(255, 255, 255, 0)),
    var(--panel-2, #0e1428);
}
.mk-stat__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mk-stat__label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.1px;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-stat__sub {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2, #5c6584);
  white-space: nowrap;
}
.mk-stat__val {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.mk-stat__num {
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.6px;
  color: var(--blue-text, #4c9aff);
  font-variant-numeric: tabular-nums;
}
.mk-stat__unit {
  font-size: 14px;
  font-weight: 800;
  color: var(--text, #fff);
}
.mk-stat__coin {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
}
/* the highlighted "Total Volume" card (card 2) */
.mk-stat--hl {
  border-color: rgba(47, 123, 246, .34);
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(47, 123, 246, .16), transparent 58%),
    linear-gradient(180deg, #111c37, #0d1426);
  box-shadow: 0 8px 24px rgba(3, 8, 20, .45), inset 0 0 0 1px rgba(47, 123, 246, .08);
}
.mk-stat--hl .mk-stat__num { color: var(--text, #fff); }

/* --- toolbar: ⚡ Instant Sell · wide search · My listings · sort --- */
.mk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.mk-sell-btn {
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 18px;
  height: 44px;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}
.mk-sell-btn__ico { width: 16px; height: 16px; }
.mk-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-btn, 8px);
  background: var(--bubble, #121a2e);
  border: 1px solid var(--line, #1a2138);
  transition: border-color .15s ease, background .15s ease;
}
.mk-search:focus-within { border-color: rgba(47, 123, 246, .6); background: #141d34; }
.mk-search__ico { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted-2, #5c6584); }
.mk-search__input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text, #fff);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
}
.mk-search__input::placeholder { color: var(--muted-2, #5c6584); }
.mk-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.mk-mine-btn { flex: 0 0 auto; height: 44px; font-size: 12.5px; }
.mk-sort { position: relative; flex: 0 0 auto; }
.mk-sort__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-btn, 8px);
}
.mk-sort__btn .ico { width: 18px; height: 18px; }
.mk-sort__btn.is-open { color: var(--text, #fff); background: #1a2440; border-color: rgba(47, 123, 246, .5); }
.mk-sort__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line, #1a2138);
  background: var(--panel, #0c1120);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.mk-sort__head {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2, #5c6584);
  padding: 5px 9px 7px;
}
.mk-sort__opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted, #828ca6);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.mk-sort__opt:hover { background: var(--bubble, #121a2e); color: var(--text, #fff); }
.mk-sort__opt.is-on { color: var(--blue-text, #4c9aff); background: rgba(47, 123, 246, .1); }
.mk-result-note {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2, #5c6584);
  margin: 0 0 12px 2px;
}
.mk-note {
  background: rgba(255, 176, 32, .08);
  border: 1px solid rgba(255, 176, 32, .35);
  color: var(--gold-2, #ffb020);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* --- directory grid (v9.2 rework: BIG cards, ~5/row desktop -> 4/3/2) ---
   Fixed column counts per breakpoint (not auto-fill) so the "5-ish per row on
   desktop, gracefully collapsing" promise holds regardless of item name
   lengths; every card is image-first with the name + "X sellers" line. */
.mk-dir {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1560px) {
  .mk-dir { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-height: 196px;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--tier, #2f7bf6) 9%, transparent), transparent 62%),
    var(--panel-2, #0e1428);
  border: 1px solid var(--line, #1a2138);
  border-radius: 14px;
  padding: 15px 12px 14px;
  cursor: pointer;
  color: var(--text, #fff);
  font: inherit;
  text-align: center;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.mk-card::after {                                   /* thin tier accent on top */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tier, var(--blue, #2f7bf6));
  opacity: .55;
  transition: opacity .15s ease;
}
.mk-card:hover, .mk-card:focus-visible {
  border-color: var(--tier, var(--blue, #2f7bf6));
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
  outline: none;
}
.mk-card:hover::after, .mk-card:focus-visible::after { opacity: 1; }
.mk-card__thumb {
  width: 108px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .04);
  padding: 8px;
}
.mk-card__thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.mk-card__name {
  font-size: 13.5px;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mk-card__type { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--tier, var(--muted-2, #5c6584)); }
.mk-card__count {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--green, #22de79);
  background: rgba(34, 222, 121, .1);
  border: 1px solid rgba(34, 222, 121, .4);
  border-radius: 999px;
  padding: 3px 10px;
}
.mk-card__count--dim { color: var(--muted-2, #5c6584); background: none; border-color: var(--line, #1a2138); }
.mk-card__floors { display: flex; flex-direction: column; gap: 5px; align-items: center; min-height: 20px; }
.mk-card__floors--empty { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2, #5c6584); }
.mk-floor {
  font-size: 13px;
  font-weight: 900;
  color: var(--gold-2, #ffb020);
  background: rgba(255, 176, 32, .1);
  border: 1px solid rgba(255, 176, 32, .28);
  border-radius: 8px;
  padding: 3px 10px;
}

/* --- item page + my listings --- */
.mk-back { margin-bottom: 10px; }
.mk-item { display: flex; flex-direction: column; gap: 8px; max-width: 920px; }
.mk-item__head {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel-2, #0e1428);
  border: 1px solid var(--line, #1a2138);
  border-radius: 14px;
  padding: 14px;
}
.mk-item__thumb { width: 72px; height: 72px; flex: 0 0 auto; }
.mk-item__thumb img { width: 100%; height: 100%; object-fit: contain; }
.mk-item__meta { flex: 1; min-width: 0; }
.mk-item__name { font-size: 16px; font-weight: 900; }
.mk-item__type { font-size: 11.5px; font-weight: 700; color: var(--muted, #828ca6); }
.mk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bubble, #121a2e);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
}
.mk-row--dim { opacity: .65; }
.mk-row__seller { flex: 1; font-weight: 700; color: var(--muted, #828ca6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row__price { font-weight: 900; color: var(--gold-2, #ffb020); }
.mk-row__mine { font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2, #5c6584); }
.mk-status {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line, #1a2138);
  color: var(--muted, #828ca6);
}
.mk-status--active { color: var(--green, #22de79); border-color: rgba(34, 222, 121, .5); }
.mk-status--sold { color: var(--gold-2, #ffb020); border-color: rgba(255, 176, 32, .5); }
.mk-status--cancelled { color: var(--red, #f0454a); border-color: rgba(240, 69, 74, .5); }

/* --- sell / buy modals --- */
.market-panel { max-width: 560px; width: min(560px, calc(100vw - 24px)); }
.mk-modal-body { display: flex; flex-direction: column; gap: 8px; }
.mk-sell-grid {
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}
.mk-pick { cursor: pointer; border: 1px solid transparent; font: inherit; color: inherit; }
.mk-pick.is-picked {
  border-color: var(--gold-2, #ffb020);
  box-shadow: 0 0 0 2px rgba(255, 176, 32, .35);
  border-radius: 10px;
}
.mk-buy__price { font-size: 20px; font-weight: 900; color: var(--gold-2, #ffb020); }
.mk-hint { margin: 2px 0 0; }

@media (max-width: 640px) {
  .market-panel { width: calc(100vw - 16px); }
  /* roomier tap targets on cards/rows (the 2-column grid switch lives in the
     LAST <=640px block below so it wins over the <=880px 3-column rule) */
  .mk-card { min-height: 172px; padding: 13px 10px 12px; }
  .mk-card__thumb { width: 88px; height: 84px; }
  /* stat header -> 2x2; the highlighted volume card keeps its treatment */
  .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mk-stat { padding: 12px 13px 13px; }
  .mk-stat__num { font-size: 21px; }
  /* toolbar wraps: sell + my-listings + sort on top, search full-width below */
  .mk-toolbar { flex-wrap: wrap; }
  .mk-sell-btn { flex: 1 1 auto; }
  .mk-search { order: 3; flex: 1 1 100%; }
  .mk-row { flex-wrap: wrap; padding: 10px 12px; }
  .mk-row .btn { min-height: 38px; }
  .mk-item__head { flex-wrap: wrap; }
  .mk-item__head .btn { flex: 1 1 100%; min-height: 40px; }
}

/* ==========================================================================
   v9 D3 — SUPPORT CENTER (#support-modal) + sidenav unread badge
   ========================================================================== */

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.modal__panel--support {
  width: min(560px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  max-height: min(640px, calc(100vh - 48px));
}
.modal__panel--support #sup-list-view,
.modal__panel--support #sup-thread-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 120px;
  max-height: 380px;
  padding: 2px;
}

.sup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}
.sup-row:hover { border-color: var(--blue); }
.sup-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sup-row__subject {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-row__meta { color: var(--muted-2); font-size: 11px; font-weight: 600; }
.sup-row__right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.sup-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.sup-status {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.sup-status--open { color: var(--green); border-color: rgba(34, 222, 121, .5); }
.sup-status--closed { color: var(--muted-2); }

.sup-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sup-thread-subject {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sup-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 140px;
  max-height: 320px;
  padding: 2px;
  margin-bottom: 10px;
}

.sup-msg {
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  padding: 8px 12px;
  max-width: 88%;
}
.sup-msg--user { align-self: flex-end; border-color: rgba(47, 123, 246, .45); }
.sup-msg--admin { align-self: flex-start; border-color: rgba(255, 176, 32, .45); }
.sup-msg__who { font-size: 10.5px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.sup-msg--admin .sup-msg__who { color: var(--gold-2); }
.sup-msg__ts { font-weight: 600; text-transform: none; letter-spacing: 0; }
.sup-msg__text { font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

.sup-composer { display: flex; flex-direction: column; gap: 8px; }
.sup-composer__row { display: flex; justify-content: space-between; gap: 8px; }
.sup-ta { resize: vertical; min-height: 40px; font: inherit; }

@media (max-width: 640px) {
  .modal__panel--support { width: calc(100vw - 16px); }
  .sup-msg { max-width: 100%; }
}

/* ==========================================================================
   v9 D4 — UI/UX OVERHAUL
   1) clarity badges (.you-pill / .side-tag / jackpot YOU markers)
   2) chat emoji picker (#emoji-pop — native unicode, CSP-safe)
   3) mobile chrome: bottom tab bar (#tabbar), chat drawer (<=1100px #chat),
      chat FAB (881–1100px), shared .modal__panel responsive pass
   4) polish (empty states, consistent chips, touch targets)
   ========================================================================== */

/* -- clarity: "this is YOU" pill ----------------------------------------- */
.you-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3fd57e, #23a659);
  color: #04120a;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: 0 0 10px rgba(34, 222, 121, .45);
  white-space: nowrap;
}

/* -- clarity: coinflip side tag (HEADS blue / TAILS gold) ---------------- */
.side-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  white-space: nowrap;
  background: rgba(47, 123, 246, .16);
  border: 1px solid rgba(47, 123, 246, .5);
  color: #7db4ff;
}
.side-tag--t {
  background: rgba(255, 176, 32, .14);
  border-color: rgba(255, 176, 32, .5);
  color: #ffc35c;
}

/* coinflip row: the pill stacks above the "Items staked" value */
.row__value .you-pill { margin-bottom: 1px; }

/* game modal: pill + side tag ride in the id line under each avatar */
.gm__id .you-pill, .gm__id .side-tag { vertical-align: 1px; }
.gm-team-player .you-pill { margin-left: 2px; }

/* jackpot entries list: my row glows */
.jp-entry--you {
  border: 1px solid rgba(34, 222, 121, .55);
  background: rgba(34, 222, 121, .07);
  border-radius: 8px;
}
.jp-entry__id .you-pill { margin-left: 6px; }

/* jackpot lobby card: my avatar slot gets a mini YOU ribbon */
.jp-slot { position: relative; }
.jp-slot__you {
  position: absolute;
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3fd57e, #23a659);
  color: #04120a;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .05em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  z-index: 2;
  pointer-events: none;
}

/* buy modal: USD is the primary label for dollar-pegged coins */
.mk-buy__sub { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: -6px; }

/* -- chat emoji picker --------------------------------------------------- */
.chat-composer { position: relative; }
.emoji-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 212px;
  overflow-y: auto;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6);
  animation: modal-in .14s ease-out;
}
.emoji-pop button {
  font-size: 19px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 7px;
  transition: background .12s, transform .08s;
}
.emoji-pop button:hover { background: var(--bubble); }
.emoji-pop button:active { transform: scale(1.18); }
#chat-emoji-btn[aria-expanded="true"] { color: var(--gold-2); }

/* -- chat drawer chrome (desktop: hidden) -------------------------------- */
.chat-drawer-head { display: none; }
.chat-drawer-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
}
.chat-drawer-title .ico { width: 17px; height: 17px; color: var(--blue-text); }
.chat-drawer-x { width: 34px; height: 34px; font-size: 13px; font-weight: 800; }

/* v12: branded MM2ROLL chat header — an R-glyph panel with the wordmark, shown
   on desktop AND mobile (overrides the base .chat-drawer-head display:none). */
.chat-drawer-head.chat-brandhead {
  display: block;
  position: relative;
  flex: none;
  min-height: 86px;                 /* v12c: the full high-res MM2ROLL banner (logo + R-glyphs baked in) */
  padding: 0;
  background: #0c1322 url("/img/chat-header-bg.png?v=3") center bottom / cover no-repeat;
  box-shadow: 0 8px 22px -14px var(--blue, #3b82f6);
}
.chat-drawer-head.chat-brandhead .chat-drawer-x { display: none; } /* desktop: no close button */

#chat-scrim {
  position: fixed;
  inset: 0;
  z-index: 218;
  background: rgba(2, 4, 10, .66);
  backdrop-filter: blur(2px);
  animation: fade-in .18s ease-out;
}

.chat-fab { display: none; }

/* -- bottom tab bar (shown <=880px) -------------------------------------- */
#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;               /* under modals (100) and the chat drawer */
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgba(7, 11, 22, .97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.tabbar__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  padding: 6px 2px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  transition: color .15s, background .15s;
}
.tabbar__btn .ico { width: 20px; height: 20px; }
.tabbar__btn .rc { width: 21px; height: 21px; }
.tabbar__btn:active { transform: scale(.95); }
.tabbar__btn.is-active { color: var(--blue-text); background: #0f1830; }
.tabbar__dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 17px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

/* -- polish: friendlier empty states ------------------------------------- */
.cx-empty {
  color: var(--muted-2);
  font-weight: 700;
  font-size: 12.5px;
  text-align: center;
  padding: 26px 12px;
  border: 1px dashed #1c2440;
  border-radius: var(--r-row);
}
.jp-empty {
  border: 1px dashed #1c2440;
  border-radius: var(--r-panel);
}

/* ==========================================================================
   v9 D4 — RESPONSIVE PASS (tablet 1101px down to phones)
   Later-in-file rules override the older RESPONSIVE-ISH block above.
   ========================================================================== */

/* --- <=1100px: the chat column collapses into a fixed left DRAWER -------- */
@media (max-width: 1100px) {
  #chat {
    display: flex;                 /* overrides the old display:none */
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(330px, 88vw);
    z-index: 220;
    transform: translateX(-106%);
    transition: transform .25s ease;
    border-right: 1px solid var(--line);
    box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
  }
  body.chat-open #chat { transform: none; }
  .chat-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 4px 16px;
  }
  .chat-drawer-head.chat-brandhead .chat-drawer-x { display: inline-flex; position: absolute; top: 9px; right: 9px; } /* mobile drawer: close */
  /* 881–1100px: no tab bar yet — a floating bubble opens the drawer */
  .chat-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--violet-bright), var(--violet-deep));
    color: #fff;
    box-shadow: 0 10px 30px -6px var(--violet-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
  }
  .chat-fab .ico { width: 22px; height: 22px; }
  .chat-fab:active { transform: scale(.94); }
}

/* --- <=880px: PHONE layout — stacked topbar, tab bar, tighter everything - */
@media (max-width: 880px) {
  /* v-next: subnav row removed — 2 rows (topbar auto, then main). */
  #app { grid-template-rows: auto minmax(0, 1fr); }
  .topbar__spacer { display: none; }   /* no forced line break on the wrapped phone bar */

  /* v10 phone topbar: logo + user on line 1; Deposit + Wallet full-width on
     line 2. Home / Marketplace move to the bottom tab bar; the balance-pill
     breakdown stays reachable via the Wallet button. */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }
  #brand { display: none; }                        /* phone: Deposit/Withdraw own line 2 cleanly */
  .tb-nav { display: none; }                       /* Home → tab bar */

  /* v-next single-bar phone layout: line 1 = balance pill · Wallet · user;
     line 2 = Deposit + Withdraw (full-width, equal). Marketplace/socials/bell/
     Home collapse to the bottom tab bar as before. */
  .topbar__right { order: 1; flex: 1 1 100%; margin-left: 0; gap: 8px; align-items: center; }
  .topbar__right .tb-balance { margin-right: auto; }   /* pill left, Wallet + user right */
  .topbar__left  { order: 2; flex: 1 1 100%; gap: 8px; min-width: 0; }
  .topbar__left .btn { flex: 1 1 0; min-width: 0; padding: 12px 6px; font-size: 11.5px; }
  .tb-market { display: none; }                    /* Marketplace → tab bar */
  #notif-btn { display: none; }
  .topbar__socials, .topbar__links { display: none; }   /* secondary content → hidden on phones */
  .topbar .icon-btn { width: 38px; height: 38px; }
  .tb-userbtn { padding: 4px 8px 4px 4px; gap: 6px; }
  .tb-userbtn__name { max-width: 96px; }           /* keep the name, just cap it */
  #me-avatar { width: 34px; height: 34px; }
  .tb-menu--user { right: 0; }

  /* the tab bar takes over primary navigation */
  #tabbar { display: grid; }
  .chat-fab { display: none; }         /* tab bar has a Chat tab */
  #main { padding: 16px 12px calc(88px + env(safe-area-inset-bottom)); }

  /* subnav: swipeable link strip */
  .subnav { padding: 0 12px; }
  .subnav__links { gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subnav__links::-webkit-scrollbar { display: none; }

  .main-head { margin-bottom: 16px; gap: 10px; }
  #page-title, .main-head h1 { font-size: 19px; }
  .ico--title { width: 24px; height: 24px; }
  .hv-chip { min-width: 0; padding: 9px 10px; font-size: 12px; }
  .coin-filter { width: 40px; height: 40px; }
  .coin-filter .rc { width: 34px; height: 34px; }

  /* coinflip rows wrap: players / stake box / actions (v9 D7 groups) */
  .row { flex-wrap: wrap; gap: 10px 12px; padding: 12px 12px 12px 18px; min-height: 0; }
  .row__stake { flex: 1 1 100%; order: 5; }
  .row__items .item-thumb { width: 44px; height: 44px; }
  .row__players { gap: 8px; flex: 1 1 auto; min-width: 0; }
  .row__seat { gap: 7px; }
  .row__who { max-width: 74px; }
  .row__pname { font-size: 11.5px; }
  .row__result-coin .rc { width: 52px; height: 52px; }
  .row__actions { order: 6; width: 100%; }
  .row__join { flex: 1; }

  /* shared modal chassis — covers EVERY modal incl. the v9 wallet/list/buy/
     support panels (they all sit on .modal__panel) */
  .modal { padding: 10px; }
  .modal__panel {
    padding: 18px 14px 16px;
    max-width: calc(100vw - 20px);
    max-height: 94vh;
  }
  .modal__foot { flex-wrap: wrap; gap: 10px; }
  .modal__foot-btns { flex: 1; justify-content: flex-end; }

  /* jackpot lobby cards + wheel modal */
  .jp-card__entries { flex-wrap: wrap; }

  /* marketplace directory: three thumb-friendly columns on tablets */
  .mk-dir { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* stat header: 2 columns from tablet down */
  .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* segmented control stays a single row (the 560px panel fits 4 tabs) */
  .wallet-tab { padding: 9px 6px; }
}

/* --- <=640px: small phones — tighter pickers, roomier tap targets -------- */
@media (max-width: 640px) {
  /* marketplace directory: two comfy image-first columns (must live AFTER the
     <=880px 3-column rule above so small phones actually get 2) */
  .mk-dir { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
  .side-pick, .mode-pick { flex-wrap: wrap; }
  .side-pick__label, .mode-pick__label { flex-basis: 100%; margin-right: 0; }
  .side-chip, .mode-chip { flex: 1; justify-content: center; }
  .pick-sub { flex-wrap: wrap; gap: 8px; }
  .dep-search { width: 100%; }
  .pick-sub__helpers { width: 100%; display: flex; gap: 8px; }
  .join-target { flex-wrap: wrap; }
  #join-auto { margin-left: 0; }
  .join-hint { flex-basis: 100%; }
}

/* --- <=480px: the game modal + wheel scale down to fit ------------------- */
@media (max-width: 480px) {
  .gm__top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
  .gm__player { min-width: 0; }
  #gm-l-name, #gm-r-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gm__player { padding-top: 12px; }
  .gm__player img { width: 56px; height: 56px; }
  .gm__id { flex-wrap: wrap; justify-content: center; gap: 5px; }
  #gm-l-name, #gm-r-name { font-size: 13px; }
  .coin3d { width: 108px; height: 108px; }
  .gm__stats, .gm__lists { gap: 8px; }
  .gm__stat { padding: 10px 10px; font-size: 12px; gap: 6px; }
  .gm__items { min-height: 150px; max-height: 210px; padding: 4px 8px; }
  .emoji-pop { grid-template-columns: repeat(7, 1fr); }
}

/* ==========================================================================
   v9 D7 — COINFLIP CLARITY (operator screenshots)
   1) game-context avatar rings = SIDE color (heads --blue / tails --gold, the
      .side-tag badge colors) — app.js sets --ring / borderColor per side
   2) lobby row reads as PLAYERS (avatar + name + side tag) vs a separate
      labeled STAKE box (count + item thumbs)
   3) game modal: "Stakes" divider between the players area and the stat/item
      area; each stat pill carries its side's accent
   ========================================================================== */

/* -- lobby row: players cluster ------------------------------------------ */
.row__players {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);   /* seat A | ⚔ | seat B */
  align-items: center;
  column-gap: 12px;
  /* v-next: min-width aligns the stake column across solo & team rows; minmax(0,1fr)
     keeps the two seat columns equal so the ⚔ centres. NO overflow clip — that cut
     off the +slot / avatar-badge symbols; the box just grows for a wide 4v4. */
  flex: none;
  min-width: 500px;
}
.row__seat--b { justify-self: start; }
.row__seat {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  min-width: 0;
}
.row__who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  /* v-next: FIXED width (~15 chars) so a short name never pulls the vs / opponent
     / stake forward — every row lines up. Longer names ellipsis (JS caps at 15). */
  flex: none;
  width: 104px;
  min-width: 104px;
}
.row__pname {
  font-size: 12.5px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__pname--empty { color: var(--muted-2); font-weight: 700; }
.side-tag--sm { font-size: 8.5px; padding: 1px 7px; letter-spacing: .08em; }

/* -- lobby row: the stake is its own labeled box ------------------------- */
.row__stake {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  /* v-next: clip to the stake box. When the row is narrow (e.g. a Call Bot row on
     a laptop) the stake shrinks — its content (YOU pill, count, thumbs) now clips
     INSIDE this rounded box instead of spilling over the Call Bot / action
     buttons. Wide rows have room, so nothing is clipped there. */
  overflow: hidden;
  align-self: stretch;
  padding: 6px 12px;
  background: rgba(9, 13, 26, .5);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.row__stake-div { width: 1px; align-self: stretch; background: var(--line); flex: none; }

/* -- game modal: players (top) vs stakes (below) ------------------------- */
.gm__sec { display: flex; align-items: center; gap: 12px; margin: -10px 0 12px; }
.gm__sec-line { flex: 1; height: 1px; background: var(--line); }
.gm__sec-title {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
/* each stake pill carries its side's color (left column = creator's face) */
#game-modal.gm--h .gm__stat:first-child, #game-modal.gm--t .gm__stat:last-child { box-shadow: inset 3px 0 0 var(--blue); }
#game-modal.gm--t .gm__stat:first-child, #game-modal.gm--h .gm__stat:last-child { box-shadow: inset 3px 0 0 var(--gold); }

/* ================= v9.4: exact-item join + call bot + cancel ============= */

/* required-stake grid (join modal): missing copies are dimmed + flagged */
.inv-item.is-missing { opacity: .45; cursor: default; }
.inv-item.is-missing .item-thumb { filter: grayscale(1); }

/* game-modal footer action cluster (Call bot / Cancel / Provably Fair) */
.gm__foot-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* row-level creator cancel (open, unjoined games only) */
.row__cancel { flex: none; }

/* create modal stock-mode note reuses .mode-hint; make it stand out a bit */
#create-stock-note { color: var(--gold-2, #ffb020); }
/* v-next: live bot-match verdict states for the stock-mode create note */
#create-stock-note.is-ok  { color: var(--green, #35c06b); }
#create-stock-note.is-bad { color: var(--red, #f0454a); }

/* ============ v9.5: marketplace multi-crypto + USD approximation ============ */

/* clickable coin chips (sell modal multi-select + buy modal pay picker) */
.mk-coins { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.mk-coins-hint {
  font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: none;
  color: var(--muted-2, #5c6584); margin-left: 6px;
}
.mk-coin-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, #1a2138);
  background: var(--panel-2, #0e1428);
  color: var(--muted, #828ca6);
  font-family: inherit; font-size: 11.5px; font-weight: 800;
  cursor: pointer;
  transition: border-color .15s, color .15s, box-shadow .15s, transform .1s;
  min-height: 32px; /* comfy tap target on mobile */
}
.mk-coin-chip:hover { border-color: var(--muted-2, #5c6584); color: var(--text, #fff); }
.mk-coin-chip:active { transform: scale(.97); }
.mk-coin-chip.is-on {
  color: var(--text, #fff);
  border-color: var(--blue, #2f7bf6);
  box-shadow: inset 0 0 0 1px var(--blue, #2f7bf6);
  background: rgba(47, 123, 246, .10);
}
.mk-coin-chip__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  font-size: 9px; font-weight: 900; letter-spacing: .02em;
  color: #fff;
}
.mk-coin-chip__chain { font-size: 10px; font-weight: 600; color: var(--muted-2, #5c6584); }
.mk-coin-chip.is-on .mk-coin-chip__chain { color: var(--muted, #828ca6); }
/* v9.7 USD anchor: the primary/price-coin marker is gone — every chip is a
   pay option; the canonical price is USD everywhere. */

/* dim secondary line under a USD headline (settled coin amount, notes) */
.mk-usd { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted-2, #5c6584); }

/* directory-card USD floor headline — the gold price pill, slightly bigger */
.mk-floor--usd { font-size: 13px; padding: 3px 10px; }
/* directory-card accepted-coin mini badges (next to the floor pill) */
.mk-card__coins { display: inline-flex; gap: 3px; align-items: center; }

/* accepted-coin mini badges on listing rows */
.mk-row__accepts { display: flex; gap: 3px; margin-top: 3px; }
.mk-coin-mini {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 5px; border-radius: 999px;
  font-size: 8px; font-weight: 900; letter-spacing: .02em; color: #fff;
}

@media (max-width: 520px) {
  /* keep the chain label — five same-ticker stable chips must stay tellable
     apart; the row simply wraps (flex-wrap) on narrow screens */
  .mk-coin-chip { padding: 5px 8px; gap: 5px; }
  .mk-coin-chip__chain { font-size: 9.5px; }
}

/* ==========================================================================
   v9.6 — CALL BOT (prominent branded button + chooser) & PER-COPY picker
   ========================================================================== */

/* THE Call Bot button — a core feature, not a secondary link. Own branded
   violet, glow, slight pulse; reads instantly next to blue/gold actions. */
.btn--bot {
  background: linear-gradient(180deg, #a06bf7, #7c3aed);
  box-shadow: 0 4px 16px rgba(140, 80, 240, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 900;
  letter-spacing: .01em;
  position: relative;
}
.btn--bot:hover { filter: brightness(1.12); box-shadow: 0 6px 20px rgba(140, 80, 240, .6), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn--bot:not(:disabled) { animation: botPulse 2.6s ease-in-out infinite; }
@keyframes botPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(47, 123, 246, .45), inset 0 1px 0 rgba(255, 255, 255, .18); }
  50%      { box-shadow: 0 4px 22px rgba(160, 107, 247, .7), inset 0 1px 0 rgba(255, 255, 255, .18); }
}
.row__callbot { flex: none; }

/* ---- chooser modal (#callbot-modal) ---- */
.modal__panel--callbot { max-width: 560px; }
.cb-note {
  font-size: 12.5px;
  color: var(--muted, #828ca6);
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 14px;
}
.cb-count-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bubble, #121a2e);
  border-radius: var(--r-row, 12px);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.cb-count-label { font-size: 13px; font-weight: 800; color: var(--text, #fff); }
.cb-stepper { display: inline-flex; align-items: center; gap: 10px; }
.cb-step-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bubble);
  color: #c9b6ff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: filter .12s, background .12s;
}
.cb-step-btn:hover { background: #24304f; color: #fff; }
.cb-step-btn[disabled] { opacity: .35; cursor: not-allowed; }
.cb-count-num {
  min-width: 30px;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  color: #c9a7ff;
}
.cb-count-hint { font-size: 11.5px; font-weight: 700; color: var(--muted-2, #5c6584); }
#cb-grid { max-height: 300px; overflow-y: auto; }
#cb-search { width: 190px; }

/* ---- v9.6 PER-COPY stack stepper inside the shared item picker ---- */
.inv-qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.inv-qty__btn {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--bubble, #121a2e);
  color: var(--muted, #828ca6);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.inv-qty__btn:hover { background: #1a2440; color: #fff; }
.inv-qty__btn.is-off { opacity: .3; cursor: default; }
.inv-qty__btn.is-off:hover { background: var(--bubble, #121a2e); color: var(--muted, #828ca6); }
.inv-qty__n {
  min-width: 38px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #828ca6);
}
.inv-item.is-selected .inv-qty__n { color: #fff; }

/* mobile: the chooser inherits the shared .modal__panel <=880px chassis; keep
   tap targets comfy and let the count row wrap on small phones */
@media (max-width: 640px) {
  .cb-count-row { flex-wrap: wrap; gap: 10px; }
  .cb-count-hint { flex-basis: 100%; }
  .cb-step-btn { width: 40px; height: 40px; }
  #cb-search { width: 100%; }
  .inv-qty__btn { width: 26px; height: 26px; }
}

/* ==========================================================================
   V19 — BRANDED ASSET PASS (operator design assets, mockup-matched)
   Assets: /img/coin-heads.png (blue H face) · /img/coin-tails.png (orange T
   face) · /img/coin-gold.png (gold R currency coin) · /img/login-banner.jpg
   (squid art) · /img/logo-badge.png + /img/favicon.png (round badge).
   This block lives LAST so it wins cascade ties against the mobile chassis.
   ========================================================================== */

/* PNG coin faces slot into every .rc sizing hook (26px default, 40px filters,
   21px tabbar, 20px sidenav) — keep them crisp + round */
img.rc-img { object-fit: contain; display: block; }

/* gold R currency coin — inline next to play-money item counts/amounts */
.coin-r { width: 16px; height: 16px; flex: none; object-fit: contain; }
.coin-r--bal { width: 18px; height: 18px; }
.coin-r--hub { width: 14px; height: 14px; }

/* jackpot wheel hub: coin + pot number on one line under the POT label */
.jp-hub__amt { display: flex; align-items: center; gap: 4px; max-width: 92px; }
.jp-hub__amt #jp-hub-pot { max-width: 72px; }

/* --- login modal: two columns — form left, squid banner right (mockup) --- */
.modal__panel--login {
  width: 700px;
  padding: 0;
  display: flex;
  align-items: stretch;
  text-align: center;
  overflow: hidden;
}
.login-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 30px 28px 26px;
  overflow-y: auto;
}
.login-art {
  flex: 0 0 275px;
  min-height: 100%;
  background: #0a1226;
  border-left: 1px solid var(--line);
}
.login-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* stacked/mobile: the banner goes away, the form gets the full card */
@media (max-width: 760px) {
  .modal__panel--login { width: 380px; display: block; }
  .login-art { display: none; }
  .login-main { padding: 26px 20px 22px; max-height: none; overflow: visible; }
}

/* v-next: persistent resume bar for an in-progress deposit/withdraw (fixed bottom-center) */
.pending-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 91; display: flex; align-items: center; gap: 12px;   /* above #tabbar (90) */
  max-width: min(560px, calc(100vw - 24px));
  padding: 11px 12px 11px 16px;
  background: var(--bg-2, #0f1626); border: 1px solid var(--line, #223a5e); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  font-size: 13px; font-weight: 700; color: #fff;
}
.pending-bar[hidden] { display: none; }
.pending-bar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold, #f5b74e); flex: none; animation: pb-pulse 1.6s ease-out infinite; }
.pending-bar__txt { flex: 1 1 auto; min-width: 0; color: var(--muted, #b9c2d8); font-weight: 600; }
.pending-bar__btn { flex: none; background: var(--blue, #2f7bf6); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.pending-bar__btn:hover { filter: brightness(1.08); }
/* Task 1: live mm:ss countdown to the server-side auto-cancel (abandoned request). */
.pending-bar__cd { flex: none; color: var(--gold, #f5b74e); font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .95; }
@media (max-width: 600px) { .pending-bar__cd { display: none; } }
@keyframes pb-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 183, 78, .55); } 70% { box-shadow: 0 0 0 7px rgba(245, 183, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 183, 78, 0); } }
/* v-next: float the resume bar above the mobile bottom tab bar (#tabbar, shown <=880px) */
@media (max-width: 880px) { .pending-bar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 600px) { .pending-bar { font-size: 12px; padding: 9px 10px 9px 13px; } }

/* ==========================================================================
   v66 RESTYLE — signature effects & theme harmonization
   Appended last so equal-specificity rules win by source order. Purely
   additive / repaint — no IDs or classes renamed; JS hooks untouched.
   ========================================================================== */

/* ---- TYPOGRAPHY: Chakra Petch on display headings + hero numbers ---- */
#page-title,
.main-head h1,
.jp-center__title,
.login-brand,
.gm__sec-title,
.info-body h1, .info-body h2, .info-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .015em;
}
.main-head h1, #page-title { letter-spacing: .01em; }

/* tabular numerals + tight tracking on every money / stat readout */
#balance-usd, .tb-pill__val, .row__value-amt, .row__value-amt b,
.gm__total, .gm__stat span, .jp-pot-total b, #jp-pot-total, .jp-hub__pot,
#jp-hub-pot, .jp-hub__max, #jp-hub-max, .hist-row__value, .item-val,
.inv-item__val, .sel-total b, #header-value, #jp-header-value, .badge,
.gw-card__time, .tb-bal-row__amt, .wallet-row__amt, .jp-players b,
.gw-rain__total, .gw-rain__amt, .join-target__range, #join-target {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
/* hero numbers in the display face */
.jp-hub__pot, #jp-pot-total, #jp-hub-pot, .gm__total { font-family: var(--font-display); }
/* wallet addresses / provably-fair hashes → mono */
.fair-field code, #fair-hash, #fair-seed, #jp-fair-hash, #jp-fair-seed,
.wallet-addr, .rblx-phrase-row code, #aset-reauth-phrase, #aset-rb-phrase {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

/* ---- AMBIENT: faint violet/green vignette + hairline grid behind main ---- */
#main {
  background:
    radial-gradient(120% 78% at 50% -8%, rgba(47, 123, 246, .06), transparent 60%),
    radial-gradient(150% 120% at 50% 120%, rgba(34, 222, 121, .035), transparent 62%),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(255, 255, 255, .012) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 43px, rgba(255, 255, 255, .012) 43px 44px),
    var(--bg);
}

/* ---- TOPBAR + side rails: glass ---- */
.topbar {
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

/* ---- Marketplace CTA = VIOLET (brand), not the green money button ---- */
.btn--blue.tb-market {
  background: linear-gradient(180deg, var(--violet-bright), var(--violet-deep));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2),
              0 0 0 1px color-mix(in srgb, var(--violet) 30%, transparent),
              0 6px 18px -4px var(--violet-glow);
}

/* ---- BALANCE PILL — hero chip: green open border ring ---- */
#balance-pill[aria-expanded="true"], .tb-pill[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-glow) 55%, transparent);
}
.notif-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ---- INPUTS: clean dark base for .inp fields + custom-styled <select>.
       The v14 modals (tip / gift / referral / giveaways / rain) and the support
       subject used a bare .inp class that only had a :focus ring and no base look,
       so text/number inputs fell back to native white boxes and <select> rendered
       as a native OS dropdown. This gives them the same dark treatment as
       .field input, once, everywhere. ---- */
.inp {
  width: 100%;
  max-width: 100%;
  background-color: #0d1326;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.inp::placeholder { color: var(--muted-2); }
.inp[readonly] { color: var(--muted); cursor: default; }
/* strip native number spinners for a cleaner field */
.inp[type=number] { -moz-appearance: textfield; appearance: textfield; }
.inp[type=number]::-webkit-outer-spin-button,
.inp[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* custom dark <select>: drop the native chrome, draw our own chevron */
select.inp {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93ad' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
}
select.inp:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
select.inp option { background: #0d1326; color: var(--text); }

/* ---- INPUTS: acid-green focus ring across every field ---- */
.field input:focus, .dep-search:focus, .wallet-input:focus, .inp:focus,
.pm-search:focus, .code-input:focus, .auto-input:focus, .wallet-select:focus,
.sup-ta:focus, textarea.inp:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-glow) 55%, transparent) !important;
}
.chat-composer:focus-within, .mk-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-glow) 45%, transparent);
}

/* ---- ITEM TILE rarity FRAME — ~2px gradient ring per --tier + hover lift ---- */
.item-thumb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  padding: 2px;
  background: conic-gradient(from 130deg,
      color-mix(in srgb, var(--tier) 92%, #fff),
      color-mix(in srgb, var(--tier) 55%, #000),
      color-mix(in srgb, var(--tier) 100%, #fff 18%),
      color-mix(in srgb, var(--tier) 55%, #000),
      color-mix(in srgb, var(--tier) 92%, #fff));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .85;
  transition: opacity .15s;
}
.item-thumb { transition: transform .15s, box-shadow .15s; }
.inv-item:hover .item-thumb, .item-thumb:hover { transform: translateY(-2px); }
.inv-item:hover .item-thumb::before, .item-thumb:hover::before { opacity: 1; }
.inv-item:hover .item-thumb {
  box-shadow: 0 0 18px -2px color-mix(in srgb, var(--tier) 45%, transparent),
              inset 0 0 12px color-mix(in srgb, var(--tier) 10%, transparent);
}
/* chroma tier — animated rainbow ring (additive helper; JS does not reference it) */
.item-thumb--chroma::before {
  background: conic-gradient(from 0deg, #ff4fd8, #5b9dff, #22d3ee, #22de79, #ffb020, #f0454a, #ff4fd8);
  opacity: 1;
  animation: chroma-spin 3.4s linear infinite;
}
@keyframes chroma-spin { to { filter: hue-rotate(360deg); } }

/* ---- LOBBY ROW — crisp border, hover lift, resolve win-flash ---- */
.row {
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--hairline);
  transition: background .15s, transform .12s, box-shadow .15s, border-color .15s;
}
.row:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .8), inset 0 1px 0 var(--hairline);
  border-color: color-mix(in srgb, var(--violet) 26%, var(--line));
}
.row--t:hover { border-color: color-mix(in srgb, var(--gold) 26%, var(--line)); }
.row--coin-h.row--resolved, .row--coin-t.row--resolved { animation: win-flash .8s ease-out 1; }
@keyframes win-flash {
  0%   { box-shadow: inset 0 1px 0 var(--hairline); transform: scale(1); }
  30%  { box-shadow: 0 0 0 2px var(--accent), 0 0 30px -2px var(--accent-glow); transform: scale(1.015); }
  100% { box-shadow: inset 0 1px 0 var(--hairline); transform: scale(1); }
}
/* result coin pop */
.row--resolved .row__result-coin { animation: rc-pop .55s cubic-bezier(.3, 1.5, .4, 1) 1; }
@keyframes rc-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---- JACKPOT result flashes (keyed to existing #jp-modal.jp--win/--house) ---- */
#jp-modal.jp--win .modal__panel--jackpot { animation: jp-win-flash 1s ease-out 1; }
#jp-modal.jp--house .modal__panel--jackpot { animation: jp-house-flash 1s ease-out 1; }
@keyframes jp-win-flash {
  0%, 100% { box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 1px 0 var(--hairline); }
  25%      { box-shadow: 0 0 0 2px var(--accent), 0 0 70px -8px var(--accent-glow), 0 30px 90px rgba(0, 0, 0, .65); }
}
@keyframes jp-house-flash {
  0%, 100% { box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 1px 0 var(--hairline); }
  25%      { box-shadow: 0 0 0 2px var(--red), 0 0 70px -8px var(--red-glow), 0 30px 90px rgba(0, 0, 0, .65); }
}

/* ---- CHAT: system/giveaway message gets a gold left bar + faint glow ---- */
.chat-msg--system .chat-msg__text {
  border-left: 2px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .28), 0 0 18px -6px var(--gold-glow);
}

/* ---- BRAND logo: slow ambient sheen ---- */
.brand-logo { animation: logo-sheen 9s ease-in-out infinite; }
@keyframes logo-sheen {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(47, 123, 246, .28)); }
  50%      { filter: drop-shadow(0 0 13px rgba(34, 222, 121, .22)); }
}

/* ---- PENDING TRADE BAR — on-theme glass + green resume ---- */
.pending-bar {
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border-color: var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), inset 0 1px 0 var(--hairline);
}
.pending-bar__dot { background: var(--gold); }
.pending-bar__btn {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 12px -3px var(--accent-glow);
}

/* ---- HEADS coin PNG → violet-shift to match the violet heads identity
   (SVG faces, rings and side tags are already violet) ---- */
/* coin-heads.png is already the blue we want — no hue-rotate tint (was purple-shifting it) */

/* ---- PRIMARY CTA idle breathing glow (prominent hero buttons only) ---- */
.main-head__tools .btn--blue, .jp-actions__join {
  animation: cta-breathe 2.8s ease-in-out infinite;
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 18px -4px var(--accent-glow); }
  50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px color-mix(in srgb, var(--accent) 48%, transparent), 0 9px 28px -2px var(--accent-glow); }
}

/* ---- Respect reduced-motion: disable all new ambient/pulse/spin/breathe ---- */
@media (prefers-reduced-motion: reduce) {
  .live-dot, .jp-players__dot, .btn--bot:not(:disabled), .pending-bar__dot,
  .item-thumb--chroma::before, .brand-logo,
  .row--coin-h.row--resolved, .row--coin-t.row--resolved,
  .row--resolved .row__result-coin,
  #jp-modal.jp--win .modal__panel--jackpot, #jp-modal.jp--house .modal__panel--jackpot,
  .main-head__tools .btn--blue, .jp-actions__join {
    animation: none !important;
  }
}
