/* BIG / MEGA / EPIC WIN celebration (2026-09-25). Carnival marquee sign: tier plate colour + gold rim +
   chasing bulbs; MEGA adds a starburst, EPIC adds the crown. Motion uses transform/opacity only. */
.bigwin{position:fixed;inset:0;z-index:60;display:grid;place-items:center;overflow:hidden;cursor:pointer;
  -webkit-tap-highlight-color:transparent;user-select:none;touch-action:manipulation;
  --bw:min(88vw,100dvh,820px);
  --digit:min(calc(var(--bw) * .165),calc(var(--bw) * .92 / var(--units,6)));
  --bw-plate-hi:#e2263f;--bw-plate-lo:#6a0715;--bw-tail:#8e0d20;--bw-burst:#ffb52e;--bw-ray:#ffd765;--bw-glow:#ff9c1a;--bw-rays-opacity:.42}
.bigwin[data-tier="mega"]{--bw-plate-hi:#a23ddc;--bw-plate-lo:#32084d;--bw-tail:#5c1482;--bw-burst:#ff4fb8;--bw-ray:#ff8ae0;--bw-glow:#e04bff;--bw-rays-opacity:.56}
.bigwin[data-tier="epic"]{--bw-plate-hi:#19aebd;--bw-plate-lo:#04323e;--bw-tail:#0b5e6c;--bw-burst:#ffd23f;--bw-ray:#8ef6ff;--bw-glow:#35dcff;--bw-rays-opacity:.7}
.bigwin-dim{position:absolute;inset:0;background:radial-gradient(ellipse 75% 65% at 50% 46%,#2a0a1cb0 0,#0d0310e6 78%);animation:bigwin-fade-in .22s ease-out both}
.bigwin-coins{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.bigwin-flash{position:absolute;inset:0;pointer-events:none;opacity:0;background:radial-gradient(circle at 50% 42%,#fffdf0 0,#fff6c8aa 22%,#ffe08a33 42%,transparent 62%)}
.bigwin-stack{position:relative;width:var(--bw);display:flex;flex-direction:column;align-items:center;gap:calc(var(--bw) * .008);pointer-events:none}
.bigwin-badge-wrap{position:relative;width:100%;aspect-ratio:800/380;animation:bigwin-badge-in .56s cubic-bezier(.2,.9,.3,1) both}
.bigwin-rays{position:absolute;left:50%;top:50%;width:calc(var(--bw) * 1.9);aspect-ratio:1;translate:-50% -50%;opacity:var(--bw-rays-opacity);transition:opacity .3s ease;
  background:repeating-conic-gradient(from 0deg,color-mix(in srgb,var(--bw-ray) 70%,transparent) 0deg 6deg,transparent 6deg 18deg);
  -webkit-mask-image:radial-gradient(closest-side,#000 16%,#0008 42%,transparent 72%);mask-image:radial-gradient(closest-side,#000 16%,#0008 42%,transparent 72%);
  animation:bigwin-rays 18s linear infinite}
.bigwin-glow{position:absolute;left:50%;top:50%;width:92%;height:88%;translate:-50% -50%;border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--bw-glow) 62%,transparent),transparent);opacity:.75}
.bigwin-badge{position:absolute;inset:0;animation:bigwin-breathe 1.5s ease-in-out .6s infinite alternate}
.bw-svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 calc(var(--bw) * .012) calc(var(--bw) * .018) #12020acc)}
.bw-title,.bw-title-shadow{font-family:CarnivalCoin,Georgia,serif;font-weight:700;font-size:92px;letter-spacing:3px}
.bw-title{fill:url(#bw-text);stroke:#3c0508;stroke-width:9px;paint-order:stroke;stroke-linejoin:round}
.bw-title-shadow{fill:#1c0206;opacity:.55}
.bw-bulb{fill:#fff3c0;stroke:#6a3004;stroke-width:2px;animation:bigwin-bulb .66s steps(1) infinite}
.bw-bulb.b1{animation-delay:-.22s}.bw-bulb.b2{animation-delay:-.44s}
.bw-burst,.bw-crown,.bw-burst-spin{transform-box:fill-box;transform-origin:50% 50%}
.bw-burst{transform:scale(0);transition:transform .45s cubic-bezier(.2,1.6,.4,1)}
.bw-burst-spin{animation:bigwin-rays 14s linear infinite}
.bw-crown{transform:translateY(-40px) scale(0);opacity:0;transition:transform .5s cubic-bezier(.2,1.5,.4,1),opacity .2s ease}
.bigwin:is([data-tier="mega"],[data-tier="epic"]) .bw-burst{transform:scale(1)}
.bigwin[data-tier="epic"] .bw-crown{transform:none;opacity:1}
.bigwin-caption,.bigwin-basis,.bigwin-hint{margin:0;font-family:CarnivalCoin,Georgia,serif;font-weight:700;text-align:center;white-space:nowrap;color:#ffe9a8;text-shadow:0 2px 0 #4a0a0a,0 0 10px #000}
.bigwin-caption{font-size:max(12px,calc(var(--bw) * .036));letter-spacing:.18em;animation:bigwin-fade-in .3s ease-out .2s both}
.bigwin-amount{height:var(--digit);display:flex;justify-content:center;animation:bigwin-amount-in .42s cubic-bezier(.2,1.4,.45,1) .16s both}
.bigwin-digits{display:flex;align-items:flex-end;gap:calc(var(--digit) * .02);filter:drop-shadow(0 3px 5px #1a0510) drop-shadow(0 0 12px color-mix(in srgb,var(--bw-glow) 55%,transparent))}
.bigwin-digits i{display:block;flex:none;height:var(--digit);width:calc(var(--digit) * var(--gw) / 240);
  background-image:url('../../assets/ui/win-numerals-v3.webp');background-repeat:no-repeat;
  background-size:calc(var(--digit)  * 2128 / 240) var(--digit);background-position:calc(var(--digit) * var(--gx) / -240) 0}
.bigwin-basis{min-height:1.2em;font-size:max(12px,calc(var(--bw) * .034));letter-spacing:.12em;color:#fff4c4}
.bigwin-hint{margin-top:calc(var(--bw) * .02);font-size:max(10px,calc(var(--bw) * .022));letter-spacing:.22em;color:#f3d9a0b0;animation:bigwin-hint 1.2s ease-in-out infinite alternate}
.bigwin-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* Phone portrait: the sign spans the width; everything stays inside a 16 px gutter. */
@media (max-width:600px),(orientation:portrait) and (max-width:900px){.bigwin{--bw:min(calc(100vw - 32px),100dvh,560px)}.bigwin-rays{width:calc(var(--bw) * 2.3)}}
@keyframes bigwin-fade-in{from{opacity:0}to{opacity:1}}
@keyframes bigwin-badge-in{0%{opacity:0;transform:scale(.2) rotate(-8deg)}55%{opacity:1;transform:scale(1.12) rotate(2deg)}78%{transform:scale(.96) rotate(0)}100%{opacity:1;transform:none}}
@keyframes bigwin-amount-in{0%{opacity:0;transform:scale(.5) translateY(20%)}100%{opacity:1;transform:none}}
@keyframes bigwin-breathe{from{transform:scale(1)}to{transform:scale(1.025)}}
@keyframes bigwin-rays{to{transform:rotate(360deg)}}
@keyframes bigwin-bulb{0%{opacity:1}33%{opacity:.28}}
@keyframes bigwin-hint{from{opacity:.45}to{opacity:1}}
/* After the overlay leaves, the already-updated BALANCE / WIN readouts flash once. */
.bigwin-credited{animation:bigwin-credited 1.1s ease-out}
@keyframes bigwin-credited{0%,100%{transform:none;filter:none}25%{transform:scale(1.12);filter:brightness(1.6) drop-shadow(0 0 8px #ffd76a)}}
.bigwin.is-reduced *,.bigwin.is-reduced{animation:none!important;transition:none!important}
@media (prefers-reduced-motion:reduce){.bigwin *,.bigwin,.bigwin-credited{animation:none!important;transition:none!important}}
/* Painted tier badges (2026-09-29): the art replaces the code-drawn SVG once it has loaded. */
.bigwin-badge{position:relative}
.bigwin-badge>.bw-art{position:absolute;left:50%;top:50%;width:100%;height:auto;translate:-50% -50%;pointer-events:none;filter:drop-shadow(0 10px 22px #000c) drop-shadow(0 0 28px #ffcf4a66);opacity:0;transition:opacity .12s ease}
.bigwin-badge>.bw-art[data-ready="true"]{opacity:1}
.bigwin-badge:has(>.bw-art[data-ready="true"])>.bw-svg{visibility:hidden}
.bigwin[data-tier="epic"] .bigwin-badge>.bw-art,.bigwin[data-tier="mega"] .bigwin-badge>.bw-art{width:104%}

/* Only the painted badge and the amount (Vadim 2026-09-29): no code-drawn captions under the art. */
.bigwin .bigwin-caption,.bigwin .bigwin-basis,.bigwin .bigwin-hint{display:none!important}
