*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
html,body{width:100%;height:100%;overflow:hidden;background:#000;font-family:"Trebuchet MS","Segoe UI",Roboto,Arial,sans-serif;color:#fff;touch-action:manipulation}
button{font-family:inherit;color:inherit;border:0;background:none;cursor:pointer}

/* ---------- page background (fills desktop / tablet sides) ---------- */
#bg{position:fixed;inset:0;background:#000;display:none;background:
  radial-gradient(ellipse at 50% 35%,#13335a 0%,#0a1a33 45%,#050a14 100%);}
#bg::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,rgba(255,255,255,.015) 0 2px,transparent 2px 60px)}

/* ---------- loading ---------- */
#loading::before{content:"";position:absolute;left:0;right:0;bottom:0;height:min(100vh,158vw);background:linear-gradient(180deg,#4a44a6 0%,#5a64b8 35%,#6f9bdc 75%,#73aae6 100%)}
#loading{position:fixed;inset:0;z-index:100;background:#000;display:flex;align-items:center;justify-content:center;transition:opacity .5s;--x:linear-gradient(180deg,#4a44a6 0%,#5a64b8 35%,#6f9bdc 75%,#73aae6 100%);display:flex;align-items:center;justify-content:center;transition:opacity .5s}
#loading.hide{opacity:0;pointer-events:none}
.load-wrap{position:relative;width:min(66.5vw,480px);}
.load-bar{position:relative;height:54px;border-radius:30px;background:#18203a;border:4px solid #9aa3b5;box-shadow:0 0 0 2px #50596e,inset 0 3px 6px rgba(0,0,0,.6);overflow:hidden}
.load-fill{position:absolute;left:0;top:0;bottom:0;width:0%;border-radius:30px;background:repeating-linear-gradient(115deg,#f9a825 0 14px,#ef7d0c 14px 28px);box-shadow:inset 0 6px 8px rgba(255,255,255,.35);transition:width .15s}
#loadTxt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:21px;text-shadow:0 1px 2px #0006}

/* ---------- stage (fixed 720 x 1140 design, scaled by JS) ---------- */
#viewport{position:fixed;inset:0;overflow:hidden;background:#000}
#stage{position:absolute;left:50%;bottom:0;width:720px;height:1140px;transform-origin:50% 100%;overflow:hidden;
  background:linear-gradient(180deg,#060d1c 0%,#0a1830 28%,#0c1d38 36%)}
#stage::before{content:"";position:absolute;left:0;right:0;top:0;height:400px;background:
  radial-gradient(ellipse at 50% 50%,rgba(40,90,160,.35),transparent 70%),
  repeating-linear-gradient(90deg,rgba(255,255,255,.025) 0 3px,transparent 3px 48px)}

.round-btn{position:absolute;width:60px;height:60px;border-radius:50%;z-index:5;
  background:radial-gradient(circle at 50% 30%,#4a6f9b,#243e63 70%);border:3px solid #a9c7e6;box-shadow:0 0 0 2px #1b2c47,0 4px 8px #0008,inset 0 0 8px #9cd0ff55;
  display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:700;color:#fff;transition:transform .1s}
.round-btn:active{transform:scale(.92)}
.round-btn svg{width:30px;height:30px;stroke:#fff;stroke-width:3.4;fill:none;stroke-linecap:round}
.round-btn svg .fill{fill:#fff;stroke:none}
.round-btn svg .fill:nth-child(1){stroke:#fff;stroke-width:1}
.round-btn.big{width:80px;height:80px;background:radial-gradient(circle at 50% 30%,#59a9d8,#2c6e9f 70%);border-color:#bfe4ff}
.round-btn.big svg{width:46px;height:46px}
#roundTxt{position:absolute;left:119px;top:42px;font-size:26px;color:#8e98a8;letter-spacing:.3px}

/* players */
#players{position:absolute;left:0;top:110px;width:720px;height:140px;z-index:4}
.pl{position:absolute;top:0;width:110px;height:125px;transition:left .6s}
.pl .crown{position:absolute;left:50%;top:-6px;transform:translateX(-50%);width:62px;height:38px;z-index:2}
.pl .frame{position:absolute;left:0;top:22px;width:110px;height:100px;border-radius:6px;background:#4a2c10;border:3px solid #cfa56a;box-shadow:0 0 0 2px #2b1a0a,0 0 10px #0008,inset 0 0 0 3px #1d1208;overflow:hidden}
.pl.p2 .frame{border-color:#9fc2e8;background:#1f3550}
.pl.p3 .frame{border-color:#e08f6b;background:#4a2a20}
.pl.p4 .frame,.pl.p5 .frame{border-color:#b7bcc6;background:#3d3d49}
.pl .frame i{position:absolute;inset:4px;border-radius:3px;display:block;overflow:hidden}
.pl .frame svg{width:100%;height:100%;display:block}
.pl .rk{position:absolute;left:50%;top:1px;transform:translateX(-50%);font-size:11px;font-weight:700;color:#3a2a10;z-index:3;text-shadow:0 0 2px #fff8}
.pl .nm{position:absolute;left:0;right:0;bottom:6px;font-size:11px;text-align:center;background:linear-gradient(transparent,#000b);padding-top:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:2}

#btnTrophy{position:absolute;left:602px;top:260px;width:84px;height:80px;z-index:5}
#btnTrophy svg{width:84px;height:62px;filter:drop-shadow(0 2px 3px #0008)}
#btnTrophy span{position:absolute;left:6px;right:6px;bottom:2px;height:14px;background:linear-gradient(#b3202c,#7b0f1b);border:1px solid #f1b24a;font-size:11px;line-height:12px;border-radius:2px}

/* table */
#table{position:absolute;left:0;top:395px;width:720px;height:600px;background:
  radial-gradient(ellipse at 50% 15%,#2a9fb2 0%,#1a7f98 40%,#136a86 100%);border-top:5px solid #6b5420;z-index:1}
#table::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.35),transparent 20%)}
.rail{position:absolute;top:-24px;width:250px;height:60px;z-index:2}
.rail.left{left:-6px;background:
  radial-gradient(circle at 150px 26px,#ffe493 3px,transparent 4px),radial-gradient(circle at 190px 26px,#ffe493 3px,transparent 4px)}
.rail::before{content:"";position:absolute;left:0;right:0;top:15px;height:16px;border-radius:0 0 40px 8px;background:linear-gradient(#ffe9a3,#d79a2b 50%,#8a5a12);box-shadow:0 3px 4px #0007}
.rail.left::before{border-radius:0 0 8px 40px;left:0;right:0}
.rail.left::after,.rail.right::after{content:"";position:absolute;top:-10px;width:30px;height:46px;border:9px solid #e5b546;border-bottom:0;border-radius:40px 40px 0 0}
.rail.left::after{right:0;border-left:0;border-radius:0 40px 0 0;transform:none}
.rail.right{right:-6px}
.rail.right::before{border-radius:0 0 40px 8px}
.rail.right::after{left:0;border-right:0;border-radius:40px 0 0 0}
.rail.right{background:radial-gradient(circle at 50px 26px,#ffe493 3px,transparent 4px),radial-gradient(circle at 90px 26px,#ffe493 3px,transparent 4px)}
.stitch{position:absolute;left:0;right:0;border-top:2px dashed rgba(255,255,255,.28)}
.stitch.top{top:20px}.stitch.bottom{bottom:30px}

/* cup */
#cupWrap{position:absolute;left:210px;top:250px;width:300px;height:300px;z-index:3;pointer-events:none}
#cup{position:absolute;left:50px;top:30px;width:200px;height:240px;transition:transform .6s cubic-bezier(.3,1.4,.5,1),opacity .4s}
.cup-body{position:absolute;left:22px;right:22px;top:34px;bottom:14px;border-radius:30% 30% 12% 12%/24% 24% 6% 6%;
  background:radial-gradient(ellipse at 35% 30%,#5a5f69 0%,#2a2d33 38%,#0d0e11 85%);
  box-shadow:inset 0 -8px 14px #000,inset 0 0 0 3px #3a3e4755}
.cup-body::before{content:"";position:absolute;left:-14px;right:-14px;bottom:-4px;height:62%;border-radius:18% 18% 30% 30%/30%;background:inherit;z-index:-1}
.cup-top{position:absolute;left:36px;right:36px;top:8px;height:56px;border-radius:50%;background:radial-gradient(ellipse,#05060a 50%,#444955 62%,#14161a 100%);border:3px solid #3a3e47;z-index:2}
.cup-base{position:absolute;left:-8px;right:-8px;bottom:-2px;height:36px;border-radius:50%/60%;background:linear-gradient(#444,#0b0b0d);box-shadow:0 10px 14px #0007}
.cup-body::after{content:"";position:absolute;left:30%;top:32%;width:40%;height:34%;border-radius:50%;background:radial-gradient(#ffffff10,transparent 70%)}
.cup-glass{position:absolute;left:30px;top:-10px;width:140px;height:112px;display:none}
/* glass mode */
#cup.glass .cup-body,#cup.glass .cup-top{display:none}
#cup.glass .cup-glass{display:block;top:50px;left:12px;width:176px;height:130px;border-radius:50% 50% 12% 12%/70% 70% 12% 12%;
  background:radial-gradient(ellipse at 35% 25%,#ffffff55,#a6c7c244 40%,#3a5a5a66);border:2px solid #ffffff55;overflow:hidden}
#cup.glass .cup-base{bottom:20px;left:-30px;right:-30px;height:90px;background:radial-gradient(ellipse at 50% 30%,#4d4d4d,#101010 70%);border-radius:50%/50%}
#cup.glass .cup-glass .die.s{display:block}
.cup-glass .die.s{display:none}
#cup.closed{transform:none}
#cup.shake{animation:cupshake .12s linear infinite}
#cup.lift{transform:translateY(-175px) rotate(-8deg);opacity:0}
@keyframes cupshake{0%{transform:translate(-8px,-6px) rotate(-3deg)}25%{transform:translate(8px,4px) rotate(3deg)}50%{transform:translate(-6px,6px) rotate(-2deg)}75%{transform:translate(6px,-5px) rotate(2deg)}100%{transform:translate(-8px,-6px) rotate(-3deg)}}
.cup-glass .die.s{position:absolute;width:48px;height:48px;animation:tumble .5s ease-in-out infinite}
.cup-glass .die.s[data-i="0"]{left:40px;top:40px}
.cup-glass .die.s[data-i="1"]{left:86px;top:56px;animation-delay:-.2s}
.cup-glass .die.s[data-i="2"]{left:100px;top:16px;animation-delay:-.35s}
@keyframes tumble{0%{transform:translate(0,0) rotate(0)}25%{transform:translate(-14px,-24px) rotate(90deg)}50%{transform:translate(10px,6px) rotate(200deg)}75%{transform:translate(18px,-18px) rotate(290deg)}100%{transform:translate(0,0) rotate(360deg)}}

/* dice */
.die{position:relative;width:56px;height:56px;border-radius:14px;background:radial-gradient(circle at 30% 25%,#fff,#e9edf2 55%,#b9c0ca);box-shadow:inset -3px -4px 6px #8f99a8aa,0 4px 6px #0007;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);padding:9px;gap:0}
.die i{display:block;width:78%;height:78%;margin:auto;border-radius:50%;background:radial-gradient(circle at 35% 30%,#555,#111);visibility:hidden}
.die i.on{visibility:visible}
.die i.red{background:radial-gradient(circle at 35% 30%,#ff7b6f,#e8221a)}
#diceArea{position:absolute;left:0;top:545px;width:720px;height:80px;z-index:4;pointer-events:none}
#diceArea .die{position:absolute;top:0;opacity:0;transform:scale(.3)}
#diceArea .die[data-i="0"]{left:250px}
#diceArea .die[data-i="1"]{left:322px}
#diceArea .die[data-i="2"]{left:394px}
#diceArea.show .die{opacity:1;animation:dpop .5s cubic-bezier(.2,1.6,.4,1) forwards}
#diceArea.show .die[data-i="1"]{animation-delay:.12s}
#diceArea.show .die[data-i="2"]{animation-delay:.24s}
@keyframes dpop{0%{transform:scale(.3) translateY(-60px) rotate(-120deg);opacity:0}100%{transform:scale(1) translateY(0) rotate(0);opacity:1}}
#resultTxt{position:absolute;left:0;top:490px;width:720px;z-index:5;text-align:center;opacity:0;pointer-events:none}
#resLabel{font-size:46px;font-weight:700;color:#ffe44d;text-shadow:0 2px 4px #0009;letter-spacing:1px;height:52px}
#resTotal{position:absolute;left:470px;top:70px;font-size:44px;color:#fff;text-shadow:0 2px 4px #000a}
#resultTxt.show{opacity:1;animation:rpop .4s ease-out}
@keyframes rpop{from{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}

/* history box */
#histBox{position:absolute;left:515px;top:435px;width:193px;height:86px;z-index:5;border-radius:10px;
  background:linear-gradient(#1c4a68,#143a54);border:3px solid #2c6a8e;box-shadow:0 4px 8px #0006,inset 0 0 10px #61c0e855;text-align:left}
#histBox .arrow{position:absolute;left:14px;top:5px;font-size:24px;font-weight:700;color:#7fd6ff}
#histBox b{position:absolute;left:0;right:0;top:3px;text-align:center;font-size:27px;color:#86daff;font-style:italic;border-bottom:1px solid #4a8bad;height:32px;line-height:32px}
.mini-dice{position:absolute;left:0;right:0;bottom:6px;display:flex;justify-content:center;gap:10px}
.mini-dice i{display:block;width:36px;height:36px;border-radius:9px;background:radial-gradient(circle at 30% 25%,#fff,#d6dbe3);position:relative;box-shadow:inset -2px -2px 4px #8a94a4,0 2px 3px #0006;padding:5px;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr)}
.mini-dice i b2{display:block}
.mini-dice i u{display:block;width:70%;height:70%;margin:auto;border-radius:50%;background:#222;text-decoration:none}
.mini-dice i u.r{background:#e8221a}
.mini-dice i u.off{visibility:hidden}

/* clock */
#clock{position:absolute;left:68px;top:490px;width:94px;height:94px;border-radius:50%;z-index:4;opacity:0;pointer-events:none;
  background:radial-gradient(circle at 40% 30%,#3a86d8,#1a4e96);border:5px solid #f4d27a;box-shadow:0 0 0 2px #7a5a1a,0 4px 8px #0008;display:flex;align-items:center;justify-content:center}
#clock::before{content:"";position:absolute;top:-17px;left:36px;width:22px;height:12px;background:#aab;border-radius:3px 3px 0 0}
#clock.on{opacity:1}
#clockNum{font-size:44px;font-weight:700;color:#fff}
#clock.warn{border-color:#f4b27a;animation:cpulse 1s infinite}
#clock.warn #clockNum{color:#ff2a2a}
@keyframes cpulse{50%{transform:scale(.94)}}

/* bet zones */
.zone{position:absolute;z-index:3;border-radius:80px;border:4px solid #7fe4ff;background:rgba(40,150,185,.28);box-shadow:inset 0 0 18px #9be9ff44,0 0 8px #43c7e655;cursor:pointer;overflow:hidden;transition:transform .08s,background .2s,box-shadow .2s}
.zone:active{transform:scale(.985)}
.zone .zt,.zone .zb{position:absolute;left:0;right:0;height:34px;text-align:center;font-size:23px;color:#f4d38a;line-height:34px;background:rgba(10,60,85,.35);z-index:2}
.zone .zt{top:0;border-bottom:1px solid #6fd7ee77;height:36px}
.zone .zb{bottom:0;color:#fff;border-top:1px solid #6fd7ee77;background:rgba(10,60,85,.28)}
.zone .zn{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;font-size:48px;font-weight:700;color:#8ad7ee;letter-spacing:.5px;white-space:nowrap}
.zone .zn em{font-style:normal;font-size:42px;margin-left:10px;font-weight:400}
.zone.has .zn{color:#bff0ff}
.zone.win{background:rgba(255,240,120,.3);border-color:#fff6a8;box-shadow:0 0 26px 6px #fff58a,inset 0 0 26px #fff58a99;animation:zwin .5s ease-in-out 4}
@keyframes zwin{50%{box-shadow:0 0 40px 12px #fff58a,inset 0 0 30px #fff58a}}
.zone.closed{opacity:.75}
.chipstack{position:absolute;left:0;right:0;top:34px;bottom:34px;z-index:1;pointer-events:none}
.mc{position:absolute;width:38px;height:38px;animation:chipin .3s ease-out}
@keyframes chipin{from{transform:translateY(-120px) scale(1.5);opacity:0}to{opacity:1}}
#notice{position:absolute;left:30px;right:30px;top:884px;font-size:17px;line-height:26px;color:rgba(160,220,235,.28);z-index:2;pointer-events:none;text-align:left;width:620px}

/* bottom */
#bottom{position:absolute;left:0;right:0;top:990px;height:150px;z-index:6;background:linear-gradient(#17151b,#0d0c10);
  background-image:radial-gradient(rgba(255,255,255,.04) 1px,transparent 1.5px),linear-gradient(#26222b,#0d0c10);background-size:7px 7px,100% 100%}
.gold-line{position:absolute;left:0;right:0;top:0;height:5px;background:linear-gradient(#ffe9a3,#b98a28);box-shadow:0 -2px 4px #0008}
#coinIcon{position:absolute;left:3px;top:62px;width:48px;height:48px}
#balance{position:absolute;left:73px;top:67px;font-size:24px;color:#cfcfd4;width:130px;white-space:nowrap}
#gain{position:absolute;left:3px;top:36px;font-size:18px;color:#f6c84a;opacity:0;font-weight:700}
#gain.show{animation:gainup 2.2s ease-out}
@keyframes gainup{0%{opacity:0;transform:translateY(14px)}15%{opacity:1;transform:none}80%{opacity:1}100%{opacity:0;transform:translateY(-10px)}}
#chips{position:absolute;left:0;top:0;width:100%;height:100%}
.chip{position:absolute;top:30px;width:76px;height:76px;border-radius:50%;transition:transform .15s,filter .15s;z-index:2;padding:0}
.chip .c{position:absolute;inset:0;border-radius:50%;box-shadow:0 5px 7px #000a;
  background:repeating-conic-gradient(var(--c2) 0 18deg,var(--c1) 18deg 45deg)}
.chip .c::before{content:"";position:absolute;inset:7px;border-radius:50%;background:radial-gradient(circle at 40% 30%,var(--c3),var(--c1));border:2px solid #ffffffaa}
.chip .c::after{content:"";position:absolute;inset:0;border-radius:50%;background:radial-gradient(circle at 35% 25%,#ffffff55,transparent 45%)}
.chip span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:23px;font-weight:700;color:#fff;text-shadow:0 2px 2px #0008;z-index:2;letter-spacing:-1px}
.chip.sel{transform:translateY(-20px) scale(1.28)}
.chip.sel::before{content:"";position:absolute;inset:-9px;border-radius:50%;background:radial-gradient(#fff 55%,#cfd6e0 60%,#ffffff22 70%);z-index:-1;box-shadow:0 0 14px #fff9}
#btnAgain{position:absolute;left:567px;top:23px;width:148px;height:66px;border-radius:33px;font-size:27px;font-weight:700;color:#fff;
  background:linear-gradient(#ffd84a,#f59a0c 55%,#e57c00);border:3px solid #ffe79a;text-shadow:0 2px 2px #8a4a0099;box-shadow:0 5px 8px #000a,inset 0 3px 6px #fff8;padding-top:2px;transition:transform .1s,filter .2s;top:36px}
#btnAgain:active{transform:scale(.94)}
#btnAgain:disabled{filter:grayscale(.8) brightness(.7)}

/* win popup */
#winPop{position:absolute;left:30px;top:365px;width:660px;height:380px;z-index:20;opacity:0;pointer-events:none;transform:scale(.4)}
#winPop.show{animation:winshow 3s ease-out forwards}
@keyframes winshow{0%{opacity:0;transform:scale(.3)}12%{opacity:1;transform:scale(1.08)}20%{transform:scale(1)}85%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.05)}}
#winPop::before{content:"";position:absolute;left:70px;top:30px;width:520px;height:340px;border-radius:260px 260px 0 0;background:radial-gradient(circle at 50% 0%,#e0242e 30%,#8d0f1b 100%);border:8px solid #f6c242;box-shadow:0 0 40px #ffcf4a99}
.win-crown{position:absolute;left:250px;top:-10px;width:170px;height:100px;background:linear-gradient(#ffe56a,#e49a14);clip-path:polygon(0 100%,5% 20%,25% 55%,50% 0,75% 55%,95% 20%,100% 100%);filter:drop-shadow(0 4px 4px #0008)}
.win-txt{position:absolute;left:0;right:0;top:50px;text-align:center;font-size:190px;line-height:190px;font-weight:900;font-family:Impact,"Arial Black",sans-serif;letter-spacing:6px;
  background:linear-gradient(#fff6a0 10%,#ffc928 45%,#e18200 90%);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-stroke:3px #a9570a;filter:drop-shadow(0 6px 3px #0009)}
.win-amt{position:absolute;left:5px;right:5px;top:245px;height:130px;border-radius:65px;background:linear-gradient(#5a0a7a,#33034d);border:6px solid #f2c24a;box-shadow:0 0 0 3px #7b5412,0 8px 14px #000a;text-align:center;line-height:118px;font-size:104px;font-weight:900;font-family:Impact,"Arial Black",sans-serif;
  color:#ffd23a;-webkit-text-stroke:2px #a0620a;text-shadow:0 4px 0 #b36b0a,0 6px 8px #000a}

/* toast */
#toast{position:absolute;left:50%;top:700px;transform:translateX(-50%);z-index:50;background:#000c;padding:12px 26px;border-radius:30px;font-size:24px;opacity:0;pointer-events:none;transition:opacity .25s;white-space:nowrap;border:1px solid #fff3}
#toast.show{opacity:1}

/* modals */
.modal{position:absolute;inset:0;z-index:30;display:none;background:rgba(0,0,0,.35)}
.modal.open{display:block;animation:fade .2s}
@keyframes fade{from{opacity:0}}
.panel{position:absolute;left:44px;width:632px;top:380px;border-radius:14px;overflow:hidden}
.hist{height:640px;background:rgba(214,152,52,.88);border:3px solid #f1b24a;box-shadow:0 0 18px #000a;backdrop-filter:blur(3px)}
.tabs{display:flex;height:84px}
.tab{flex:1;font-size:30px;color:#6a410a;background:linear-gradient(#b87a22,#a56a18);border-bottom:2px solid #f5c25f}
.tab.on{background:linear-gradient(#ffc44d,#f09a1a);color:#fff;text-shadow:0 2px 2px #8a4a00}
.hbody{height:480px;overflow-y:auto;padding:10px 0}
.hbody::-webkit-scrollbar{width:0}
.hrow{position:relative;display:flex;align-items:center;height:100px;padding-left:176px}
.hrow .die{width:54px;height:54px;margin-right:46px;padding:8px}
.hrow .tot{position:absolute;right:62px;font-size:34px;color:#fff;width:60px;text-align:center}
.hrow .new{position:absolute;left:30px;background:#b01820;padding:5px 14px;border-radius:4px;font-size:26px;border:1px solid #f08a8a}
.hfoot{position:absolute;bottom:0;left:0;right:0;text-align:center;font-size:21px;padding:10px;color:#fff;background:#a8701c88}
.datebar{display:flex;align-items:center;justify-content:center;gap:34px;font-size:32px;height:70px;color:#fff}
.datebar button{width:36px;height:36px;border-radius:8px;background:#d88e2a;font-size:22px;color:#fff;border:1px solid #fff6}
#mineList{padding:0 16px}
.mrow{display:flex;justify-content:space-between;align-items:center;font-size:24px;padding:12px 8px;border-bottom:1px solid #ffffff44}
.mrow .w{color:#c6ffc6}.mrow .l{color:#ffd0d0}
.nodata{text-align:center;font-size:32px;padding-top:150px}
.xbtn{position:absolute;width:62px;height:62px;border-radius:50%;background:radial-gradient(#e0a23a,#b46f12);border:4px solid #f5c860;font-size:50px;line-height:44px;color:#4b2a05;box-shadow:0 3px 6px #000a}
.modal:has(.hist) .xbtn{left:586px;top:350px}
.xbtn.red{background:radial-gradient(#ff7a96,#d02356);border-color:#ffc3d3;color:#fff;font-size:56px;left:648px;top:350px}
.rank{top:358px;height:640px;left:40px;width:640px;background:linear-gradient(#7d1230,#561026);border:4px solid #f0c060;border-radius:22px;box-shadow:0 0 22px #000a;padding:12px 14px}
.rank-top{display:flex;align-items:center;justify-content:space-between;padding:0 6px;height:106px}
.hex{width:54px;height:60px;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700;background:linear-gradient(#e84a3a,#b01a1a);clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);color:#fff}
.hex.on{background:linear-gradient(#ff9a6a,#e05a2a);transform:scale(1.15)}
.hex.crown{background:linear-gradient(#ffd34a,#e08a10);color:#7a1a10;font-size:30px;width:64px;height:68px}
.rank-table{border:2px solid #888;background:#000;height:490px;overflow:hidden;border-radius:4px}
.rh{display:grid;grid-template-columns:110px 195px 155px 1fr;height:50px;line-height:50px;background:linear-gradient(#444,#2c2c2c);color:#ddd;font-size:25px;text-align:center}
.rh.single{grid-template-columns:1fr}
.rbody{height:440px;overflow-y:auto}
.rbody::-webkit-scrollbar{width:0}
.rr{display:grid;grid-template-columns:110px 195px 155px 1fr;height:90px;align-items:center;border-bottom:2px solid #333;font-size:23px;text-align:center}
.rr .u{display:flex;align-items:center;gap:6px;text-align:left;font-size:19px;line-height:21px;padding-left:4px}
.rr .u svg{width:40px;height:40px;flex:none;border-radius:3px}
.rr .a{display:flex;align-items:center;justify-content:center;gap:8px;background:#000a;margin:0 6px;border-radius:18px;padding:3px 0}
.rr .a i{width:26px;height:26px;border-radius:50%;background:radial-gradient(#ffd75a,#d98a14);flex:none}
.rr.r1{background:linear-gradient(90deg,#d6246f,#f1b341)}
.rr.r2{background:linear-gradient(90deg,#4a4aa8,#dcdcec);color:#222}
.rr.r3{background:linear-gradient(90deg,#b45a2a,#f09a6a)}
.rr.r1 .rk,.rr.r2 .rk,.rr.r3 .rk{font-size:46px;font-style:italic;font-weight:900;color:#ffe6a0;-webkit-text-stroke:2px #5a2a6a}
.rr.r1 .a,.rr.r2 .a,.rr.r3 .a{background:#222c}
.rr.r2 .a{color:#fff}
.users .rr{grid-template-columns:90px 1fr 140px}
.rule{top:370px;left:10px;width:700px;height:640px;background:#136a98;border:2px solid #0a3a58;border-radius:20px}
.rule-h{height:68px;background:#e8b23a;text-align:center;line-height:68px;font-size:40px;color:#fff;text-shadow:2px 2px 0 #333,-1px -1px 0 #333;position:relative}
.rule-h button{position:absolute;right:20px;top:10px;font-size:48px;line-height:48px;color:#fff}
.rule-b{padding:28px 14px;font-size:31px;line-height:38px}
.rule-b p{margin-bottom:26px}
.confirm{left:110px;width:500px;top:480px;background:linear-gradient(#1c4a68,#143a54);border:3px solid #7fd6ff;padding:40px 30px;text-align:center;font-size:30px}
.cbtns{display:flex;gap:20px;justify-content:center;margin-top:34px}
.cbtns button{padding:14px 34px;border-radius:30px;font-size:26px;background:#3a5a78;border:2px solid #9cd0ff}
.cbtns .primary{background:linear-gradient(#ffd84a,#f59a0c);color:#fff}

/* ======== clone refinements ======== */
html,body{font-family:Roboto,"Segoe UI","Helvetica Neue",Arial,sans-serif}
#roundTxt{left:119px;top:43px;font-size:25px;color:#8d96a3;font-weight:400}
.zone .zn{font-weight:500;color:rgba(135,205,228,.88);font-size:46px;text-shadow:0 1px 0 #0a4a6455}
.zone .zn em{font-weight:400;font-size:40px;margin-left:12px}
.zone .zt,.zone .zb{font-size:22px;font-weight:400}
.zone .zt{color:#e8b94f}
#resultTxt{top:508px}
#resLabel{font-size:44px;font-weight:500;color:#ffe83a;text-shadow:0 2px 3px #0008}
#resTotal{left:466px;top:62px;font-size:42px;font-weight:400}
#diceArea{top:572px}
#diceArea .die{width:58px;height:58px}
#diceArea .die[data-i="0"]{left:251px;--r:-8deg}
#diceArea .die[data-i="1"]{left:321px;--r:4deg}
#diceArea .die[data-i="2"]{left:391px;--r:-3deg}
@keyframes dpop{0%{transform:scale(.3) translateY(-60px) rotate(-120deg);opacity:0}100%{transform:scale(1) translateY(0) rotate(var(--r,0));opacity:1}}
.modal{background:rgba(0,0,0,.22)}
/* history */
.hist{left:45px;width:630px;top:270px;height:635px;background:rgba(222,160,62,.9);border:2px solid #f6c067;border-radius:12px}
.tab{font-size:30px;font-weight:400;height:84px;color:#7a4a12;background:linear-gradient(#c58426,#b3721d);clip-path:none}
.tab.on{background:linear-gradient(#f9b94a,#ec8f12);color:#fff;text-shadow:0 2px 2px #9a5a0088}
.hrow{height:100px}
.hrow .new{background:#c4161c;border:0;border-radius:4px;font-weight:500;font-size:27px;padding:4px 14px;left:32px;box-shadow:inset 0 0 0 1px #ff8a8a55}
.hrow .tot{font-size:36px;font-weight:300}
.modal:has(.hist) .xbtn{left:588px;top:222px;width:58px;height:58px;font-size:48px}
.xbtn{background:radial-gradient(circle at 50% 30%,#e9a93a,#b9741a);border:4px solid #f2c262;color:#4a2a08}
/* rank */
.rank{top:248px;height:642px;left:38px;width:644px;border:3px solid #f2c765;background:linear-gradient(#85163a,#5d1330);border-radius:20px}
.xbtn.red{left:648px;top:580px;top:213px;width:64px;height:64px;background:radial-gradient(circle at 50% 30%,#ff9ab0,#e0305f);border:5px solid #ffd3dc;font-weight:400}
.rh{font-size:24px;font-weight:400;color:#d6d6d6}
.rr .rk{font-weight:400}
/* rule */
.rule{left:10px;width:700px;top:237px;height:651px;background:#17689b;border:2px solid #0f4b73;border-radius:22px}
.rule-h{height:68px;font-size:40px;font-weight:500;background:#ecb93f;-webkit-text-stroke:0;text-shadow:-2px -2px 0 #2a2a2a,2px -2px 0 #2a2a2a,-2px 2px 0 #2a2a2a,2px 2px 0 #2a2a2a,0 3px 0 #2a2a2a}
.rule-h button{right:18px;top:8px;font-size:54px;text-shadow:-2px -2px 0 #1b5a8a,2px 2px 0 #1b5a8a}
.rule-b{padding:34px 12px;font-size:30px;line-height:38px}
.rule-b p{margin-bottom:41px}
.rule-b p:last-child{margin-top:-4px}
/* win */
.win-laurel{position:absolute;top:140px;width:70px;height:220px;z-index:-0;opacity:.95}
.win-laurel.l{left:30px}.win-laurel.r{right:30px;transform:scaleX(-1)}
.win-bulb{position:absolute;width:20px;height:20px;border-radius:50%;background:radial-gradient(#fff,#ffd54a 60%,#c98a0a);box-shadow:0 0 12px #ffe27a}

/* ======== real image assets ======== */
.round-btn{background:none!important;border:0!important;box-shadow:none!important;width:62px;height:62px;font-size:0;background-size:100% 100%!important}
.round-btn.big{width:84px;height:84px}
#btnClose{background:url(assets/btn-close.png) center/100% 100% no-repeat!important}
#btnHelp{background:url(assets/btn-help.png) center/100% 100% no-repeat!important}
#btnSound{background:url(assets/btn-sound.png) center/100% 100% no-repeat!important}
#btnUsers{background:url(assets/btn-users.png) center/100% 100% no-repeat!important}
#btnSound #sndSlash{display:none;position:absolute;left:10px;right:10px;top:50%;height:4px;background:#fff;border-radius:2px;transform:rotate(-45deg);box-shadow:0 0 0 1.5px #1b2c47}
#btnSound.off{opacity:.75}#btnSound.off #sndSlash{display:block}
.pl{width:118px;height:140px;top:-2px}
.pl img{position:absolute;left:0;top:0;width:118px;height:140px;display:block}
#players{top:112px}
.pl{left:auto}
#btnTrophy{left:600px;top:275px;width:86px;height:80px}
#btnTrophy img{width:86px;height:48px;display:block}
#btnTrophy span{bottom:auto;top:44px;left:12px;right:12px}
.rail{background:none!important;height:76px;width:252px;top:-43px}
.rail::before,.rail::after{display:none!important}
.rail.left{left:0;background:url(assets/rail-l.png) no-repeat!important;background-size:100% 100%!important}
.rail.right{right:0;left:auto;background:url(assets/rail-r.png) no-repeat!important;background-size:100% 100%!important}
#cupWrap{left:0;top:270px;width:720px;height:330px}
#cup{left:0;top:0;width:720px;height:330px;transition:transform .55s cubic-bezier(.3,1.2,.5,1),opacity .4s}
#cup img{position:absolute;left:238px;top:0;width:244px;height:252px;clip-path:inset(0 3% 0 3%)}
#cup.glass img{left:212px;top:-12px;width:296px;height:280px;clip-path:polygon(12% 0,88% 0,88% 30%,100% 30%,100% 100%,0 100%,0 30%,12% 30%)}
#cup.lift{transform:translateY(-120px);opacity:0}
.chip{width:82px;height:82px;top:27px;background:none}
.chip img{width:100%;height:100%;display:block;pointer-events:none;filter:drop-shadow(0 4px 4px #000a)}
.chip.sel::before{inset:-8px}
#chips .chip:nth-child(1){left:183px}#chips .chip:nth-child(2){left:279px}#chips .chip:nth-child(3){left:375px}#chips .chip:nth-child(4){left:471px}
#btnAgain{left:566px;top:30px;width:152px;height:70px;font-size:0;background:url(assets/btn-again.png) center/100% 100% no-repeat;border:0;box-shadow:none}
#coinIcon{left:2px;top:64px;width:52px;height:52px}#coinIcon img{width:100%;height:100%}
#winPop{left:30px;top:376px;width:664px;height:382px}
#winPop::before{display:none}
.win-img{position:absolute;left:0;top:0;width:664px;height:250px}
.win-amt{left:0;right:0;top:242px;height:136px;z-index:1;margin:0 0}
.xbtn,.rule-h button{font-size:0!important;color:transparent!important}
.modal:has(.hist) .xbtn{background:url(assets/x-gold.png) center/100% 100% no-repeat!important;border:0!important;box-shadow:none!important;width:56px;height:56px}
.xbtn.red{background:url(assets/x-red.png) center/100% 100% no-repeat!important;border:0!important;box-shadow:none!important;width:66px;height:66px}
.rule-h button{background:url(assets/x-rule.png) center/100% 100% no-repeat;width:48px;height:48px;top:10px}
#cup.glass.tilt{transform:rotate(7deg) translate(6px,-10px)}
#cup.glass.shake img{animation:domeshake .14s linear infinite}
@keyframes domeshake{0%{transform:translate(-5px,-3px) rotate(-2deg)}50%{transform:translate(5px,3px) rotate(2deg)}100%{transform:translate(-5px,-3px) rotate(-2deg)}}
#cup.closed.shake img{animation:domeshake .14s linear infinite}

/* ======== real dice faces + clock ======== */
.die,.mini-dice i{background:transparent center/contain no-repeat;box-shadow:none;display:block;padding:0;border-radius:0;filter:drop-shadow(0 3px 3px #0006)}
.mini-dice i{width:38px;height:38px}
#diceArea .die{width:62px;height:62px}
.hrow .die{width:58px;height:58px}
#clock{left:64px;top:482px;width:106px;height:118px;border:0;border-radius:0;background:url(assets/clock.png) center/100% 100% no-repeat;box-shadow:none;display:block}
#clock::before{display:none}
#clockNum{position:absolute;left:0;right:0;top:46px;text-align:center;font-size:50px;font-weight:400;line-height:56px;color:#fff;text-shadow:0 1px 2px #0a3a7a88}
#clock.warn{border:0;animation:cshake .5s infinite}
#clock.warn #clockNum{color:#ff2a2a}
@keyframes cshake{0%,100%{transform:rotate(0)}25%{transform:rotate(-7deg)}75%{transform:rotate(7deg)}}

/* ======== loader clone ======== */
#loading{display:block;background:#000;--x:0}
#loading::before{display:none}
#lstage{position:absolute;left:50%;bottom:0;width:720px;height:1142px;transform-origin:50% 100%;background:#6f9bdc url(assets/loading-bg.png) 0 0/720px 1142px no-repeat}
.load-bar{position:absolute;left:116px;top:538px;width:488px;height:64px;border-radius:32px;background:#1a2339;border:5px solid #9aa1b1;box-shadow:0 0 0 2px #656e82,inset 0 4px 8px rgba(0,0,0,.65);overflow:hidden}
.load-fill{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:27px;background:linear-gradient(#ffc247 0%,#f7a21a 45%,#ee8310 100%);overflow:hidden;box-shadow:inset 0 3px 4px rgba(255,255,255,.45);transition:width .15s linear}
.load-fill i{position:absolute;inset:0;background:repeating-linear-gradient(115deg,rgba(235,110,10,.55) 0 13px,transparent 13px 30px);animation:lstripe 1s linear infinite}
@keyframes lstripe{to{background-position:30px 0}}
#loadTxt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:400;color:#fff;text-shadow:0 1px 2px #0007;z-index:2}

/* ======== selected chip like the original ======== */
.chip.sel{transform:translateY(-27px) scale(1.18)}
.chip.sel::before{inset:-6px;background:radial-gradient(circle,rgba(210,215,225,.22) 58%,rgba(235,240,250,.45) 64%,rgba(255,255,255,.12) 74%,transparent 76%);box-shadow:0 0 12px rgba(255,255,255,.35)}
.mc{width:38px;height:38px}

/* ======== chip tray size/position matched to the original ======== */
.chip{top:36px;width:78px;height:78px}
#chips .chip:nth-child(1){left:185px}#chips .chip:nth-child(2){left:281px}#chips .chip:nth-child(3){left:377px}#chips .chip:nth-child(4){left:473px}
.chip.sel{transform:translateY(-27px) scale(1.04)}
.chip.sel::before{inset:-6px}

/* ======== background colours sampled from the original screenshot ======== */
#stage{background:linear-gradient(180deg,#030509 0,#030509 40px,#040b11 110px,#0a1220 210px,#0c1425 250px,#0d1727 290px,#161320 370px,#161320 395px)}
#stage::before{background:radial-gradient(ellipse 60% 40% at 50% 12%,rgba(10,50,70,.28),transparent 70%),radial-gradient(ellipse 30% 20% at 72% 22%,rgba(30,70,100,.12),transparent 70%);height:395px}
#table{background:radial-gradient(ellipse 72% 58% at 50% 44%,#32aac0 0%,#2790a6 28%,#217b94 52%,#1b5568 82%,#15414c 100%)}
#table::before{background:linear-gradient(180deg,rgba(3,28,38,.85) 0,rgba(6,44,55,.55) 6%,transparent 16%),linear-gradient(0deg,rgba(8,40,58,.7) 0,transparent 8%)}

/* ======== clock: size/position + video animation ======== */
#clock{left:62px;top:442px;width:106px;height:118px}
#clockNum{top:40px;font-size:48px;line-height:56px}
#clock.flipin{animation:cflip .32s ease-out}
@keyframes cflip{0%{transform:perspective(500px) rotateY(88deg) scale(.9)}100%{transform:perspective(500px) rotateY(0) scale(1)}}
#clock.warn{animation:cswing .7s ease-in-out infinite;transform-origin:50% 22%}
@keyframes cswing{0%,100%{transform:rotate(0)}30%{transform:rotate(-7deg)}70%{transform:rotate(6deg)}}

/* ======== real bar texture + "New" box ======== */
#bottom{background:#0e0c19 url(assets/bar-bg.png) 0 0/100% 100% no-repeat}
#histBox{left:513px;top:433px;width:197px;height:90px;background:url(assets/newbox.png) 0 0/100% 100% no-repeat;border:0;box-shadow:none;border-radius:0}
#histBox .arrow,#histBox b{display:none}
.mini-dice{position:absolute;left:0;top:0;right:auto;bottom:auto;width:100%;height:100%;display:block}
.mini-dice i{position:absolute;top:36px;width:40px;height:40px}
.mini-dice i:nth-child(1){left:31px}.mini-dice i:nth-child(2){left:78px}.mini-dice i:nth-child(3){left:124px}

/* history popup: translucent like the original (table shows through) */
.hist{background:rgba(224,160,60,.74)}
.hist .tab{background:linear-gradient(rgba(190,128,34,.9),rgba(172,112,28,.9))}
.hist .tab.on{background:linear-gradient(#fbbc4f,#ee9216)}

/* dice inside the dome */
#domeDice{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;display:none}
#cup.glass #domeDice{display:block}
#domeDice i{position:absolute;left:0;top:0;width:48px;height:48px;background:center/contain no-repeat;filter:drop-shadow(0 3px 3px #0007)}
#cup.glass.shake img{animation:none}

/* ======== cup <-> dome transitions as in the video ======== */
#cup #cupImg{position:absolute;left:238px;top:0;width:244px;height:252px;clip-path:inset(0 3% 0 3%);opacity:1;transition:opacity .55s ease,transform .55s ease;transform-origin:50% 90%}
#cup #domeImg{position:absolute;left:212px;top:-12px;width:296px;height:280px;clip-path:polygon(12% 0,88% 0,88% 30%,100% 30%,100% 100%,0 100%,0 30%,12% 30%);opacity:0;transform:scale(.88);transform-origin:50% 78%;transition:opacity .6s ease,transform .6s ease-out}
#cup.glass #cupImg{left:238px;top:0;width:244px;height:252px;clip-path:inset(0 3% 0 3%);opacity:0;transform:scale(.94);animation:none}
#cup.glass #domeImg{opacity:1;transform:scale(1);animation:none}
#cup.glass.shrink #domeImg{transform:scale(.9) translateY(-6px);opacity:.15;transition:opacity .45s ease,transform .45s ease}
#cup.glass.shrink #cupImg{opacity:1;transform:scale(1)}
#cup.closed #cupImg{opacity:1;transform:none}
#cup.closed #domeImg{opacity:0;transform:scale(.88)}
#cup.lift,#cup.glass.tilt{transform:none;opacity:1}
#rollInfo{position:absolute;left:0;width:720px;top:462px;text-align:center;z-index:6;opacity:0;transition:opacity .3s;pointer-events:none}
#rollInfo.show{opacity:1}
#rollInfo b{display:block;font-weight:400;font-size:24px;color:rgba(255,255,255,.5)}
#rollInfo span{display:block;font-size:17px;color:rgba(255,255,255,.4)}
#rollInfo p{margin-top:62px;font-size:13px;color:#e6c84a}

/* ======== cup lifts off the dome / descends over it (video frames 28s and 36.6-37.4s) ======== */
#cup #cupImg{z-index:3;transition:transform .8s cubic-bezier(.4,0,.3,1),opacity .8s ease;transform:none;opacity:1}
#cup #domeImg{z-index:1;transition:none;opacity:0;transform:none}
#domeDice{z-index:2}
#cup.closed #cupImg{opacity:1;transform:none}
#cup.closed #domeImg{opacity:0}
#cup.glass #domeImg{opacity:1;transform:none}
#cup.glass #cupImg{opacity:0;transform:translateY(-100px) scale(1.04)}
#cup.glass.cover #cupImg{opacity:1;transform:none}

/* ======== cup descent as in the video (36.2-37.3s): dome shrinks, ghost cup drops in with a small bounce ======== */
#cup.glass #cupImg{transform:translateY(-70px) scale(1.05)}
#domeDice{transform-origin:360px 206px}
#cup #domeImg,#cup #domeDice{transition:transform .35s ease}
#cup.glass.shrink #domeImg,#cup.glass.shrink #domeDice{transform:scale(.9) translateY(-6px);opacity:1}
#cup.glass.shrink.cover #cupImg{opacity:1;transform:none;transition:transform .6s cubic-bezier(.25,1.45,.5,1),opacity .4s ease}
#cup.glass.shrink:not(.cover) #cupImg{opacity:0;transform:translateY(-70px) scale(1.05)}
#cup.glass.shrink.cover #domeImg,#cup.glass.shrink.cover #domeDice{opacity:0;transition:opacity .25s .4s,transform .35s ease}

/* ======== roll info above/over the dome (matches the video frame) ======== */
#rollInfo{top:484px;padding-left:86px;box-sizing:border-box}
#rollInfo b{font-size:28px;line-height:32px;color:rgba(255,255,255,.92);font-weight:400;text-shadow:0 1px 3px #0008}
#rollInfo span{font-size:20px;line-height:28px;color:rgba(255,255,255,.9);text-shadow:0 1px 3px #0008}
#rollInfo p{margin-top:26px;font-size:17px;line-height:20px;color:#e6d44a;padding-right:86px;white-space:nowrap}
#rollInfo p em{font-style:normal;margin-left:8px;font-size:13px}

/* avatar circle left of the name (video 29-33s) */
#rollInfo .rollAv{position:absolute;left:205px;top:-9px;width:82px;height:82px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#97404f,#762f3d 70%);border:2px solid rgba(255,190,190,.4);box-shadow:0 2px 6px rgba(0,0,0,.4)}

/* translucent dark band behind the name (matches the reference frame) */
#rollInfo::before{content:"";position:absolute;left:0;top:-29px;width:720px;height:152px;z-index:-1;background:linear-gradient(rgba(0,0,0,.36),rgba(0,0,0,.32) 80%,rgba(0,0,0,.22));border-top:1px solid rgba(255,255,255,.4)}
#rollInfo{isolation:isolate}
#rollInfo .rollAv{display:none}

/* no full-width band in the reference: only a hairline; dome sits lower so the name overlaps the black plate */
#rollInfo::before{top:-42px;height:1px;background:linear-gradient(90deg,transparent 0,rgba(255,255,255,.45) 28%,rgba(255,255,255,.45) 100%);border:0}
#cup #domeImg{top:33px}
#domeDice{top:45px;transform-origin:360px 251px}

/* text centred on the dome (x=360) */
#rollInfo{padding-left:0}
#rollInfo p{padding-right:0}

/* translucent black box behind the name */
#rollInfo b{position:relative}
#rollInfo b::before{content:"";position:absolute;left:50%;top:-10px;width:262px;height:72px;margin-left:-131px;border-radius:14px;background:rgba(0,0,0,.38);z-index:-1;box-shadow:0 0 0 1px rgba(255,255,255,.06)}
#rollInfo b::before{top:-16px;width:320px;height:92px;margin-left:-160px;border-radius:18px}

/* match the reference: the dark backdrop is the dome plate (~286px wide), not a rectangle */
#rollInfo b::before{top:-14px;width:286px;height:104px;margin-left:-143px;border-radius:50% 50% 46% 46% / 40% 40% 60% 60%;background:radial-gradient(ellipse at 50% 40%,rgba(0,0,0,.18),rgba(0,0,0,.42) 75%);box-shadow:none}

/* ======== marked style: big rounded translucent black panel behind dome-bottom + name + line ======== */
#rollInfo b::before{display:none}
#rollInfo::before{content:"";position:absolute;left:-10px;top:-54px;width:714px;height:226px;z-index:-1;border-radius:62px;border:0;background:linear-gradient(rgba(0,0,0,.34),rgba(0,0,0,.30));box-shadow:inset 0 0 0 1px rgba(255,255,255,.05)}
#rollInfo::after{content:"";position:absolute;left:0;top:-41px;width:100%;height:1px;z-index:-1;background:linear-gradient(90deg,transparent 0,rgba(255,255,255,.45) 28%,rgba(255,255,255,.45) 100%)}
#rollInfo{z-index:4}

/* panel stays during the result stage; only the name/line text fades out */
#rollInfo{z-index:3}
#rollInfo b,#rollInfo span,#rollInfo p{transition:opacity .25s}
#rollInfo.res b,#rollInfo.res span,#rollInfo.res p{opacity:0}

/* panel moved ~28px lower */
#rollInfo::before{top:-26px}
#rollInfo::after{top:-13px}

/* panel above the New box; dice + result label stay on top of the panel */
#rollInfo{z-index:5}
#diceArea,#resultTxt{z-index:6}

/* side vignette measured from the reference: table is ~54% darker at the left/right edges */
#table::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(2,24,38,.42) 0,rgba(2,24,38,.28) 8%,rgba(2,24,38,.12) 18%,rgba(2,24,38,0) 30%,rgba(2,24,38,0) 70%,rgba(2,24,38,.12) 82%,rgba(2,24,38,.28) 92%,rgba(2,24,38,.42) 100%)}
/* panel fades out toward the left/right edges */
#rollInfo::before{background:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.32) 16%,rgba(0,0,0,.32) 84%,rgba(0,0,0,0) 100%);box-shadow:none}

/* panel: longer fade toward both edges */
#rollInfo::before{background:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.08) 8%,rgba(0,0,0,.22) 20%,rgba(0,0,0,.32) 34%,rgba(0,0,0,.32) 66%,rgba(0,0,0,.22) 80%,rgba(0,0,0,.08) 92%,rgba(0,0,0,0) 100%)}

/* panel: even softer, longer fade at both edges */
#rollInfo::before{background:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.04) 10%,rgba(0,0,0,.12) 22%,rgba(0,0,0,.22) 34%,rgba(0,0,0,.30) 46%,rgba(0,0,0,.30) 54%,rgba(0,0,0,.22) 66%,rgba(0,0,0,.12) 78%,rgba(0,0,0,.04) 90%,rgba(0,0,0,0) 100%)}

/* zones (Small / Big / Triples): amount bands fade out toward left and right like the panel */
.zone .zt,.zone .zb{background:linear-gradient(90deg,rgba(10,60,85,0) 0,rgba(10,60,85,.30) 22%,rgba(10,60,85,.42) 50%,rgba(10,60,85,.30) 78%,rgba(10,60,85,0) 100%)}
.zone .zt{border-bottom:1px solid transparent;border-image:linear-gradient(90deg,rgba(111,215,238,0),rgba(111,215,238,.55) 30%,rgba(111,215,238,.55) 70%,rgba(111,215,238,0)) 1}
.zone .zb{border-top:1px solid transparent;border-image:linear-gradient(90deg,rgba(111,215,238,0),rgba(111,215,238,.55) 30%,rgba(111,215,238,.55) 70%,rgba(111,215,238,0)) 1}

/* ======== table = the real background from the reference screenshot (zones/cup/New box painted out) ======== */
#table{height:601px;border-top:0;background:#1a5466 url(assets/table-bg.png) 0 0/720px 601px no-repeat}
#table::before,#table::after{display:none!important}
#table .stitch{display:none}

/* ======== opening: cup does a quick up/down wobble, the dome plate grows out and down (video 28.0-28.85s) ======== */
@keyframes cupwob{0%{translate:0 0}30%{translate:0 -10px}55%{translate:0 1px}80%{translate:0 -10px}100%{translate:0 0}}
#cup.glass:not(.shrink) #cupImg{animation:cupwob .3s ease-out}
#cup #domeImg{transition:transform .65s cubic-bezier(.2,.75,.3,1),opacity .25s ease;transform-origin:50% 22%}
#cup.closed #domeImg{opacity:0;transform:translateY(-52px) scale(.6);transition:none}
#cup.glass #domeImg{opacity:1;transform:none}

/* ======== opening sequence tuned to the video: cup turns see-through in place first, then lifts; dice fade in with the dome ======== */
#cup.glass:not(.shrink) #cupImg{transition:opacity .55s ease-in,transform .5s cubic-bezier(.3,.6,.4,1) .15s}
#domeDice{opacity:0;transition:opacity .15s}
#cup.glass #domeDice{opacity:1;transition:opacity .35s ease .2s}
#cup.glass.shrink.cover #domeDice{opacity:0;transition:opacity .25s .4s}
#cup.glass:not(.shrink) #cupImg{transition:opacity .45s ease-out,transform .5s cubic-bezier(.3,.6,.4,1) .12s}

/* ======== zones: font + border matched to the reference ======== */
.zone{border:3px solid #78d4f0;background:rgba(120,210,235,.10);box-shadow:inset 0 0 14px rgba(140,225,250,.18)}
.zone .zn{font-family:"Open Sans",Roboto,Arial,sans-serif;font-weight:600;font-size:36px;letter-spacing:-.6px;color:rgba(122,205,226,.88);text-shadow:none}
.zone .zn em{font-family:"Open Sans",Roboto,Arial,sans-serif;font-style:normal;font-weight:600;font-size:34px;margin-left:14px;letter-spacing:0}
.zone .zt,.zone .zb{font-family:Tinos,"Times New Roman",Georgia,serif;font-weight:700;font-size:23px}
.zone .zt{color:#f2c65f}
.zone .zb{color:#fff}
.zone.has .zn{color:rgba(150,222,240,.95)}

/* ======== zones exactly like the reference (colours sampled from the screenshot) ======== */
.zone{border:4px solid #89e7fd;background:rgba(40,150,185,.04);box-shadow:inset 0 0 12px rgba(2,40,55,.32)}
.zone .zt,.zone .zb{height:31px;line-height:31px;background:rgba(8,48,64,.34);border-image:none}
.zone .zt{top:0;border-bottom:1px solid #4488a3}
.zone .zb{bottom:0;border-top:1px solid #4488a3}
.zone .zn{color:#77d9f1}
.zone.has .zn{color:#86e0f5}
.chipstack{top:31px;bottom:31px}

/* ======== zone labels: Roboto, sized to the measured reference (Small=111px wide, 35px tall) ======== */
.zone .zn{font-family:Roboto,"Segoe UI",Arial,sans-serif;font-weight:500;font-size:46px;letter-spacing:-1.6px}
.zone .zn em{font-family:Roboto,"Segoe UI",Arial,sans-serif;font-weight:500;font-size:46px;margin-left:24px;letter-spacing:4px}
#zone-big .zn em{margin-left:34px}
.zone .zn em{margin-left:12px}
#zone-big .zn em{margin-left:22px}
#zone-triple .zn em{margin-left:14px}
.zone .zn{font-weight:400;letter-spacing:-1.1px}
.zone .zn em{font-weight:400;font-size:44px;letter-spacing:4px}

/* bolder multiplication sign */
.zone .zn em u{text-decoration:none;font-weight:700;-webkit-text-stroke:.7px currentColor}

/* ======== bet chip effect (video): small chip pops in at the tap point, then fades; amount pops ======== */
.betchip{position:absolute;z-index:9;width:28px;height:28px;pointer-events:none;filter:drop-shadow(0 2px 2px rgba(0,0,0,.45));animation:betpop .85s ease-out forwards}
@keyframes betpop{0%{transform:translateY(-46px) scale(1.8) rotate(0);opacity:0}22%{transform:translateY(0) scale(1.05) rotate(var(--rot));opacity:1}34%{transform:scale(.95) rotate(var(--rot))}45%{transform:scale(1) rotate(var(--rot))}75%{opacity:1}100%{transform:scale(1) rotate(var(--rot));opacity:0}}
.zone .zb span.pop,.zone .zt span.pop{display:inline-block;animation:amtpop .35s ease-out}
@keyframes amtpop{0%{transform:scale(1.35)}100%{transform:scale(1)}}

/* ======== coin flow chips + balance flash ======== */
.fchip{position:absolute;z-index:9;pointer-events:none;filter:drop-shadow(0 2px 2px rgba(0,0,0,.45));will-change:left,top,transform}
#balance.flash{animation:balflash .6s ease-out}
@keyframes balflash{0%{transform:scale(1.25);color:#ffe27a}100%{transform:scale(1);color:#cfcfd4}}

/* profile circle back at the left of the name (as in the video); text block shifts right so the group stays centred */
#rollInfo .rollAv{display:block;left:205px;top:-21px;width:80px;height:80px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#9a3040,#7a2433 70%);border:2px solid rgba(255,190,190,.35);box-shadow:0 2px 6px rgba(0,0,0,.4)}
#rollInfo{padding-left:86px}
#rollInfo p{padding-right:86px}

/* ======== two stages as in the video: [red circle + username/betNumber] 1.3s-6.3s, then [vashisht prasad / 7000] centred without the circle ======== */
#rollInfo{padding-left:0}
#rollInfo p{padding-right:0;position:absolute;left:0;right:0;top:86px;margin:0}
#rollInfo .ph,#rollInfo .rl{position:absolute;left:0;right:0;top:0;transition:opacity .25s}
#rollInfo .ph{padding-left:86px}
#rollInfo .rl{opacity:0}
#rollInfo.real .ph{opacity:0}
#rollInfo.real .rl{opacity:1}
#rollInfo.res .ph,#rollInfo.res .rl{opacity:0}
#rollInfo .ph b,#rollInfo .rl b,#rollInfo .ph span,#rollInfo .rl span{opacity:1}

/* ======== popup fades measured from the video: fade-in ~0.18s (29.35-29.50s), name swap is instant (34.25s), fade-out ~0.12s (34.62-34.75s) ======== */
#rollInfo{transition:opacity .18s ease-out}
#rollInfo .ph,#rollInfo .rl{transition:none}
#rollInfo.res .ph,#rollInfo.res .rl{opacity:0;transition:opacity .12s linear}
#rollInfo p{transition:opacity .12s linear}
#rollInfo.res p{opacity:0}

/* profile circle a little lower */
#rollInfo .rollAv{top:-12px}

/* placeholder stage sized/positioned from the reference image: "username" ~40px (181px wide), "betNumber" ~24px, circle 80px centred on the name line */
#rollInfo .ph{top:-4px}
#rollInfo .ph b{font-size:40px;line-height:40px}
#rollInfo .ph span{font-size:24px;line-height:28px}
#rollInfo .rollAv{top:-16px}

/* profile circle lower again (+10px) */
#rollInfo .rollAv{top:-6px}

/* profile circle lower again (+10px more) */
#rollInfo .rollAv{top:4px}

/* ======== new trophy icon + the glint effect measured from the video (pulse every ~1.34s: sparkle on top + glow in the cup) ======== */
#btnTrophy{left:600px;top:275px;width:84px;height:70px;overflow:visible}
#btnTrophy .tr-img{position:absolute;left:0;top:0;width:84px;height:70px;display:block;animation:trbright 1.34s linear infinite}
#btnTrophy #trophyTime{position:absolute;left:14px;right:14px;top:44px;bottom:auto;height:16px;background:none;border:0;font-size:11px;line-height:16px;color:#fff;text-shadow:0 1px 1px rgba(80,0,0,.6);letter-spacing:.2px}
#btnTrophy .tr-glow{position:absolute;left:22px;top:6px;width:40px;height:34px;border-radius:50%;background:radial-gradient(circle,rgba(255,250,200,.95),rgba(255,214,90,.45) 45%,transparent 72%);mix-blend-mode:screen;opacity:0;animation:trglow 1.34s linear infinite;pointer-events:none}
#btnTrophy .tr-star{position:absolute;left:34px;top:-8px;width:16px;height:16px;opacity:0;animation:trstar 1.34s linear infinite;pointer-events:none;background:conic-gradient(from 0deg,transparent 0 40deg,#fff 45deg,transparent 50deg 130deg,#fff 135deg,transparent 140deg 220deg,#fff 225deg,transparent 230deg 310deg,#fff 315deg,transparent 320deg);-webkit-mask:radial-gradient(circle,#000 0,#000 18%,transparent 70%);mask:radial-gradient(circle,#000 0,#000 18%,transparent 70%);filter:drop-shadow(0 0 3px #fff)}
@keyframes trbright{0%{filter:brightness(1.12)}12%{filter:brightness(1.04)}25%{filter:brightness(1)}62%{filter:brightness(1)}84%{filter:brightness(1.3)}100%{filter:brightness(1.12)}}
@keyframes trglow{0%{opacity:.4}25%{opacity:0}62%{opacity:0}84%{opacity:1}100%{opacity:.4}}
@keyframes trstar{0%,76%{opacity:0;transform:scale(.2) rotate(0)}85%{opacity:1;transform:scale(1.15) rotate(25deg)}95%{opacity:0;transform:scale(.4) rotate(60deg)}100%{opacity:0}}
#btnTrophy .tr-star{left:31px;top:-14px;width:22px;height:22px}

/* ======== WIN popup timing measured from the video (38.15-39.70s): ghost 0.3s, pop to full at scale 1.17 -> 1.0 in 0.08s, hold ~1.1s, 2-frame fade-out ======== */
#winPop{transform-origin:50% 50%}
#winPop.show{animation:winshow2 1.55s linear forwards}
@keyframes winshow2{0%{opacity:0;transform:scale(1.17)}19%{opacity:.3;transform:scale(1.17)}20%{opacity:1;transform:scale(1.17)}25%{opacity:1;transform:scale(1)}93.5%{opacity:1;transform:scale(1)}94.8%{opacity:.72;transform:scale(1)}100%{opacity:0;transform:scale(1)}}
@keyframes winshow2{0%{opacity:0;transform:scale(1.105)}19%{opacity:.3;transform:scale(1.105)}20%{opacity:1;transform:scale(1.105)}25%{opacity:1;transform:scale(.945)}93.5%{opacity:1;transform:scale(.945)}94.8%{opacity:.72;transform:scale(.945)}100%{opacity:0;transform:scale(.945)}}

/* ======== Game Rule popup matched to the reference (sampled: panel x12-708, y237-888, header #ebb94a 67px, body #1a5d7d, text 32px/40px) ======== */
#mRule{background:rgba(0,0,0,.45)}
.rule{left:12px;width:696px;top:237px;height:651px;background:#1a5d7d;border:1px solid #05080f;border-radius:14px 14px 22px 22px;box-shadow:0 0 0 1px rgba(0,0,0,.35);overflow:hidden}
.rule-h{height:67px;line-height:67px;background:#ebb94a;font-size:44px;font-weight:400;border-bottom:1px solid #50503e;box-sizing:border-box}
.rule-b{padding:46px 9px 0;font-size:32px;line-height:40px;font-weight:400;color:#fff}
.rule-b p{margin:0 0 40px}
.rule-b{font-size:34.5px}
.rule-h{font-size:46px}

/* ======== Leaderboard popup matched to the reference screenshot (panel image with tabs baked in, table built live) ======== */
#mRank{background:rgba(0,0,0,.4)}
#mRank .rank{left:37px;top:248px;width:646px;height:644px;padding:0;border:0;border-radius:0;background:url(assets/rk-panel.png) 0 0/646px 644px no-repeat;overflow:visible;box-shadow:none}
#mRank .rank-table{position:absolute;left:18px;top:106px;width:610px;height:521px;border:2px solid #77757a;box-sizing:border-box;background:#000;overflow:hidden;border-radius:3px}
#mRank .rh{display:grid;grid-template-columns:107px 196px 156px 1fr;height:46px;background:linear-gradient(#3a3533,#212020);color:#cfcfcf;font-size:24px;line-height:44px;text-align:center;font-family:Roboto,Arial,sans-serif}
#mRank .rh span{border-right:2px solid #0d0d0d}
#mRank .rh span:last-child{border-right:0}
#mRank .rh .q{display:inline-block;width:20px;height:20px;line-height:17px;border:2px solid #cfcfcf;border-radius:50%;font-size:14px;font-weight:400;vertical-align:2px;margin-left:4px}
#mRank .rbody{height:473px;overflow-y:auto;background:#000}
#mRank .rbody::-webkit-scrollbar{width:0}
#mRank .rr{position:relative;display:grid;grid-template-columns:107px 196px 156px 1fr;height:45px;align-items:center;border-bottom:2px solid #444443;background:#000;font-family:Roboto,Arial,sans-serif;font-size:21.5px;color:#fff;text-align:center}
#mRank .rr>span{height:100%;display:flex;align-items:center;justify-content:center;border-right:2px solid #4b4b4a}
#mRank .rr>span:last-child{border-right:0}
#mRank .rr .rk{font-size:22px}
#mRank .rr .u{justify-content:flex-start;gap:7px;padding-left:4px;text-align:left;font-size:20px;line-height:20px;font-weight:500}
#mRank .rr .u img{width:38px;height:38px;flex:none;border-radius:3px;object-fit:cover}
#mRank .rr .u svg{width:38px;height:38px;flex:none;border-radius:3px}
#mRank .rr .u em{font-style:normal;display:block;width:128px;word-break:break-word}
#mRank .rr .aw{justify-content:flex-start;gap:14px;padding-left:12px}
#mRank .rr .aw i{width:26px;height:26px;border-radius:50%;background:url(assets/rk-coin.png) center/100% 100%;flex:none}
#mRank .rr .aw b{font-weight:500;width:76px;text-align:center}
#mRank .rr.top{height:56px;border-bottom:2px solid #1c1c1c;color:#472c10}
#mRank .rr.top .rkb{position:absolute;left:0;top:0;width:112px;height:56px;z-index:1}
#mRank .rr.top>span{border-right:2px solid rgba(255,255,255,.18)}
#mRank .rr.top .rk{opacity:0}
#mRank .rr.top .u{z-index:2;padding-left:3px}
#mRank .rr.top .u img{width:48px;height:48px;border-radius:2px}
#mRank .rr.top .u em{color:#2d1a08;font-size:20px;font-weight:500;width:130px}
#mRank .rr.top .aw b{color:#fff}
#mRank .rr.top .aw{background:none;position:relative}
#mRank .rr.top .aw::before{content:"";position:absolute;left:4px;right:4px;top:10px;bottom:10px;border-radius:18px;background:#472c10;z-index:0}
#mRank .rr.top .aw i,#mRank .rr.top .aw b{position:relative;z-index:1}
#mRank .rr.r1{background:linear-gradient(#fdf1a4,#e8cd6c)}
#mRank .rr.r2{background:linear-gradient(#f4f6fb,#c6c8d9)}
#mRank .rr.r3{background:linear-gradient(#f6ab88,#dc7d54)}
#mRank .rr.r2 .aw::before{background:#28272a}
#mRank .rr.r3 .aw::before{background:#392a1c}
#mRank .rr.r1 .u,#mRank .rr.r2 .u,#mRank .rr.r3 .u{color:#2d1a08}
.modal:has(#mRank) .xbtn.red,#mRank .xbtn.red{left:647px;top:210px;width:66px;height:66px;background:url(assets/rk-x.png) center/100% 100% no-repeat!important;border:0!important;box-shadow:none!important}

/* ======== My Round History popup matched to reference ======== */
.modal:has(.hist) .xbtn{top:198px;left:592px;width:48px;height:48px}
.hist #histMine .datebar{margin-top:-8px;gap:38px}
.hist .datebar button{width:29px;height:29px;border-radius:6px;background:#c27a22;border:0;font-size:19px;line-height:27px;padding:0;color:#fff3e0;box-shadow:inset 0 0 0 1px #f0b45a55}
.hist .hfoot{font-size:19px;white-space:nowrap;background:none;color:#2b1a05;padding:0 0 12px;line-height:24px;font-weight:400}
.hist .nodata{font-size:28px;padding-top:164px;color:#2b1a05}
