/* =========================================================================
   CRASH view (CRASH area) — everything around the scene canvas:
   top bar, HUD (timer / multiplier), history chips, bet panel, main button,
   players list, win FX. Transform/opacity animations only.
   ========================================================================= */
.crash { position: relative; display: flex; flex-direction: column; gap: var(--s-3); }

/* ---------------------------------------------------------------- stage */
.stage {
  --stage-top: calc(var(--tg-top) + var(--s-3));
  position: relative; isolation: isolate; overflow: hidden;
  margin: calc(-1 * var(--stage-top)) calc(-1 * var(--gutter)) 0;
  height: calc(var(--stage-top) + clamp(286px, 44vh, 372px));
  background: #0c0c12;
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.stage__shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 12, 15, 0.72) 0, rgba(12, 12, 15, 0) calc(var(--stage-top) + 76px)),
    linear-gradient(0deg, var(--bg) 0, rgba(21, 21, 23, 0.86) 34px, rgba(21, 21, 23, 0) 116px),
    radial-gradient(130% 80% at 50% 45%, transparent 55%, rgba(8, 8, 11, 0.45) 100%);
}

/* ---------------------------------------------------------------- top bar (over the scene) */
.cbar {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); top: var(--stage-top);
  display: flex; align-items: center; gap: var(--s-2);
}
.cbar__btn, .cbar__bal {
  height: 40px; border-radius: 13px;
  background: rgba(26, 26, 31, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07); border-top-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.crash.is-tg .cbar__btn[data-go='back'] { display: none; }
.cbar__btn { width: 40px; display: grid; place-items: center; color: var(--text); flex: none; }
.cbar__btn .ic { width: 20px; height: 20px; }
.cbar__bal {
  position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 4px 0 10px; min-width: 0;
  font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.cbar__bal > .coin { --coin: 20px; }
.cbar__bal > .num { text-align: right; }
.cbar__bal::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 203, 71, 0.55), 0 0 22px rgba(255, 203, 71, 0.45);
  opacity: 0;
}
.cbar__bal.is-hit { animation: crash-hit 520ms var(--ease-spring); }
.cbar__bal.is-hit::after { animation: crash-hit-ring 900ms var(--ease-standard); }
.cbar__plus {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #957dff, var(--violet-600));
  box-shadow: var(--shadow-primary);
}
.cbar__plus .ic { width: 17px; height: 17px; --ic-stroke: 2.4; }
@keyframes crash-hit { 30% { transform: scale(1.07); } }
@keyframes crash-hit-ring { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- HUD */
.hud {
  position: absolute; z-index: 2; left: 0; right: 0;
  top: calc(var(--stage-top) + 48px); height: 46%;
  display: grid; place-items: center; pointer-events: none;
}
.hud__layer {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  opacity: 0; transform: scale(0.94);
  transition: opacity var(--dur-ui) var(--ease-standard), transform var(--dur-slow) var(--ease-spring);
}
.hud[data-mode='idle'] .hud__idle,
.hud[data-mode='wait'] .hud__wait,
.hud[data-mode='fly'] .hud__fly,
.hud[data-mode='crash'] .hud__fly { opacity: 1; transform: none; }

.hud__sk { width: 168px; height: 52px; border-radius: 14px; position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.hud__sk--sm { width: 92px; height: 22px; border-radius: 11px; }
.hud__sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); animation: shimmer 1.4s var(--ease-inout) infinite; }

.hud__caption {
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.hud__chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 750; color: var(--text-2);
  background: rgba(20, 20, 25, 0.6); border: 1px solid rgba(255, 255, 255, 0.07); border-top-color: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hud__chip--crash { color: #ffd0d4; background: rgba(120, 22, 34, 0.55); border-color: rgba(255, 71, 87, 0.35); border-top-color: rgba(255, 140, 150, 0.4); }
.hud__chip--crash { animation: pop var(--dur-ui) var(--ease-spring); }

/* ---- 3·2·1 bubble countdown */
@property --cd { syntax: '<color>'; inherits: true; initial-value: #8468f6; }
.cdown {
  --cd: #8468f6;
  position: relative; width: 136px; height: 136px; display: grid; place-items: center;
  transition: --cd 360ms var(--ease-standard);
}
.cdown[data-n='3'] { --cd: #ff4d5e; }
.cdown[data-n='2'] { --cd: #ffbf2e; }
.cdown[data-n='1'] { --cd: #2fd27e; }
.cdown::before { /* coloured halo */
  content: ''; position: absolute; inset: -30px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cd) 42%, transparent), transparent 75%);
  opacity: 0.75;
}
.cdown__defs { position: absolute; width: 0; height: 0; }
.cdown__goo { position: absolute; inset: 0; filter: url(#cdown-goo); }
.cdown__goo > i {
  position: absolute; left: 50%; top: 50%; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--cd) 55%, #fff) 0%, var(--cd) 48%, color-mix(in srgb, var(--cd) 70%, #000) 100%);
}
.cdown__blob {
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  animation: cdown-morph 2.4s ease-in-out infinite;
}
@keyframes cdown-morph {
  0%, 100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; }
  25% { border-radius: 56% 44% 52% 48% / 46% 54% 46% 54%; }
  50% { border-radius: 46% 54% 44% 56% / 55% 45% 55% 45%; }
  75% { border-radius: 53% 47% 57% 43% / 47% 55% 45% 53%; }
}
/* small bubbles that bulge out of the edge and sink back: the "bubbling" */
.cdown__bub {
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  animation: cdown-bub 2.6s ease-in-out var(--dl) infinite;
}
@keyframes cdown-bub {
  0%, 100% { transform: rotate(var(--a)) translateX(30px) scale(0.6); }
  50% { transform: rotate(calc(var(--a) + 24deg)) translateX(58px) scale(1); }
}
.cdown__drop { margin: 0; transform: translate(-50%, -50%); }
.cdown__gloss { /* glassy highlight, outside the goo so it stays crisp */
  position: absolute; left: 50%; top: 50%; width: 64px; height: 30px; margin: -42px 0 0 -40px;
  border-radius: 50%; transform: rotate(-24deg); pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}
.cdown__num {
  position: relative; font-family: var(--font-display); font-weight: 800; font-size: 54px; line-height: 1;
  letter-spacing: -0.04em; color: #fff;
  text-shadow: 0 2px 0 color-mix(in srgb, var(--cd) 55%, #000), 0 6px 18px rgba(0, 0, 0, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .cdown__blob, .cdown__bub { animation: none; }
}

/* ---- multiplier */
.mult { position: relative; display: grid; place-items: center; --mc: #ffffff; --mg: rgba(255, 255, 255, 0.28); }
.mult[data-tier='1'] { --mc: #5ff0a6; --mg: rgba(34, 197, 120, 0.45); }
.mult[data-tier='2'] { --mc: #ffd35c; --mg: rgba(255, 190, 50, 0.5); }
.hud[data-mode='crash'] .mult { --mc: #ff5865; --mg: rgba(255, 71, 87, 0.5); }
.mult::before { /* dark scrim: keeps the number legible when a planet drifts behind it */
  content: ''; position: absolute; left: 50%; top: 50%; width: 270px; height: 150px; margin: -75px 0 0 -135px;
  background: radial-gradient(closest-side, rgba(8, 8, 14, 0.5), rgba(8, 8, 14, 0.22) 55%, transparent);
  pointer-events: none;
}
.mult__glow {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 170px; margin: -85px 0 0 -150px;
  background: radial-gradient(closest-side, var(--mg), transparent 72%);
  opacity: 0.2; transition: opacity 200ms linear; pointer-events: none;
}
.mult__num {
  position: relative; display: inline-flex; align-items: baseline;
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(54px, 16.5vw, 70px); letter-spacing: -0.025em;
  color: var(--mc);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 10px 34px rgba(0, 0, 0, 0.55);
  transition: color 320ms var(--ease-standard);
}
.mult__val { font-variant-numeric: tabular-nums; }
.mult__x { font-size: 0.5em; margin-left: 0.06em; opacity: 0.7; letter-spacing: 0; }
.mult.is-shake .mult__num { animation: crash-shake 520ms var(--ease-standard); }
.mult__ring {
  position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; border-radius: 50%;
  border: 2px solid var(--mc); box-shadow: 0 0 24px var(--mg), inset 0 0 18px var(--mg); pointer-events: none;
}
@keyframes crash-shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-7px) rotate(-1.5deg); }
  30% { transform: translateX(6px) rotate(1deg); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  80% { transform: translateX(-1px); }
  100% { transform: none; }
}

/* ---------------------------------------------------------------- history chips */
.hist {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 8px;
  display: flex; align-items: center; gap: var(--s-2); padding-left: var(--gutter);
}
.hist__row {
  flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 2px var(--gutter) 2px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  scrollbar-width: none;
}
.hist__row::-webkit-scrollbar { display: none; }
.hchip {
  --hc: var(--text-2); --hb: rgba(255, 255, 255, 0.05); --hl: rgba(255, 255, 255, 0.08);
  flex: none; display: inline-flex; align-items: baseline; justify-content: center;
  height: 32px; padding: 0 10px; border-radius: 10px; line-height: 30px;
  font-size: var(--fs-sm); font-weight: 800; color: var(--hc); letter-spacing: -0.01em;
  background: var(--hb); border: 1px solid var(--hl);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hchip i { font-style: normal; font-size: 0.82em; opacity: 0.65; margin-left: 1px; }
.hchip.is-grey { --hc: #c9c8d3; }
.hchip.is-bust { --hc: var(--red-400); --hb: rgba(255, 71, 87, 0.09); --hl: rgba(255, 71, 87, 0.2); }
.hchip.is-green { --hc: var(--green-400); --hb: rgba(34, 197, 120, 0.1); --hl: rgba(34, 197, 120, 0.24); }
.hchip.is-gold { --hc: var(--gold-300); --hb: rgba(255, 190, 50, 0.12); --hl: rgba(255, 190, 50, 0.32); }
.hchip.is-latest { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px var(--hl), 0 4px 14px -4px var(--hl); }

/* ---------------------------------------------------------------- bet panel */
.betpanel, .players {
  position: relative; isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 40%),
    var(--surface-1);
  border: 1px solid var(--line); border-top-color: var(--line-top);
  border-radius: var(--r-2xl);
  box-shadow: var(--hl-top), var(--shadow-2);
}
.betpanel::after, .players::after {
  /* grain */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px;
}
.betpanel { margin-top: calc(-1 * var(--s-1)); padding: var(--s-3); display: flex; flex-direction: column; gap: 10px; }

/* amount stepper (shared component, tuned here) */
.betpanel__amount .stepper__row { height: 54px; padding: 5px; border-radius: 16px; background: var(--bg-0); }
.betpanel__amount .stepper__btn { width: 48px; border-radius: 12px; font-family: var(--font-text); font-size: var(--fs-md); color: var(--text); background: linear-gradient(180deg, #2b2b31, #232328); }
.betpanel__amount .stepper__btn b { font-weight: 800; }
.betpanel__amount .stepper__field { gap: 8px; }
.betpanel__amount .stepper__field .coin { --coin: 20px; }
.betpanel__amount .stepper__input {
  flex: 0 1 auto; width: 7ch; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); letter-spacing: -0.02em;
}
.stepper { transition: opacity var(--dur-ui) var(--ease-standard); }
.betpanel .stepper.is-disabled { opacity: 0.55; }

.betpanel__quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.qchip {
  height: 34px; border-radius: 11px; font-size: var(--fs-sm); font-weight: 800; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line); border-top-color: var(--line-top);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.qchip.is-active { color: var(--violet-300); background: var(--primary-tint); border-color: rgba(132, 104, 246, 0.42); border-top-color: rgba(195, 181, 255, 0.5); }
.qchip:disabled { opacity: 0.45; }

.betpanel__auto { display: flex; align-items: center; gap: 10px; padding: 2px 0 2px var(--s-1); min-height: 42px; }
.betpanel__auto > .switch { flex: none; }
.betpanel__autolabel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; cursor: pointer; }
.betpanel__autotitle { font-size: var(--fs-sm); font-weight: 750; }
.betpanel__autostep { flex: none; width: 140px; }
.betpanel__autostep .stepper__row { height: 40px; padding: 3px; border-radius: 12px; }
.betpanel__autostep .stepper__btn { width: 32px; border-radius: 9px; }
.betpanel__autostep .stepper__btn .ic { width: 15px; height: 15px; }
.betpanel__autostep .stepper__field { gap: 1px; }
.betpanel__autostep .stepper__input { font-size: var(--fs-md); width: 5ch; flex: 0 1 auto; text-align: right; }
.betpanel__autostep .stepper__suffix { font-size: var(--fs-sm); }
.betpanel:not(.is-auto) .betpanel__autostep .stepper { opacity: 0.4; }


/* ---------------------------------------------------------------- main button */
.mbwrap { position: relative; }
.mb {
  position: relative; display: block; width: 100%; height: 64px; padding: 0;
  border-radius: var(--r-xl); overflow: hidden; isolation: isolate;
  color: #fff; font-family: var(--font-text); text-align: center;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 24px -10px rgba(0, 0, 0, 0.6);
}
.mb::before { /* specular band */
  content: ''; position: absolute; inset: 0 0 50% 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
}
.mb::after { /* bevel */
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -2px 0 rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.mb__bgs { position: absolute; inset: 0; z-index: 0; }
.mb__bg { position: absolute; inset: 0; opacity: 0; transition: opacity 340ms var(--ease-standard); }
.mb__bg--primary { background: linear-gradient(180deg, #9a83ff 0%, var(--violet-500) 50%, var(--violet-600) 100%); }
.mb__bg--queue { background: linear-gradient(180deg, #8f78fb 0%, #7356ee 50%, #5b3fd8 100%); }
.mb__bg--neutral { background: linear-gradient(180deg, #37373e 0%, #2c2c32 100%); }
.mb__bg--cashout { background: linear-gradient(180deg, #6af4b1 0%, #27cc7f 50%, #15a862 100%); }
.mb__bg--win { background: linear-gradient(115deg, #fff0b8 0%, #ffd35c 30%, #ffb52e 70%, #f59a1b 100%); }
.mb__bg--lost { background: linear-gradient(180deg, #3d2328 0%, #2b1b1f 100%); }
.mb__bg--muted { background: var(--surface-3); }
.mbwrap[data-tone='primary'] .mb__bg--primary,
.mbwrap[data-tone='queue'] .mb__bg--queue,
.mbwrap[data-tone='neutral'] .mb__bg--neutral,
.mbwrap[data-tone='cashout'] .mb__bg--cashout,
.mbwrap[data-tone='win'] .mb__bg--win,
.mbwrap[data-tone='lost'] .mb__bg--lost,
.mbwrap[data-tone='muted'] .mb__bg--muted { opacity: 1; }
.mbwrap[data-tone='cashout'] .mb { color: #03170c; }
.mbwrap[data-tone='win'] .mb { color: #2b1700; }
.mbwrap[data-tone='lost'] .mb { color: #ffb3ba; }
.mbwrap[data-tone='lost'] .mb::after { box-shadow: inset 0 1px 0 rgba(255, 160, 170, 0.18), inset 0 0 0 1px rgba(255, 71, 87, 0.28); }
.mbwrap[data-tone='neutral'] .mb::after { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.mbwrap[data-tone='neutral'] .mb::before, .mbwrap[data-tone='muted'] .mb::before { opacity: 0.4; }
.mbwrap[data-tone='muted'] .mb { color: var(--text-2); box-shadow: none; }
.mb:disabled { cursor: default; }

.mb__sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  transform: translateX(-120%) skewX(-18deg); opacity: 0;
}
.mbwrap[data-tone='cashout'] .mb__sheen { opacity: 0.6; animation: crash-sheen 2.6s var(--ease-inout) infinite 0.4s; }
.mbwrap[data-tone='win'] .mb__sheen { opacity: 0.9; animation: crash-sheen 1.1s var(--ease-standard) 1 0.1s; }
@keyframes crash-sheen { 0% { transform: translateX(-120%) skewX(-18deg); } 55%, 100% { transform: translateX(330%) skewX(-18deg); } }

.mb__stack { position: relative; z-index: 2; display: grid; height: 100%; }
.mb__content {
  grid-area: 1 / 1; display: flex; align-items: center; justify-content: center;
  min-width: 0; padding: 0 var(--s-4);
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.mb__content.is-leaving { pointer-events: none; }
/* one line, always centred on the button */
.mb__text { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-width: 0; max-width: 100%; white-space: nowrap; }
.mb__label { font-size: clamp(14px, 4.1vw, var(--fs-md)); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mb__label--big { font-family: var(--font-display); font-size: clamp(17px, 5vw, var(--fs-lg)); font-weight: 700; letter-spacing: -0.02em; }
.mb__label .num { font-variant-numeric: tabular-nums; }
.mb__cur { font-family: var(--font-text); font-size: 0.68em; font-weight: 800; opacity: 0.72; letter-spacing: 0.02em; }
.mb__sub { flex: none; font-size: var(--fs-sm); font-weight: 700; opacity: 0.66; white-space: nowrap; }
.mb__spin {
  align-self: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12); border-top-color: var(--text-2);
  animation: spin 1.1s linear infinite;
}

.mb__spinner {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast);
}
.mb.is-busy .mb__spinner { opacity: 0.9; animation: spin 0.7s linear infinite; }
.mb.is-busy .mb__stack { opacity: 0; transition: opacity var(--dur-fast); }

.mb__bar { position: absolute; left: 18px; right: 18px; bottom: 7px; height: 3px; border-radius: 2px; z-index: 3; background: rgba(255, 255, 255, 0.1); overflow: hidden; transition: opacity var(--dur-ui); }
.mb__bar i { display: block; height: 100%; border-radius: inherit; background: rgba(255, 255, 255, 0.55); transform-origin: left center; will-change: transform; }
.mb__bar.is-off { opacity: 0; }

/* ---------------------------------------------------------------- players */
.players { padding: var(--s-4) var(--s-3) var(--s-3); }
.players__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 0 var(--s-1); }
.players__title { display: flex; align-items: center; gap: var(--s-2); }
.players__title h2 { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.01em; }
.players__count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 800; color: var(--text-2); background: var(--surface-3);
}
.players__bank { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 800; }
.players__bank .coin { --coin: 15px; }
.players__bank-label { color: var(--text-3); font-weight: 700; font-size: var(--fs-xs); margin-right: 2px; }
.players__list { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-3); }
.players__list:empty { display: none; }

.pl {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-top-color: var(--line-top);
  transition: background-color var(--dur-slow) var(--ease-standard), border-color var(--dur-slow), opacity var(--dur-slow);
}
.pl .avatar { border-radius: 12px; }
.pl__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl__name { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 750; min-width: 0; }
.pl__bet { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 750; color: var(--text-2); }
.pl__bet .coin { --coin: 13px; }
.pl__out { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pl__x {
  height: 19px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center;
  font-size: var(--fs-2xs); font-weight: 800; color: var(--green-400); background: var(--green-tint);
}
.pl__win { font-size: var(--fs-sm); font-weight: 800; color: var(--green-400); }
.pl__lost { font-size: var(--fs-xs); font-weight: 750; color: var(--red-400); opacity: 0.75; }
.pl__live { display: inline-flex; gap: 3px; padding: 0 2px; }
.pl__live i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: crash-dots 1.2s var(--ease-inout) infinite; }
.pl__live i:nth-child(2) { animation-delay: 0.15s; }
.pl__live i:nth-child(3) { animation-delay: 0.3s; }
@keyframes crash-dots { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.pl.is-mine { border-color: rgba(132, 104, 246, 0.3); border-top-color: rgba(195, 181, 255, 0.35); background: linear-gradient(90deg, rgba(132, 104, 246, 0.1), rgba(132, 104, 246, 0.02)), var(--surface-2); }
.pl[data-status='won'] {
  border-color: rgba(34, 197, 120, 0.22); border-top-color: rgba(95, 240, 166, 0.3);
  background: linear-gradient(90deg, rgba(34, 197, 120, 0.15), rgba(34, 197, 120, 0.03) 70%), var(--surface-2);
}
.pl[data-status='lost'] { opacity: 0.5; }
.pl.is-flash::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(95, 240, 166, 0.28) 50%, transparent 80%);
  transform: translateX(-100%); animation: crash-flash 760ms var(--ease-standard) forwards;
}
@keyframes crash-flash { to { transform: translateX(100%); } }

/* ---------------------------------------------------------------- FX */
.fxlayer { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: visible; }
.fxcoin {
  position: absolute; display: block; will-change: transform, opacity;
  background: url('../../img/gram.svg') center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(120, 60, 0, 0.55));
}
.fxflash {
  position: absolute; width: 180px; height: 90px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 214, 102, 0.75), rgba(255, 190, 50, 0) 75%);
}

/* ---------------------------------------------------------------- small phones */
@media (max-width: 370px) {
  .mb__label { font-size: var(--fs-sm); }
  .mb__content { gap: 10px; padding: 0 var(--s-3); }
  .betpanel__autostep { width: 128px; }
}
@media (max-height: 760px) {
  .stage { height: calc(var(--stage-top) + clamp(262px, 41vh, 320px)); }
}
.hchip--sk { width: 58px; position: relative; overflow: hidden; }
.hchip--sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); animation: shimmer 1.4s var(--ease-inout) infinite; }

.hud__chip.is-empty { display: none; }

/* caption sits above the bubble so nothing reaches the history chips */
.hud__wait { gap: var(--s-1); transform-origin: 50% 40%; }


.peek {
  --hc: #c9c8d3; --hl: rgba(255, 255, 255, 0.12);
  position: absolute; z-index: 4; left: var(--gutter); top: calc(var(--stage-top) + 50px); /* under the top bar, clear of the rocket */
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; white-space: nowrap;
  border-radius: var(--r-pill); background: rgba(20, 20, 25, 0.62);
  border: 1px solid rgba(132, 104, 246, 0.35); border-top-color: rgba(195, 181, 255, 0.45);
  box-shadow: 0 6px 20px -6px rgba(132, 104, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: pop var(--dur-ui) var(--ease-spring);
}
.peek[hidden] { display: none; }
.peek__ic {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff;
  background: linear-gradient(180deg, var(--violet-400), var(--violet-600)); box-shadow: 0 2px 8px rgba(132, 104, 246, 0.5);
}
.peek__ic .ic { width: 14px; height: 14px; --ic-stroke: 2.2; }
.peek__label { font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--violet-300); }
.peek__val { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--hc); text-shadow: 0 0 12px var(--hl); }
.peek__val i { font-style: normal; font-size: 0.8em; opacity: 0.7; margin-left: 1px; }
.peek.is-bust { --hc: var(--red-400); --hl: rgba(255, 71, 87, 0.45); }
.peek.is-green { --hc: var(--green-400); --hl: rgba(34, 197, 120, 0.45); }
.peek.is-gold { --hc: var(--gold-300); --hl: rgba(255, 190, 50, 0.5); }

/* very narrow windows: the auto cash-out stepper must not run into its label */
@media (max-width: 359px) {
  .betpanel__autostep { width: 116px; }
  .betpanel__autostep .stepper__btn { width: 28px; }
  .betpanel__autostep .stepper__input { font-size: var(--fs-sm); width: 4ch; }
  .betpanel__autostep .stepper__suffix { font-size: var(--fs-xs); }
  .betpanel__autotitle { font-size: var(--fs-xs); }
}
