/* ============ HILO – responsive: whole game scales as one unit ============ */
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
:root{
  --navy:#1a1d45; --navy2:#12153a; --blue:#2a45c9;
  --orange:#ffa726; --pink:#ee3f9a;
}
html{
  /* 1rem = 10 design-px of a 360x751 phone. Fits any screen without scrolling. */
  font-size:min(calc(100vw / 36), calc(100vh / 58), 16px);
  font-size:min(calc(100vw / 36), calc(100dvh / 58), 16px);
}
html,body{height:100%;overflow:hidden;background:#0a0c22;font-family:Roboto,"Segoe UI","Helvetica Neue",Arial,sans-serif;color:#fff;touch-action:manipulation}
button{font-family:inherit;color:inherit;border:0;background:none;cursor:pointer}
button:disabled{cursor:default}

.backdrop{position:fixed;inset:0;background:
  radial-gradient(60% 50% at 20% 20%,#3a2f6b 0,transparent 70%),
  radial-gradient(60% 50% at 85% 80%,#5a2b4f 0,transparent 70%),#0a0c22;filter:blur(2px)}

.app{
  position:relative;margin:0 auto;height:100vh;height:100dvh;width:36rem;max-width:100vw;
  display:flex;flex-direction:column;overflow:hidden;background:var(--navy);
  box-shadow:0 0 6rem rgba(0,0,0,.6);
}

/* ================= ROOM ================= */
.room{position:relative;flex:1 1 auto;min-height:14rem;overflow:hidden}
.room-bg{position:absolute;inset:0;background:
  radial-gradient(18% 30% at 62% 78%,rgba(255,255,255,.55),transparent 70%),
  radial-gradient(12% 20% at 8% 70%,rgba(60,120,60,.8),transparent 70%),
  radial-gradient(14% 25% at 94% 35%,rgba(190,30,40,.85),transparent 70%),
  radial-gradient(50% 55% at 48% 105%,#3b2b2f 0,#4a3a3d 40%,transparent 75%),
  linear-gradient(180deg,#8d7c80 0%,#6a5558 45%,#4b3b45 100%);
  filter:blur(1px)}
.room::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.15),rgba(0,0,0,.25))}
.room>*:not(.room-bg){z-index:2}
.profile{position:absolute;left:.8rem;top:.85rem;width:12.2rem;height:3.7rem;border-radius:2rem;background:#1b1d40;border:1px solid #2b2f66;display:flex;align-items:center;padding:.3rem}
.avatar-ring{width:3.2rem;height:3.2rem;border-radius:50%;overflow:hidden;flex:none;border:1px solid #fff3}
.avatar-ring svg{width:100%;height:100%;display:block}
.pf-text{margin-left:.6rem;line-height:1.25;min-width:0}
.pf-text b{display:block;font-size:1.15rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:8rem}
.pf-text span{display:flex;align-items:center;gap:.4rem;font-size:1.05rem;color:#dfe3ff}
.ico-user{display:inline-block;width:.9rem;height:.9rem;background:
  radial-gradient(circle at 50% 28%,#fff 0 .22rem,transparent .24rem),
  radial-gradient(ellipse at 50% 100%,#fff 0 .38rem,transparent .4rem);}
.ico-user.pink{background:radial-gradient(circle at 50% 28%,#ff9fe0 0 .22rem,transparent .24rem),radial-gradient(ellipse at 50% 100%,#ff9fe0 0 .4rem,transparent .42rem);width:1rem;height:1rem}
.ghost-avatar{position:absolute;left:14.6rem;top:1.6rem;width:2.3rem;height:2.3rem;border-radius:50%;overflow:hidden}
.ghost-avatar svg{width:100%;height:100%;display:block}
.viewers{position:absolute;left:26.6rem;top:1.5rem;height:2.4rem;width:4.8rem;border-radius:1.2rem;background:#5b2bc9;border:1px solid #8a5cf5;display:flex;align-items:center;justify-content:center;gap:.7rem;font-size:1.1rem}
.exit-btn{position:absolute;right:.9rem;top:1.1rem;width:3.1rem;height:3.1rem;border-radius:50%;background:#1b1d40;border:1px solid #2b2f66;display:grid;place-items:center}
.exit-btn svg{width:1.7rem;height:1.7rem}
.pill{position:absolute;top:5.45rem;height:2.5rem;border-radius:1.3rem;background:#1b1d40;border:1px solid #2b2f66;display:flex;align-items:center;font-size:1.25rem;font-weight:500}
.pill.fire{left:.8rem;width:8.3rem;justify-content:space-between;padding:0 1rem 0 .5rem}
.pill.fire .flame{font-size:1.5rem;line-height:1}
.pill.fire .chev{width:1rem;height:1rem}
.pill.star{left:10rem;width:6.2rem;padding-left:0;overflow:hidden}
.pill.star .starbox{width:2.9rem;height:100%;background:#4a2bbd;display:grid;place-items:center;flex:none}
.pill.star .starbox svg{width:2rem;height:2rem}
.pill.star b{flex:1;text-align:center;font-weight:500}
.roomtimer{position:absolute;right:0;top:8.4rem;padding:.4rem 1rem;border-radius:1.4rem 0 0 1.4rem;background:#8fc2f0;color:#fff;font-size:1.5rem;font-weight:500;opacity:0;transition:.3s}
.roomtimer.show{opacity:1}
.min-btn{position:absolute;right:.9rem;top:11.1rem;width:2.5rem;height:2.5rem;border-radius:.6rem;background:#7a2fe0;display:grid;place-items:center}
.min-btn svg{width:1.6rem;height:1.6rem}
.seats{position:absolute;left:0;right:0;bottom:-2.2rem;height:6rem;display:flex;align-items:flex-start;justify-content:center;gap:0}
.seat{width:5.2rem;height:5.2rem;border-radius:50%;border:.2rem solid #d54894;background:#ffdcc8;overflow:hidden;box-shadow:0 0 1.2rem #f05aa1aa;position:relative;left:-5.5rem}
.seat svg{width:100%;height:100%}
.seat.chair{left:5.5rem;background:#151338;border-color:#f0c45c;display:grid;place-items:center;font-size:2.8rem}
.hearts{position:absolute;left:50%;transform:translateX(-50%);top:.5rem;font-size:2rem}

/* ================= GAME PANEL ================= */
.game{flex:none;height:56.4rem;background:linear-gradient(180deg,#191c45 0%,#14173c 100%);position:relative;padding:0 1.4rem;border-top:1px solid #2a2e6a}
@media (min-height:1px){.game{margin-top:auto}}
.g-head{height:3.9rem;display:flex;align-items:center;position:relative;margin:0 -.2rem}
.backbtn{width:3.8rem;height:3rem;display:grid;place-items:center;margin-left:-.1rem}
.backbtn svg{width:3.2rem;height:2rem}
.title{font-size:1.65rem;color:#8f95ff;font-weight:500;margin-left:.2rem;letter-spacing:.02rem;margin-right:auto}
.coins{display:none;align-items:center;height:3.4rem;border-radius:1.7rem;background:#1e2250;padding:0 .3rem 0 0;font-size:1.8rem;font-weight:500;margin-right:.2rem;position:relative}
.coins.on{display:flex}
.coin{width:3.2rem;height:3.2rem;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe27a,#f2a615 70%,#b86f05);display:grid;place-items:center;border:.15rem solid #ffd04a;flex:none}
.coin i{font-style:normal;color:#fff3b8;font-size:1.7rem;text-shadow:0 0 2px #b86f05}
.coin.sm{width:2.1rem;height:2.1rem}.coin.sm i{font-size:1.1rem}
.coins b{margin:0 .8rem 0 .5rem;font-weight:500;color:#e8e8ff}
.plus{width:2.8rem;height:2.8rem;border-radius:50%;background:#7fdde2;color:#17306a;font-size:2.6rem;line-height:2.7rem;display:grid;place-items:center;font-weight:600}
.ping{display:none;flex-direction:column;align-items:center;width:4.5rem;margin-right:.3rem;color:#35d84a}
.ping.on{display:flex}
.ping svg{width:3rem;height:2.4rem}
.ping small{font-size:.95rem;margin-top:-.1rem;color:inherit}
.ping.mid{color:#f5c518}
.rbtn{width:3.1rem;height:3.1rem;border-radius:50%;background:#bcc6dc;display:grid;place-items:center;margin-left:.5rem;font-size:2.2rem;font-weight:700;color:#18214a}
.rbtn svg{width:2.1rem;height:2.1rem}
.trophy{position:absolute;right:.6rem;top:5.4rem;width:4.8rem;height:4.4rem;z-index:3;display:none;cursor:pointer}
.trophy.on{display:block}
.trophy svg{width:100%;height:3.8rem;display:block;filter:drop-shadow(0 0 .5rem #f5a21a99)}
.trophy em{position:absolute;left:.4rem;right:.4rem;bottom:0;background:#b4271c;border:1px solid #f5c542;border-radius:.4rem;font-style:normal;font-size:.9rem;text-align:center;line-height:1.3rem;font-family:Georgia,serif;color:#fff}

/* history strip */
.history{height:8.5rem;border-radius:1.3rem;background:rgba(10,12,34,.55);margin:0 .2rem;position:relative;padding:.8rem 1.2rem 0;overflow:hidden;border:1px solid #ffffff08}
.ghost-hint{position:absolute;left:0;right:0;top:1.4rem;display:flex;justify-content:center;align-items:flex-start;gap:1.8rem;pointer-events:none;padding-left:0}
.ghost-hint.hide{display:none}
.ghost-hint i{font-style:normal;color:#3b4073;font-size:2.4rem;align-self:center;font-weight:700}
.gcard{width:4.2rem;height:5.7rem;border:.15rem solid #343970;border-radius:.6rem;color:#3d4378;display:flex;flex-direction:column;align-items:center;padding:.2rem}
.gcard b{align-self:flex-start;font-size:2.3rem;line-height:2.3rem;margin-left:.3rem;font-weight:500}
.gcard span{font-size:2.8rem;line-height:3rem}
.hist-row{display:flex;gap:1.1rem;align-items:flex-start;position:relative;height:100%;padding-right:1rem;overflow:hidden}
.hcard{position:relative;flex:none;width:4.9rem;animation:pop .35s ease}
.hcard .c{width:4.9rem;height:6.4rem;border-radius:.6rem;background:#f5f5f7;position:relative;box-shadow:0 .2rem .4rem #0006}
.hcard .c b{position:absolute;left:.4rem;top:.1rem;font-size:2.5rem;line-height:2.9rem;font-weight:500;letter-spacing:-.15rem}
.hcard .c small{position:absolute;left:.5rem;top:2.8rem;font-size:1.5rem;line-height:1}
.hcard .c em{position:absolute;right:.4rem;bottom:.1rem;font-style:normal;font-size:3.5rem;line-height:3.8rem}
.hcard.red .c{color:#e0242a}.hcard.blk .c{color:#16161a}
.hcard .tag{display:block;margin:.4rem auto 0;width:4.6rem;text-align:center;font-size:.95rem;color:#3fe2a6;background:#12163a;border:1px solid #2b6a5d;border-radius:1rem;line-height:1.4rem}
.hcard .win{position:absolute;right:.2rem;top:.2rem;font-size:.9rem;color:#ffc933;font-weight:700;opacity:.9}
.hcard .win.lose{color:#ff5a6a}
.hcard .dir{position:absolute;left:-1.2rem;top:2.2rem;width:1.5rem;height:1.5rem;border-radius:.4rem;background:#2b2a56;border:1px solid #fff4;z-index:2;display:grid;place-items:center;font-size:.9rem;line-height:1}
.hcard .dir.up{color:#69f0b3}.hcard .dir.down{color:#ff8da1}.hcard .dir.eq{color:#ffd36b}
.hcard.last .c{outline:.15rem solid #ffd24a}
@keyframes pop{from{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}

/* table */
.frame{position:relative;margin:.65rem .2rem 0;height:29.7rem;border-radius:1.6rem;background:linear-gradient(180deg,#1b1f4e,#161a42);padding:1.1rem 1.2rem 0}
.frame .round{position:absolute;left:3rem;top:.1rem;font-size:1.1rem;color:#4a4f89;z-index:2}
.table{position:relative;width:30.8rem;height:27.5rem;margin:0 auto;border-radius:1.6rem 1.6rem 15.4rem 15.4rem;
  background:linear-gradient(180deg,#6fd6d3 0%,#7ac7e0 30%,#7f8ee6 60%,#7a50e2 100%);box-shadow:0 0 0 .9rem #12163b inset,0 0 0 .1rem #262a66;border:.9rem solid #14173f}
.table{box-shadow:none;border:0}
.table::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 .8rem #141840;pointer-events:none;display:none}
.ring{position:absolute;inset:.8rem;border-radius:1rem 1rem 14.8rem 14.8rem;border:.1rem solid rgba(255,255,255,.28);pointer-events:none}
.pill-odds,.pill-bonus{position:absolute;top:1.85rem;height:1.9rem;line-height:1.9rem;font-size:1.35rem;font-weight:500;padding:0 .9rem;white-space:nowrap}
.pill-odds{left:0;width:8.9rem;background:#2a2e47;border-radius:0 1rem 1rem 0;color:#ff9f2e}
.pill-bonus{right:0;width:9.1rem;background:#c04ca0;border-radius:1rem 0 0 1rem;color:#ffe9f6;text-align:center}
.pill-odds b,.pill-bonus b{font-weight:500}
.pill-bonus{background:linear-gradient(90deg,#c8419f,#d150b0)}
.timer{position:absolute;left:50%;top:1.6rem;margin-left:-1.6rem;width:3.2rem;height:3.2rem;border-radius:50%;display:none;place-items:center;font-size:2rem;color:#35e684;font-weight:500;
  background:conic-gradient(#27e07a var(--p,100%),#0e3a46 0);}
.timer::before{content:"";position:absolute;inset:.3rem;border-radius:50%;background:#1b3a63}
.timer span{position:relative}
.timer.on{display:grid}
.timer.low{color:#ff7a7a}

/* main card + flip */
.cardwrap{position:absolute;left:7rem;top:7.6rem;width:7rem;height:9.2rem;perspective:60rem}
.flip{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .5s ease}
.flip.show{transform:rotateY(180deg)}
.face{position:absolute;inset:0;border-radius:.8rem;backface-visibility:hidden;-webkit-backface-visibility:hidden;border:.2rem solid #fff;box-shadow:0 .3rem .8rem rgba(0,0,0,.35)}
.face.back{background-color:#e0243f;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M10 0L20 10 10 20 0 10z' fill='%23ff6b84' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E");background-size:1.6rem 1.6rem;background-position:center}
.face.front{background:#fafafc;transform:rotateY(180deg);color:#16161a}
.face.front.red{color:#e0242a}
.face.front b{position:absolute;left:.4rem;top:.1rem;font-size:3.5rem;line-height:4rem;font-weight:500;letter-spacing:-.25rem;font-family:"Segoe UI",Arial,sans-serif}
.face.front small{position:absolute;left:.7rem;top:4.2rem;font-size:2rem;line-height:1}
.face.front em{position:absolute;right:.5rem;bottom:.1rem;font-style:normal;font-size:5.6rem;line-height:6rem}
.flip.drop .face.front{animation:none}
.cardwrap.shake{animation:shake .4s}
@keyframes shake{20%{transform:translateX(-.6rem)}40%{transform:translateX(.6rem)}60%{transform:translateX(-.4rem)}80%{transform:translateX(.4rem)}}
.cardwrap.deal{animation:deal .4s ease}
@keyframes deal{from{transform:translateY(-3rem) scale(.8);opacity:0}to{transform:none;opacity:1}}

/* hex buttons */
.hexbtn{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;font-family:Georgia,"Times New Roman",serif;color:#fff;transition:transform .15s,filter .2s;padding:0}
.hexbtn .lbl{font-size:1.4rem;line-height:1.45rem;text-shadow:0 .1rem .2rem #0005;padding:0 .2rem;white-space:normal;max-width:7rem}
.hexbtn .val{margin-top:.6rem;min-width:5.2rem;height:2.7rem;line-height:2.7rem;border-radius:1.4rem;background:#12333f;color:#ffb02e;font-family:"Segoe UI",Arial,sans-serif;font-size:1.95rem;font-weight:500;padding:0 .6rem}
.hexbtn.hi{left:16.8rem;top:4.5rem;width:7.7rem;height:7.5rem;clip-path:polygon(50% 0,100% 20%,100% 100%,0 100%,0 20%);background:linear-gradient(180deg,#1ccaa6,#2bd7b8);padding-top:1.4rem}
.hexbtn.lo{left:16.4rem;top:13rem;width:8.3rem;height:8.3rem;clip-path:polygon(0 0,100% 0,100% 80%,50% 100%,0 80%);background:linear-gradient(180deg,#f9718f,#ff8f6e);padding-bottom:1.4rem}
.hexbtn.hi::before,.hexbtn.lo::before{content:"";position:absolute;inset:.35rem;background:inherit;filter:brightness(1.08);clip-path:inherit;z-index:-1}
.hexbtn:not(:disabled):active{transform:scale(.95)}
.hexbtn:not(:disabled){animation:pulse 1.4s infinite}
@keyframes pulse{50%{filter:brightness(1.12)}}
.hexbtn:disabled{filter:saturate(.7) brightness(.62)}
.hexbtn.hi:disabled{background:#1f9a85}.hexbtn.lo:disabled{background:#c0586b}
.hexbtn.picked{outline:none;filter:brightness(1.3)}

.switch{position:absolute;left:50%;transform:translateX(-50%);top:22.1rem;height:2.2rem;padding:0 .9rem;border-radius:.6rem;background:#0c0c14;color:#fff;font-size:1.55rem;display:flex;align-items:center;gap:.4rem;white-space:nowrap;font-weight:500}
.switch svg{width:1.6rem;height:1.1rem}
.switch:disabled{opacity:.85}
.switch.small{font-size:1.35rem}
.chest{position:absolute;left:-.3rem;top:21.4rem;width:4.4rem;height:3.4rem}
.chest svg{width:100%;height:100%;filter:drop-shadow(0 .2rem .3rem #0007)}
.badge{position:absolute;right:-.2rem;top:-.9rem;min-width:2.4rem;height:2.4rem;border-radius:50%;background:#e13232;border:.15rem solid #ffd2d2;color:#fff;font-style:normal;font-size:1.4rem;line-height:2.1rem;text-align:center;display:none}
.badge.on{display:block}
.chest.open{animation:chestOpen .8s}
@keyframes chestOpen{30%{transform:scale(1.4) rotate(-8deg)}60%{transform:scale(1.4) rotate(8deg)}}
.suit{position:absolute;bottom:.7rem;font-size:3.3rem;line-height:1;opacity:.45;color:#8b93c9}
.suit.sp{left:1.1rem;color:#8c92c8}
.suit.cl{right:1rem;color:#8c92c8}

/* bet box */
.betbox{margin:.55rem .2rem 0;height:12.5rem;border-radius:1.4rem;background:linear-gradient(180deg,#171b4a,#11143a);padding:.9rem 1.4rem 0}
.bet-row{height:3.5rem;border-radius:.4rem;background:#080b2c;display:flex;align-items:center;padding:0 .5rem 0 .5rem;gap:.8rem;margin:0 -.1rem}
.bet-l{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;margin-left:.2rem}
.bet-l small{font-size:1.15rem;color:#7a82c0;line-height:1.3rem}
.bet-l b{font-family:Orbitron,"Segoe UI",Arial,sans-serif;font-style:italic;font-weight:900;font-size:1.65rem;line-height:1.9rem;color:#ffc61a;letter-spacing:.05rem;overflow:hidden;text-overflow:ellipsis}
.bbtn{height:3.2rem;min-width:2.9rem;border-radius:.4rem;background:#2a46c4;display:grid;place-items:center;box-shadow:inset 0 -.15rem 0 #1b2f90;color:#fff}
.bbtn.max{width:5.8rem;font-size:1.9rem;font-weight:500}
.bbtn i{display:block;position:relative;width:1.6rem;height:.35rem;background:#fff;border-radius:.2rem}
.bbtn i.plus2::after{content:"";position:absolute;left:.62rem;top:-.62rem;width:.35rem;height:1.6rem;background:#fff;border-radius:.2rem}
.bbtn:active:not(:disabled){filter:brightness(1.25)}
.bbtn:disabled{opacity:.5}
.main-btn{display:block;width:100%;height:3.9rem;margin-top:1.4rem;border-radius:1.5rem;font-size:2.1rem;font-weight:400;color:#fff;background:linear-gradient(180deg,#1c93ff,#0d63ee);box-shadow:0 .2rem 0 #0a3fa5,inset 0 .1rem 0 #7fc2ff;transition:filter .2s,transform .1s;margin-top:1.3rem;margin-left:0}
.main-btn:active{transform:scale(.98)}
.main-btn.cash{background:linear-gradient(180deg,#8a2d63,#7a2358);box-shadow:0 .2rem 0 #4a1236;color:#e9b4cf}
.main-btn.cash.ready{background:linear-gradient(180deg,#ffb12b,#f28e08);color:#fff;box-shadow:0 .2rem 0 #a95d00,inset 0 .1rem 0 #ffe29a;animation:glow 1.1s infinite}
@keyframes glow{50%{filter:brightness(1.15)}}
.main-btn:disabled{filter:grayscale(.2) brightness(.9)}

.toast{position:absolute;left:50%;top:52%;transform:translate(-50%,-30%) scale(.9);background:rgba(10,10,30,.92);border:1px solid #ffffff30;padding:1rem 2rem;border-radius:1.2rem;font-size:1.5rem;opacity:0;pointer-events:none;transition:.25s;z-index:30;text-align:center;max-width:30rem}
.toast.show{opacity:1;transform:translate(-50%,-50%) scale(1)}
.toast.win{color:#ffe27a}.toast.lose{color:#ff8da1}

/* ================= MODALS ================= */
.overlay{position:absolute;inset:0;background:rgba(5,6,22,.72);display:none;align-items:center;justify-content:center;z-index:50}
.overlay.show{display:flex;animation:fade .2s}
@keyframes fade{from{opacity:0}}
.x{position:absolute;right:1.5rem;top:1.5rem;font-size:2.6rem;color:#fff;width:3rem;height:3rem;line-height:3rem;text-align:center;font-weight:300}
.pink-btn{height:4.7rem;min-width:12rem;padding:0 2rem;border-radius:2.4rem;background:linear-gradient(180deg,#ff4fb0,#e72b93);font-size:2.3rem;color:#fff;box-shadow:0 .2rem 0 #a0156a}
.pink-btn.ghost{background:#2a2e66;box-shadow:none}
.blue-btn{height:4.9rem;width:16.6rem;background:linear-gradient(180deg,#2d7cff,#1b4fe0);font-size:2.4rem;color:#fff}

.win-modal{position:relative;width:27.5rem;padding:7rem 1.6rem 2.2rem;border-radius:2rem;background:linear-gradient(180deg,#1d2a92,#3d2aa6 45%,#7a3fc5);text-align:center;border:1px solid #6c6cf055}
.win-modal .god{position:absolute;left:50%;top:-6rem;width:12.6rem;height:12.6rem;margin-left:-6.3rem}
.win-modal .god svg{width:100%;height:100%}
.win-modal h3{font-weight:400;font-size:2.3rem;margin-top:1.5rem}
.win-amt{display:inline-flex;align-items:center;justify-content:space-between;width:12.4rem;height:3.2rem;border-radius:1.6rem;background:#141449;margin-top:1.3rem;padding-left:1.2rem;padding-right:.3rem;font-size:1.9rem}
.win-amt b{flex:1;font-weight:400}
.win-modal p{font-size:2.3rem;margin:1.2rem 0 1.1rem;color:#fff}

.rules-modal{width:32.6rem;height:34.5rem;border-radius:1.6rem;background:#232766;position:relative;overflow:hidden}
.rm-head{height:5rem;background:#2d3278;text-align:center;line-height:5rem;font-size:2.2rem;position:relative}
.rm-head .x{top:1rem;right:1rem}
.rm-body{padding:3rem 1.9rem 1rem;font-size:1.55rem;line-height:2.7rem;color:#fff;font-weight:400;overflow:auto;max-height:29.5rem}
.rm-body p{margin-bottom:2rem;line-height:2.7rem}

.chest-modal{position:relative;width:32.6rem;padding:6.4rem 1.7rem 3rem;border-radius:2.4rem;background:#2d2a7a;text-align:center;border:1px solid #fff1;background:linear-gradient(180deg,#3a3a8a,#2a2573)}
.chest-modal .chest-top{position:absolute;left:50%;top:-4.6rem;width:14rem;height:10.5rem;margin-left:-7rem}
.chest-top svg{width:100%;height:100%;filter:drop-shadow(0 .4rem .6rem #0008)}
.chest-modal h4{font-weight:400;font-size:2.4rem;line-height:2.4rem;color:#a7a8e6;margin-top:.3rem}
.chest-modal p{font-size:1.8rem;line-height:3.4rem;margin-top:3rem;color:#f1f1ff}
.chest-modal p.gap{margin-top:2.6rem}
.chest-modal .blue-btn{margin-top:3rem}
.chest-modal{background:#3a3189;border-radius:2.4rem}

.confirm{width:28rem;padding:2.6rem 2rem 2.2rem;border-radius:2rem;background:linear-gradient(180deg,#2d2a7a,#232766);text-align:center;border:1px solid #fff2}
.confirm h4{font-weight:500;font-size:2.4rem}
.confirm p{font-size:1.7rem;margin:1.3rem 0 2rem;color:#d7d8ff;line-height:2.4rem}
.cbtns{display:flex;gap:1.2rem;justify-content:center}
.cbtns .pink-btn{font-size:2rem;height:4.2rem;min-width:10rem}

.board{position:relative;width:34.4rem;height:61.4rem;max-height:92%;border-radius:1.8rem;border:.3rem solid #f2b84b;background:linear-gradient(180deg,#8d1f4e,#5f1740 70%,#3d0f33);padding:5.4rem 1.6rem 1.6rem;display:flex;flex-direction:column;margin-top:2rem}
.board .x.red{width:4rem;height:4rem;line-height:3.8rem;border-radius:50%;background:#e8243a;border:.2rem solid #ffd0d0;top:-1.5rem;right:-1.3rem;font-size:2.3rem;font-weight:700}
.tabs{position:absolute;top:1.3rem;left:1.3rem;right:1.3rem;display:flex;justify-content:space-between;align-items:center}
.tabs .tab{width:3.7rem;height:3.9rem;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);background:linear-gradient(180deg,#ff6868,#c32a43);display:grid;place-items:center;font-family:Georgia,serif;font-weight:700;font-size:1.7rem;color:#ffe1e1;opacity:.75;position:relative}
.tabs .tab.on{opacity:1;background:linear-gradient(180deg,#ffc9c9,#f06b7d);color:#7a1230}
.tabs .crown{font-size:3.6rem;filter:drop-shadow(0 0 .6rem #ff8a1c)}
.tbl-head{font-size:1.7rem !important;display:grid;grid-template-columns:4.6rem 1fr 7.4rem 7.8rem;height:3.8rem;border:1px solid #c8a4b0;background:rgba(40,10,30,.5);border-radius:.6rem .6rem 0 0;align-items:center;text-align:center;font-size:1.9rem;color:#f0dfe8;margin-top:.2rem}
.tbl-head span{border-right:1px solid #c8a4b055;height:100%;line-height:3.8rem}
.tbl-head span:last-child{border:0}
.tbl-head i{display:inline-grid;place-items:center;width:1.8rem;height:1.8rem;border:1px solid #fff9;border-radius:50%;font-style:normal;font-size:1.2rem;vertical-align:middle}
.rows{flex:1;overflow-y:auto;border:1px solid #c8a4b0;border-top:0;background:#0d0d10;scrollbar-width:none}
.rows::-webkit-scrollbar{display:none}
.lrow{display:grid;grid-template-columns:4.6rem 1fr 7.4rem 7.8rem;height:4.4rem;align-items:center;font-size:1.9rem;color:#e9e9ee;border-bottom:1px solid #262630}
.lrow .rk{text-align:center}
.lrow .un{display:flex;align-items:center;gap:.5rem;padding:0 .4rem;font-size:1.65rem;line-height:1.7rem;overflow:hidden;height:100%}
.lrow .un img,.lrow .av{width:3.4rem;height:3.4rem;border-radius:.3rem;flex:none;background:#444;display:block}
.lrow .un span{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
.lrow .pt{text-align:center;font-size:1.55rem}
.lrow .aw{display:flex;align-items:center;justify-content:center;font-size:1.6rem;white-space:nowrap}.lrow .aw>span{display:flex;align-items:center;gap:.4rem;white-space:nowrap}
.lrow.top1{background:linear-gradient(90deg,#e6b43c,#f6dc86 40%,#e7b63e);color:#3b2a08;height:5.2rem}
.lrow.top2{background:linear-gradient(90deg,#8a82bd,#e0def2 40%,#9e98cb);color:#2a2750;height:5.2rem}
.lrow.top3{background:linear-gradient(90deg,#c4642c,#ee9a62 40%,#c9672e);color:#4a1d08;height:5.2rem}
.lrow.top1 .rk,.lrow.top2 .rk,.lrow.top3 .rk{font-family:Georgia,serif;font-style:italic;font-weight:900;font-size:3.6rem;color:#fff;text-shadow:0 .1rem .3rem #0007;-webkit-text-stroke:.1rem #0004}
.lrow.top1 .rk{background:linear-gradient(90deg,#d24c8f,#e665a0);height:100%;line-height:5.2rem}
.lrow.top2 .rk{background:linear-gradient(90deg,#6c4fb7,#8f72d6);height:100%;line-height:5.2rem}
.lrow.top3 .rk{background:linear-gradient(90deg,#d65b2a,#ec7b3f);height:100%;line-height:5.2rem}
.lrow.top1 .aw span,.lrow.top2 .aw span,.lrow.top3 .aw span{background:#14143c;color:#fff;border-radius:1rem;padding:.3rem 1rem .3rem .4rem;display:flex;align-items:center;gap:.4rem;border:1px solid #ffffff55;min-width:0;justify-content:center}
.lrow .aw .coin{width:2.2rem;height:2.2rem}.lrow .aw .coin i{font-size:1.2rem}

/* ================= LOADER ================= */
.loader{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#4a43a2 0%,#5b66bd 40%,#6f98dd 75%,#7bb0ec 100%);transition:opacity .4s}
.loader.hide{opacity:0;pointer-events:none}
.bubbles{position:absolute;inset:0;background:
  radial-gradient(circle at 12% 88%,rgba(110,140,240,.45) 0 3%,transparent 3.2%),
  radial-gradient(circle at 80% 78%,rgba(110,140,240,.4) 0 5%,transparent 5.2%),
  radial-gradient(circle at 25% 72%,rgba(110,140,240,.45) 0 4%,transparent 4.2%),
  radial-gradient(circle at 90% 55%,rgba(110,140,240,.35) 0 3%,transparent 3.2%)}
.lbar{position:relative;width:min(47.6rem,86vw);height:min(5.4rem,11vw);min-height:34px;border-radius:999px;border:.35rem solid #98a0b6;background:#1a2040;overflow:hidden;box-shadow:0 .3rem 1rem #0004}
.lfill{height:100%;width:0;border-radius:999px;background:repeating-linear-gradient(115deg,#ffa31a 0 1.4rem,#f58a05 1.4rem 2.8rem);transition:width .12s linear}
.lbar span{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:min(2.3rem,4.6vw);text-shadow:0 .1rem .2rem #0006}.lrow .un{font-size:1.4rem}
.lrow .un .av{width:3rem;height:3rem}
.lrow.top1 .rk,.lrow.top2 .rk,.lrow.top3 .rk{font-size:3rem}
.lrow .aw .coin{width:1.9rem;height:1.9rem}

/* ===== Fixed layout: black space on top, game UI pinned to the bottom (all screens) ===== */
html,body,.backdrop{background:#000}
.backdrop{display:none}
.app{background:#000;box-shadow:none}
.room{background:#000;min-height:0}
.room>*{display:none !important}
.room::after{display:none}
.game{margin-top:auto;flex:none;padding-bottom:env(safe-area-inset-bottom)}

/* ===================== TYPOGRAPHY + POPUPS: clone-accurate pass ===================== */
/* header */
.title{font-size:1.45rem;font-weight:400}
.coins{font-size:1.4rem}
.coins b{font-weight:400}
.rbtn{font-size:1.8rem}
.ping small{font-size:.85rem}
/* table */
.pill-odds,.pill-bonus{font-size:1.2rem;font-weight:400}
.timer{font-size:1.6rem}
.hexbtn{padding:0 !important}
.hexbtn .lbl{position:absolute;left:0;right:0;top:2.4rem;font-size:1.1rem;line-height:1.3rem;white-space:nowrap;max-width:none;padding:0;letter-spacing:-.02rem}
.hexbtn .val{position:absolute;left:50%;transform:translateX(-50%);top:4.9rem;margin:0;min-width:0;width:5rem;height:1.5rem;line-height:1.5rem;font-size:1.2rem;border-radius:.8rem;padding:0;background:#10313b}
.hexbtn.lo .lbl{top:2.1rem}.hexbtn.lo .val{top:4.8rem}
.switch{font-size:1.3rem;height:2.2rem;border-radius:.5rem}
.switch.small{font-size:1.3rem}
.chest .badge{font-size:1.1rem;min-width:1.9rem;height:1.9rem;line-height:1.6rem}
/* bet */
.bet-l small{font-size:.9rem}
.bet-l b{font-size:1.2rem;line-height:1.4rem}
.bbtn.max{font-size:1.5rem;font-weight:400}
.main-btn{font-size:1.5rem;border-radius:2rem;font-weight:400}
.toast{font-size:1.2rem}

/* ---- win popup ---- */
.win-modal{width:27.5rem;padding:5.2rem 1rem 1.4rem;border-radius:1.4rem;
  background:radial-gradient(60% 40% at 80% 70%,rgba(255,255,255,.08),transparent 70%),linear-gradient(180deg,#232f9a 0%,#4a2fb0 50%,#7a3fc7 100%)}
.win-modal .god{top:-8rem;width:9rem;height:9rem;margin-left:-4.5rem}
.win-modal .x{top:1.3rem;right:1.5rem;font-size:1.9rem;font-weight:300;width:2.4rem;height:2.4rem;line-height:2.4rem}
.win-modal h3{font-size:1.45rem;font-weight:400;margin-top:1.8rem}
.win-amt{width:15rem;width:14.5rem;height:3.2rem;height:1.6rem;border-radius:.8rem;margin-top:1.5rem;padding:0;position:relative;justify-content:center;font-size:1.2rem;background:#12154a}
.win-amt b{flex:none;text-align:center;font-weight:400;margin-left:-1rem}
.win-amt .coin.sm{position:absolute;right:-.2rem;top:-.1rem;width:1.8rem;height:1.8rem}
.win-modal p{font-size:1.35rem;margin:1.1rem 0 1rem}
.pink-btn{height:3rem;min-width:9.5rem;padding:0 1.5rem;font-size:1.5rem;border-radius:1.5rem;border:.15rem solid #ff9bd4;background:linear-gradient(180deg,#ff4fb4,#ec2f9a);box-shadow:none}
.pink-btn.ghost{background:#2a2e66;border-color:#4a4f99}

/* ---- rules popup ---- */
.rules-modal{width:29.5rem;height:35.3rem;border-radius:1.3rem;background:#20245a}
.rm-head{height:4.4rem;line-height:4.4rem;font-size:1.5rem;background:#2b3070}
.rm-head .x{top:.9rem;right:1.1rem;font-size:2.2rem;width:2.6rem;height:2.6rem;line-height:2.6rem}
.rm-body{padding:3.2rem 1.9rem 1rem;font-size:1.15rem;line-height:1.65rem;max-height:30.9rem}
.rm-body p{margin-bottom:1.65rem;line-height:1.65rem;color:#f2f2ff}

/* ---- treasure popup ---- */
.chest-modal{width:29.5rem;height:33.2rem;padding:4.2rem 1.4rem 0;border-radius:2rem;background:#2f2c80}
.chest-modal .chest-top{top:-4rem;width:7.5rem;height:6rem;margin-left:-3.75rem}
.chest-modal .x{top:2.1rem;right:2rem;font-size:2.2rem;font-weight:300}
.chest-modal h4{font-size:1.6rem;line-height:1.55rem;color:#a6a3ec;margin-top:0}
.chest-modal p{font-size:1.15rem;line-height:1.85rem;margin-top:2rem}
.chest-modal p.gap{margin-top:2.7rem}
.chest-modal .blue-btn{margin-top:2.6rem;height:2.5rem;width:8.3rem;font-size:1.3rem;background:linear-gradient(180deg,#2f6cff,#1a52e8);border-radius:.2rem}

/* ---- exit confirm ---- */
.confirm{width:26rem;padding:2.2rem 1.6rem 1.8rem;border-radius:1.4rem}
.confirm h4{font-size:1.6rem;font-weight:400}
.confirm p{font-size:1.2rem;line-height:1.8rem;margin:1rem 0 1.6rem}
.cbtns .pink-btn{font-size:1.4rem;height:3rem;min-width:8.5rem}

/* ---- leaderboard ---- */
.board{width:31.8rem;height:31.8rem;max-height:none;margin-top:0;padding:5.25rem .9rem .9rem;border:.3rem solid #f1b94a;border-radius:1.4rem;background:linear-gradient(180deg,#8e1c4c,#701845 60%,#4e1239)}
.board .x.red{width:3.1rem;height:3.1rem;line-height:2.8rem;top:-1.55rem;right:-1.55rem;font-size:1.8rem;border-width:.15rem;font-weight:700}
.tabs{top:1.6rem;left:1.8rem;right:1.2rem}
.tabs .tab{width:2.5rem;height:2.4rem;font-size:1.2rem}
.tabs .crown{font-size:3rem;line-height:1;margin-top:-.4rem}
.tbl-head,.lrow{grid-template-columns:5.3rem 9.6rem 7.6rem 1fr}
.tbl-head{height:2.4rem;font-size:1.45rem !important;border-radius:.3rem .3rem 0 0;background:rgba(60,15,40,.55)}
.tbl-head span{line-height:2.4rem}
.tbl-head i{width:1.3rem;height:1.3rem;font-size:.9rem}
.lrow{height:2.2rem;font-size:1.2rem;color:#f0f0f5}
.lrow .un{font-size:1.1rem;line-height:1.1rem;padding:0 .3rem;gap:.4rem}
.lrow .un .av{width:2rem;height:2rem;font-size:1rem;border-radius:.2rem}
.lrow .pt{font-size:1.2rem}
.lrow .aw{font-size:1.2rem}
.lrow .aw .coin{width:1.5rem;height:1.5rem;margin-right:.3rem}.lrow .aw .coin i{font-size:.9rem}
.lrow.top1,.lrow.top2,.lrow.top3{height:2.65rem}
.lrow.top1 .rk,.lrow.top2 .rk,.lrow.top3 .rk{font-size:2.4rem;line-height:2.65rem;font-weight:900}
.lrow.top1 .rk sup,.lrow.top2 .rk sup,.lrow.top3 .rk sup{font-size:1.1rem !important}
.lrow.top1 .aw span,.lrow.top2 .aw span,.lrow.top3 .aw span{padding:.2rem .8rem .2rem .3rem;border-radius:.8rem;font-size:1.2rem;min-width:5.4rem}
.lrow.top1 .aw .coin,.lrow.top2 .aw .coin,.lrow.top3 .aw .coin{margin-right:.4rem}

/* ---- loader ---- */
.lbar{width:24rem;height:2.8rem;min-height:0;border:.2rem solid #9aa2b8}
.lbar span{font-size:1.3rem}
.lfill{border-radius:999px}

/* ===================== REAL IMAGES / ICONS (cropped from the reference screenshots) ===================== */
.room{background:#000 url(img/room.jpg) center bottom/100% auto no-repeat}
.coin{background:url(img/coin.png) center/100% 100% no-repeat !important;border:0 !important}
.coin i{display:none}
.plus{background:url(img/plus.png) center/100% 100% no-repeat !important;font-size:0 !important;width:2.7rem;height:2.7rem}
.rbtn{background:center/100% 100% no-repeat !important;font-size:0 !important;width:3.2rem;height:3.2rem}
.rbtn svg{display:none !important}
#soundBtn{background-image:url(img/sound.png) !important;position:relative}
#helpBtn{background-image:url(img/help.png) !important}
#soundBtn.muted{opacity:.6}
#soundBtn.muted::after{content:"";position:absolute;left:15%;right:15%;top:48%;height:.25rem;background:#18214a;transform:rotate(-45deg);border-radius:.2rem}
.backbtn{background:url(img/back.png) center/contain no-repeat;width:3.3rem;height:2.4rem}
.backbtn svg{display:none}
.ping svg{display:none}
.ping::before{content:"";display:block;width:3rem;height:2.2rem;background:url(img/wifi_g.png) center/contain no-repeat}
.ping.mid::before{background-image:url(img/wifi_y.png)}
.trophy{width:4.8rem;height:3.8rem;top:4rem;right:.6rem;background:url(img/trophy.png) center/100% 100% no-repeat}
.trophy svg{display:none}
.trophy em{left:.7rem;right:.65rem;bottom:.3rem;height:1.2rem;line-height:1.1rem;background:#b3261c;border:1px solid #f1c545;border-radius:.3rem;font-size:.95rem}
.chest{left:-.5rem;top:21.3rem;width:4.7rem;height:3.6rem;background:url(img/chest.png) center/100% 100% no-repeat}
.chest svg{display:none}
.chest .badge{right:-.3rem;top:-1rem}
.face.back{background:url(img/cardback.png) center/100% 100% no-repeat !important;border:0 !important;box-shadow:0 .3rem .8rem rgba(0,0,0,.3)}
.chest-modal .chest-top{top:-2.3rem;width:7.6rem;height:5.6rem;margin-left:-3.8rem;background:url(img/chestbig.png) center/100% 100% no-repeat}
.chest-top svg{display:none}
.win-modal .god{top:-4.05rem;width:9.2rem;height:7.8rem;margin-left:-4.6rem;background:url(img/god.png) center/100% 100% no-repeat}
.win-modal .god svg{display:none}
.board .x.red{background:url(img/closex.png) center/100% 100% no-repeat !important;border:0 !important;font-size:0 !important;width:3.3rem;height:3.3rem;top:-1.6rem;right:-1.6rem}

/* leaderboard header strip + real avatars / rank badges */
.tabs{top:.4rem;left:1rem;right:auto;width:29.9rem;height:4.3rem;background:url(img/strip.png) center/100% 100% no-repeat;display:block}
.tabs .tab{position:absolute;top:.5rem;width:3.2rem;height:3.3rem;background:none !important;clip-path:none;opacity:1;cursor:pointer}
.tabs .tab.on::after{content:"";position:absolute;left:50%;bottom:-.2rem;width:.5rem;height:.5rem;margin-left:-.25rem;border-radius:50%;background:#ffe9a6;display:none}
.lrow .un img.av{object-fit:cover;background:#333}
.lrow.top1 .un .av,.lrow.top2 .un .av,.lrow.top3 .un .av{width:2.3rem;height:2.3rem}
.lrow.top1 .rk{background:url(img/rank1.png) center/100% 100% no-repeat}
.lrow.top2 .rk{background:url(img/rank2.png) center/100% 100% no-repeat}
.lrow.top3 .rk{background:url(img/rank3.png) center/100% 100% no-repeat}

/* cash out: pink when it can be used (as in the video) */
.main-btn.cash.ready{background:linear-gradient(180deg,#ff55b6,#f0309c);color:#fff;box-shadow:0 .2rem 0 #a40f6a,inset 0 .1rem 0 #ffa5da;animation:none}
.main-btn.cash{background:linear-gradient(180deg,#8a2b63,#7b2358);color:#b88aa6}

/* start "loading..." veil */
.gload{position:absolute;left:0;right:0;bottom:0;height:56.4rem;background:rgba(14,16,50,.55);display:none;align-items:center;justify-content:center;font-size:2rem;color:#fff;z-index:20;animation:fade .15s}
.gload.show{display:flex}

/* win sparkles */
.spark{position:absolute;color:#ffe45e;pointer-events:none;z-index:5;transform:translate(-50%,-50%);text-shadow:0 0 .6rem #ffb300;animation:spark .8s ease-out forwards;opacity:0}
@keyframes spark{0%{opacity:1;transform:translate(-50%,-50%) scale(.3) rotate(0)}70%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.2) rotate(160deg)}}

/* bet keypad bottom sheet */
.overlay.sheet{align-items:flex-end;background:rgba(5,6,22,.45)}
.keypad{position:relative;width:100%;background:#1c2145;border-radius:1.6rem 1.6rem 0 0;padding:2.2rem 1.5rem 1.6rem;animation:sheet .25s ease}
@keyframes sheet{from{transform:translateY(100%)}}
.keypad .grab{position:absolute;left:50%;top:.9rem;width:3.4rem;height:.3rem;margin-left:-1.7rem;background:#d9dcf0;border-radius:.2rem}
.keypad .kx{position:absolute;right:1.8rem;top:2.3rem;font-size:2.1rem;color:#fff;font-weight:300}
.klimit{text-align:center;font-size:1.1rem;color:#aab0d6;margin-top:1.8rem}
.kdisp{height:3.1rem;margin:1.2rem 0 1.3rem;border-radius:1.6rem;background:#141737;text-align:center;line-height:3.1rem;font-size:1.3rem;color:#e9ebff}
.kgrid{display:grid;grid-template-columns:repeat(3,1fr) 8rem;gap:1rem .9rem}
.kgrid button{height:3.2rem;border-radius:1.6rem;background:#2a2f58;color:#e8eaff;font-size:1.5rem}
.kgrid button:active{filter:brightness(1.3)}
.kgrid .ok{grid-row:1/3;grid-column:4;height:auto;border-radius:1.6rem;background:linear-gradient(180deg,#6c63ec,#5649d6);font-size:1.5rem}
.kgrid .side{grid-column:4;font-size:1.3rem;background:#262b52}
.kgrid i{font-style:normal;width:1.7rem;height:1.7rem;border-radius:50%;background:#e7e9ff;color:#1c2145;display:inline-grid;place-items:center;font-size:1rem;line-height:1}

/* loader: soft floating squares like the original */
.bubbles{background:
  linear-gradient(rgba(120,150,245,.35),rgba(120,150,245,.35)) 5% 82%/7% 4% no-repeat,
  linear-gradient(rgba(120,150,245,.3),rgba(120,150,245,.3)) 18% 90%/9% 5% no-repeat,
  linear-gradient(rgba(120,150,245,.35),rgba(120,150,245,.35)) 82% 72%/14% 7% no-repeat,
  linear-gradient(rgba(120,150,245,.25),rgba(120,150,245,.25)) 95% 92%/12% 5% no-repeat,
  linear-gradient(rgba(120,150,245,.3),rgba(120,150,245,.3)) 40% 96%/16% 4% no-repeat,
  linear-gradient(rgba(120,150,245,.25),rgba(120,150,245,.25)) 8% 60%/6% 3% no-repeat !important;
  animation:drift 6s ease-in-out infinite alternate}
@keyframes drift{to{transform:translateY(-1.5rem)}}
.trophy,.chest{-webkit-mask-image:radial-gradient(ellipse 52% 52% at 50% 50%,#000 72%,transparent 100%);mask-image:radial-gradient(ellipse 52% 52% at 50% 50%,#000 72%,transparent 100%)}
.trophy em,.chest .badge{position:absolute}
.win-amt{width:7.5rem !important}.win-amt b{margin-left:-.8rem}
.lrow .aw span.coin{all:unset;display:block;flex:none;width:1.5rem;height:1.5rem;background:url(img/coin.png) center/100% 100% no-repeat;margin-right:.4rem}
.lrow.top1 .aw>span,.lrow.top2 .aw>span,.lrow.top3 .aw>span{padding:.15rem .6rem .15rem .25rem;min-width:0;font-size:1.15rem}

/* ===== Final layout (as in the reference): pure black on top, game + loader pinned to the bottom ===== */
.room{background:#000 !important}
.loader{inset:auto;left:50%;bottom:0;transform:translateX(-50%);width:36rem;max-width:100vw;height:57rem;max-height:100%}
.loader .lbar{margin-top:0}
html,body{background:#000}

/* ===== Landscape / short screens: two-column layout so the WHOLE game fits on one screen ===== */
@media (orientation:landscape) and (max-height:600px){
  html{font-size:min(calc(100vw / 69), calc(100vh / 38), 14px);font-size:min(calc(100vw / 69), calc(100dvh / 38), 14px)}
  .app{width:68rem}
  .room{flex:1 1 auto;min-height:0}
  .game{height:31.4rem;display:grid;grid-template-columns:33.2rem 1fr;grid-template-rows:3.9rem 8.7rem 1fr;column-gap:1.6rem;padding:0 1.4rem}
  .frame{grid-column:1;grid-row:1 / 4;margin-top:.9rem}
  .g-head{grid-column:2;grid-row:1}
  .history{grid-column:2;grid-row:2;margin:0}
  .betbox{grid-column:2;grid-row:3;align-self:start;margin:.6rem 0 0;height:12.5rem}
  .trophy{top:4rem;right:1.4rem}
  .gload{height:31.4rem}
  .loader{width:68rem;height:31.4rem}
  .overlay.sheet .keypad{max-width:36rem;margin:0 auto}
}
/* ===== win popup: exact look + entrance burst (from the video) ===== */
.win-modal{overflow:visible;background:linear-gradient(180deg,#1e2b86 0%,#33309a 45%,#7a46c8 100%) !important}
.win-modal .wm-bg{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}
.win-modal .wm-bg svg{width:100%;height:100%;display:block}
.win-modal>*:not(.wm-bg):not(.fx):not(.god):not(.x){position:relative;z-index:1}
.win-modal .god,.win-modal .x{z-index:2}
.win-modal .x{position:absolute}
.win-amt b{color:#ffc247}
.overlay.show .win-modal{animation:winpop .5s cubic-bezier(.2,1.35,.4,1)}
@keyframes winpop{0%{transform:scale(.55);opacity:0}60%{opacity:1}100%{transform:scale(1)}}
.win-modal .fx{position:absolute;left:50%;top:50%;width:0;height:0;z-index:3;pointer-events:none}
.fx .ringfx{position:absolute;left:-13rem;top:-13rem;width:26rem;height:26rem;border-radius:50%;
  background:radial-gradient(circle,rgba(255,60,90,.0) 0 20%,rgba(255,70,110,.9) 28%,rgba(255,150,200,.85) 40%,rgba(180,190,255,.9) 54%,rgba(255,255,255,.7) 64%,rgba(255,255,255,0) 72%);
  filter:blur(1px);opacity:0;animation:ringfx 1.1s ease-out forwards}
@keyframes ringfx{0%{transform:scale(.15);opacity:0}15%{opacity:1}55%{transform:scale(1);opacity:.95}100%{transform:scale(1.25);opacity:0}}
.fx .gstar{position:absolute;width:var(--s);height:var(--s);margin:calc(var(--s) / -2) 0 0 calc(var(--s) / -2);clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  background:radial-gradient(circle at 50% 45%,#fffbc8,#ffe03a 55%,#f6b300);opacity:0;animation:gstar 1.1s ease-out forwards}
@keyframes gstar{0%{transform:translate(0,0) scale(.2) rotate(0);opacity:0}20%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1) rotate(var(--r));opacity:0}}
.fx .conf{position:absolute;width:var(--w);height:var(--h);background:var(--c);opacity:0;animation:conf var(--t) ease-in forwards}
@keyframes conf{0%{transform:translate(0,0) rotate(0);opacity:0}10%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) rotate(var(--r));opacity:0}}
.win-modal .wm-bg svg{opacity:.55}

/* ===== history strip: exact look from the video (start / SKIP / WIN cards, per-step odds) ===== */
.history{padding:.9rem 0 0 .9rem}
.hist-row{gap:.5rem}
.hcard{width:3.85rem}
.hcard .c{width:3.85rem;height:5rem;border-radius:.5rem;box-shadow:0 .15rem .3rem #0007}
.hcard .c b{left:.35rem;top:0;font-size:1.9rem;line-height:2.1rem;letter-spacing:-.1rem;font-weight:500}
.hcard .c small{left:.4rem;top:2.05rem;font-size:1.05rem}
.hcard .c em{right:.3rem;bottom:.1rem;font-size:2.9rem;line-height:3.1rem}
.hcard .tag{width:3.7rem;height:1rem;line-height:.9rem;margin:.45rem auto 0;border-radius:.6rem;background:#0e2b3a;border:1px solid #1d5a5a;font-size:.8rem;color:#f2b93a}
.hcard .tag.tg-start{color:#34dca0}
.hcard .tag.tg-lose{color:#ff8da1;border-color:#6a2b3c}
.hcard .dir{left:-.85rem;top:1.65rem;width:1.2rem;height:1.2rem;margin-left:-.6rem;border-radius:.35rem;background:#1c2046;border:1px solid #ffffff22;display:grid;place-items:center;z-index:3;font-size:0}
.hcard .dir svg{width:.85rem;height:.85rem}
.hcard .dir.skip{color:#2de3b2}
.hcard .dir.step{color:#ff7a2e}
.hcard .badge-c{position:absolute;right:.2rem;top:.2rem;width:1.3rem;height:1.3rem;border-radius:50%;border:.12rem solid;display:grid;place-items:center;font-size:.42rem;font-weight:700;letter-spacing:-.02rem;background:#fff;line-height:1}
.hcard .badge-c.b-skip{color:#22cfa0;border-color:#22cfa0}
.hcard .badge-c.b-win{color:#f09a1a;border-color:#f5b13a}
.hcard .badge-c.b-lose{color:#ff4d63;border-color:#ff4d63}

/* connecting state: red wifi, empty text */
.ping.bad::before{filter:hue-rotate(250deg) saturate(1.6)}
.ping.bad small{visibility:hidden}

/* ===== notice toast: same look as the video (dark slate box + orange "!" icon) ===== */
.toast{background:rgba(36,40,82,.9) !important;border:0 !important;border-radius:.8rem;padding:3rem 1.4rem 1.1rem;width:22.5rem;max-width:90%;font-size:1.15rem;line-height:1.5rem;color:#fff !important;text-align:center}
.toast::before{content:"!";position:absolute;left:50%;top:.8rem;transform:translateX(-50%);width:1.5rem;height:1.5rem;border-radius:.3rem;background:#ff8a6e;color:#fff;font-weight:700;font-size:1.2rem;line-height:1.5rem}

/* ===== Reward treasure popup: pixel layout from the reference ===== */
.chest-modal{width:29.5rem !important;height:31.75rem !important;padding:0 !important;border-radius:1.4rem !important;position:relative;text-align:center;border:0 !important;
  background:linear-gradient(180deg,#38368f 0%,#2d2a7b 50%,#221e5d 100%) !important}
.chest-modal .halo{position:absolute;left:50%;top:-1.9rem;width:14.5rem;height:9.5rem;margin-left:-7.25rem;border-radius:50%;background:radial-gradient(ellipse at 50% 45%,rgba(24,20,92,.55),rgba(24,20,92,.85));z-index:0}
.chest-modal .chest-top{position:absolute !important;left:50%;top:-2.1rem !important;width:7rem !important;height:4.6rem !important;margin-left:-3.5rem !important;z-index:2;
  background:url(img/chestbig.png) center/100% 100% no-repeat !important;filter:drop-shadow(0 .3rem .4rem rgba(0,0,0,.45))}
.chest-modal h4{position:absolute;left:0;right:0;top:3rem;margin:0;font-size:1.55rem;line-height:1.5rem;font-weight:400;color:#b9a8ee;z-index:1}
.chest-modal p{position:absolute;left:0;right:0;margin:0 !important;font-size:1.15rem;line-height:1.85rem;color:#fff;white-space:nowrap;z-index:1}
.chest-modal .tp1{top:7.8rem}
.chest-modal .tp2{top:19.9rem}
.chest-modal .blue-btn{position:absolute;left:50%;top:27.5rem;margin:0 0 0 -4.15rem !important;width:8.3rem !important;height:2.5rem !important;font-size:1.3rem;border-radius:.2rem;background:linear-gradient(180deg,#2f6dff,#1b50e8);z-index:1}
.chest-modal .x{position:absolute;right:1.35rem !important;top:2.35rem !important;width:1.8rem !important;height:1.8rem !important;font-size:0 !important;z-index:3}
.chest-modal .x::before,.chest-modal .x::after{content:"";position:absolute;left:50%;top:50%;width:2rem;height:.25rem;margin:-.125rem 0 0 -1rem;background:#fff;border-radius:.2rem}
.chest-modal .x::before{transform:rotate(45deg)}
.chest-modal .x::after{transform:rotate(-45deg)}
.chest-modal .halo{background:radial-gradient(ellipse at 50% 50%,rgba(26,22,96,.5) 55%,rgba(26,22,96,.18) 100%) !important}

/* Reward treasure popup: quick pop-in (video: appears within ~0.1s from ~90% size), closes instantly */
.overlay.show .chest-modal{animation:chestpop .16s ease-out}
@keyframes chestpop{from{transform:scale(.88);opacity:.25}to{transform:scale(1);opacity:1}}
#mChest.overlay.show{animation:none}

/* table chest: real cut-out image (no mask / box) */
.chest{-webkit-mask-image:none !important;mask-image:none !important;filter:drop-shadow(0 .25rem .3rem rgba(0,0,0,.5))}
.chest .badge{right:-.2rem;top:-.9rem;min-width:1.8rem;height:1.8rem;line-height:1.5rem;font-size:1.1rem;border:.12rem solid #ffd0d0;background:#e42f2f}

/* trophy: user-supplied icon (84x70, ribbon is empty -> timer text drawn on top) */
.trophy{width:4.8rem !important;height:4rem !important;-webkit-mask-image:none !important;mask-image:none !important;background:url(img/trophy.png) center/100% 100% no-repeat !important;filter:drop-shadow(0 .2rem .3rem rgba(0,0,0,.35))}
.trophy svg{display:none !important}
.trophy em{left:.63rem !important;right:.63rem !important;top:2.6rem !important;bottom:auto !important;height:.85rem !important;line-height:.85rem !important;background:none !important;border:0 !important;font-size:.78rem !important;color:#fff;text-shadow:0 0 .2rem #7a0d0d,0 .05rem .1rem #5a0a0a;font-family:Georgia,serif;font-weight:700;letter-spacing:.02rem}

/* K > A hint is a fixed background element of the history strip: always visible, cards sit on top (video) */
.ghost-hint{display:flex !important;left:0;right:0;top:1.35rem;padding-left:0;gap:1.55rem;justify-content:center;align-items:center;z-index:0}
.ghost-hint.hide{display:flex !important}
.ghost-hint .gcard{width:4.2rem;height:5.6rem;border:.15rem solid #2c3260;color:#30376b;border-radius:.6rem}
.ghost-hint i{width:1.2rem;text-align:center;color:#2c3260;font-size:2.4rem;line-height:1}
.hist-row{position:relative;z-index:1}
.history{overflow:hidden}
