/* Greedy – modern skin + motion layer (loaded after style.css)
   Palette: night #0a0406 · crimson #3a070b · gold #ffd76a / #b97a14 · ice #8ff3ff · ember #ff4d4d */
:root{--gold-edge:linear-gradient(135deg,#ffe9a0,#b97a14 42%,#6b3f06 60%,#ffd76a);--dock:linear-gradient(180deg,#3a070b,#14040a)}

/* ---------- ambience ---------- */
#amb,#conf{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#amb{z-index:0;opacity:0;transition:opacity 1.2s}
#amb.ready{opacity:1}
#conf{z-index:150}
#bgfill{filter:saturate(1.15) brightness(.48) blur(2px);animation:kb 26s ease-in-out infinite alternate}
@keyframes kb{from{transform:scale(1.06)}to{transform:scale(1.16) translateY(-1.5%)}}
#stage::before{content:"";position:absolute;left:-90px;top:-98px;width:900px;height:900px;border-radius:50%;z-index:0;pointer-events:none;
  background:repeating-conic-gradient(from 0deg,rgba(255,215,120,.16) 0 7deg,transparent 7deg 22deg);
  -webkit-mask:radial-gradient(closest-side,#000 20%,transparent 78%);mask:radial-gradient(closest-side,#000 20%,transparent 78%);
  mix-blend-mode:screen;animation:spin 48s linear infinite}
#stage[data-phase=drawing]::before{animation-duration:9s}

/* ---------- wheel + centre ---------- */
#wheel{filter:drop-shadow(0 0 16px rgba(255,70,70,.4));transition:filter .4s}
#stage[data-phase=drawing] #wheel{filter:drop-shadow(0 0 26px rgba(255,190,60,.75))}
#center .ring{opacity:.38}
#center .bulbs{box-shadow:none;animation:spin 2.4s linear infinite;mix-blend-mode:screen;opacity:.7;
  background:conic-gradient(from 0deg,transparent 0 58%,rgba(255,255,255,.95) 80%,transparent 94%);
  -webkit-mask:radial-gradient(closest-side,transparent 75%,#000 80%,#000 97%,transparent 100%);mask:radial-gradient(closest-side,transparent 75%,#000 80%,#000 97%,transparent 100%)}
#stage[data-phase=drawing] #center .bulbs{animation-duration:.7s}
#ring{position:absolute;left:-26px;top:-26px;width:300px;height:300px;transform:rotate(-90deg);overflow:visible;transition:opacity .3s}
#ring circle{fill:none;stroke-width:7;stroke-linecap:round}
#ring .track{stroke:rgba(255,255,255,.13)}
#ring .prog{stroke:#8ff3ff;stroke-dasharray:867.1;filter:drop-shadow(0 0 6px #37d9f5);transition:stroke .3s}
#stage.hot #ring .prog{stroke:#ff4d4d;filter:drop-shadow(0 0 8px #ff2a2a)}
#stage.hot #center{animation:beat .5s ease-in-out infinite}
@keyframes beat{50%{transform:scale(1.035)}}
#stage[data-phase=drawing] #ring .prog{stroke:#ffd76a;stroke-dasharray:38 24;filter:drop-shadow(0 0 8px #ffb300);animation:dash .55s linear infinite}
@keyframes dash{to{stroke-dashoffset:-62}}
#stage[data-phase=result] #ring,#stage:not([data-phase]) #ring{opacity:0}

/* ---------- baskets ---------- */
.basket{animation:float 3.6s ease-in-out infinite;animation-delay:calc(var(--i,0)*-.45s)}
@keyframes float{50%{transform:translateY(-5px)}}
.basket:active{filter:brightness(1.18)}
.basket .mine{background:linear-gradient(#ffe38a,#f0a21a);border:0;color:#4a1500;box-shadow:0 2px 6px rgba(0,0,0,.45)}
.basket.lit{animation:litpop .16s ease-out both;filter:brightness(1.28) drop-shadow(0 0 14px #ffd54a) drop-shadow(0 0 30px rgba(255,190,40,.95))}
@keyframes litpop{from{transform:scale(1)}to{transform:scale(1.14)}}
.basket.trail{z-index:62;animation:none;transform:scale(1.04);filter:brightness(1.02) drop-shadow(0 0 10px rgba(255,200,60,.55))}
@keyframes winpulse{from{transform:scale(1.06);filter:brightness(1.15) drop-shadow(0 0 12px #ffd54a)}to{transform:scale(1.18);filter:brightness(1.4) drop-shadow(0 0 30px #ffe27a)}}

/* ---------- header ---------- */
.ib{transition:transform .18s cubic-bezier(.2,1.8,.4,1)}
.ib:active{transform:scale(.86)}
#recent,#winToday{background:linear-gradient(#2c080b,#13040a) padding-box,var(--gold-edge) border-box;border:2px solid transparent;border-radius:23px;
  box-shadow:0 6px 16px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.1)}
#recent{height:46px;top:5px}
#recent .new{top:5px;left:4px}
#recent .list{left:58px;gap:4px}
#recent .list img:first-child{filter:drop-shadow(0 0 6px #ffd54a);transform:scale(1.12)}
#winToday{left:438px;top:5px;width:200px;height:46px;display:flex;flex-direction:column;align-items:center;justify-content:center}
#winToday>img{display:none}
#winToday::before{content:"Win today";font-size:11px;line-height:13px;color:#f3c98a;font-weight:500}
#winToday span{position:static;font-size:16px;line-height:20px;color:#fff}
#ping{background:rgba(8,3,4,.55);padding:3px 9px;border-radius:12px;font-size:13px;right:76px;top:66px}

/* ---------- totals / hint ---------- */
#totals{background:rgba(10,4,6,.62);border:1px solid rgba(255,215,120,.32);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);height:34px;border-radius:17px}
#totals b{color:#ffd76a}
#stage[data-phase=betting] #hint span{animation:hintp 1.8s ease-in-out infinite}
@keyframes hintp{50%{opacity:.55}}

/* ---------- dock ---------- */
#bottom{background:var(--dock) padding-box,var(--gold-edge) border-box;border:2.5px solid transparent;border-radius:30px;
  box-shadow:0 -10px 34px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.14)}
#bottom::before{content:"";position:absolute;left:40px;right:40px;top:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,240,190,.8),transparent)}
#balanceBox{background:rgba(0,0,0,.38);border:1px solid rgba(255,215,120,.28);border-radius:18px}
#balanceBox .lbl{font-size:13px;line-height:17px;color:#f3c98a;font-weight:500}
#balanceBox .val{font-size:20px}
.chip{transition:transform .32s cubic-bezier(.2,1.9,.4,1)}
.chip:active{transform:scale(.9)}
.chip.sel{transform:translateY(-10px) scale(1.16)}
.chip.sel img{filter:drop-shadow(0 0 10px rgba(255,214,90,.95)) drop-shadow(0 6px 6px rgba(0,0,0,.5))}
.chip.sel::after{inset:-8px;box-shadow:none;opacity:1;background:conic-gradient(#fff6c2,#ffb300,#fff6c2,#ffb300,#fff6c2,#ffb300,#fff6c2);
  -webkit-mask:radial-gradient(closest-side,transparent 87%,#000 89%);mask:radial-gradient(closest-side,transparent 87%,#000 89%);animation:spin 2.2s linear infinite}
#btnRepeat{overflow:hidden;border-radius:28px;transition:transform .18s cubic-bezier(.2,1.8,.4,1)}
#btnRepeat:not(.dis)::after{content:"";position:absolute;top:-10px;bottom:-10px;width:46px;left:-70px;transform:skewX(-20deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent);animation:sweep 2.6s ease-in-out infinite}
@keyframes sweep{0%,55%{left:-70px}100%{left:190px}}

/* ---------- entrance (one orchestrated moment) ---------- */
#stage.ready .ib:not(.trophy),#stage.ready #recent,#stage.ready #winToday,#stage.ready #ping{animation:dropIn .6s cubic-bezier(.2,1.4,.4,1) backwards}
#stage.ready #recent{animation-delay:.06s}#stage.ready #winToday{animation-delay:.12s}
#stage.ready #bottom{animation:riseIn .65s .1s cubic-bezier(.2,1.3,.4,1) backwards}
#stage.ready #center{animation:zoomIn .7s .1s cubic-bezier(.2,1.5,.4,1) backwards}
#stage.ready #totals,#stage.ready #hint{animation:fadeIn .6s .45s backwards}
@keyframes dropIn{from{transform:translateY(-70px);opacity:0}}
@keyframes riseIn{from{transform:translateY(130px);opacity:0}}
@keyframes zoomIn{from{transform:scale(.3);opacity:0}}
@keyframes fadeIn{from{opacity:0}}

/* ---------- draw / result ---------- */
#dim{background:radial-gradient(circle at 50% 42%,rgba(0,0,0,.42),rgba(0,0,0,.84) 70%)}
#fx .rays{position:absolute;width:520px;height:520px;margin:-260px 0 0 -260px;border-radius:50%;mix-blend-mode:screen;
  background:repeating-conic-gradient(rgba(255,225,130,.6) 0 9deg,transparent 9deg 24deg);
  -webkit-mask:radial-gradient(closest-side,#000 10%,transparent 72%);mask:radial-gradient(closest-side,#000 10%,transparent 72%);animation:spin 7s linear infinite}
#fx .flash{position:absolute;width:900px;height:900px;margin:-450px 0 0 -450px;border-radius:50%;background:radial-gradient(closest-side,rgba(255,250,220,.9),transparent 70%)}
#fly .ft{position:absolute;transform:translate(-50%,-50%);font-size:24px;white-space:nowrap;color:#ffe27a;-webkit-text-stroke:3px #5a1400;paint-order:stroke fill;text-shadow:0 3px 6px rgba(0,0,0,.5)}
#fly .rip{position:absolute;width:120px;height:120px;margin:-60px 0 0 -60px;border-radius:50%;border:3px solid #ffe27a;box-shadow:0 0 14px #ffb300}
#toast{background:rgba(10,4,6,.86);border:1px solid rgba(255,215,120,.4);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}

/* ---------- popups ---------- */
#modal{background:rgba(6,2,3,.62);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}
#modal.show .frame.anim{animation:popin .42s cubic-bezier(.2,1.6,.35,1)}
#modal.show .rk,#modal.show .hrow,#modal.show .row,#modal.show .rules p,#modal.show .res .top{animation:rowIn .38s cubic-bezier(.2,1.2,.4,1) both}
@keyframes rowIn{from{transform:translateY(18px);opacity:0}}
.rk.me{box-shadow:inset 0 0 0 2px #f0a21a}
.frame.res.won::before{content:"";position:absolute;left:50%;top:-40px;width:760px;height:760px;margin-left:-380px;margin-top:-300px;border-radius:50%;z-index:-1;
  background:repeating-conic-gradient(rgba(255,220,120,.5) 0 8deg,transparent 8deg 20deg);
  -webkit-mask:radial-gradient(closest-side,#000 15%,transparent 75%);mask:radial-gradient(closest-side,#000 15%,transparent 75%);animation:spin 10s linear infinite}
#loader .bar i{background:linear-gradient(90deg,#f0a21a,#ffe38a,#f0a21a);background-size:200% 100%;animation:shim 1.1s linear infinite}
@keyframes shim{to{background-position:-200% 0}}

@media (prefers-reduced-motion:reduce){
  .basket,#bgfill,#stage::before,#center .ring,#stage.hot #center,#btnRepeat::after,.ib.trophy{animation:none!important}
}
#modal.show .scroll>:nth-child(1),#modal.show .rules>:nth-child(1){animation-delay:120ms}
#modal.show .scroll>:nth-child(2),#modal.show .rules>:nth-child(2){animation-delay:160ms}
#modal.show .scroll>:nth-child(3),#modal.show .rules>:nth-child(3){animation-delay:200ms}
#modal.show .scroll>:nth-child(4),#modal.show .rules>:nth-child(4){animation-delay:240ms}
#modal.show .scroll>:nth-child(5),#modal.show .rules>:nth-child(5){animation-delay:280ms}
#modal.show .scroll>:nth-child(6),#modal.show .rules>:nth-child(6){animation-delay:320ms}
#modal.show .scroll>:nth-child(7),#modal.show .rules>:nth-child(7){animation-delay:360ms}
#modal.show .scroll>:nth-child(8),#modal.show .rules>:nth-child(8){animation-delay:400ms}
#modal.show .scroll>:nth-child(9),#modal.show .rules>:nth-child(9){animation-delay:440ms}
#modal.show .scroll>:nth-child(10),#modal.show .rules>:nth-child(10){animation-delay:480ms}
#modal.show .scroll>:nth-child(11),#modal.show .rules>:nth-child(11){animation-delay:520ms}
#modal.show .scroll>:nth-child(12),#modal.show .rules>:nth-child(12){animation-delay:560ms}
#modal.show .res .top:nth-child(1){animation-delay:.25s}#modal.show .res .top:nth-child(2){animation-delay:.15s}#modal.show .res .top:nth-child(3){animation-delay:.35s}
