/* Partner Arcade: shared scene, header, keys, wells and the CSS 3D die.
   Same language as the shop and the lootbox: matte clay on dark paper, ONE light
   from the upper right (highlights top-right, shadows fall down-left). */
:root {
  --bg: #0a0a0a; --bg2: #121213; --ink: #0b0b0b; --cream: #f2f0ec;
  --t2: rgba(242, 240, 236, .58); --t3: rgba(242, 240, 236, .4); --t4: rgba(242, 240, 236, .28);
  --hair: rgba(242, 240, 236, .12); --hair2: rgba(242, 240, 236, .2);
  --clay-hi: #1c1c1e; --clay-mid: #141415; --clay-lo: #101011;
  --well-hi: #0b0b0c; --well-lo: #121213;
  --out: #e58c7d; --error-text: #f1b6ab; --error-fill: rgba(229, 140, 125, .08); --error-line: rgba(229, 140, 125, .3);
  --display: 'Archivo', 'Satoshi', system-ui, sans-serif;
  --sans: 'Satoshi', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.22, 1.2, .36, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --clay-edge: inset -1.5px 1.5px 0 rgba(255, 255, 255, .07), inset 2px -3px 0 rgba(0, 0, 0, .55);
  --sh-plate: var(--clay-edge), inset 0 0 0 1px rgba(255, 255, 255, .02), -14px 22px 34px rgba(0, 0, 0, .5), -3px 6px 10px rgba(0, 0, 0, .32);
  --sh-lift: var(--clay-edge), inset 0 0 0 1px rgba(255, 255, 255, .03), -24px 36px 60px rgba(0, 0, 0, .6), -6px 10px 18px rgba(0, 0, 0, .4);
  --sh-well: inset -3px 4px 7px rgba(0, 0, 0, .75), inset 2px -2px 4px rgba(255, 255, 255, .05);
  --sh-socket: inset -4px 6px 12px rgba(0, 0, 0, .8), inset 2px -2px 4px rgba(255, 255, 255, .045), -1px 1px 0 rgba(255, 255, 255, .05);
  --sh-groove: inset -1px 2px 3px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .05);
  --sh-clay-key: var(--clay-edge), -8px 12px 20px rgba(0, 0, 0, .45), -2px 3px 5px rgba(0, 0, 0, .3);
  --sh-clay-key-sm: var(--clay-edge), -3px 5px 8px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; background: var(--bg); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg svg { width: 100%; height: 100%; display: block; }
.bg__grain {
  position: absolute; inset: 0; opacity: .1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bgprops { position: absolute; inset: 0; }
.bgprop {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); translate: -50% -50%;
  transform: translate3d(calc(var(--mx, 0) * var(--d) * -26px), calc(var(--my, 0) * var(--d) * -20px), 0);
  transition: transform 1.2s var(--ease);
}
.bgprop img {
  display: block; width: 100%; height: auto; rotate: var(--r); opacity: var(--o);
  filter: brightness(var(--br)) saturate(.8) blur(var(--b)) drop-shadow(-14px 20px 18px rgba(0, 0, 0, .6));
  animation: drift var(--t) ease-in-out infinite; animation-delay: var(--delay);
}
@keyframes drift { 50% { transform: translateY(-14px) rotate(4deg); } }
@media (max-width: 720px) { .bgprop:nth-child(n+4) { display: none; } }

.app { position: relative; z-index: 1; }

/* ---------- header ---------- */
/* brand left, balance in the middle where the eye lands, links right */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; max-width: 1440px; margin: 0 auto; padding: 20px var(--gutter); }
.top__brand { justify-self: start; }
.top__brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.top__brand b { font: 850 19px/1 var(--display); font-stretch: 88%; font-variation-settings: 'wdth' 88; letter-spacing: -.02em; }
.top__brand span { font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--t3); }
.top__right { display: flex; align-items: center; gap: 22px; justify-self: end; }
.top__back { font: 500 14px/1 var(--sans); color: var(--t2); text-decoration: none; border-bottom: 1px solid var(--hair2); padding: 4px 0; }
.top__back:hover { color: var(--cream); }
.top__sound { padding: 0; border: 0; background: none; cursor: pointer; font: 500 13px/1 var(--sans); color: var(--t3); }
.top__sound:hover { color: var(--cream); }
/* balance: a readout pressed into a raised clay socket, the one number always in view */
.bal {
  position: relative; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px;
  background: linear-gradient(195deg, var(--well-hi), var(--well-lo));
  box-shadow: var(--sh-socket), 0 0 0 6px #151516, 0 0 0 7px rgba(255, 255, 255, .04), -10px 16px 26px rgba(0, 0, 0, .55);
  text-decoration: none; transition: box-shadow .25s var(--ease);
}
.bal:hover { box-shadow: var(--sh-socket), inset 0 0 0 1px rgba(242, 240, 236, .2), 0 0 0 6px #151516, 0 0 0 7px rgba(255, 255, 255, .06), -10px 16px 26px rgba(0, 0, 0, .55); }
.bal__text { display: flex; flex-direction: column; gap: 5px; }
.bal__text small { font: 500 10px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--t3); }
.bal__num { display: flex; align-items: baseline; gap: 6px; }
.bal b { font: 850 24px/.9 var(--display); font-stretch: 100%; font-variation-settings: 'wdth' 100; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bal__num span { font: 600 12px/1 var(--sans); color: var(--t2); }
.bal .led { width: 9px; height: 9px; }
.bal.is-up b { animation: balup .8s var(--ease); }
@keyframes balup { 30% { text-shadow: 0 0 18px rgba(242, 240, 236, .9); } }
/* the change floats out under the balance: +147 on a win, −100 when a play starts */
.bal__delta {
  position: absolute; left: 50%; top: calc(100% + 10px); translate: -50% 0; pointer-events: none; white-space: nowrap;
  font: 700 14px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--t3);
  animation: delta 1.6s var(--ease) forwards;
}
.bal__delta.is-plus { font: 850 18px/1 var(--display); color: var(--cream); text-shadow: 0 0 16px rgba(242, 240, 236, .6); }
@keyframes delta { 0% { opacity: 0; transform: translateY(-8px); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--cream); box-shadow: 0 0 8px rgba(242, 240, 236, .8), inset -1px 1px 0 rgba(255, 255, 255, .6); flex: none; }
.led--off { background: #0a0a0b; box-shadow: inset -1px 1px 2px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .06); }
.led--half { background: #e9c46a; box-shadow: 0 0 8px rgba(233, 196, 106, .6); }
.led--out { background: var(--out); box-shadow: 0 0 8px rgba(229, 140, 125, .6); }
.eyebrow { font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--t3); margin: 0 0 18px; }
.label { display: block; font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }

/* ---------- surfaces ---------- */
.plate {
  position: relative; border-radius: 26px; padding: clamp(20px, 2.6vw, 32px);
  background:
    radial-gradient(90% 60% at 95% 0%, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 60%),
    linear-gradient(195deg, var(--clay-hi), var(--clay-mid) 55%, var(--clay-lo));
  box-shadow: var(--sh-plate);
}
.well { border-radius: 18px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); }
.groove { height: 2px; border-radius: 2px; box-shadow: var(--sh-groove); }

/* well input: a field pressed into the clay */
.field { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-radius: 15px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); transition: box-shadow .2s; }
.field:focus-within { box-shadow: var(--sh-well), inset 0 0 0 1.5px rgba(242, 240, 236, .5); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--cream); font: 700 18px/1 var(--sans); font-variant-numeric: tabular-nums; }
.field small { font: 500 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--t3); }
.field.is-bad { box-shadow: var(--sh-well), inset 0 0 0 1.5px var(--error-line); }

/* clay key: a small raised secondary button */
.ckey {
  display: inline-grid; place-items: center; min-width: 48px; height: 44px; padding: 0 14px; border: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(195deg, #222224, #19191b 55%, #141416); box-shadow: var(--sh-clay-key-sm);
  font: 600 14px/1 var(--sans); color: var(--t2); font-variant-numeric: tabular-nums;
  transition: transform .12s ease, box-shadow .12s ease, color .2s;
}
.ckey:hover { color: var(--cream); transform: translate(1px, -2px); }
.ckey:active, .ckey[aria-pressed="true"] { transform: translateY(1px); color: var(--cream); background: linear-gradient(195deg, #121213, #0d0d0e); box-shadow: inset -2px 3px 5px rgba(0, 0, 0, .8), inset 1px -1px 0 rgba(255, 255, 255, .04), inset 0 0 0 1px rgba(242, 240, 236, .16); }
.ckey:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* ---------- keycap ---------- */
.keycap {
  display: inline-block; padding: 0 0 7px; border: 0; border-radius: 18px; cursor: pointer; text-decoration: none;
  background: var(--kc-base, linear-gradient(180deg, #c4c3be, #a3a29d));
  box-shadow: -10px 16px 24px rgba(0, 0, 0, .5), -2px 4px 6px rgba(0, 0, 0, .35);
  color: var(--kc-ink, var(--ink)); transition: padding .12s ease, transform .12s ease, box-shadow .12s ease;
}
.keycap__face {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 60px; padding: 0 28px 0 30px; border-radius: 17px;
  background: var(--kc-face, radial-gradient(130% 140% at 75% 10%, #fbfaf7 0%, #ecebe6 55%, #dcdbd6 100%));
  box-shadow: var(--kc-shine, inset 0 1.5px 0 rgba(255, 255, 255, .9), inset 0 -2px 4px rgba(0, 0, 0, .07));
  font: 700 16px/1 var(--sans); white-space: nowrap;
}
.keycap--sm { padding-bottom: 5px; border-radius: 14px; }
.keycap--sm .keycap__face { height: 46px; padding: 0 18px 0 20px; border-radius: 13px; font-size: 15px; }
.keycap--block { display: block; width: 100%; }
.keycap--block .keycap__face { display: flex; width: 100%; }
.keycap svg { width: 18px; height: 18px; transition: transform .3s var(--spring); }
.keycap:hover { transform: translateY(-1px); }
.keycap:hover svg { transform: translateX(3px); }
.keycap:active, .keycap.is-down { padding-bottom: 1px; transform: translateY(6px); box-shadow: -4px 7px 10px rgba(0, 0, 0, .45), -1px 2px 3px rgba(0, 0, 0, .3); }
.keycap--sm:active { transform: translateY(4px); }
.keycap--dark {
  --kc-face: radial-gradient(130% 140% at 75% 10%, #3a3a3d 0%, #2a2a2c 60%, #222224 100%);
  --kc-base: linear-gradient(180deg, #0f0f10, #0a0a0b); --kc-ink: var(--cream);
  --kc-shine: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1.5px 0 rgba(255, 255, 255, .14);
}
.keycap[aria-disabled="true"], .keycap:disabled {
  cursor: not-allowed; padding-bottom: 2px; transform: translateY(5px);
  --kc-base: #3a3a3c; --kc-face: #2a2a2c; --kc-ink: rgba(242, 240, 236, .42); --kc-shine: inset 0 1px 0 rgba(255, 255, 255, .06);
  box-shadow: -3px 5px 8px rgba(0, 0, 0, .4);
}
.keycap[aria-disabled="true"]:hover svg, .keycap:disabled:hover svg { transform: none; }
.textlink { padding: 6px 0; border: 0; border-bottom: 1px solid var(--hair2); background: none; cursor: pointer; font: 500 15px/1 var(--sans); color: rgba(242, 240, 236, .72); text-decoration: none; }
.textlink:hover { color: var(--cream); }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: #1c1c1e; box-shadow: var(--sh-clay-key-sm); font: 600 11px/1 var(--sans); color: var(--t2); }

/* ---------- CSS 3D die ---------- */
.dice { position: absolute; transform-style: preserve-3d; }
.dice__float { transform-style: preserve-3d; animation: bob var(--bob, 6s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
.dice__cube { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-27deg) rotateY(38deg) rotateZ(var(--tilt, 0deg)); }
.dice__cube.is-rolling { animation: roll var(--roll, 1.15s) cubic-bezier(.25, .7, .25, 1); }
@keyframes roll {
  0%   { transform: translateY(0) rotateX(-27deg) rotateY(38deg) rotateZ(var(--tilt, 0deg)); }
  45%  { transform: translateY(var(--hop, -46px)) rotateX(-207deg) rotateY(218deg) rotateZ(var(--tilt, 0deg)); }
  80%  { transform: translateY(3px) rotateX(-380deg) rotateY(392deg) rotateZ(var(--tilt, 0deg)); }
  100% { transform: translateY(0) rotateX(-387deg) rotateY(398deg) rotateZ(var(--tilt, 0deg)); }
}
.dice__face, .dice__core { position: absolute; inset: 0; backface-visibility: hidden; }
.dice__face { border-radius: 18%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15%; }
.dice__core { inset: 5%; backface-visibility: visible; }
.f-front { transform: translateZ(calc(var(--s) / 2)); }
.f-back  { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f-right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f-left  { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f-top   { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f-bottom{ transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.c-x1 { transform: rotateY(90deg) translateZ(calc(var(--s) * .45)); } .c-x2 { transform: rotateY(-90deg) translateZ(calc(var(--s) * .45)); }
.c-y1 { transform: rotateX(90deg) translateZ(calc(var(--s) * .45)); } .c-y2 { transform: rotateX(-90deg) translateZ(calc(var(--s) * .45)); }
.c-z1 { transform: translateZ(calc(var(--s) * .45)); } .c-z2 { transform: rotateY(180deg) translateZ(calc(var(--s) * .45)); }
.pip { width: 74%; aspect-ratio: 1; border-radius: 50%; place-self: center; }
/* faces carry their light: top brightest, front (turned right) mid, left darkest */
.dice--cream .dice__core { background: #8f8e89; }
.dice--cream .f-top { background: radial-gradient(120% 120% at 80% 10%, #ffffff, #f1f0eb 50%, #dddcd6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.dice--cream .f-front, .dice--cream .f-right { background: radial-gradient(130% 120% at 90% 0%, #eceae5, #d3d2cc 60%, #bdbcb6); }
.dice--cream .f-left, .dice--cream .f-back, .dice--cream .f-bottom { background: radial-gradient(130% 120% at 90% 0%, #a6a59f, #8d8c87 60%, #7a7974); }
.dice--cream .pip { background: radial-gradient(circle at 35% 65%, #3c3c3f, #141415 70%); box-shadow: inset -2px 2px 3px rgba(0, 0, 0, .75), -.5px .5px 0 rgba(255, 255, 255, .55); }
.dice--cream .f-left .pip, .dice--cream .f-back .pip, .dice--cream .f-bottom .pip { opacity: .8; }
.dice--graphite .dice__core { background: #111112; }
.dice--graphite .f-top { background: radial-gradient(120% 120% at 80% 10%, #4e4e52, #3a3a3d 55%, #2c2c2f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.dice--graphite .f-front, .dice--graphite .f-right { background: radial-gradient(130% 120% at 90% 0%, #333336, #252527 60%, #1d1d1f); }
.dice--graphite .f-left, .dice--graphite .f-back, .dice--graphite .f-bottom { background: radial-gradient(130% 120% at 90% 0%, #1c1c1e, #151516 60%, #101011); }
.dice--graphite .pip { background: radial-gradient(circle at 70% 30%, #fbfaf7, #d6d4ce 70%); box-shadow: inset -1px 1px 1px rgba(255, 255, 255, .6), -1px 1.5px 2px rgba(0, 0, 0, .6); }
.dice--graphite .f-left .pip, .dice--graphite .f-back .pip, .dice--graphite .f-bottom .pip { opacity: .55; }

/* ---------- CSS 3D coin: cream face, graphite face, milled rim ---------- */
.coin { position: absolute; left: 50%; top: 50%; width: 128px; height: 128px; margin: -70px 0 0 -64px; transform-style: preserve-3d; }
.coin__toss { width: 100%; height: 100%; transform-style: preserve-3d; animation: bob 5.4s ease-in-out infinite; }
.coin__toss.is-tossing { animation: toss var(--toss, 1.1s) cubic-bezier(.3, .7, .35, 1); }
@keyframes toss { 0% { transform: translateY(0); } 42% { transform: translateY(var(--toss-h, -58px)); } 78% { transform: translateY(4px); } 100% { transform: translateY(0); } }
.coin__spin {
  width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateZ(-10deg) rotateX(18deg) rotateY(calc(-50deg + var(--flip, 0) * 1deg));
  transition: transform var(--toss, 1.1s) cubic-bezier(.3, .7, .35, 1);
}
.coin__layer { position: absolute; inset: 0; border-radius: 50%; backface-visibility: visible; }
.coin__face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; }
.coin__face--heads { background: radial-gradient(110% 110% at 78% 18%, #ffffff, #efeee9 40%, #d5d4ce 80%, #c4c3bd); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); transform: translateZ(7px); }
.coin__face--tails { background: radial-gradient(110% 110% at 22% 18%, #48484c, #333336 45%, #222224 85%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .08); transform: rotateY(180deg) translateZ(7px); }
.coin__face::before {
  content: ""; position: absolute; inset: 11%; border-radius: 50%;
  box-shadow: inset -2px 3px 4px rgba(0, 0, 0, .22), inset 1.5px -1.5px 0 rgba(255, 255, 255, .7), -1.5px 2px 3px rgba(0, 0, 0, .12), 1px -1px 0 rgba(255, 255, 255, .8);
}
.coin__face--tails::before { box-shadow: inset -2px 3px 4px rgba(0, 0, 0, .6), inset 1.5px -1.5px 0 rgba(255, 255, 255, .1), -1.5px 2px 3px rgba(0, 0, 0, .5), 1px -1px 0 rgba(255, 255, 255, .1); }
.coin__mark { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; translate: -50% -50%; rotate: 45deg; border-radius: 22%; }
.coin__face--heads .coin__mark { background: linear-gradient(225deg, #ffffff, #e3e2dc 60%, #cfcec8); box-shadow: -3px 4px 5px rgba(0, 0, 0, .22), inset 1px -1px 0 rgba(255, 255, 255, .9), inset -1px 1px 2px rgba(0, 0, 0, .1); }
.coin__face--tails .coin__mark { rotate: 0deg; border-radius: 50%; width: 26%; background: radial-gradient(circle at 70% 30%, #5a5a5e, #303033 70%); box-shadow: -3px 4px 6px rgba(0, 0, 0, .6), inset 1px -1px 0 rgba(255, 255, 255, .14); }
/* flat coin face for buttons and chips */
.facechip { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 50%; position: relative; }
.facechip--cream { background: radial-gradient(110% 110% at 78% 18%, #ffffff, #e9e8e3 50%, #c4c3bd); box-shadow: -2px 3px 4px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .6); }
.facechip--graphite { background: radial-gradient(110% 110% at 78% 18%, #55555a, #333336 50%, #1f1f21); box-shadow: -2px 3px 4px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.facechip::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; box-shadow: inset -1px 1px 1px rgba(0, 0, 0, .25), 1px -1px 0 rgba(255, 255, 255, .35); }

/* ---------- win burst ---------- */
.sparks { position: absolute; width: 0; height: 0; pointer-events: none; }
.sparks i { position: absolute; width: 5px; height: 5px; border-radius: 1.5px; background: var(--cream); box-shadow: 0 0 8px rgba(242, 240, 236, .9); opacity: 0; }
.sparks b { position: absolute; left: 0; top: 0; translate: -50% -50%; border-radius: 50%; border: 2px solid rgba(242, 240, 236, .8); opacity: 0; }

/* ---------- reward flash: the win moment, fast and hands-free ----------
   Plays over the game's own stage, never blocks input, and fades by itself.
   --rg is the tier glow: cream (under ×2), steel (×2–10), violet (×10 and up) */
.rflash {
  --rg: 236, 230, 218;
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; border-radius: inherit;
  background: radial-gradient(70% 70% at 50% 50%, rgba(10, 10, 10, .78), rgba(10, 10, 10, .45));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: rfin .14s ease-out both;
}
.rflash.is-out { animation: rfout .35s var(--ease) forwards; }
@keyframes rfin { from { opacity: 0; } }
@keyframes rfout { to { opacity: 0; transform: scale(1.04); } }
.rflash__rays {
  position: absolute; left: 50%; top: 50%; width: 180%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(var(--rg), .14) 0deg 4deg, rgba(var(--rg), 0) 4deg 16deg);
  -webkit-mask: radial-gradient(closest-side, #000 6%, transparent 60%); mask: radial-gradient(closest-side, #000 6%, transparent 60%);
  animation: spin 14s linear infinite;
}
.rflash__glow { position: absolute; left: 50%; top: 50%; width: 80%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--rg), .3), rgba(var(--rg), 0)); }
.rflash .sparks { left: 50%; top: 50%; }
.rflash .sparks i { background: rgb(var(--rg)); box-shadow: 0 0 8px rgba(var(--rg), .9); }
.rflash .sparks b { border-color: rgba(var(--rg), .85); }
.rflash__body { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.rflash__tier {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px;
  background: rgba(var(--rg), .12); box-shadow: inset 0 0 0 1px rgba(var(--rg), .4);
  font: 600 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgb(var(--rg));
  animation: rfup .3s var(--ease) both;
}
.rflash__tier::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.rflash__mult {
  margin: 10px 0 0; font: 900 clamp(64px, 9.5vw, 124px)/.84 var(--display); font-stretch: 112%; font-variation-settings: 'wdth' 112;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--cream);
  text-shadow: 0 0 46px rgba(var(--rg), .6), 0 0 2px rgba(var(--rg), .6);
  animation: slam .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes slam { 0% { opacity: 0; transform: scale(2.1); filter: blur(8px); } 60% { opacity: 1; transform: scale(.95); filter: blur(0); } 100% { transform: scale(1); } }
.rflash__pts { margin: 12px 0 0; font: 850 clamp(28px, 3.6vw, 40px)/1 var(--display); font-stretch: 110%; font-variation-settings: 'wdth' 110; font-variant-numeric: tabular-nums; color: rgb(var(--rg)); text-shadow: 0 0 24px rgba(var(--rg), .5); animation: rfup .3s var(--ease) .1s both; }
.rflash__pts small { margin-left: 6px; font: 500 15px/1 var(--sans); color: var(--t2); text-shadow: none; }
@keyframes rfup { from { opacity: 0; transform: translateY(10px); } }

/* a gem flying from the board into the balance */
.flygem { position: fixed; z-index: 30; pointer-events: none; filter: drop-shadow(0 0 12px rgba(185, 166, 236, .7)) drop-shadow(-4px 6px 6px rgba(0, 0, 0, .5)); }
.flygem svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bal.is-catch { animation: catch .32s var(--spring); }
@keyframes catch { 40% { transform: scale(1.07); box-shadow: var(--sh-socket), 0 0 0 6px #151516, 0 0 26px 6px rgba(185, 166, 236, .45), -10px 16px 26px rgba(0, 0, 0, .55); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 10; translate: -50% 0; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 12px; padding: 14px 20px 14px 16px; border-radius: 18px;
  background: linear-gradient(195deg, #222224, #19191b 55%, #141416);
  box-shadow: var(--clay-edge), -22px 34px 60px rgba(0, 0, 0, .7), -5px 8px 16px rgba(0, 0, 0, .45);
  font: 500 14.5px/1.45 var(--sans); opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-on { opacity: 1; transform: none; }

@keyframes bob { 50% { transform: translateY(-7px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 620px) {
  .top__back, .top__brand span, .top__sound { display: none; }
  .top { grid-template-columns: auto 1fr; padding-top: 16px; padding-bottom: 16px; }
  .top > .bal { justify-self: end; height: 50px; padding: 0 18px 0 14px; }
  .top__right { display: none; }
  .bal b { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
