:root {
  --app-base-width: 496px;
  --app-base-height: 668px;
  --app-scale: 1;
  --candy-ink: #4a1840;
  --candy-ink-soft: #8a3a72;
  --panel-text: #4a1840;
  --panel-shadow: rgba(120, 30, 110, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

html {
  background: transparent;
}

/* fora do card e transparente, como nos demais slots (train/golden-egypt) —
   o cenario doce fica todo DENTRO do .container (frame-background.png) */
body {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden !important;
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", "Segoe UI",
    sans-serif;
  background: transparent;
  color: var(--panel-text);
}

body,
body * {
  -webkit-user-select: none;
  user-select: none;
}

button,
img {
  -webkit-user-drag: none;
}

/* ===== Loader ===== */
.app-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 24px 42px;
  border-radius: inherit;
  background:
    url("assets/capa.png") center top / cover no-repeat,
    #2c0b45;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.app-loader-card {
  width: min(320px, 100%);
  padding: 22px 18px;
  border: 1px solid rgba(255, 184, 221, 0.45);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 230, 246, 0.98),
    rgba(247, 214, 255, 0.98)
  );
  box-shadow:
    0 20px 70px rgba(120, 30, 110, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-align: center;
  color: var(--candy-ink);
}

.app-loader-title,
.app-loader-status,
.app-loader-progress {
  display: block;
}

.app-loader-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.app-loader-status {
  margin-bottom: 14px;
  color: var(--candy-ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.app-loader-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(140, 40, 120, 0.18);
}

.app-loader-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5fa2, #c084fc);
  transition: width 0.16s ease;
}

.app-loader-progress {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--candy-ink-soft);
}

/* ===== Chassis ===== */
.container {
  position: relative;
  flex: 0 0 auto;
  width: var(--app-base-width);
  height: var(--app-base-height);
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  border-radius: 26px;
  transform: scale(var(--app-scale));
  transform-origin: bottom center;
  background: linear-gradient(180deg, #4a1466 0%, #2c0b45 100%);
  box-shadow: 0 24px 70px rgba(120, 30, 110, 0.35);
}

/* Frame image lifted onto its own layer so .layout-center sits behind it */
.container.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: 26px;
  background: url("assets/frame-background.png") top center / 496px 668px
    no-repeat;
}

.frame-layer {
  display: none;
}

.shell::before,
.shell::after {
  content: none;
}

/* ===== Top bar ===== */
.layout-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.slot-back {
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.slot-back img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(120, 30, 110, 0.4));
}

.slot-back:hover {
  opacity: 0.85;
}

.mute {
  border: none;
  outline: none;
  width: 52px;
  height: 52px;
  background-color: transparent;
  background-image: url("assets/sound-on.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  z-index: 6;
  filter: drop-shadow(0 3px 5px rgba(120, 30, 110, 0.4));
}

.mute.unmute {
  background-image: url("assets/sound-off.png");
}

/* ===== Header ===== */
.slot-header {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-bottom: 6px;
}

.slot-title {
  font-size: 44px;
  font-weight: 900;
  background: linear-gradient(180deg, #ff4f8d 0%, #ff8ac1 50%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.5);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
}

.slot-subtitle {
  margin: 6px 0 0;
  font-weight: 800;
  color: var(--candy-ink-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ===== Grid stage ===== */
.layout-center {
  position: absolute;
  left: 6%;
  top: 13%;
  width: 81%;
  height: 55%;
  z-index: 3;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background:
    url("assets/frame-reels-bg.png") center / cover no-repeat,
    #3a1160;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.28),
    inset 0 4px 14px rgba(40, 8, 60, 0.5);
}

#slot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  padding: 6px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#reels {
  display: grid;
  grid-template-columns: repeat(var(--grid-w, 5), 1fr);
  grid-template-rows: repeat(var(--grid-h, 5), 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 14px;
  box-shadow: inset 0 2px 8px rgba(40, 8, 60, 0.3);
  overflow: hidden;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  height: 90%;
  align-self: center;
  justify-self: center;
  border-radius: 12px;
  transition:
    transform 180ms ease,
    filter 180ms ease;
  animation: cell-drop 280ms ease-out;
  overflow: hidden;
}

.cell-img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(120, 30, 110, 0.35));
  pointer-events: none;
}

.cell-win {
  animation: cell-pulse 700ms ease-in-out infinite;
  z-index: 1;
}

.cell-mult {
  position: absolute;
  top: 2px;
  right: 2px;
  background: linear-gradient(180deg, #ffd84d, #ff8a00);
  color: #4a1a00;
  font-weight: 900;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 999px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  line-height: 1.2;
  z-index: 3;
}

#reels.is-spinning .cell {
  animation: cell-shake 200ms ease-in-out infinite;
  filter: blur(1px);
}

.cluster-overlay {
  position: absolute;
  inset: 6px;
  z-index: -1;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  pointer-events: none;
  filter: blur(16px) brightness(1.25) saturate(1.35);
}

.cluster-glow-blob {
  animation: cluster-glow 700ms ease-in-out infinite;
}

@keyframes cell-drop {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cell-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
    filter: brightness(1.15);
  }
}

@keyframes cell-shake {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes cluster-glow {
  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* ===== Candy mascot (gif on special wins) ===== */
.candy-mascot {
  position: absolute;
  right: -84px;
  top: 205px;
  width: 309px;
  height: auto;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(74, 8, 40, 0.4));
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

.candy-mascot.is-animating {
  filter: drop-shadow(0 10px 22px rgba(74, 8, 40, 0.45))
    drop-shadow(0 0 26px rgba(255, 140, 210, 0.75));
  animation: mascot-pop 0.5s ease;
}

@keyframes mascot-pop {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* ===== Free spins badge ===== */
.freespins-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd84d, #ff8a00);
  color: #4a1a00;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
  box-shadow:
    0 6px 14px rgba(255, 140, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  z-index: 8;
  white-space: nowrap;
  animation: cell-pulse 1.2s ease-in-out infinite;
}

.freespins-badge.is-visible {
  display: inline-flex;
}

.freespins-badge-icon {
  font-size: 15px;
}

/* ===== Turbo + how to play (na barra de baixo) ===== */
#fast-forward,
#fast-alert {
  position: relative;
  flex: 0 0 auto;
  z-index: 14;
}

/* ===== How-to panel ===== */
.slot-blue-panel {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: radial-gradient(
      circle at 50% 18%,
      rgba(255, 184, 221, 0.4),
      transparent 36%
    ),
    linear-gradient(
      180deg,
      rgba(255, 95, 162, 0.96) 0%,
      rgba(124, 58, 237, 0.97) 100%
    );
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.slot-blue-panel.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.slot-blue-panel-card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 28px 24px;
  overflow-y: auto;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  background: rgba(74, 24, 64, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  scroll-behavior: smooth;
}

.slot-blue-panel-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 92px;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.7);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.slot-blue-panel-close:hover {
  filter: brightness(1.08);
}

.slot-blue-panel-title {
  display: block;
  margin-bottom: 14px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-align: center;
}

.slot-blue-panel-list {
  margin: 0;
  padding-left: 22px;
  color: #fff3fb;
  font-size: 15px;
  line-height: 1.45;
}

.slot-blue-panel-list li + li {
  margin-top: 10px;
}

/* ===== Win value display ===== */
.layout-points {
  position: absolute;
  left: 0;
  right: 0;
  top: 70.5%;
  z-index: 10;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
}

#value-earning {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 286px;
  max-width: 90%;
  height: 56px;
  padding: 0 18px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: linear-gradient(180deg, #ff5fa2 0%, #c41a64 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    0 8px 18px rgba(192, 26, 100, 0.4);
  text-shadow: 0 1px 2px rgba(74, 8, 40, 0.45);
}

#value-earning::after {
  content: "GANHO";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd84d, #ff8a00);
  color: #4a1a00;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#value-earning-number {
  display: block;
  width: 100%;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  line-height: 1;
}

/* ===== Bottom controls ===== */
.layout-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  gap: 8px;
  width: 100%;
}

.layout-bottom-group1 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-bottom-group2 {
  display: grid;
  grid-template-columns: repeat(2, 54px);
  grid-template-areas:
    "bet bet"
    "decrease increase";
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: 7px 10px;
  flex: 0 0 auto;
}

.layout-bottom-group1,
.layout-bottom-group3 {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.item4-col-1,
.item4-col-3 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
}

.item4-col-1 {
  width: 116px;
  height: 56px;
  justify-content: center;
  padding-left: 14px;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #ffffff, #ffd5ea);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(192, 30, 110, 0.22);
}

.item4-col-1::before {
  content: "SALDO";
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #c4216d;
}

.item4-col-3 {
  grid-area: bet;
  width: 118px;
  height: 48px;
  flex-direction: column;
  gap: 1px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #ffffff, #ffd5ea);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(192, 30, 110, 0.22);
}

#coins,
#value-bet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #c4216d;
}

#coins {
  width: 100%;
  align-items: flex-start;
}

#value-bet::after {
  content: "APOSTA";
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #c4216d;
}

#value-earning-number,
#coins-number,
#value-bet-number {
  position: relative;
  z-index: 1;
  display: block;
  font-weight: 900;
  line-height: 1;
}

#coins-number {
  font-size: 19px;
  width: 100%;
  text-align: left;
}

#value-bet-number {
  font-size: 20px;
}

.item4-col-2,
.item4-col-4 {
  position: relative;
  width: 54px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #ffd5ea);
  border: 2px solid rgba(236, 106, 169, 0.6);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    0 4px 10px rgba(192, 30, 110, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.item4-col-2 {
  grid-area: decrease;
}

.item4-col-4 {
  grid-area: increase;
}

#increase-value-bet,
#decrease-value-bet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  outline: none;
  border: none;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  color: #c4216d;
  font-size: 30px;
  font-weight: 900;
}

#decrease-value-bet::before {
  content: "-";
}

#increase-value-bet::before {
  content: "+";
}

#increase-value-bet:hover,
#decrease-value-bet:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ===== Spin button ===== */
.button-1 {
  width: 98px;
  height: 98px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.button-1-small {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.button-1-front {
  position: relative;
  width: 98px;
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

#spin .button-1-front {
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(
      circle at 35% 28%,
      rgba(255, 255, 255, 0.85),
      transparent 30%
    ),
    linear-gradient(180deg, #ff5fa2 0%, #ff2d7a 60%, #c41a64 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -8px 18px rgba(139, 14, 71, 0.4),
    0 10px 22px rgba(196, 26, 100, 0.4);
}

#spin .button-1-front::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.button-1-small .button-1-front {
  width: 48px;
  height: 48px;
}

#fast-forward .button-1-front,
#fast-alert .button-1-front {
  z-index: 21;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(
      circle at 35% 28%,
      rgba(255, 255, 255, 0.85),
      transparent 30%
    ),
    linear-gradient(180deg, #c084fc, #7e3af2);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -4px 10px rgba(76, 29, 149, 0.4),
    0 6px 14px rgba(124, 58, 237, 0.35);
}

#fast-forward .button-1-front::before,
#fast-alert .button-1-front::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.button-1-front-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(74, 8, 40, 0.5);
}

#spin .button-1-front-text {
  width: auto;
  height: auto;
}

#spin .button-1-front-text::before {
  content: "SPIN";
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px 0 rgba(139, 14, 71, 0.55),
    0 6px 12px rgba(0, 0, 0, 0.3);
}

.fast-forward-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateX(2px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  pointer-events: none;
}

.fast-forward-icon svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}

.fast-forward-chevron {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(76, 29, 149, 0.55))
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
  opacity: 0.9;
}

#fast-forward.is-active .button-1-front-text,
#fast-forward[aria-pressed="true"] .button-1-front-text {
  opacity: 0;
}

#fast-forward.is-active .fast-forward-chevron-1,
#fast-forward[aria-pressed="true"] .fast-forward-chevron-1 {
  animation: fast-forward-pulse 0.7s ease-in-out infinite;
}

#fast-forward.is-active .fast-forward-chevron-2,
#fast-forward[aria-pressed="true"] .fast-forward-chevron-2 {
  animation: fast-forward-pulse 0.7s ease-in-out infinite 0.12s;
}

@keyframes fast-forward-pulse {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

#fast-alert .button-1-front-text::before {
  content: "?";
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  text-shadow:
    0 1px 0 rgba(76, 29, 149, 0.55),
    0 3px 6px rgba(0, 0, 0, 0.3);
}

.button-1:hover .button-1-front {
  filter: brightness(1.07);
}

.button-1:active .button-1-front {
  transform: translateY(3px);
}

.button-1.is-active .button-1-front,
.button-1[aria-pressed="true"] .button-1-front {
  filter: saturate(1.2) brightness(1.08);
}

.button-1:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5) brightness(0.95);
  opacity: 0.7;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 180px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #ffe1f0);
  border: 1px solid rgba(236, 106, 169, 0.4);
  color: #c4216d;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(192, 30, 110, 0.28);
  animation: toast-in 0.18s ease;
}

.toast.is-error {
  border-color: rgba(255, 90, 90, 0.45);
  color: #c41a3a;
}

.toast.is-success {
  border-color: rgba(124, 58, 237, 0.4);
  color: #7e3af2;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Win celebration overlay ===== */
.result-overlay-shell {
  position: absolute;
  inset: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
  will-change: opacity, transform;
}

.result-overlay-shell.is-visible {
  opacity: 1;
  visibility: visible;
  animation: win-overlay-hit 0.42s cubic-bezier(0.2, 0.9, 0.22, 1);
}

.result-overlay-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 50% 45%,
      rgba(255, 184, 221, 0.4),
      transparent 32%
    ),
    rgba(74, 24, 64, 0.45);
  pointer-events: none;
  animation: win-overlay-flash 0.8s ease-out;
}

.result-lottie {
  position: relative;
  z-index: 1;
  width: 460px;
  height: 300px;
  max-width: 90%;
  transform: scale(1.4);
  transform-origin: center center;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 28px rgba(255, 138, 193, 0.5));
  animation: win-lottie-pulse 1s ease-in-out infinite;
}

.result-overlay-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#slot-earning-container {
  min-width: 170px;
  min-height: 46px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow:
    0 3px 6px rgba(74, 8, 40, 0.45),
    0 0 18px rgba(255, 138, 193, 0.75);
  animation: win-points-pulse 0.78s ease-in-out infinite;
}

@keyframes win-overlay-hit {
  0% {
    transform: scale(0.94);
  }

  60% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes win-overlay-flash {
  0% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

@keyframes win-lottie-pulse {
  0%,
  100% {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34))
      drop-shadow(0 0 24px rgba(255, 138, 193, 0.45));
  }

  50% {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34))
      drop-shadow(0 0 38px rgba(255, 138, 193, 0.7));
  }
}

@keyframes win-points-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

/* ===== Fatal error ===== */
.fatal-error {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(74, 24, 64, 0.9);
}

.fatal-error-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 132, 178, 0.4);
  background: linear-gradient(180deg, #ffffff, #ffe1f0);
  color: #c4216d;
  text-align: center;
  box-shadow: 0 12px 28px rgba(120, 30, 110, 0.34);
}

.fatal-error-card strong {
  font-size: 16px;
  font-weight: 800;
}

.fatal-error-card span {
  font-size: 13px;
  line-height: 1.4;
}
