.win {
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
  background: rgba(11, 15, 35, 0.8019607843);
}
.win--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}
.win--visible .win__popup {
  animation: win-pop-in 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards, win-shake 0.32s ease-in-out 0.38s, win-glow 0.8s ease-in-out 0.55s infinite;
}
.win--visible .win__amount {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.22s;
}
.win--visible .win__multiplier-value {
  animation: win-mult-pop 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.42s forwards;
}
.win--hiding .win__popup {
  animation: win-pop-out 0.22s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}
.win__popup {
  position: relative;
  z-index: 1;
  width: min(70vw, 360px);
  max-width: 100%;
  height: auto;
  padding: 40px 30px 30px 30px;
  border-radius: 20px;
  background: radial-gradient(85.27% 86.29% at 50% 13.71%, rgba(46, 56, 102, 0.7) 0%, rgba(67, 79, 135, 0.5) 33.98%, rgba(165, 175, 220, 0.5) 80.75%);
  box-shadow: 0 1.362px 0 0 rgba(255, 255, 255, 0.55) inset, 0 0 9.73px 0 rgba(255, 255, 255, 0.6) inset, 0 3.892px 9.73px 0 rgba(9, 33, 63, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform-origin: 50% 60%;
  will-change: transform, opacity;
  transform: translateY(14px) scale(0.92);
  filter: blur(2px);
}
@media (orientation: portrait) {
  .win__popup {
    padding: 30px 20px;
    gap: 10px;
  }
}
.win__popup::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  border-radius: inherit;
  clip-path: inset(0 round 23px);
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0.06) 55%, transparent 65%);
  transform: translateX(-35%) translateY(0);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.win__title-wrap {
  position: relative;
  display: inline-block;
  z-index: 1;
  max-width: 100%;
}
.win__title {
  position: relative;
  overflow: visible;
  font-family: var(--basic-font);
  font-weight: 900;
  font-size: clamp(20px, 6.5vw, 42px);
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  background: linear-gradient(180deg, #F9F104 0%, #FEDD09 52%, #FF8401 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  margin: 0;
}
.win__title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 -1px 0 rgb(255, 139, 7), 0 1px 0 rgb(252, 249, 21), 0 2px 2px rgba(28, 35, 67, 0.8), 0 0 20px rgba(24, 26, 61, 0.85);
}
.win__divider {
  width: 100%;
  height: 2px;
  flex: 0 0 auto;
  align-self: stretch;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.01) 4.31%, rgba(255, 255, 255, 0.16) 49.04%, rgba(255, 255, 255, 0.01) 100%);
}
.win__mult {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--basic-font);
  font-size: clamp(12px, 4vw, 16px);
  font-weight: 700;
  color: #2E3866;
  padding: 0;
}
.win__amount {
  position: relative;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  font-family: var(--basic-font);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1;
  color: #FFFFFF;
  padding: 6px 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.win__amount-stroke {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1C2343 0%, #2176ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 4px transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
  white-space: nowrap;
  pointer-events: none;
}
.win__multiplier {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--basic-font);
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: white;
}
.win__multiplier-label {
  opacity: 0.95;
}
.win__multiplier-value {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: clamp(16px, 3vw, 22px);
  line-height: 1;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  color: white;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
}
.win {
  /* region SPARKLES */
}
.win__dialog-sparkles {
  position: absolute;
  inset: -70px;
  pointer-events: none;
  z-index: 3;
}
.win__sparkles {
  position: absolute;
  inset: -26px;
  pointer-events: none;
  z-index: 2;
}
.win__sparkle {
  position: absolute;
  display: block;
  --star-base: clamp(18px, 3vmin, 42px);
  opacity: 0.9;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  animation: win-twinkle 1.45s ease-out infinite, win-glow-breath 1.45s ease-in-out infinite;
}
.win__sparkle svg {
  width: 100%;
  height: 100%;
  display: block;
}
.win__dialog-sparkles .win__sparkle {
  --star-base: clamp(18px, 3vmin, 42px);
  width: var(--star-base);
  height: var(--star-base);
  animation: win-twinkle 1.45s ease-out infinite;
}
.win__sparkle.s1 {
  left: 8%;
  top: 54%;
  width: 14px;
  height: 14px;
  animation-delay: 0s;
  animation-duration: 1.35s, 1.35s;
}
.win__sparkle.s2 {
  left: 40%;
  bottom: 22%;
  width: 14px;
  height: 14px;
  animation-delay: 0.22s, 0.22s;
  animation-duration: 1.55s, 1.55s;
}
.win__sparkle.s3 {
  right: 10%;
  top: 26%;
  width: 14px;
  height: 14px;
  animation-delay: 0.1s, 0.1s;
  animation-duration: 1.45s, 1.45s;
}
.win__sparkle.s4 {
  right: 3%;
  bottom: 24%;
  width: 26px;
  height: 26px;
  animation-delay: 0.38s, 0.38s;
  animation-duration: 1.6s, 1.6s;
}
.win__sparkle.s5 {
  left: 33%;
  top: 16%;
  width: 18px;
  height: 18px;
  animation-delay: 0.16s, 0.16s;
  animation-duration: 1.5s, 1.5s;
}
.win__sparkle.s6 {
  right: 1%;
  bottom: 44%;
  width: 14px;
  height: 14px;
  animation-delay: 0.52s, 0.52s;
  animation-duration: 1.7s, 1.7s;
}
.win__sparkle.s7 {
  left: -5%;
  bottom: 35%;
  width: 35px;
  height: 35px;
  animation-delay: 0.3s, 0.3s;
  animation-duration: 1.58s, 1.58s;
}
.win__sparkle.p1 {
  left: 5%;
  bottom: 11%;
  width: 55px;
  height: 55px;
  animation-delay: 0.1s;
}
.win__sparkle.p2 {
  left: 11%;
  bottom: 26%;
  width: 31px;
  height: 31px;
  animation-delay: 0.7s;
}
.win__sparkle.p3 {
  left: 15%;
  bottom: 5%;
  width: 38px;
  height: 38px;
  animation-delay: 0.55s;
}
.win__sparkle.p4 {
  right: 12%;
  top: 17%;
  width: 31px;
  height: 31px;
  animation-delay: 0.25s;
}
.win__sparkle.p5 {
  right: 9%;
  top: 5%;
  width: 38px;
  height: 38px;
  animation-delay: 0.7s;
}
.win__sparkle.p6 {
  right: 18%;
  top: -5%;
  width: 22px;
  height: 22px;
  animation-delay: 0.48s;
}
.win {
  /* endregion */
}

@media (orientation: landscape) {
  .win__popup {
    padding: 30px 40px;
    gap: 12px;
  }
  .win__amount {
    font-size: clamp(24px, 5vw, 44px);
  }
}
@keyframes win-pop-in {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.5);
    filter: blur(6px);
  }
  40% {
    opacity: 1;
    transform: translateY(-8px) scale(1.08);
    filter: blur(0);
  }
  60% {
    transform: translateY(3px) scale(0.97);
  }
  80% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes win-shake {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  15% {
    transform: translateX(-4px) rotate(-1.5deg);
  }
  30% {
    transform: translateX(4px) rotate(1.5deg);
  }
  45% {
    transform: translateX(-3px) rotate(-1deg);
  }
  60% {
    transform: translateX(3px) rotate(1deg);
  }
  75% {
    transform: translateX(-1px) rotate(-0.5deg);
  }
  90% {
    transform: translateX(1px) rotate(0.5deg);
  }
}
@keyframes win-pop-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.99);
    filter: blur(0);
  }
}
@keyframes win-glow {
  0%, 100% {
    box-shadow: 0 1.362px 0 rgba(255, 255, 255, 0.55) inset, 0 0 9.73px rgba(255, 255, 255, 0.6) inset, 0 6px 18px rgba(9, 33, 63, 0.95);
  }
  50% {
    box-shadow: 0 1.362px 0 rgba(255, 255, 255, 0.7) inset, 0 0 14px rgba(255, 255, 255, 0.75) inset, 0 3.892px 9.73px rgba(9, 33, 63, 0.9);
  }
}
@keyframes win-twinkle {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }
  18% {
    transform: scale(1.05);
    opacity: 1;
  }
  55% {
    transform: scale(0.95);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}
@keyframes win-glow-breath {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
  50% {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
  }
}
@keyframes win-mult-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    color: #ffffff;
  }
  40% {
    opacity: 1;
    transform: translateY(-4px) scale(1.15);
    color: #5ec5ff;
  }
  70% {
    transform: translateY(2px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    color: #ffffff;
  }
}
/* === DEV ONLY: force popup visible === */
/* ==================================== */
