:root{
  --w: 7426;
  --h: 2434;

  --bg: url("../assets/bg.png");

  --left-name-x: 1270;
  --left-name-y: 800;

  --right-name-x: 5000;
  --right-name-y: 800;

  --prize-x: 3703;
  --prize-y: 2110;

  --roller-left-x: 1830;
  --roller-left-y: 1290;

  --roller-right-x: 5580;
  --roller-right-y: 1290;

  --digit-w: 240;
  --digit-h: 340;
  --digit-gap: 12;
  --digits: 6;

  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html, body{
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
  font-family: var(--font);
}

.viewport{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
}

.stage{
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  transform-origin: center center;
  position: relative;
  background-image: var(--bg);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.glow{
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(255,220,120,.10), rgba(0,0,0,0) 55%);
  mix-blend-mode: screen;
}

.text{
  position: absolute;
  color: #ffe9b0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 8px 18px rgba(0,0,0,.55);
  font-weight: 800;
  white-space: nowrap;
}

.name{
  font-size: 140px;
  line-height: 1;
  -webkit-text-stroke: 6px rgba(80,20,0,.35);
}

.prize{
  font-size: 92px;
  transform: translateX(-50%);
  text-align: center;
  -webkit-text-stroke: 5px rgba(80,20,0,.35);
}

.roller{
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: calc(var(--digit-gap) * 1px);
  filter: drop-shadow(0 16px 18px rgba(0,0,0,.45));
}

.digit{
  width: calc(var(--digit-w) * 1px);
  height: calc(var(--digit-h) * 1px);
  overflow: hidden;
  border-radius: 26px;
  position: relative;
  background: rgba(255,255,255,0);
  contain: layout paint;     /* giảm repaint */
  transform: translateZ(0);  /* ép GPU */
}

.strip{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  will-change: transform;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.num{
  height: calc(var(--digit-h) * 1px);
  display: grid;
  place-items: center;
  font-size: 220px;
  font-weight: 900;
  color: #000;
  text-shadow:
    0 2px 0 rgba(255,255,255,.6),
    0 10px 16px rgba(0,0,0,.22);
  background: rgba(255,255,255,0);
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.box{ position: absolute; }

#prize { display: none !important; }
/* ===== ZERO-SPIN OVERLAY (Way B - rolling) ===== */
.digit.zeroSpin{
  position: relative;
  overflow: hidden;
}

.digit.zeroSpin::after{
  content: "0";
  position: absolute;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;

  font-size: 220px;
  font-weight: 900;
  color: #000;
  text-shadow:
    0 2px 0 rgba(255,255,255,.6),
    0 10px 16px rgba(0,0,0,.22);

  pointer-events: none;
  background: transparent;

  /* CUỘN LÊN XUỐNG GIẢ LẬP SLOT */
  animation: zeroSpinRoll .18s infinite linear;
}

/* cuộn dạng slot: đi lên nhanh rồi reset */
@keyframes zeroSpinRoll{
  0%   { transform: translateY(140px); filter: blur(1.3px); }
  100% { transform: translateY(-140px); filter: blur(1.3px); }
}
.digit.zeroSpin:nth-child(1)::after{ animation-duration: .16s; }
.digit.zeroSpin:nth-child(2)::after{ animation-duration: .18s; }
.digit.zeroSpin:nth-child(3)::after{ animation-duration: .14s; }
.digit.zeroSpin:nth-child(4)::after{ animation-duration: .20s; }
.digit.zeroSpin:nth-child(5)::after{ animation-duration: .15s; }
.digit.zeroSpin:nth-child(6)::after{ animation-duration: .19s; }