* {
  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: Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  touch-action: manipulation
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  background: none
}

.hidden {
  display: none !important
}

img {
  -webkit-user-drag: none
}

/* Fixed 720x1509 stage (black band on top, game anchored at the bottom) scaled to fit every screen */

#viewport {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 720px;
  height: 1509px;
  transform-origin: 0 0;
  overflow: hidden;
  background: #000
}

.screen {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 369px
}

/* ---------- loading ---------- */

#loading {
  background: #6a8fd6 url(img/load.png) 0 0/720px 1140px no-repeat
}

.load-bar {
  position: absolute;
  left: 122px;
  top: 541px;
  width: 476px;
  height: 54px;
  border-radius: 27px;
  background: #1a1d3a;
  border: 3px solid #8e94ad;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .35);
  overflow: hidden
}

.load-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 24px;
  background: repeating-linear-gradient(115deg, #ffa726 0 16px, #f57c00 16px 30px);
  box-shadow: inset 0 6px 8px rgba(255, 255, 255, .35)
}

.load-bar span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45)
}

/* ---------- game (background is the real artwork) ---------- */

#game {
  background: #2a0f7a url(img/bg.png) 0 0/720px 1140px no-repeat
}

.hit {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 14px;
  transition: background .08s
}

.hit:active {
  background: rgba(255, 255, 255, .18)
}

#btnSound .mute {
  display: none;
  position: absolute;
  left: 14px;
  top: 34px;
  width: 42px;
  height: 4px;
  background: #ff5fa2;
  border-radius: 2px;
  transform: rotate(-45deg)
}

#btnSound.off .mute {
  display: block
}

#roundText {
  position: absolute;
  left: 260px;
  width: 200px;
  top: 30px;
  height: 34px;
  text-align: center;
  font-size: 29px;
  line-height: 34px;
  color: #c1a5fc;
  letter-spacing: .3px
}

.rank-bubble {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden
}

.rank-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5)
}

#btnTrophy b {
  position: absolute;
  left: 28px;
  top: 58px;
  width: 44px;
  text-align: center;
  font-weight: 400;
  font-size: 16px;
  line-height: 16px;
  color: #fff;
  background: #b11f2c;
  letter-spacing: .2px
}

#ping {
  position: absolute;
  left: 62px;
  top: 246px;
  width: 60px;
  text-align: center;
  font-size: 11px;
  color: #f5c518
}

#ping.hidden {
  display: none
}

/* cards (artwork is in the background; these are state overlays) */

.card {
  position: absolute;
  width: 130px;
  height: 128px;
  margin: -64px 0 0 -65px;
  border-radius: 30px;
  cursor: pointer
}

.card .pk {
  position: absolute;
  left: 3px;
  right: 3px;
  top: 82px;
  bottom: 3px;
  border-radius: 0 0 27px 27px;
  opacity: 0;
  background: linear-gradient(180deg, #f2519d 0%, #ff6fb2 45%, #ff8fc9 100%);
  transition: opacity .12s
}

.card .dim {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: rgba(22, 8, 78, .55);
  opacity: 0;
  transition: opacity .25s
}

.card .bet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-shadow: 0 1px 3px rgba(80, 0, 40, .8);
  z-index: 2
}

.card .bet .coin {
  width: 22px;
  height: 22px
}

.card.flash .pk,
.card.hit .pk {
  opacity: 1
}

.card:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  border: 3px solid #ffd2ea;
  box-shadow: 0 0 14px 2px rgba(255, 120, 200, .85), inset 0 0 8px rgba(255, 200, 235, .6);
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none
}

.card.hit:after,
.card.flash:after {
  opacity: 1
}


@keyframes pulse {
  to {
    transform: scale(1.07)
  }
}

.card.dimmed .dim {
  opacity: 1
}

.card.hit .dim,
.card.betlive .dim {
  opacity: 0
}


.pedestal {
  position: absolute;
  width: 76px;
  height: 100px;
  border-radius: 12px;
  cursor: pointer
}

.pedestal .dim {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 0;
  bottom: 0;
  border-radius: 14px;
  background: rgba(22, 8, 78, .5);
  opacity: 0;
  transition: opacity .25s
}

.pedestal.dimmed .dim {
  opacity: 1
}

.pedestal.hit {
  animation: glow .4s infinite alternate
}

@keyframes glow {
  from {
    box-shadow: 0 0 6px 2px rgba(255, 120, 200, .4)
  }
  to {
    box-shadow: 0 0 22px 8px rgba(255, 120, 200, .9)
  }
}

/* hub text */

#hubLabel {
  position: absolute;
  left: 262px;
  width: 200px;
  top: 524px;
  text-align: center;
  font-size: 23px;
  line-height: 26px;
  color: #b88dfc
}

#hubTime {
  position: absolute;
  left: 262px;
  width: 200px;
  top: 545px;
  text-align: center;
  font-size: 52px;
  line-height: 56px;
  font-weight: 400
}

#hubTime em {
  font-style: normal;
  font-size: 25px;
  margin-left: 2px
}

#hubTime.spin {
  top: 530px
}

/* chips */

#chips .chip {
  position: absolute;
  top: 861px;
  width: 92px;
  height: 90px;
  background: url(img/chip.png) 0 0/92px 90px no-repeat;
  cursor: pointer;
  transition: transform .08s
}

#chips .chip.sel {
  background-image: url(img/chip_sel.png)
}

#chips .chip:active {
  transform: scale(.95)
}

#chips .chip b {
  position: absolute;
  left: 4px;
  right: 6px;
  top: 49px;
  height: 33px;
  line-height: 33px;
  text-align: center;
  font-weight: 500;
  font-size: 26px;
  border-radius: 7px;
  background: linear-gradient(#34229f, #2a1685);
  color: #e6e2ff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45)
}

#chips .chip.sel b {
  background: linear-gradient(#a5265d, #7a1340);
  color: #ffd8e6
}

#chips.off {
  pointer-events: none;
  filter: brightness(.55)
}

#chips .chip.dis {
  filter: grayscale(.6) brightness(.7)
}

/* result bar */

#resultIcons {
  position: absolute;
  left: 0;
  top: 0
}

#resultIcons img {
  position: absolute;
  top: 992px;
  width: 64px;
  height: 56px;
  object-position: center bottom;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35))
}

#resultIcons img.fresh {
  animation: slidein .45s ease-out
}

@keyframes slidein {
  from {
    transform: translateX(-30px);
    opacity: 0
  }
}

.newtag {
  position: absolute;
  left: 132px;
  top: 980px;
  background: #e86bb4;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 0 8px;
  line-height: 17px;
  border-radius: 2px;
  letter-spacing: .4px
}

/* mine / today win */

.coin {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url(img/coin.png) center/contain no-repeat;
  flex: none
}

.infobox {
  position: absolute;
  top: 1079px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px
}

#boxMine {
  left: 97px;
  width: 188px
}

#boxWin {
  left: 312px;
  width: 233px;
  cursor: pointer;
  padding-left: 50px
}

.infobox b {
  font-size: 26px;
  font-weight: 500;
  color: #ffe9a8;
  font-variant-numeric: tabular-nums
}

#btnAuto {
  position: absolute;
  left: 562px;
  top: 1066px;
  width: 118px;
  height: 68px;
  border-radius: 12px;
  background: transparent;
  font-size: 21px;
  line-height: 24px;
  font-weight: 500;
  color: transparent
}

#btnAuto.on {
  background: linear-gradient(#ff6fb0, #e0338a);
  border: 3px solid #ffc0dc;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 100, 180, .7)
}

#btnAuto:active {
  background: rgba(255, 255, 255, .2)
}

/* floaters & toast */

#floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20
}

.float {
  position: absolute;
  font-size: 34px;
  font-weight: 800;
  color: #ffe45e;
  text-shadow: 0 2px 0 #b34a00, 0 0 8px #000;
  animation: rise 1.6s ease-out forwards;
  transform: translateX(-50%)
}

@keyframes rise {
  from {
    opacity: 1;
    transform: translate(-50%, 0)
  }
  to {
    opacity: 0;
    transform: translate(-50%, -90px)
  }
}

#toast {
  position: absolute;
  left: 50%;
  top: 790px;
  transform: translateX(-50%);
  background: rgba(20, 10, 70, .92);
  border: 2px solid #8f78f0;
  border-radius: 14px;
  padding: 10px 22px;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 30;
  white-space: nowrap
}

#toast.show {
  opacity: 1
}

/* ---------- modals ---------- */

#modalLayer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 369px;
  background: rgba(10, 4, 40, .5);
  z-index: 50
}

.modal {
  position: absolute;
  animation: pop .18s ease-out
}

@keyframes pop {
  from {
    transform: scale(.9)
  }
}

.panel {
  background: rgba(104, 72, 232, .86);
  backdrop-filter: blur(2px);
  border-radius: 26px;
  color: #fff;
  overflow: hidden
}

.panel h3 {
  font-weight: 400;
  font-size: 26px;
  text-align: center;
  line-height: 60px;
  position: relative;
  margin: 0 12px;
  border-bottom: 2px solid #e6e0ff
}

.panel h3 button {
  position: absolute;
  right: 6px;
  top: 2px;
  font-size: 30px;
  font-weight: 300;
  color: #fff
}

.rule {
  left: 60px;
  top: 300px;
  width: 600px;
  height: 530px
}

.rule ol {
  list-style: decimal inside;
  padding: 36px 12px 0 12px;
  font-size: 20.5px;
  line-height: 30.6px;
  color: #fff
}

.setting {
  left: 155px;
  top: 468px;
  width: 410px;
  height: 205px
}

.setting .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 40px 0 68px;
  font-size: 25px
}

.switch {
  width: 142px;
  height: 50px;
  border-radius: 8px;
  background: #4a31b8;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 26px
}

.switch b {
  font-weight: 400;
  position: absolute;
  left: 30px;
  transition: .2s
}

.switch i {
  position: absolute;
  right: 0;
  top: -1px;
  width: 50px;
  height: 52px;
  border-radius: 12px;
  background: #e86bb4;
  border: 2px solid #f1a0d0;
  transition: .2s
}

.switch:not(.on) b {
  left: 76px
}

.switch:not(.on) i {
  right: 92px;
  background: #ff5fa2
}

/* ---------- leaderboard popup (built in CSS to match the reference) ---------- */

.rank {
  left: 66px;
  top: 275px;
  width: 588px;
  height: 586px;
  border-radius: 20px;
  overflow: visible;
  background: radial-gradient(ellipse at 50% 0, #9a2347 0, #7d1636 45%, #5e0f29 100%);
  border: 3px solid #e6b8b0;
  box-shadow: inset 0 0 0 2px #7a1030, 0 0 0 2px rgba(120, 20, 50, .9)
}

.rank .close-x {
  position: absolute;
  left: 552px;
  top: -38px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  z-index: 3;
  background: radial-gradient(circle at 40% 30%, #ff6b78, #d4142e 70%);
  border: 4px solid #ffc4cb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .4)
}

.rank .close-x:before,
.rank .close-x:after {
  content: "";
  position: absolute;
  left: 13px;
  top: 23px;
  width: 30px;
  height: 7px;
  background: #fff;
  border-radius: 4px;
  transform: rotate(45deg)
}

.rank .close-x:after {
  transform: rotate(-45deg)
}

.rank .close-x:active {
  transform: scale(.92)
}

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100px
}

.tabs:before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 58px;
  border-top: 3px dotted #f08a9a;
  opacity: .7
}

.tab {
  position: absolute;
  top: 34px;
  width: 56px;
  height: 52px;
  margin-left: -28px;
  border: 0;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  background: linear-gradient(#f1d2c8, #c9857e);
  clip-path: polygon(23% 0, 77% 0, 100% 50%, 77% 100%, 23% 100%, 0 50%)
}

.tab span {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#ef3a50, #a6122f);
  clip-path: polygon(23% 0, 77% 0, 100% 50%, 77% 100%, 23% 100%, 0 50%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5)
}

.tab.on span {
  background: linear-gradient(#ffd9d2, #ee8e88);
  color: #b0112c;
  text-shadow: none
}

.tab.fire {
  top: 28px;
  width: 62px;
  height: 62px;
  margin-left: -31px;
  background: linear-gradient(#ffe2a0, #e0a04a)
}

.tab.fire span {
  background: linear-gradient(#ff7a1a, #c4140f);
  font-size: 30px
}

.tab.fire:before {
  content: "";
  position: absolute;
  left: 12px;
  top: -12px;
  width: 38px;
  height: 22px;
  background: linear-gradient(#ffd24a, #e69a14);
  clip-path: polygon(0 100%, 0 25%, 25% 55%, 50% 0, 75% 55%, 100% 25%, 100% 100%)
}

.rank-table {
  position: absolute;
  left: 13px;
  top: 97px;
  width: 556px;
  height: 477px;
  background: #000;
  border: 3px solid #e9d6d9;
  border-radius: 7px;
  overflow: hidden
}

.rh {
  display: grid;
  grid-template-columns: 100px 178px 141px 1fr;
  height: 44px;
  align-items: center;
  text-align: center;
  background: linear-gradient(#2d2629, #241e21);
  font-size: 24px;
  color: #e2dcdc;
  border-bottom: 2px solid #555
}

.rh span+span {
  border-left: 2px solid #555;
  height: 100%;
  line-height: 42px
}

.rh span:first-child {
  line-height: 42px
}

.rh u {
  text-decoration: none;
  display: inline-block;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  font-size: 14px;
  width: 20px;
  height: 20px;
  line-height: 17px;
  vertical-align: 3px;
  margin-left: 3px
}

.rb {
  height: 429px;
  overflow-y: auto;
  scrollbar-width: none
}

.rb::-webkit-scrollbar {
  display: none
}

.rr {
  display: grid;
  grid-template-columns: 100px 178px 141px 1fr;
  height: 41px;
  align-items: center;
  background: #000;
  border-bottom: 2px solid #484848;
  font-size: 20px;
  color: #e8e8e8;
  text-align: center;
  position: relative
}

.rr>* {
  position: relative;
  z-index: 1
}

.rr .rk {
  font-size: 22px;
  font-weight: 600;
  font-family: Arial, sans-serif;
  color: #eee
}

.rr .av {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  font-size: 16px;
  line-height: 15px;
  overflow: hidden;
  padding-left: 3px;
  height: 100%;
  border-left: 2px solid #484848
}

.rr .av img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  flex: none
}

.rr .av span {
  display: block;
  overflow: hidden
}

.rr>span:nth-child(3) {
  border-left: 2px solid #484848;
  height: 100%;
  line-height: 39px
}

.rr .aw {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 18px;
  font-size: 21px;
  font-weight: 700;
  height: 100%;
  border-left: 2px solid #484848
}

.rr .aw .coin {
  width: 26px;
  height: 26px
}

.rr.r1,
.rr.r2,
.rr.r3 {
  height: 50px;
  border-bottom: 2px solid #3a2a20;
  color: #2b1700;
  font-weight: 500
}

.rr.r1 {
  background: linear-gradient(180deg, #fbe9a8, #e9b43a 45%, #c98f1c)
}

.rr.r2 {
  background: linear-gradient(180deg, #f4f4fa, #cfd0de 45%, #a9aabe);
  color: #1f1f2c
}

.rr.r3 {
  background: linear-gradient(180deg, #f6b58f, #e58759 45%, #c9633a);
  color: #35160a
}

.rr.r1:before,
.rr.r2:before,
.rr.r3:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 106px;
  z-index: 0;
  clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%)
}

.rr.r1:before {
  background: linear-gradient(90deg, #d4287f, #f0489a)
}

.rr.r2:before {
  background: linear-gradient(90deg, #4440a0, #6a66c8)
}

.rr.r3:before {
  background: linear-gradient(90deg, #c9482a, #ec7a4c)
}

.rr.r1 .rk,
.rr.r2 .rk,
.rr.r3 .rk {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 44px;
  font-weight: 700;
  line-height: 50px;
  color: #fff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .45);
  text-align: left;
  padding-left: 10px
}

.rr .rk sup {
  font-size: 19px;
  vertical-align: 14px;
  margin-left: 1px
}

.rr.r1 .av,
.rr.r2 .av,
.rr.r3 .av,
.rr.r1>span:nth-child(3),
.rr.r2>span:nth-child(3),
.rr.r3>span:nth-child(3),
.rr.r1 .aw,
.rr.r2 .aw,
.rr.r3 .aw {
  border-left: 0
}

.rr.r1 .av,
.rr.r2 .av,
.rr.r3 .av {
  font-size: 19px;
  font-weight: 600
}

.rr.r1 .av img,
.rr.r2 .av img,
.rr.r3 .av img {
  width: 44px;
  height: 44px;
  margin-left: 4px
}

.rr.r1 .aw,
.rr.r2 .aw,
.rr.r3 .aw {
  background: #17100a;
  color: #fff;
  border-radius: 9px;
  margin: 7px 10px 7px 0;
  height: 36px;
  padding-left: 14px;
  border: 2px solid #7a5a2a
}

.rr.r1>span:nth-child(3),
.rr.r2>span:nth-child(3),
.rr.r3>span:nth-child(3) {
  font-size: 22px
}

.rr.r1>span:nth-child(3),
.rr.r2>span:nth-child(3),
.rr.r3>span:nth-child(3) {
  line-height: 48px
}

.rr .av span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 15px;
  line-height: 16px;
  max-height: 34px
}

.rr.r1 .av span,
.rr.r2 .av span,
.rr.r3 .av span {
  font-size: 18px;
  line-height: 19px;
  max-height: 40px
}

.tabs .crown {
  position: absolute;
  top: 8px;
  width: 40px;
  height: 26px;
  margin-left: -20px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(#ffe27a, #e6a014);
  clip-path: polygon(0 100%, 0 22%, 25% 55%, 50% 0, 75% 55%, 100% 22%, 100% 100%)
}

/* My History popup (matches reference sizes/colours) */

.history {
  left: 88px;
  top: 297px;
  width: 544px;
  height: 542px;
  background: rgba(104, 72, 232, .86);
  border-radius: 26px
}

.history h3 {
  font-size: 27px;
  line-height: 46px;
  margin: 0;
  border: 0;
  color: #fff
}

.history h3 button {
  right: 20px;
  top: 0;
  line-height: 46px;
  font-size: 31px;
  font-weight: 300
}

.history .hh {
  position: relative;
  height: 31px;
  margin: 0 8px 0 9px;
  border-bottom: 2px solid #fff;
  font-size: 18px;
  line-height: 26px;
  color: #d9d0ff;
  display: grid;
  grid-template-columns: 149px 176px 80px 1fr;
  padding-left: 16px
}

#histBody {
  height: 455px;
  overflow-y: auto;
  padding: 2px 8px 0 9px;
  scrollbar-width: none
}

#histBody::-webkit-scrollbar {
  display: none
}

.hrow {
  display: grid;
  grid-template-columns: 149px 176px 80px 1fr;
  align-items: center;
  font-size: 18px;
  color: #fff;
  padding: 7px 0 7px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .18)
}

.hrow .ri img {
  width: 44px;
  height: 36px;
  object-fit: contain
}

.hrow .win {
  color: #ffe45e;
  font-weight: 700
}

.hrow .lose {
  color: #fff
}

/* bet tag / HOT / seats / coin effects (from the second reference video) */

.card .tag {
  position: absolute;
  left: 14px;
  top: -25px;
  height: 34px;
  padding: 0 11px 0 7px;
  border-radius: 9px;
  background: linear-gradient(#ff68ae, #ee4c97);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  z-index: 3;
  white-space: nowrap;
  box-shadow: 0 2px 0 #b92f78;
  animation: bob 1.3s ease-in-out infinite alternate;
  transition: opacity .25s
}

.card .tag .coin {
  width: 23px;
  height: 23px
}

.card .hot {
  position: absolute;
  left: 121px;
  top: -3px;
  height: 20px;
  padding: 0 5px;
  border-radius: 3px;
  background: #ee4c97;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  z-index: 3;
  letter-spacing: .3px;
  animation: bob 1.1s ease-in-out infinite alternate;
  transition: opacity .25s
}

.card .hot:before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -5px;
  border: 5px solid transparent;
  border-top-color: #ee4c97;
  border-left-width: 2px;
  border-right-width: 2px
}

.card.dimmed .tag,
.card.dimmed .hot {
  opacity: .5
}

@keyframes bob {
  from {
    transform: translateY(0)
  }
  to {
    transform: translateY(-3px)
  }
}

.card .seats {
  position: absolute;
  left: 0;
  right: 0;
  top: 95px;
  height: 21px;
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: none
}

.card .seats i {
  width: 24px;
  height: 21px;
  background: url(img/seat.png) -13px -10px no-repeat
}

.coin-fly {
  position: absolute;
  left: 0;
  top: 0;
  background: url(img/coin.png) center/contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
  will-change: transform
}

.infobox.pulse {
  animation: pulsebox .6s ease-out
}

@keyframes pulsebox {
  30% {
    transform: scale(1.12)
  }
}

/* "max 6 options" popup (reference video) */

.alert {
  left: 125px;
  top: 439px;
  width: 486px;
  height: 239px;
  background: #1262ac;
  border: 4px solid #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(10, 60, 120, .5)
}

.alert p {
  padding: 54px 40px 0;
  text-align: center;
  font-size: 19px;
  line-height: 34px;
  color: #fff
}

.alert button {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 70px;
  border-top: 2px solid #fff;
  font-size: 26px;
  color: #fff;
  background: transparent
}

.alert button:active {
  background: rgba(255, 255, 255, .15)
}

.card.pop {
  animation: cardpop .22s ease-out
}

@keyframes cardpop {
  40% {
    transform: scale(1.06)
  }
}


/* win / loss popup */

.resultpop {
  position: absolute;
  left: 110px;
  top: 380px;
  width: 500px;
  height: 300px;
  border-radius: 30px;
  z-index: 40;
  text-align: center;
  transform: scale(0);
  pointer-events: none;
  transition: transform .28s cubic-bezier(.2, 1.4, .4, 1);
  overflow: visible
}

.resultpop.show {
  transform: scale(1);
  pointer-events: auto
}

.resultpop.win {
  background: linear-gradient(180deg, rgba(132, 86, 255, .96), rgba(86, 48, 200, .96));
  border: 4px solid #ffd45a;
  box-shadow: 0 0 30px 6px rgba(255, 200, 80, .55)
}

.resultpop.lose {
  background: linear-gradient(180deg, rgba(78, 64, 170, .96), rgba(48, 36, 120, .96));
  border: 4px solid #8a82d8;
  box-shadow: 0 0 22px 4px rgba(20, 10, 70, .6)
}

.resultpop h2 {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 2px;
  font-style: italic
}

.resultpop.win h2 {
  color: #ffe36a;
  -webkit-text-stroke: 2px #b9540a;
  text-shadow: 0 4px 0 #b9540a, 0 0 18px rgba(255, 210, 80, .8)
}

.resultpop.lose h2 {
  top: 44px;
  color: #c9c2ff;
  -webkit-text-stroke: 2px #3a2c90;
  text-shadow: 0 4px 0 #3a2c90
}

.rp-trophy {
  position: absolute;
  left: 50%;
  top: -62px;
  width: 112px;
  margin-left: -56px;
  clip-path: inset(0 0 36% 0);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  animation: bob 1.2s ease-in-out infinite alternate
}

.rp-ray {
  position: absolute;
  left: 50%;
  top: -80px;
  width: 160px;
  height: 160px;
  margin-left: -80px;
  border-radius: 50%;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 235, 150, .9), rgba(255, 235, 150, 0) 70%)
}

.rp-amt {
  position: absolute;
  left: 0;
  right: 0;
  top: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 56px;
  font-weight: 800;
  color: #fff
}

.rp-amt .coin {
  width: 56px;
  height: 56px
}

.resultpop.win .rp-amt {
  color: #ffe9a0;
  text-shadow: 0 3px 0 #8a4a00
}

.resultpop.lose .rp-amt {
  color: #ffb4c4
}

.rp-sub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  font-size: 22px;
  color: #e8e2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px
}

.rp-sub img {
  height: 38px;
  margin: 0 2px
}

.card .seats i.mine {
  animation: seatpop .35s cubic-bezier(.2, 1.6, .4, 1) .65s backwards
}

.card .seats i.new:not(.mine) {
  animation: seatpop .35s cubic-bezier(.2, 1.6, .4, 1)
}

@keyframes seatpop {
  from {
    transform: scale(0)
  }
}
/* pressed / hovered card zooms (~1.08x, measured from the video), then returns to normal */
.card { transition: transform .2s ease-out }
.card.flash { transform: scale(1.08); z-index: 2 }

/* the card artwork itself (icon + multiplier) is a layer so it zooms together with the pink hover */
.card .art { position: absolute; inset: 0; border-radius: 30px; background: url(img/bg.png) 0 0/720px 1140px no-repeat; pointer-events: none }
/* press zoom measured frame-by-frame from the video: 1.0 -> ~1.23 (peak) -> 1.0 -> settles ~1.04 while pressed */
.card { transition: transform .12s ease-out }
.card.flash { transform: scale(1.04); animation: zoompop .3s ease-out }
@keyframes zoompop {
  0% { transform: scale(1) }
  35% { transform: scale(1.23) }
  70% { transform: scale(1) }
  100% { transform: scale(1.04) }
}

/* 7th leaderboard tab = the supplied fire-hexagon-with-crown image */
.tab.fireimg { top: 18px; width: 64px; height: 75px; margin-left: -32px; background: none; clip-path: none; padding: 0 }
.tab.fireimg img { display: block; width: 100%; height: 100% }

/* leaderboard coin = the coin cropped from the reference popup */
.rr .aw .coin { width: 32px; height: 30px; background: url(img/coin_rank.png) center/contain no-repeat; margin-left: -4px }

/* ---- leaderboard: closer clone of the reference popup ---- */
.rank { background: radial-gradient(ellipse at 50% 0, #8d1c3d 0, #7b1635 40%, #66102b 100%); border: 3px solid #e9bdb4 }
.tabs:before { display: none }
.tabs .dia { position: absolute; top: 55px; width: 10px; height: 10px; margin-left: -5px; background: #f08aa0; transform: rotate(45deg) scale(.8); border-radius: 1px; opacity: .95 }
.rh { font-weight: 300; color: #d4d0d0; background: linear-gradient(#303030, #262626) }
.rh span { font-weight: 300 }
.rr .rk { font-weight: 400; font-size: 21px; color: #ececec }
.rr { color: #ececec }
.rr .av { font-size: 16.5px }
.rr .av img { width: 38px; height: 38px; border: 1px solid #777 }
.rr .aw { font-size: 22px; letter-spacing: .3px }
.rr.r1 .rk, .rr.r2 .rk, .rr.r3 .rk { font-size: 54px; line-height: 52px; padding-left: 8px; letter-spacing: -1px; text-shadow: 0 2px 3px rgba(0, 0, 0, .55), 0 0 1px #fff }
.rr .rk sup { font-size: 20px; vertical-align: 20px; margin-left: 2px; font-style: italic }
.rr.r1 .av, .rr.r2 .av, .rr.r3 .av { font-size: 21px; font-weight: 500 }
.rr.r1 > span:nth-child(3), .rr.r2 > span:nth-child(3), .rr.r3 > span:nth-child(3) { font-size: 22px; letter-spacing: .5px }
.rr.r1 .aw, .rr.r2 .aw, .rr.r3 .aw { height: 30px; margin: 10px 10px 10px 0; border-radius: 12px; padding-left: 10px; border: 2px solid #8a6a3a; background: linear-gradient(#0c0805, #1d130a) }
.rr.r1 .av img, .rr.r2 .av img, .rr.r3 .av img { width: 44px; height: 44px; margin-left: 2px; border: 1px solid rgba(0, 0, 0, .35) }
.rr.r1 .rk, .rr.r2 .rk, .rr.r3 .rk { font-size: 44px; line-height: 50px; padding-left: 20px; overflow: hidden; white-space: nowrap }
.rr .rk sup { font-size: 17px; vertical-align: 18px }

/* labels drawn as real text (the artwork's faint baked labels were removed) */
.lbl { position: absolute; z-index: 2; color: #e6e0ff; font-size: 20px; line-height: 22px; font-weight: 500; pointer-events: none; text-shadow: 0 1px 2px rgba(20, 8, 90, .6) }
#lblMine { left: 47px; top: 1091px; width: 48px }
#lblWin { left: 311px; top: 1081px; width: 56px; text-align: left }
#lblWin br + * { }
#btnAuto { color: #fff; text-shadow: 0 1px 3px rgba(10, 40, 120, .8); font-size: 22px; line-height: 25px; display: flex; align-items: center; justify-content: center; text-align: center }
#btnAuto.on { color: #fff }
#lblResult { left: 62px; top: 1012px; font-size: 19px; width: 50px; font-weight: 400; color: #b29cd2; text-shadow: none }

/* ---- win / loss result popup (clone of the reference) ---- */
#floaters { z-index: 60 }
.rp2 { position: absolute; left: 60px; top: 421px; width: 597px; height: 415px; border-radius: 28px; z-index: 40; color: #fff;
  background: linear-gradient(180deg, rgba(118, 90, 240, .9), rgba(100, 70, 228, .9)); transform: scale(0); pointer-events: none;
  transition: transform .25s cubic-bezier(.2, 1.3, .4, 1) }
.rp2.show { transform: scale(1); pointer-events: auto }
.rp2 > * { position: absolute }
.rp2 .rp-cd { right: 30px; top: 22px; font-size: 22px; color: #ff6fa8; opacity: .85 }
.rp2 .rp-l1 { left: 105px; top: 28px; width: 190px; text-align: center; font-size: 21px; line-height: 30px }
.rp2 .rp-r1 { left: 415px; top: 14px; width: 54px; height: 46px; object-fit: contain }
.rp2 .rp-big { left: 42px; top: 62px; width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)) }
.rp2 .rp-l2 { left: 175px; top: 79px; width: 200px; text-align: center; font-size: 21px; line-height: 30px }
.rp2 .rp-l3 { left: 190px; top: 134px; width: 180px; text-align: center; font-size: 21px; line-height: 30px }
.rp2 .rp-v2, .rp2 .rp-v3 { display: flex; align-items: center; gap: 8px; font-size: 23px; line-height: 30px }
.rp2 .rp-v2 { left: 400px; top: 79px }
.rp2 .rp-v3 { left: 405px; top: 134px }
.rp2 .rp-v2 .coin, .rp2 .rp-v3 .coin { width: 30px; height: 28px }
.rp2 .rp-title { left: 130px; width: 320px; top: 175px; text-align: center; font-size: 30px; line-height: 36px; font-weight: 500;
  color: #ffd84a; text-shadow: 0 2px 0 #c77a10, 0 0 6px rgba(255, 190, 60, .5) }
.rp2 .rp-dash { top: 192px; width: 90px; height: 0; border-top: 2px dashed #f5b23a; opacity: .9 }
.rp2 .rp-dl { left: 36px } .rp2 .rp-dr { left: 468px }
.rp2 .rp-bub { left: 263px; top: 258px; width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(190, 170, 255, .55), rgba(120, 90, 220, .4) 60%, rgba(120, 90, 220, .25)); border: 1px solid rgba(255, 255, 255, .2) }
.rp2 .rp-crown { position: absolute; right: -12px; top: -22px; width: 30px; height: 24px; background: linear-gradient(#ffe27a, #e6a014);
  transform: rotate(18deg); clip-path: polygon(0 100%, 0 25%, 25% 55%, 50% 0, 75% 55%, 100% 25%, 100% 100%) }
.rp2 .rp-name { left: 180px; width: 226px; top: 332px; text-align: center; font-size: 16px; color: #d8cfff }
.rp2 .rp-v4 { left: 180px; width: 226px; top: 356px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 24px; line-height: 30px }
.rp2 .rp-v4 .coin { width: 28px; height: 26px }
.rp2 .rp-l1, .rp2 .rp-l2, .rp2 .rp-l3, .rp2 .rp-name, .rp2 .rp-title { white-space: nowrap }
.rp2 .rp-l1 { left: 140px; width: 260px; top: 28px }
.rp2 .rp-l2 { left: 142px; width: 260px }
.rp2 .rp-l3 { left: 146px; width: 260px }
.rp2 .rp-l1, .rp2 .rp-l2, .rp2 .rp-l3 { font-size: 20px }

/* ---- winning popup: tuned against the reference ---- */
.rp2 { top: 423px; background: linear-gradient(180deg, rgba(120, 92, 238, .82), rgba(104, 74, 230, .82)) }
.rp2 .rp-cd { color: #c24a96; opacity: .9 }
.rp2 .rp-l1, .rp2 .rp-l2, .rp2 .rp-l3 { font-size: 21px }
.rp2 .rp-v2 { left: 411px } .rp2 .rp-v3 { left: 416px }
.rp2 .rp-v2, .rp2 .rp-v3 { font-size: 22px }
.rp2 .rp-dash { width: 80px; border-top: 0; height: 2px; background: repeating-linear-gradient(90deg, #f0a836 0 5px, transparent 5px 8px) }
.rp2 .rp-dl { left: 40px; width: 78px } .rp2 .rp-dr { left: 470px; width: 87px }
.rp2 .rp-name { left: 189px; font-size: 15.5px; color: #cdbfff }
.rp2 .rp-v4 { left: 189px; font-size: 23px }

/* crown on the winner bubble = the real crown sprite (cropped from the artwork), placed like the reference */
.rp2 .rp-crown { right: auto; top: -25px; left: 32px; width: 42px; height: 38px; transform: none; clip-path: none;
  background: url(img/crown1.png) center/contain no-repeat; filter: drop-shadow(0 1px 1px rgba(80, 30, 0, .35)) }
