@font-face{font-family:"GPop";src:url(fonts/Poppins-Bold.ttf) format("truetype");font-weight:700}
@font-face{font-family:"GPop";src:url(fonts/Poppins-Medium.ttf) format("truetype");font-weight:500}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
html,body{margin:0;height:100%;background:transparent;overflow:hidden;font-family:GPop,Arial,sans-serif;font-weight:700;color:#fff}
img{-webkit-user-drag:none;pointer-events:none}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
:root{--gold:#ffe49d;--gold2:#f7b537;--ink:#3a1d6b;--vio1:#8d5cce;--vio2:#50318d;--mint:#38e9b4}

/* ---------------- stage (720 x 1000, scaled to the bottom sheet) ---------------- */
#stage{position:absolute;left:50%;bottom:0;width:720px;height:1000px;transform-origin:50% 100%;overflow:hidden;background:#5a2f98;opacity:0;transition:opacity .45s}
#stage.ready{opacity:1}
#bg{position:absolute;inset:0;background:#3d0f86}
#bg::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse 60% 40% at 50% 43%,rgba(255,214,120,.18),transparent 70%)}
#amb,#fx{position:absolute;inset:0;width:720px;height:1000px;pointer-events:none}
#amb{opacity:.6}
#fx{z-index:60}

/* ---------------- title + status ---------------- */
#titleRow{position:absolute;left:0;right:0;top:4px;height:56px;display:flex;align-items:flex-start;justify-content:center;gap:14px;z-index:5}
#titleRow h1{margin:0;padding:8px 30px 6px;border-radius:22px 22px 12px 12px;border:4px solid #ffd47a;border-bottom-width:3px;background:linear-gradient(#6a3aae,#4a2984);
  font-size:30px;line-height:32px;font-style:italic;font-weight:700;letter-spacing:-.5px;color:#ffe58c;text-shadow:0 3px 0 #99521c;white-space:nowrap;position:relative;overflow:hidden}
#titleRow h1 span{color:#fff4b1}
#titleRow h1::after{content:"";position:absolute;top:0;bottom:0;left:-80px;width:50px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent);transform:skewX(-20deg);animation:sheen 4.5s ease-in-out infinite 1s}
@keyframes sheen{0%,70%{left:-80px}100%{left:110%}}
#titleRow .ln{flex:1;height:4px;margin-top:44px;background:#ffda84;box-shadow:0 2px 0 #8e4b27;border-radius:2px}
#titleRow .ln.l{margin-left:14px}#titleRow .ln.r{margin-right:14px}
#ping{position:absolute;right:18px;top:12px;z-index:6;display:flex;align-items:center;gap:4px;font-size:14px;color:#3ff3b9}
#ping img{width:20px;height:20px;filter:brightness(0) saturate(100%) invert(80%) sepia(46%) saturate(600%) hue-rotate(100deg)}
#ping.slow{color:#ffd35a}#ping.bad{color:#ff6a5a}

#status{position:absolute;left:14px;right:14px;top:62px;height:42px;z-index:5;display:flex;align-items:center;gap:10px;padding:0 16px;border-radius:21px;
  background:rgba(56,27,117,.72);border:1.5px solid rgba(181,139,239,.55);font-size:16px;color:#f4e5ff;transition:opacity .25s}
#status .led{flex:none;width:10px;height:10px;border-radius:50%;background:var(--mint);box-shadow:0 0 10px #28ffc7;animation:led 1.2s ease-in-out infinite alternate}
.phase-drawing #status .led,.phase-result #status .led,.phase-locking #status .led{background:#f7cd71;box-shadow:0 0 10px #f7cd71}
@keyframes led{to{opacity:.35}}
#stTxt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#stTot{display:flex;align-items:center;gap:5px;margin-left:auto;font-size:15px;color:#ffe9a8}
#stTot img{width:20px;height:20px}#stTot em{font-style:normal;color:#c5a8ef;margin:0 2px}
#stTot b{font-variant-numeric:tabular-nums}
#stTot b.bump{animation:numBump .35s}
@keyframes numBump{40%{transform:scale(1.25);color:#fff}}
#rid{flex:none;font-size:14px;color:#c5a8ef;letter-spacing:.3px}
#drawBanner{position:absolute;left:50%;top:56px;width:300px;z-index:7;transform:translate(-50%,-30px) scale(.6);opacity:0;pointer-events:none;transition:transform .4s cubic-bezier(.2,1.6,.4,1),opacity .25s}
#drawBanner img{width:100%}
.phase-drawing #drawBanner{opacity:1;transform:translate(-50%,0) scale(1)}
.phase-drawing #status{opacity:0}

/* ---------------- toolbar ---------------- */
.tb{position:absolute;top:116px;z-index:8;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(145deg,#8f5ac5,#583493);border:2.5px solid #f1c674;box-shadow:0 4px 0 #31105c,0 2px 8px rgba(29,16,76,.4);transition:transform .12s}
.tb img{width:30px;height:30px;filter:drop-shadow(0 1px 1px #42256d)}
.tb:active{transform:translateY(3px);box-shadow:0 1px 0 #31105c}
#btnBack{left:14px}#btnRank{left:76px}#btnStats{left:138px}
.tb.r1{right:14px}.tb.r2{right:76px}.tb.r3{right:138px}

/* ---------------- wheel ---------------- */
#wheelBox{position:absolute;left:80px;top:150px;width:560px;height:560px;z-index:4}
.wglow{position:absolute;inset:-26px;border-radius:50%;background:radial-gradient(circle,rgba(255,226,140,.0) 56%,rgba(255,214,110,.35) 64%,transparent 72%);opacity:.6;transition:opacity .4s}
.phase-drawing .wglow{opacity:1;animation:wglow .5s ease-in-out infinite alternate}
@keyframes wglow{to{opacity:.55}}
#rim{position:absolute;inset:0;width:100%;height:100%;filter:drop-shadow(0 14px 18px rgba(33,10,65,.55))}
#rotorWrap{position:absolute;left:18px;top:18px;width:524px;height:524px;border-radius:50%;overflow:hidden}
#rotor{width:100%;height:100%;display:block;will-change:transform}
#rotor .lbl{font-family:GPop,Arial,sans-serif;font-weight:700;fill:#fff;paint-order:stroke;stroke:rgba(60,20,90,.55);stroke-width:5px}
#rotor .hl{fill:#fff;opacity:0;pointer-events:none}
#rotor .hl.on{animation:hl .55s ease-in-out infinite alternate}
@keyframes hl{from{opacity:.05}to{opacity:.42}}
#rotor .mas.on{animation:masWin .55s ease-in-out infinite alternate}
@keyframes masWin{to{transform:scale(1.18)}}
#blur{position:absolute;inset:0;border-radius:50%;opacity:0;pointer-events:none;
  background:repeating-conic-gradient(from 0deg,rgba(255,255,255,.22) 0 3deg,rgba(255,255,255,0) 3deg 15deg);mix-blend-mode:soft-light}
#bulbs{position:absolute;inset:0;pointer-events:none}
#bulbs i{position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#fff,#fff3b8 40%,#e0a12c 75%);
  box-shadow:0 0 4px rgba(255,240,170,.6);opacity:.55;transition:opacity .12s,box-shadow .12s}
#bulbs i.on{opacity:1;box-shadow:0 0 10px 3px rgba(255,236,150,.95),0 0 22px 4px rgba(255,200,80,.6)}
#bulbs.win i{animation:bulbWin .26s steps(1) infinite}
#bulbs.win i:nth-child(odd){animation-delay:.13s}
@keyframes bulbWin{0%{opacity:1;box-shadow:0 0 12px 4px var(--wc,#fff3a8)}50%{opacity:.3;box-shadow:none}}
#hub{position:absolute;left:50%;top:50%;width:170px;height:170px;margin:-85px 0 0 -85px;z-index:3;display:grid;place-items:center}
#hub img{position:absolute;left:18px;top:18px;width:134px;height:134px;filter:drop-shadow(0 6px 8px rgba(40,10,80,.5))}
#hubRing{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
#hubRing circle{fill:none;stroke-width:9}
#hubRing .bgc{stroke:rgba(40,12,80,.45)}
#hubArc{stroke:#38e9b4;stroke-linecap:round;stroke-dasharray:515.2;stroke-dashoffset:0;filter:drop-shadow(0 0 4px rgba(56,233,180,.9));transition:stroke .3s}
#hub.hot #hubArc{stroke:#ff5a6e;filter:drop-shadow(0 0 5px rgba(255,80,100,.9))}
#hubTxt{position:relative;font-size:58px;line-height:1;color:#fff;text-shadow:0 3px 3px #3c1c80;font-variant-numeric:tabular-nums}
#hubTxt.tick{animation:hubTick .45s cubic-bezier(.2,1.6,.4,1)}
@keyframes hubTick{from{transform:scale(1.45);opacity:.4}}
#hub.hot #hubTxt{color:#ffe0e5;text-shadow:0 0 12px #ff3d5a,0 3px 3px #6a0d25}
#hub.hot img{animation:hubHot .5s ease-in-out infinite alternate}
@keyframes hubHot{to{filter:drop-shadow(0 0 18px rgba(255,70,100,.9))}}
#hubTxt.word{font-size:30px;letter-spacing:1px;animation:wordPulse .6s ease-in-out infinite alternate}
@keyframes wordPulse{to{transform:scale(1.1);color:#ffe58c}}
#pointer{position:absolute;left:50%;top:-30px;width:66px;margin-left:-33px;z-index:5;transform-origin:50% 22%;filter:drop-shadow(0 4px 4px rgba(66,30,91,.55))}
#pointer.flick{animation:flick .16s ease-out}
@keyframes flick{40%{transform:rotate(-20deg)}}

/* ---------------- latest + wallet ---------------- */
#latest{position:absolute;left:14px;top:724px;width:466px;height:46px;z-index:6;display:flex;align-items:center;gap:8px;padding:0 10px;border-radius:12px;
  border:1.5px solid #f6a6dd;background:linear-gradient(100deg,#cb3c95,#6d328f);box-shadow:inset 0 1px rgba(255,255,255,.28),0 3px 8px rgba(30,8,60,.35);overflow:hidden}
#latest .lbl{flex:none;font-size:14px;letter-spacing:.8px}
#strip{display:flex;align-items:center;gap:4px;height:100%;overflow:hidden;flex:1}
#strip .rc{position:relative;flex:none;width:36px;height:36px}
#strip .rc img{width:100%;height:100%;filter:drop-shadow(0 1px 2px rgba(39,17,75,.6))}
#strip .rc.new::after{content:"NEW";position:absolute;left:50%;top:-4px;transform:translateX(-50%);font-size:9px;line-height:11px;padding:0 3px;border-radius:4px;background:#ffd34d;color:#6b2a00}
#strip .rc.enter{animation:rcIn .6s cubic-bezier(.2,1.6,.4,1)}
@keyframes rcIn{from{transform:scale(0) rotate(-90deg)}}
#wallet{position:absolute;right:14px;top:722px;width:212px;height:50px;z-index:6;display:flex;align-items:center;justify-content:flex-end;padding-right:18px}
#wallet b{font-size:22px;color:#fff0d6;font-variant-numeric:tabular-nums}
#wallet b.up{animation:upTick .5s}
@keyframes upTick{40%{color:#ffe36b;transform:scale(1.14)}}

/* ---------------- bet cards ---------------- */
#cards{position:absolute;left:12px;right:12px;top:782px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px 9px;z-index:6}
.card{position:relative;height:70px;background-position:center;background-size:100% 100%;background-repeat:no-repeat;transition:transform .15s,filter .3s}
.card:active{transform:scale(.96)}
.card .mas{position:absolute;left:4px;top:-8px;width:72px;height:72px;filter:drop-shadow(0 3px 3px rgba(60,20,90,.35));transform-origin:50% 90%;animation:breathe 2.6s ease-in-out infinite}
.card:nth-child(2) .mas{animation-delay:.4s}.card:nth-child(3) .mas{animation-delay:.8s}.card:nth-child(4) .mas{animation-delay:1.2s}.card:nth-child(5) .mas{animation-delay:1.6s}.card:nth-child(6) .mas{animation-delay:2s}
@keyframes breathe{50%{transform:scale(1.04,.97)}}
.card .mas.hop{animation:hop .45s cubic-bezier(.3,1.6,.5,1)}
@keyframes hop{35%{transform:translateY(-16px) scale(1.08,.95)}70%{transform:translateY(0) scale(.95,1.06)}}
.card .mx{position:absolute;right:13px;top:9px;width:66px;text-align:center;font-size:15px;line-height:21px;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.25)}
.card .my{position:absolute;right:14px;bottom:8px;font-size:21px;line-height:24px;color:#48345e;font-variant-numeric:tabular-nums}
.card .all{position:absolute;left:80px;bottom:10px;font-size:12px;line-height:14px;color:rgba(72,52,94,.7);font-weight:500;white-space:nowrap}
.card.has::after{content:"";position:absolute;inset:-3px;border:3px solid #fff7b9;border-radius:15px;box-shadow:0 0 12px #fff0a3;pointer-events:none}
.card.bump{animation:cardBump .3s}
@keyframes cardBump{40%{transform:scale(1.05)}}
.phase-drawing .card:not(.has),.phase-result .card:not(.win):not(.has),.phase-locking .card:not(.has){filter:saturate(.75) brightness(.9)}
.card.win{z-index:2;animation:cardWin .5s ease-in-out infinite alternate}
.card.win::before{content:"";position:absolute;inset:-6px;border-radius:17px;border:3px solid #fff;box-shadow:0 0 22px 6px var(--c),0 0 40px 10px rgba(255,240,170,.6);pointer-events:none}
@keyframes cardWin{to{transform:scale(1.05)}}
.card.win .mas{animation:hop .6s ease-in-out infinite}
.plus{position:absolute;z-index:65;font-size:22px;color:#fff6c9;text-shadow:0 2px 0 #7a3d00,0 0 8px rgba(255,200,80,.8);pointer-events:none;animation:plus .9s ease-out forwards}
@keyframes plus{to{transform:translateY(-46px);opacity:0}}

/* ---------------- chips ---------------- */
#chips{position:absolute;left:12px;right:12px;top:934px;display:flex;justify-content:space-between;z-index:6}
.chip{position:relative;width:132px;height:53px;transition:transform .18s cubic-bezier(.2,1.6,.4,1),filter .2s;filter:drop-shadow(0 3px 3px rgba(43,20,109,.4))}
.chip img{width:100%;height:100%}
.chip.on{transform:translateY(-6px) scale(1.06);filter:drop-shadow(0 0 8px #fff0a9) drop-shadow(0 3px 3px #3d1769)}
.chip.on::before{content:"";position:absolute;top:-4px;right:14px;width:11px;height:11px;border-radius:50%;background:#fff9d8;border:2px solid #eec663;box-shadow:0 0 8px #fff3b0}
.chip .sh{position:absolute;inset:4px 6px;border-radius:24px;overflow:hidden;pointer-events:none}
.chip.on .sh::after{content:"";position:absolute;top:0;bottom:0;left:-40px;width:30px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);transform:skewX(-20deg);animation:chipSheen 2.2s ease-in-out infinite}
@keyframes chipSheen{0%,55%{left:-40px}100%{left:150px}}
.chip.dis{filter:grayscale(.85) brightness(.65)}
.fly{position:absolute;left:0;top:0;width:76px;height:31px;margin:-15px 0 0 -38px;z-index:64;pointer-events:none}
.fly img{width:100%;height:100%}

/* ---------------- result overlay ---------------- */
#res{position:absolute;inset:0;z-index:66;display:none;flex-direction:column;align-items:center;background:radial-gradient(ellipse at 50% 38%,rgba(120,60,190,.55),rgba(13,8,34,.9) 70%)}
#res.show{display:flex;animation:fade .3s}
@keyframes fade{from{opacity:0}}
#res .rays{position:absolute;left:50%;top:250px;width:760px;height:760px;margin:-380px 0 0 -380px;border-radius:50%;
  background:repeating-conic-gradient(from 0deg,rgba(255,226,150,.2) 0 9deg,rgba(255,226,150,0) 9deg 22.5deg);
  -webkit-mask:radial-gradient(circle,#000 18%,transparent 62%);mask:radial-gradient(circle,#000 18%,transparent 62%);animation:spin 14s linear infinite}
#res.lose .rays,#res.none .rays{opacity:.45}
@keyframes spin{to{transform:rotate(360deg)}}
#res .medal{position:relative;margin-top:90px;width:300px;height:292px;animation:medalIn .8s cubic-bezier(.2,1.5,.4,1) both}
@keyframes medalIn{0%{transform:translateY(-260px) scale(.6) rotate(-14deg);opacity:0}60%{opacity:1}}
#res .medal>img{width:100%;height:100%;filter:drop-shadow(0 12px 18px rgba(0,0,0,.5))}
#res .medal .ma{position:absolute;left:19%;top:12%;width:62%;height:62%;animation:maPop .6s .45s cubic-bezier(.2,1.8,.4,1) both}
@keyframes maPop{from{transform:scale(0)}}
#res.none .medal .ma{filter:grayscale(.2) brightness(.95)}
#res .rib{position:relative;margin-top:-58px;width:420px;animation:ribIn .55s .6s cubic-bezier(.2,1.5,.4,1) both}
@keyframes ribIn{from{transform:scaleX(0)}}
#res .ttl{position:relative;margin-top:-28px;font-size:46px;letter-spacing:1px;color:#ffdf8e;text-shadow:0 4px 0 #995b26;animation:ribIn .55s .6s cubic-bezier(.2,1.5,.4,1) both}
#res.none .ttl,#res.lose .ttl{font-size:38px;color:#e9dcff;text-shadow:0 3px 0 #4b2a7a}
#res .sub{position:relative;margin-top:6px;font-size:20px;font-weight:500;color:#f1dcfc}
#res .amt{position:relative;margin-top:4px;display:flex;align-items:center;gap:8px;font-size:40px;color:#fff9c2;text-shadow:0 3px 0 #8a4a10;font-variant-numeric:tabular-nums}
#res .amt img{width:40px;height:40px}
#res .pod{position:relative;margin-top:auto;margin-bottom:96px;width:560px;height:212px;animation:podIn .6s .3s cubic-bezier(.2,1.3,.4,1) both}
@keyframes podIn{from{transform:translateY(80px);opacity:0}}
#res .pod>img{position:absolute;left:0;right:0;bottom:0;width:560px}
#res .p{position:absolute;bottom:118px;width:150px;margin-left:-75px;display:flex;flex-direction:column;align-items:center;gap:2px;animation:pIn .5s cubic-bezier(.2,1.6,.4,1) both}
#res .p.r1{left:50%;bottom:150px;animation-delay:.75s}#res .p.r2{left:20.5%;animation-delay:.9s}#res .p.r3{left:79.5%;bottom:112px;animation-delay:1.05s}
@keyframes pIn{from{transform:scale(0) translateY(30px)}}
#res .p .av{width:62px;height:62px;font-size:26px;border:3px solid #ffe49d}
#res .p.r1 .av{width:74px;height:74px}
#res .p .crown{position:absolute;top:-26px;width:38px;filter:drop-shadow(0 2px 2px rgba(0,0,0,.5)) sepia(1) saturate(4) hue-rotate(5deg) brightness(1.15)}
#res .p.r2 .crown{filter:drop-shadow(0 2px 2px rgba(0,0,0,.5)) brightness(.95)}
#res .p.r3 .crown{filter:drop-shadow(0 2px 2px rgba(0,0,0,.5)) sepia(1) saturate(2) hue-rotate(-20deg) brightness(.85)}
#res .p .n{max-width:150px;font-size:16px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#res .p .w{display:flex;align-items:center;gap:4px;font-size:15px;color:#ffe49d}
#res .p .w img{width:18px;height:18px}
#res .p.empty{opacity:.45}
#res .cont{position:absolute;bottom:34px;left:50%;transform:translateX(-50%);padding:12px 40px;border-radius:18px;border:1.5px solid #fff1ab;background:linear-gradient(#ffdf85,#e9a137);font-size:19px;color:#582d70;box-shadow:0 5px 0 #9c5e24;white-space:nowrap;animation:fade .4s 1.2s both}
#res .cont:active{transform:translate(-50%,3px);box-shadow:0 2px 0 #9c5e24}

/* avatars */
.av{flex:none;display:grid;place-items:center;border-radius:50%;background-size:cover;background-position:center;color:#fff;font-weight:700;border:2px solid rgba(255,255,255,.55);text-shadow:0 1px 2px rgba(0,0,0,.4)}

/* ---------------- popups ---------------- */
#modal{position:absolute;inset:0;z-index:70;display:none;align-items:flex-end;justify-content:center;background:rgba(8,7,25,.62)}
#modal.show{display:flex;animation:fade .2s}
.dlg{position:relative;width:692px;height:820px;margin-bottom:14px;display:flex;flex-direction:column;border-radius:26px;overflow:hidden;
  background:linear-gradient(152deg,#8b59cc 0%,#6940b0 52%,#512d91 100%);border:2px solid #ba9be9;box-shadow:0 20px 50px rgba(14,6,40,.65);animation:dlgIn .35s cubic-bezier(.2,1.25,.4,1)}
@keyframes dlgIn{from{transform:translateY(120px);opacity:0}}
.dlg::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,.08),transparent 42%)}
.dlg .hd{position:relative;flex:none;height:78px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid rgba(228,211,255,.22)}
.dlg .hd h2{margin:0;font-size:28px}
.dlg .bk{position:absolute;left:12px;top:12px;width:54px;height:54px;display:grid;place-items:center;border-radius:50%}
.dlg .bk img{width:32px;height:32px}
.dlg .bk:active{background:rgba(255,255,255,.12)}
.dlg .bd{position:relative;flex:1;overflow:auto;padding:18px 20px 26px;-webkit-overflow-scrolling:touch}
.tabs{display:flex;gap:4px;padding:4px;margin-bottom:14px;border-radius:18px;background:rgba(185,151,239,.5);border:1px solid rgba(255,255,255,.22)}
.tabs button{flex:1;height:48px;border-radius:15px;font-size:19px;color:#f4eaff}
.tabs button.on{background:#e5d5ff;color:#573399;box-shadow:0 3px 7px rgba(29,14,62,.25)}
.rk{display:flex;align-items:center;gap:14px;height:66px;padding:0 8px;border-bottom:1px solid rgba(198,178,241,.15)}
.rk .no{flex:none;width:44px;text-align:center;font-size:21px;color:#f4e3ff}
.rk .no img{width:40px;height:40px;display:inline-block}
.rk .av{width:46px;height:46px;font-size:19px}
.rk .nm{flex:1;min-width:0;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rk .pts{display:flex;align-items:center;gap:6px;font-size:18px;color:#ffe7a4;font-variant-numeric:tabular-nums}
.rk .pts img{width:22px;height:22px}
.rk.me{position:sticky;bottom:-26px;margin:10px -20px -26px;padding:0 28px;height:74px;border:0;background:linear-gradient(#5b3596,#45267a);box-shadow:0 -4px 12px rgba(20,8,50,.35)}
.rk.anim{animation:rowIn .35s both}
@keyframes rowIn{from{transform:translateX(30px);opacity:0}}
.hrow{margin-bottom:12px;padding:14px 16px;border-radius:16px;background:rgba(236,221,255,.16);border:1px solid rgba(255,243,255,.2)}
.hrow .top{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:#e9d9ff;font-weight:500}
.hrow .top b{font-size:19px;color:#ffe29b;font-weight:700}
.hrow .top b.w{color:#5affc9}
.hrow .bot{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px}
.hrow .bc{display:flex;align-items:center;gap:4px;padding:3px 8px 3px 3px;border-radius:12px;background:rgba(44,25,86,.55);font-size:14px;color:#fff3c7}
.hrow .bc img{width:32px;height:32px}
.hrow .wn{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:14px;color:#5affc9}
.hrow .wn img{width:40px;height:40px}
.stn{font-size:15px;color:#e5d5fe;font-weight:500;line-height:1.5;margin:0 0 12px}
.sgrid{border:1px solid rgba(255,255,255,.18);border-radius:14px;overflow:hidden}
.sgrid .sh{position:sticky;top:-18px;z-index:2;display:grid;grid-template-columns:repeat(6,1fr);background:#4a2584}
.sgrid .sh div{position:relative;padding:8px 0 6px;display:grid;place-items:center}
.sgrid .sh img{width:50px;height:50px}
.sgrid .sh i{position:absolute;right:8px;top:4px;min-width:26px;padding:0 6px;border-radius:12px;background:#d23a8b;color:#fff1b6;font-size:13px;font-style:normal;line-height:20px;text-align:center}
.sgrid .sr{display:grid;grid-template-columns:repeat(6,1fr);height:40px}
.sgrid .sr:nth-child(even){background:rgba(247,233,255,.07)}
.sgrid .sr span{display:grid;place-items:center;border-right:1px solid rgba(248,232,255,.1);border-bottom:1px solid rgba(248,232,255,.1)}
.sgrid .sr img{width:26px;height:26px;filter:brightness(0) saturate(100%) invert(84%) sepia(40%) saturate(900%) hue-rotate(100deg)}
.sgrid .sr.first{background:rgba(255,226,140,.18)}
.rules .rc{margin-bottom:14px;padding:16px 18px;border-radius:16px;background:rgba(39,19,74,.25);border:1px solid rgba(238,223,255,.16)}
.rules h3{margin:0 0 6px;font-size:19px;color:#ffe9a4}
.rules p{margin:0;font-size:16px;font-weight:500;line-height:1.6;color:#f6efff}
.rules p b{color:#fff6d2}
.ptab{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:6px}
.ptab div{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:14px;background:rgba(255,255,255,.12)}
.ptab img{width:48px;height:48px}
.ptab b{font-size:20px;color:#ffe49d}
.empty{padding:70px 0;text-align:center;font-size:18px;font-weight:500;color:#dcc7fa}
.loading{display:flex;justify-content:center;gap:10px;padding:80px 0}
.loading i{width:14px;height:14px;border-radius:50%;background:#ffe49d;animation:dot .9s ease-in-out infinite}
.loading i:nth-child(2){animation-delay:.15s}.loading i:nth-child(3){animation-delay:.3s}
@keyframes dot{50%{opacity:.25;transform:scale(.6)}}

#toast{position:absolute;left:50%;top:600px;transform:translate(-50%,10px);z-index:80;padding:12px 24px;border-radius:16px;background:rgba(25,13,56,.92);border:1.5px solid #b58bef;font-size:19px;color:#fff;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;white-space:nowrap}
#toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------------- loader ---------------- */
#loader{position:fixed;inset:0;z-index:100;display:flex;align-items:flex-end;justify-content:center;background:radial-gradient(ellipse at 50% 70%,#6a3aae,#241050 75%);transition:opacity .4s}
#loader.done{opacity:0;pointer-events:none}
#loader .lbox{width:100%;max-width:520px;height:min(100%,600px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}
#loader .lmas{width:120px;height:120px;animation:hop 1s ease-in-out infinite}
#loader .lttl{font-size:44px;font-style:italic;color:#ffe58c;text-shadow:0 3px 0 #99521c}
#loader .lttl span{color:#fff4b1}
#loader .lbar{width:70%;height:16px;border-radius:9px;background:#2a1458;border:2px solid #ffd47a;overflow:hidden}
#loader .lbar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#f7b537,#ffe49d);transition:width .2s}
#loader .lpct{font-size:16px;color:#e9d9ff}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important}}
/* result layout (measured against the podium art) */
#res .medal{margin-top:70px;width:270px;height:263px}
#res .rib{width:400px;margin-top:-56px}
#res .pod{position:absolute;left:50%;bottom:104px;width:460px;height:175px;margin:0 0 0 -230px}
#res .pod>img{width:460px}
#res .p{bottom:auto;top:auto}
#res .p.r1{left:50%;bottom:150px}
#res .p.r2{left:21%;bottom:107px}
#res .p.r3{left:79%;bottom:91px}
#res .p .crown{position:relative;top:auto;width:34px;margin-bottom:-6px;z-index:1}
#res .ttl{margin-top:-6px}

/* =================== v2: game-quality look =================== */
#stage{background:#2a0a5e}
#bg{background:radial-gradient(ellipse 75% 48% at 50% 41%,#a463f5 0%,#6d2cc4 38%,#3d0f86 70%,#1d0548 100%)}
#bg::before{content:"";position:absolute;inset:0;opacity:.5;
  background-image:linear-gradient(45deg,rgba(255,255,255,.05) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.05) 75%),linear-gradient(45deg,rgba(255,255,255,.05) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.05) 75%);
  background-size:56px 56px;background-position:0 0,28px 28px;-webkit-mask:radial-gradient(ellipse 80% 60% at 50% 45%,#000,transparent 85%);mask:radial-gradient(ellipse 80% 60% at 50% 45%,#000,transparent 85%)}
#bg::after{background:radial-gradient(ellipse 100% 100% at 50% 50%,transparent 55%,rgba(10,0,30,.55) 100%)}
#bg .beam{position:absolute;top:-120px;width:260px;height:1000px;background:linear-gradient(180deg,rgba(255,226,160,.38),rgba(255,200,120,0) 80%);
  clip-path:polygon(42% 0,58% 0,100% 100%,0 100%);transform-origin:50% 0;filter:blur(8px);mix-blend-mode:screen;opacity:.55}
#bg .beam.l{left:-30px;animation:beamL 9s ease-in-out infinite}
#bg .beam.r{right:-30px;animation:beamR 11s ease-in-out infinite}
@keyframes beamL{0%,100%{transform:rotate(-30deg)}50%{transform:rotate(-8deg)}}
@keyframes beamR{0%,100%{transform:rotate(30deg)}50%{transform:rotate(8deg)}}
#bg .halo{position:absolute;left:50%;top:415px;width:760px;height:760px;margin:-380px 0 0 -380px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,215,120,.42) 0%,rgba(255,190,90,.12) 40%,transparent 66%);animation:halo 3.2s ease-in-out infinite alternate}
@keyframes halo{to{transform:scale(1.08);opacity:.7}}
.phase-drawing #bg .halo{animation-duration:.4s}
#amb{opacity:.85}

/* title */
#titleRow{top:2px;height:64px;display:block}
#titleRow img{position:absolute;left:50%;top:0;width:470px;margin-left:-235px}
#titleRow h1{position:absolute;left:0;right:0;top:9px;margin:0;padding:0;border:0;border-radius:0;background:none;overflow:visible;text-align:center;
  font-size:36px;line-height:44px;font-style:italic;letter-spacing:1px;color:transparent;text-shadow:none;
  background-image:linear-gradient(180deg,#fffbe0 0%,#ffe680 40%,#ffb81f 55%,#ffe9a0 100%);-webkit-background-clip:text;background-clip:text;
  filter:drop-shadow(0 3px 0 #5b1e00) drop-shadow(0 0 10px rgba(255,200,80,.35))}
#titleRow h1::after{content:none}
#titleRow::after{content:"";position:absolute;left:50%;top:10px;width:60px;height:44px;margin-left:-200px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.6),transparent);transform:skewX(-20deg);
  animation:sheen2 4s ease-in-out infinite 1s;mix-blend-mode:overlay;pointer-events:none}
@keyframes sheen2{0%,65%{transform:translateX(0) skewX(-20deg);opacity:0}70%{opacity:1}100%{transform:translateX(340px) skewX(-20deg);opacity:0}}
#ping{top:20px;right:16px}

/* glass bars */
#status,#latest,#wallet{background:linear-gradient(180deg,rgba(52,14,104,.85),rgba(24,5,56,.85));border:2px solid #e9b44c;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 4px 10px rgba(15,2,40,.45)}
#status{top:66px;height:42px}
#latest{top:690px;height:46px;border-radius:23px;padding-left:6px}
#latest .lbl{padding:4px 10px;border-radius:14px;background:linear-gradient(#ffe27a,#e5960f);color:#5b1e00;font-size:13px;box-shadow:0 2px 0 #8a4a05}
#strip .rc{width:38px;height:38px}
#wallet{top:690px;height:46px;border-radius:23px;justify-content:flex-start;gap:8px;padding:0 16px 0 6px}
#wallet img{width:38px;height:38px}
#wallet b{font-size:23px;color:#fff3c4;text-shadow:0 2px 0 #2a0656}

/* toolbar buttons are the new glossy icons */
.tb{top:114px;width:62px;height:62px;border:0;background:none;box-shadow:none;border-radius:50%}
.tb img{width:100%;height:100%;filter:none}
.tb:active{transform:scale(.9);box-shadow:none}
#btnBack{left:10px}#btnRank{left:76px}#btnStats{left:142px}
.tb.r1{right:10px}.tb.r2{right:76px}.tb.r3{right:142px}
.tb::after{content:"";position:absolute;inset:-4px;border-radius:50%;box-shadow:0 0 0 0 rgba(255,220,120,.6);opacity:0}
.tb:active::after{animation:ping .4s}
@keyframes ping{from{box-shadow:0 0 0 0 rgba(255,220,120,.7);opacity:1}to{box-shadow:0 0 0 14px rgba(255,220,120,0);opacity:0}}

/* wheel */
#wheelBox{left:95px;top:150px;width:530px;height:530px}
.wglow{inset:-30px;background:radial-gradient(circle,transparent 58%,rgba(255,214,110,.55) 66%,transparent 74%)}
#rim{filter:drop-shadow(0 16px 20px rgba(20,4,50,.6))}
#rotorWrap{left:37px;top:37px;width:456px;height:456px;box-shadow:0 0 0 3px #2a0656}
#gloss{position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:radial-gradient(ellipse 62% 42% at 36% 24%,rgba(255,255,255,.34),rgba(255,255,255,.06) 55%,transparent 70%);
  box-shadow:inset 0 0 26px 6px rgba(25,0,60,.55),inset 0 -10px 30px rgba(25,0,60,.35)}
#rotor .lbl{stroke:#3b1170;stroke-width:9px}
#bulbs i{width:16px;height:16px;margin:-8px 0 0 -8px}
#hub{width:176px;height:176px;margin:-88px 0 0 -88px}
#hub img{left:15px;top:15px;width:146px;height:146px}
#hubRing circle{stroke-width:8}
#hubTxt{font-size:60px;text-shadow:0 3px 0 #2a0656,0 0 14px rgba(200,140,255,.8)}
#hubTxt.word{font-size:30px}
#pointer{width:72px;margin-left:-36px;top:-44px;transform-origin:50% 28%;filter:none}
#big{position:absolute;left:0;right:0;top:50%;margin-top:-130px;height:260px;display:grid;place-items:center;z-index:6;pointer-events:none;
  font-size:230px;line-height:1;color:#fff;text-shadow:0 8px 0 #7a0626,0 0 40px rgba(255,80,120,.9);opacity:0}
#big.go{animation:bigCount .95s cubic-bezier(.2,.9,.3,1) forwards}
@keyframes bigCount{0%{transform:scale(2.4);opacity:0}25%{transform:scale(1);opacity:.95}70%{transform:scale(.9);opacity:.85}100%{transform:scale(.6);opacity:0}}
.jumper{position:absolute;left:0;top:0;width:150px;height:150px;margin:-75px 0 0 -75px;z-index:58;pointer-events:none}
.jumper img{width:100%;height:100%}
.jumper .spot{position:absolute;left:50%;top:50%;width:380px;height:380px;margin:-190px 0 0 -190px;border-radius:50%;z-index:-1;
  background:repeating-conic-gradient(rgba(255,240,180,.45) 0 10deg,rgba(255,240,180,0) 10deg 24deg);-webkit-mask:radial-gradient(circle,#000 20%,transparent 66%);mask:radial-gradient(circle,#000 20%,transparent 66%);animation:spin 6s linear infinite}

/* cards: glossy 3D tiles */
#cards{top:746px;gap:10px 10px;left:12px;right:12px}
.card{height:68px;border-radius:18px;background:linear-gradient(180deg,var(--l) 0%,var(--c) 100%) !important;border:3px solid rgba(255,255,255,.92);
  box-shadow:0 5px 0 var(--d),0 9px 14px rgba(20,4,50,.45),inset 0 -8px 12px rgba(0,0,0,.12);transition:transform .15s,filter .3s}
.card::before{content:"";position:absolute;left:4px;right:4px;top:3px;height:42%;border-radius:14px 14px 30px 30px;background:linear-gradient(rgba(255,255,255,.55),rgba(255,255,255,.05));pointer-events:none}
.card:active{transform:translateY(4px);box-shadow:0 1px 0 var(--d),0 4px 8px rgba(20,4,50,.4)}
.card .mas{left:-6px;top:-20px;width:84px;height:84px;filter:none}
.card .mx{right:8px;top:6px;width:auto;padding:0 10px;border-radius:12px;background:rgba(40,8,80,.45);font-size:17px;line-height:24px;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,.4)}
.card .my{right:12px;bottom:6px;display:flex;align-items:center;gap:4px;font-size:22px;color:#fff;text-shadow:0 2px 0 var(--d),0 0 6px rgba(0,0,0,.25)}
.card .my img{width:22px;height:22px}
.card .all{left:78px;bottom:9px;font-size:12px;color:rgba(255,255,255,.9);font-weight:500;text-shadow:0 1px 1px var(--d)}
.card.has::after{inset:-7px;border:3px solid #fff3a0;border-radius:22px;box-shadow:0 0 14px #ffd84a,inset 0 0 10px rgba(255,220,100,.6);animation:hasPulse 1s ease-in-out infinite alternate}
@keyframes hasPulse{to{box-shadow:0 0 22px 4px #ffd84a,inset 0 0 14px rgba(255,220,100,.8)}}
.card.win::before{inset:-8px;height:auto;border-radius:24px;background:none;border:4px solid #fff;box-shadow:0 0 26px 8px var(--c),0 0 50px 14px rgba(255,240,170,.7)}

/* chips: round casino chips */
#chips{top:900px;left:20px;right:20px}
.chip{width:96px;height:96px;filter:drop-shadow(0 5px 4px rgba(20,4,50,.5));transition:transform .25s cubic-bezier(.2,1.6,.4,1),filter .2s}
.chip.on{transform:translateY(-10px) scale(1.1);filter:drop-shadow(0 0 12px rgba(255,236,150,.95)) drop-shadow(0 8px 6px rgba(20,4,50,.5))}
.chip.on img{animation:chipSpin 2.4s ease-in-out infinite}
@keyframes chipSpin{0%,60%{transform:rotate(0)}80%{transform:rotate(25deg)}100%{transform:rotate(0)}}
.chip.on::before{content:"";top:auto;bottom:-14px;left:50%;right:auto;width:46px;height:8px;margin-left:-23px;border:0;border-radius:50%;background:radial-gradient(ellipse,rgba(255,236,150,.9),transparent 70%);box-shadow:none}
.chip .sh{inset:6px;border-radius:50%}
.chip.on .sh::after{width:24px;animation:chipSheen2 2.2s ease-in-out infinite}
@keyframes chipSheen2{0%,55%{left:-30px}100%{left:110px}}
.fly{width:56px;height:56px;margin:-28px 0 0 -28px}

/* result */
#res .pod{width:480px;height:192px;margin-left:-240px;bottom:100px}
#res .pod>img{width:480px}
#res .p.r1{left:50%;bottom:168px}
#res .p.r2{left:19%;bottom:124px}
#res .p.r3{left:81%;bottom:108px}
#res .p .crown{width:44px;margin-bottom:-8px}
#res .medal .ma{left:14%;top:7%;width:72%;height:72%}
#gloss{background:radial-gradient(ellipse 60% 38% at 36% 22%,rgba(255,255,255,.22),rgba(255,255,255,.04) 55%,transparent 70%)}
#chips{top:904px}
.chip{width:90px;height:90px}

/* electric effects */
#zap{position:absolute;inset:0;width:720px;height:1000px;pointer-events:none;z-index:67}
#fx{z-index:68}
.zflash{position:absolute;inset:0;z-index:66;pointer-events:none;mix-blend-mode:screen}
.zring{position:absolute;width:600px;height:600px;border-radius:50%;z-index:57;pointer-events:none;border:5px solid var(--zc);
  box-shadow:0 0 28px 6px var(--zc),inset 0 0 28px 6px var(--zc)}
#hub.hot::after{content:"";position:absolute;inset:4px;border-radius:50%;box-shadow:0 0 18px 4px rgba(200,130,255,.8);animation:hubZap .18s steps(2) infinite}
@keyframes hubZap{50%{box-shadow:0 0 6px 1px rgba(255,220,120,.7)}}
#big.go{text-shadow:0 8px 0 #4b0f8a,0 0 30px rgba(200,120,255,1),0 0 60px rgba(255,210,90,.7)}
.card.zz{animation:cardZap .35s steps(3)}
@keyframes cardZap{33%{filter:brightness(1.6) drop-shadow(0 0 8px #e1b8ff)}66%{filter:brightness(1.1)}}

/* 5-animal limit: the last card can't be picked once 5 are chosen */
.card.blocked{filter:grayscale(.75) brightness(.72)!important}
.card.blocked .mas{animation:none}
.card.blocked::after{content:"MAX " attr(data-max);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:3px 12px;border-radius:12px;background:rgba(25,6,55,.82);border:1.5px solid #ffd36b;color:#ffe49d;font-size:15px;letter-spacing:.5px;pointer-events:none}
