:root {
  --bg-0: #170733;
  --bg-1: #2a0f5c;
  --ink: #fff;
  --ink-dim: #cdb8ff;
  --well: rgba(20, 6, 50, .55);

  --pink: #ff4fa3;
  --pink-d: #c9186f;
  --lemon: #ffd93b;
  --lemon-d: #e59a00;
  --mint: #3df5b0;
  --sky: #49c6ff;
  --grape: #b56bff;
  --cherry: #ff5468;
  --outline: #6b1040;

  --font-display: 'Lilita One', 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(rgba(255, 255, 255, .055) 2px, transparent 2.6px) 0 0 / 30px 30px,
    radial-gradient(1100px 620px at 8% -8%, rgba(140, 70, 255, .55), transparent 70%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 79, 163, .38), transparent 70%),
    radial-gradient(900px 700px at 60% 110%, rgba(73, 198, 255, .22), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- ambient background ---------- */
.blobs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.blobs i {
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
  animation: floaty 16s ease-in-out infinite alternate;
}
.blobs i:nth-child(1) { left: -120px; top: 30%; background: var(--pink); }
.blobs i:nth-child(2) { right: -140px; top: 55%; background: var(--sky); animation-delay: -5s; }
.blobs i:nth-child(3) { left: 40%; bottom: -220px; background: var(--grape); animation-delay: -9s; }

/* ---------- shell ---------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100vh;
  height: 100dvh;
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 18px 20px;
}

.layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.center {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}

.card {
  background: linear-gradient(180deg, rgba(98, 46, 200, .8), rgba(60, 24, 136, .86));
  border: 2px solid rgba(255, 255, 255, .17);
  border-radius: 24px;
  box-shadow:
    0 6px 0 rgba(20, 6, 50, .6),
    0 18px 34px rgba(0, 0, 0, .35),
    inset 0 2px 0 rgba(255, 255, 255, .2);
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__plane {
  width: 62px; height: 44px; flex: none;
  filter: drop-shadow(0 4px 0 rgba(20, 6, 50, .5));
  animation: hover 2.6s ease-in-out infinite alternate;
}
.brand__text { display: grid; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: .5px;
  text-shadow: 0 3px 0 var(--pink-d), 0 6px 10px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.brand__name b {
  font-weight: 400;
  margin-left: 5px;
  color: var(--lemon);
  text-shadow: 0 3px 0 var(--lemon-d), 0 6px 10px rgba(0, 0, 0, .35);
}
.brand__tag {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.fun-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #0c4a34;
  background: linear-gradient(180deg, #9dffd8, var(--mint));
  box-shadow: 0 3px 0 #0a9e68, inset 0 1.5px 0 rgba(255, 255, 255, .7);
  white-space: nowrap;
}

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  background: linear-gradient(180deg, #9a6bff, #5a2bd6);
  box-shadow: 0 4px 0 #34128f, inset 0 2px 0 rgba(255, 255, 255, .45);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { filter: brightness(1.12); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #34128f, inset 0 2px 0 rgba(255, 255, 255, .45); }
.icon-btn .snd-off { display: none; }
.icon-btn[aria-pressed="false"] .snd-on { display: none; }
.icon-btn[aria-pressed="false"] .snd-off { display: inline; }
.icon-btn[aria-pressed="false"] { background: linear-gradient(180deg, #7d7399, #4a4266); box-shadow: 0 4px 0 #2b2540, inset 0 2px 0 rgba(255, 255, 255, .3); }

.balance {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 16px 5px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a1582, #260c5c);
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .45), 0 4px 0 rgba(20, 6, 50, .55);
  font-family: var(--font-display);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.balance__coin, .coin {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fffbd0, #ffd93b 46%, #f2a400);
  box-shadow: inset 0 -3px 0 rgba(170, 90, 0, .5), 0 2px 0 #a86200;
}
.balance__coin::after { content: '★'; font-size: 16px; color: #c47a00; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.balance.is-bump { animation: bump .28s; }
.balance__cur { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--ink-dim); margin-right: -3px; }
.balance__add {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  margin: 0 -9px 0 2px;
  border: 0; border-radius: 50%;
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  color: #0c4a34;
  background: linear-gradient(180deg, #9dffd8, var(--mint));
  box-shadow: 0 3px 0 #0a9e68, inset 0 1.5px 0 rgba(255, 255, 255, .7);
  transition: transform .06s, box-shadow .06s;
}
.balance__add:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a9e68, inset 0 1.5px 0 rgba(255, 255, 255, .7); }

.guest { display: flex; gap: 8px; }
.pill-btn {
  padding: 8px 18px 9px;
  border: 0; border-radius: 999px;
  font-family: var(--font-display); font-size: 16px; letter-spacing: .5px;
  color: #5a2a00;
  background: linear-gradient(180deg, #fff07a, #ffb300);
  box-shadow: 0 4px 0 #c77700, inset 0 2px 0 rgba(255, 255, 255, .7);
  white-space: nowrap;
  transition: transform .07s, box-shadow .07s, filter .15s;
}
.pill-btn:hover { filter: brightness(1.07); }
.pill-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c77700, inset 0 2px 0 rgba(255, 255, 255, .7); }
.pill-btn--ghost { color: #fff; background: linear-gradient(180deg, #9a6bff, #5a2bd6); box-shadow: 0 4px 0 #34128f, inset 0 2px 0 rgba(255, 255, 255, .45); }
.pill-btn--ghost:active { box-shadow: 0 1px 0 #34128f, inset 0 2px 0 rgba(255, 255, 255, .45); }

.fun-chip[data-mode="test"] { color: #5a2a00; background: linear-gradient(180deg, #fff07a, #ffb300); box-shadow: 0 3px 0 #c77700, inset 0 1.5px 0 rgba(255, 255, 255, .7); }

/* ---------- history ---------- */
.history {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 9px 16px;
  border-radius: 999px;
  background: rgba(20, 6, 50, .5);
  border: 2px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .35);
  min-width: 0;
}
.history__label {
  flex: none;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--ink-dim);
}
.history__pills {
  display: flex; gap: 7px;
  min-width: 0; flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent);
}
.pill, .xpill {
  flex: none;
  padding: 3px 11px 4px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(180deg, var(--p1), var(--p2));
  box-shadow: 0 3px 0 var(--p3), inset 0 1.5px 0 rgba(255, 255, 255, .5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.pill--lo, .xpill--lo { --p1: #7ad7ff; --p2: #2a9df4; --p3: #1466b3; }
.pill--mid, .xpill--mid { --p1: #d79bff; --p2: #a04bf0; --p3: #6421b0; }
.pill--hi, .xpill--hi { --p1: #fff38a; --p2: #ffb300; --p3: #c77700; color: #5a2a00; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.pill.is-new { animation: pillIn .5s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- recent wins ---------- */
.strips { display: grid; gap: 8px; min-width: 0; }
.wins {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 16px;
  border-radius: 999px;
  background: rgba(20, 6, 50, .5);
  border: 2px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .35);
  min-width: 0;
}
.wins[hidden] { display: none; }
.wins__view {
  flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 92%, transparent);
}
.wins__track, .wins__set { display: flex; width: max-content; }
/* Only when the wins do not fit: the list is doubled and slides by half its width, so the loop is seamless. */
.wins__track.is-moving { animation: winsSlide var(--dur, 40s) linear infinite; }
.wins:hover .wins__track.is-moving { animation-play-state: paused; }
.wins__item { display: flex; align-items: center; gap: 6px; flex: none; margin-right: 24px; font-size: 13px; white-space: nowrap; color: var(--ink-dim); }
.wins__item .ava { width: 22px; height: 22px; font-size: 12px; }
.wins__item b { font-weight: 600; color: #fff; }
.wins__item .wins__amt { font-family: var(--font-display); font-weight: 400; font-size: 14px; color: var(--mint); }

/* ---------- stage ---------- */
.stage-frame {
  position: relative;
  padding: 8px;
  border-radius: 32px;
  background: repeating-linear-gradient(-45deg, #ff5fa8 0 14px, #fff 14px 28px);
  background-size: 39.598px 39.598px;
  box-shadow: 0 8px 0 #a3125c, 0 22px 40px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .5);
  min-height: 0;
}
.stage-frame:has(.stage[data-phase="flying"]) { animation: stripes .9s linear infinite; }

.stage {
  position: relative;
  height: 100%;
  border-radius: 25px;
  overflow: hidden;
  background: #56ccff;
  container-type: size;
  box-shadow: inset 0 0 0 3px rgba(107, 16, 64, .55);
  isolation: isolate;

  --m-fill: #fff;
  --m-edge: #1f7fe0;
  --m-deep: #0e4fa3;
  --m-glow: rgba(73, 198, 255, .75);
}
.stage[data-tier="mid"] { --m-edge: #b01fc9; --m-deep: #6d0f8f; --m-glow: rgba(255, 79, 163, .8); }
.stage[data-tier="hi"] { --m-fill: #fff6b8; --m-edge: #f07a00; --m-deep: #a84300; --m-glow: rgba(255, 217, 59, .9); }
.stage[data-phase="crashed"] { --m-fill: #ffe1e5; --m-edge: #e0213f; --m-deep: #8a0c22; --m-glow: rgba(255, 84, 104, .75); }
.stage.is-shake { animation: stageShake .45s; }

.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 20%), radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(40, 0, 70, .32));
  pointer-events: none;
}
.stage__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stage__flash.is-on { animation: flash .45s ease-out; }
.stage__flash.is-boom { background: #ffeeb0; animation: boomFlash .5s ease-out; }

.stage__hud {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  text-align: center;
  pointer-events: none;
}
.waiting, .flight { grid-area: 1 / 1; }
.flight { transform: translate(-5cqw, -7cqh); } /* sit up-left of the flight path */
.stage[data-phase="betting"] .flight,
.stage:not([data-phase="betting"]) .waiting { display: none; }

.waiting { display: grid; justify-items: center; gap: 12px; animation: popIn .35s cubic-bezier(.2, 1.5, .4, 1); }
.waiting__title {
  font-family: var(--font-display);
  font-size: 44px;
  font-size: clamp(26px, 7cqw, 56px);
  text-shadow: 0 3px 0 var(--pink-d), 0 6px 0 #8a0f4d, 0 12px 20px rgba(40, 0, 70, .45);
  -webkit-text-stroke: 2px var(--pink-d);
  paint-order: stroke fill;
}
.waiting__bar {
  width: min(320px, 62cqw);
  height: 22px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(40, 8, 80, .6);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .35);
}
.waiting__bar i {
  display: block; height: 100%; width: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, #ffd93b 0 9px, #ff8a3d 9px 18px);
  background-size: 25.456px 25.456px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6);
  animation: stripesSm .6s linear infinite;
}
.waiting__time {
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  background: rgba(40, 8, 80, .55);
}
.waiting__time b { display: inline-block; min-width: 2.2ch; font-family: var(--font-display); font-weight: 400; color: var(--lemon); font-variant-numeric: tabular-nums; }

.outcome {
  display: none;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 30px;
  font-size: clamp(20px, 5cqw, 40px);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #8a0c22, 0 8px 16px rgba(40, 0, 70, .5);
}
.stage[data-phase="crashed"] .outcome { display: block; animation: popIn .35s cubic-bezier(.2, 1.6, .4, 1); }
.stage[data-phase="crashed"] .outcome.is-slam { animation: slam .42s cubic-bezier(.2, 1.5, .4, 1); }

.mult {
  font-family: var(--font-display);
  font-size: 110px;
  font-size: clamp(54px, 15cqw, 150px);
  line-height: .95;
  letter-spacing: 1px;
  color: var(--m-fill);
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 3px var(--m-edge);
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 var(--m-edge), 0 4px 0 var(--m-edge), 0 6px 0 var(--m-edge),
    0 8px 0 var(--m-deep), 0 10px 0 var(--m-deep),
    0 18px 26px rgba(30, 0, 60, .45),
    0 0 46px var(--m-glow);
}
.mult.is-bump { animation: multBump .38s cubic-bezier(.2, 1.6, .4, 1); }

.banner {
  position: absolute; left: 0; right: 0; top: 13%; z-index: 3;
  text-align: center;
  font-family: var(--font-display);
  font-size: 60px;
  font-size: clamp(30px, 9cqw, 84px);
  color: var(--lemon);
  -webkit-text-stroke: 3px #e2571b;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #e2571b, 0 8px 0 #9a2f00, 0 16px 26px rgba(40, 0, 70, .5);
  pointer-events: none;
  opacity: 0;
}
.banner.is-on { animation: bannerPop 1.7s cubic-bezier(.2, 1.4, .4, 1) forwards; }

.toasts {
  position: absolute; top: 12px; left: 50%; z-index: 4;
  display: grid; gap: 6px; justify-items: center;
  transform: translateX(-50%);
  width: max-content; max-width: 92%;
  pointer-events: none;
}
.toast {
  padding: 6px 16px 7px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  color: #0c4a34;
  background: linear-gradient(180deg, #b6ffe2, var(--mint));
  box-shadow: 0 4px 0 #0a9e68, 0 10px 18px rgba(0, 0, 0, .3), inset 0 1.5px 0 rgba(255, 255, 255, .8);
  animation: toastIn 2.6s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.toast b { font-family: var(--font-display); font-weight: 400; }
.toast--warn { color: #5a2a00; background: linear-gradient(180deg, #ffe873, #ffb300); box-shadow: 0 4px 0 #c77700, 0 10px 18px rgba(0, 0, 0, .3), inset 0 1.5px 0 rgba(255, 255, 255, .8); }

.stage__round {
  position: absolute; z-index: 3;
  padding: 3px 11px;
  border: 0; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: rgba(40, 8, 80, .5);
}
.stage__round { left: 14px; top: 12px; }
.stage__zone {
  position: absolute; right: 14px; top: 12px; z-index: 3;
  padding: 3px 12px 4px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: rgba(40, 8, 80, .5);
  transition: background .4s;
}
.stage__zone[data-zone="1"] { background: rgba(214, 60, 150, .6); }
.stage__zone[data-zone="2"] { background: rgba(36, 20, 84, .78); }
.stage__zone[data-zone="3"] { background: rgba(226, 104, 40, .7); }
.stage__zone[data-zone="4"] { background: rgba(12, 6, 46, .8); box-shadow: 0 0 14px rgba(110, 240, 220, .6); }
.stage__zone.is-pop { animation: zonePop .6s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- bet panels ---------- */
.bets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 6px; }

.bet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "ctrl cta" "opts opts";
  gap: 10px 12px;
  padding: 12px 12px 10px;
}
.bet.is-won { animation: wonGlow .9s ease-out; }
.bet.is-lost { animation: shakeX .4s; }

.bet__ctrl { grid-area: ctrl; display: grid; gap: 9px; align-content: center; transition: opacity .15s; }
.bet.is-locked .bet__ctrl { opacity: .5; pointer-events: none; }

.stepper {
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--well);
  border: 2px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45);
}
.stepper__btn {
  flex: none;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  font-family: var(--font-display);
  font-size: 20px; line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #ff86c2, #ff2d87);
  box-shadow: 0 3px 0 #a80d58, inset 0 1.5px 0 rgba(255, 255, 255, .6);
  transition: transform .06s, box-shadow .06s;
}
.stepper__btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a80d58, inset 0 1.5px 0 rgba(255, 255, 255, .6); }
.stepper__input {
  flex: 1; min-width: 0; width: 100%;
  padding: 0;
  border: 0; outline: 0; background: none;
  text-align: center;
  font-family: var(--font-display);
  font-size: 19px; /* small enough that 1000.00 fits in a narrow panel */
  font-variant-numeric: tabular-nums;
}

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips button {
  padding: 4px 0 5px;
  border: 0; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, #9a6bff, #5a2bd6);
  box-shadow: 0 3px 0 #34128f, inset 0 1.5px 0 rgba(255, 255, 255, .4);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.chips button:hover { filter: brightness(1.15); }
.chips button:active { transform: translateY(2px); box-shadow: 0 1px 0 #34128f, inset 0 1.5px 0 rgba(255, 255, 255, .4); }

.cta {
  grid-area: cta;
  position: relative;
  display: grid; place-content: center; gap: 1px;
  min-height: 92px;
  padding: 8px 10px;
  border: 0; border-radius: 22px;
  font-family: var(--font-display);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow:
    0 7px 0 var(--c3),
    0 14px 22px rgba(0, 0, 0, .35),
    inset 0 2px 0 rgba(255, 255, 255, .6),
    inset 0 -8px 14px rgba(0, 0, 0, .12);
  overflow: hidden;
  transition: transform .07s, box-shadow .07s, filter .15s;
  touch-action: manipulation;
  user-select: none;
}
.cta::before {
  content: '';
  position: absolute; left: 5%; right: 5%; top: 6%; height: 40%;
  border-radius: 16px 16px 50% 50% / 16px 16px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .06));
  pointer-events: none;
}
.cta:hover { filter: brightness(1.07) saturate(1.08); }
.cta:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--c3), 0 6px 10px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -8px 14px rgba(0, 0, 0, .12); }
.cta__label { position: relative; text-transform: uppercase; font-size: 28px; font-size: clamp(22px, 2.3vw, 31px); letter-spacing: 1.5px; line-height: 1.05; }
.cta__sub { position: relative; font-family: var(--font-body); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .96; }
.cta--bet { --c1: #9cff66; --c2: #36c81c; --c3: #1b860b; }
.cta--cancel { --c1: #ff97a3; --c2: #f03352; --c3: #a3122c; }
.cta--queued { --c1: #ffb37a; --c2: #ff7a1f; --c3: #b54a06; }
.cta--cash { --c1: #fff07a; --c2: #ffb300; --c3: #c77700; color: #5a2a00; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); animation: cashPulse .55s ease-in-out infinite alternate; }
.cta--cash .cta__sub { font-family: var(--font-display); font-weight: 400; font-size: 22px; }

.bet__auto {
  grid-area: opts;
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding-top: 9px;
  border-top: 2px dashed rgba(255, 255, 255, .16);
  font-size: 14px;
}
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  position: relative; flex: none;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .18);
  transition: background .15s;
}
.switch i::after {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #d9cfff);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .18s cubic-bezier(.2, 1.6, .4, 1);
}
.switch input:checked + i { background: linear-gradient(180deg, #7df5ae, #1fc46a); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--lemon); outline-offset: 2px; }
.switch input:disabled ~ * { opacity: .5; }

.bet__cash { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.autox {
  display: flex; align-items: center; gap: 3px;
  padding: 3px 11px 4px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5);
  font-family: var(--font-display);
  color: var(--lemon);
}
.autox input { width: 46px; padding: 0; border: 0; outline: 0; background: none; text-align: right; font-family: var(--font-display); font-size: 16px; color: var(--lemon); }
.autox input:disabled { opacity: .5; }

/* ---------- side panel ---------- */
.side { display: flex; flex-direction: column; min-height: 0; padding: 12px; }

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45);
}
.tab {
  padding: 6px 4px 7px;
  border: 0; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-dim);
  background: none;
  white-space: nowrap;
  transition: color .15s;
}
.tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ff86c2, #ff2d87);
  box-shadow: 0 3px 0 #a80d58, inset 0 1.5px 0 rgba(255, 255, 255, .55);
}

.side__summary { display: flex; justify-content: space-between; gap: 10px; padding: 12px 6px 8px; }
.side__summary div { display: grid; gap: 1px; }
.side__summary b { font-family: var(--font-display); font-weight: 400; font-size: 22px; font-variant-numeric: tabular-nums; }
.side__summary span { font-size: 12px; color: var(--ink-dim); }
.side__total { text-align: right; }
.side__total b { color: var(--mint); }

.side__head, .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 58px 68px;
  align-items: center;
  gap: 6px;
}
.side__head {
  padding: 4px 10px 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-dim);
}
.side__head span:nth-child(2), .side__head span:nth-child(4) { text-align: right; }
.side__head span:nth-child(3) { text-align: center; }

.side__list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
.side__list::-webkit-scrollbar { width: 6px; }
.side__list::-webkit-scrollbar-thumb { border-radius: 6px; background: rgba(255, 255, 255, .28); }

.row {
  padding: 5px 9px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: rgba(20, 6, 50, .4);
  font-size: 14px;
}
.row + .row { margin-top: 5px; }
.row.is-won { background: linear-gradient(90deg, rgba(61, 245, 176, .32), rgba(61, 245, 176, .1)); border-color: rgba(61, 245, 176, .6); }
.row.is-lost { opacity: .5; }
.row.is-me { border-color: var(--lemon); }
.who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ava {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-style: normal; font-size: 14px;
  background: hsl(var(--h, 300) 92% 74%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .55);
}
.num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.is-won .win { color: var(--mint); }
.xcell { text-align: center; color: var(--ink-dim); }
.xpill { display: inline-block; padding: 1px 8px 2px; font-size: 13px; box-shadow: 0 2px 0 var(--p3), inset 0 1.5px 0 rgba(255, 255, 255, .5); }
.empty { padding: 26px 12px; text-align: center; color: var(--ink-dim); font-size: 14px; }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(16, 4, 40, .72);
  backdrop-filter: blur(6px);
}
.modal__card {
  position: relative;
  width: min(580px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 22px 24px 20px;
  animation: popIn .28s cubic-bezier(.2, 1.5, .4, 1);
}
.modal__card h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: 30px; text-shadow: 0 3px 0 var(--pink-d); }
.modal__close {
  position: absolute; right: 14px; top: 14px;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  font-family: var(--font-display); font-size: 22px; line-height: 1;
  background: linear-gradient(180deg, #ff97a3, #f03352);
  box-shadow: 0 3px 0 #a3122c, inset 0 1.5px 0 rgba(255, 255, 255, .55);
}
.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { position: relative; padding: 9px 12px 9px 50px; border-radius: 16px; background: rgba(20, 6, 50, .4); counter-increment: s; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 10px; top: 50%;
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-top: -15px;
  border-radius: 50%;
  font-family: var(--font-display);
  color: #5a2a00;
  background: linear-gradient(180deg, #fff07a, #ffb300);
  box-shadow: 0 3px 0 #c77700;
}
.muted { margin: 8px 0 0; font-size: 14px; color: var(--ink-dim); }
kbd { padding: 1px 7px; border-radius: 7px; font: 600 12px ui-monospace, Menlo, monospace; color: #fff; background: rgba(20, 6, 50, .6); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }

/* ---------- forms, wallet, account ---------- */
.modal__card--narrow { width: min(440px, 100%); }
.tabs--two { grid-template-columns: repeat(2, 1fr); }
.cta.is-busy { pointer-events: none; filter: saturate(.55) brightness(.92); }

.form { display: grid; gap: 12px; margin-top: 14px; }
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.field > span { color: var(--ink-dim); }
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  outline: 0;
  font-size: 16px; font-weight: 500;
  color: #fff;
  background: var(--well);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .4);
  transition: border-color .15s;
}
.field input::placeholder { color: rgba(205, 184, 255, .5); }
.field input:focus { border-color: var(--lemon); }
.field small { font-weight: 500; font-size: 12px; color: var(--ink-dim); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--pink); }
.check--small { align-items: center; gap: 8px; margin-top: -4px; font-size: 13px; color: var(--ink-dim); }
.check--small input { width: 17px; height: 17px; }
.form .chips button { padding: 7px 0 8px; font-size: 15px; }
.form__error { margin: 0; padding: 9px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #ffe1e5; background: rgba(240, 51, 82, .28); border: 1.5px solid rgba(255, 84, 104, .6); }
.form__submit { grid-area: auto; min-height: 58px; width: 100%; margin-top: 2px; }
.form__submit .cta__label { font-size: 21px; }
.form__submit:disabled { cursor: default; }

.notice { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; background: rgba(20, 6, 50, .5); border: 1.5px solid rgba(255, 255, 255, .16); }
.notice--good { color: #06402b; background: linear-gradient(180deg, #b6ffe2, var(--mint)); border-color: #0a9e68; }
.notice--bad { color: #ffe1e5; background: rgba(240, 51, 82, .28); border-color: rgba(255, 84, 104, .6); }
.notice--wait::before, .spinner {
  content: ''; flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: var(--lemon);
  animation: spin .8s linear infinite;
}

.wallet__balance { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: -2px 0 12px; padding: 10px 14px; border-radius: 16px; background: var(--well); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .4); }
.wallet__balance span { font-size: 13px; font-weight: 600; color: var(--ink-dim); }
.wallet__balance b { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--lemon); font-variant-numeric: tabular-nums; }

.txns { display: grid; gap: 6px; margin-top: 14px; max-height: 46vh; overflow-y: auto; }
.txn { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(20, 6, 50, .4); font-size: 14px; }
.txn__what { display: grid; min-width: 0; }
.txn__what span { font-size: 12px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn__amount { font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums; }
.txn--deposit .txn__amount { color: var(--mint); }
.txn__status { padding: 2px 9px 3px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #5a2a00; background: var(--lemon); }
.txn--completed .txn__status { color: #06402b; background: var(--mint); }
.txn--failed .txn__status { color: #fff; background: var(--cherry); }
.txn--failed .txn__amount { opacity: .5; text-decoration: line-through; }

.facts { display: grid; gap: 6px; margin: 0 0 12px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 13px; border-radius: 14px; background: rgba(20, 6, 50, .4); font-size: 14px; }
.facts dt { color: var(--ink-dim); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.facts--tight { margin: 0; }
.facts--tight div:last-child dd { color: var(--lemon); }
#accountBalance { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--lemon); font-variant-numeric: tabular-nums; }
.account__money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 14px; }
.account__money .cta--cash { animation: none; }
.account__money + .muted { margin: 0 0 14px; }

/* ---------- full-page effects canvas ---------- */
.fx { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; }

/* ---------- keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { to { transform: translate(60px, -50px) scale(1.15); } }
@keyframes hover { from { transform: translateY(-2px) rotate(-5deg); } to { transform: translateY(3px) rotate(-9deg); } }
@keyframes stripes { to { background-position: 39.598px 0; } }
@keyframes stripesSm { to { background-position: 25.456px 0; } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bump { 40% { transform: scale(1.12); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.05); } }
@keyframes pillIn { from { transform: scale(0) translateX(-20px); } to { transform: none; } }
@keyframes multBump { 35% { transform: scale(1.16) rotate(-2deg); } }
@keyframes cashPulse { from { transform: scale(1); } to { transform: scale(1.035); filter: brightness(1.1); } }
@keyframes shakeX { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes stageShake { 15% { transform: translate(-7px, 4px) rotate(-.5deg); } 30% { transform: translate(6px, -4px) rotate(.4deg); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); } }
@keyframes flash { from { opacity: .5; } to { opacity: 0; } }
@keyframes boomFlash { from { opacity: .36; } to { opacity: 0; } }
@keyframes zonePop { 0% { transform: scale(.5); } 45% { transform: scale(1.28); } 100% { transform: none; } }
@keyframes slam { from { transform: scale(2.4) rotate(-7deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wonGlow {
  0% { box-shadow: 0 6px 0 rgba(20, 6, 50, .6), 0 0 0 0 rgba(255, 217, 59, .9), inset 0 2px 0 rgba(255, 255, 255, .2); transform: scale(1.02); }
  100% { box-shadow: 0 6px 0 rgba(20, 6, 50, .6), 0 0 0 26px rgba(255, 217, 59, 0), inset 0 2px 0 rgba(255, 255, 255, .2); }
}
@keyframes bannerPop {
  0% { opacity: 0; transform: scale(.2) rotate(-14deg); }
  18% { opacity: 1; transform: scale(1.18) rotate(-5deg); }
  30% { transform: scale(1) rotate(-4deg); }
  75% { opacity: 1; transform: scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.05) rotate(-4deg); }
}
@keyframes winsSlide { to { transform: translateX(-50%); } }
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-16px) scale(.8); }
  10%, 82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr); }
  .fun-chip { display: none; }
}

@media (max-width: 900px) {
  .app { height: auto; min-height: 100vh; min-height: 100dvh; padding: 10px 12px 18px; gap: 10px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .center { grid-template-rows: auto auto auto; }
  .stage-frame { height: clamp(290px, 62vw, 460px); }
  .side { order: 2; height: 440px; }
}

@media (max-width: 620px) {
  .bets { grid-template-columns: minmax(0, 1fr); }
  .brand { gap: 8px; }
  .brand__plane { width: 48px; height: 34px; }
  .brand__name { display: grid; font-size: 19px; line-height: .98; }
  .brand__name b { margin-left: 0; }
  .brand__tag { display: none; }
  .cta { min-height: 84px; }
  .topbar { gap: 8px; }
  .topbar__right { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 19px; height: 19px; }
  .balance { font-size: 17px; padding-right: 12px; }
  .balance__cur { display: none; }
  .pill-btn { padding: 7px 12px 8px; font-size: 14px; }
  .guest { gap: 5px; }
  .balance__coin { width: 26px; height: 26px; }
  .history__label { display: none; }
  .history, .wins { padding-left: 9px; }
  .stage-frame { padding: 6px; border-radius: 26px; }
  .stage { border-radius: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .blobs i, .brand__plane, .stage-frame, .stage.is-shake, .cta--cash, .spinner, .wins__track { animation: none !important; }
  .wins__view { overflow-x: auto; }
}
