@font-face {
  font-family: "ChopsUey";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("ChopsUey"), url("fonts/ChopsUey.woff") format("woff");
}

:root {
  --red-deep: #4a080c;
  --red-mid: #6e0f14;
  --red-panel: #2c0508;
  --gold: #ebc85e;
  --gold-dim: #a67c2e;
  --gold-bright: #fff6c8;
  --cream: #faf6ef;
  --glass: rgba(255, 248, 235, 0.06);
  --glass-border: rgba(255, 215, 150, 0.18);
  --fall-dur: 0.66s;
  --fall-stagger: 0.078s;
  --fall-ease: cubic-bezier(0.17, 0.9, 0.32, 1);
  --bg-page: url("img/background.png");
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --fall-dur: 0.12s;
    --fall-stagger: 0s;
    --fall-ease: ease-out;
  }

  .payout-strip.is-visible .payout-strip__amount {
    animation: none;
    transform: none;
    filter: none;
    will-change: auto;
    text-shadow:
      0 0 20px rgba(235, 200, 94, 0.65),
      0 0 36px rgba(235, 200, 94, 0.35),
      0 2px 8px rgba(0, 0, 0, 0.45);
  }

  .payout-strip.is-visible::before {
    animation: none;
    opacity: 0.55;
  }

  .payout-strip__amount--calc-phase {
    animation: none !important;
  }

  .payout-strip__mult:not(.is-empty) {
    animation: none !important;
  }
}

@keyframes payout-value-pulse {
  0%,
  100% {
    transform: scale(1);
    text-shadow:
      0 0 16px rgba(235, 200, 94, 0.5),
      0 0 32px rgba(235, 200, 94, 0.22),
      0 0 48px rgba(255, 200, 100, 0.06),
      0 2px 8px rgba(0, 0, 0, 0.48);
    filter: brightness(1) drop-shadow(0 0 8px rgba(235, 200, 94, 0.32));
  }
  50% {
    transform: scale(1.055);
    text-shadow:
      0 0 28px rgba(255, 240, 180, 0.75),
      0 0 52px rgba(235, 200, 94, 0.38),
      0 0 72px rgba(255, 200, 120, 0.12),
      0 2px 10px rgba(0, 0, 0, 0.52);
    filter: brightness(1.1) drop-shadow(0 0 22px rgba(235, 200, 94, 0.65));
  }
}

@keyframes payout-frame-shimmer {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes mult-badge-glow {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(235, 200, 94, 0.35),
      0 0 28px rgba(255, 220, 140, 0.12),
      0 3px 8px rgba(0, 0, 0, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      inset 0 -1px 0 rgba(120, 80, 20, 0.15);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 22px rgba(255, 230, 160, 0.55),
      0 0 40px rgba(235, 200, 94, 0.22),
      0 3px 10px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      inset 0 -1px 0 rgba(120, 80, 20, 0.12);
    filter: brightness(1.06);
  }
}

@keyframes calc-amount-soft {
  0%,
  100% {
    opacity: 1;
    text-shadow:
      0 0 12px rgba(235, 200, 94, 0.25),
      0 0 24px rgba(255, 220, 150, 0.08),
      0 1px 3px rgba(0, 0, 0, 0.35);
  }
  50% {
    opacity: 0.97;
    text-shadow:
      0 0 18px rgba(255, 236, 180, 0.38),
      0 0 32px rgba(235, 200, 94, 0.15),
      0 1px 4px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  background-color: #1a0608;
  background-image: linear-gradient(180deg, rgba(10, 2, 4, 0.35) 0%, rgba(10, 2, 4, 0.55) 100%), var(--bg-page);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem 2rem;
  overflow-x: hidden;
}

.game {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.game-surface {
  position: relative;
  padding: 1.2rem 0.85rem 1.45rem;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--glass) 0%, rgba(0, 0, 0, 0.22) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


.game-surface:has(.grid.grid--reels) {
  background: linear-gradient(145deg, rgba(255, 248, 235, 0.04) 0%, rgba(0, 0, 0, 0.04) 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-audio {
  position: absolute;
  top: 0.48rem;
  right: 0.4rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff6d8;
  background: transparent;
  isolation: isolate;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s ease;
}

.btn-audio__halo {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(
    from 210deg,
    rgba(255, 236, 190, 0.35),
    rgba(235, 200, 94, 0.15),
    rgba(180, 120, 40, 0.25),
    rgba(255, 248, 220, 0.4),
    rgba(235, 200, 94, 0.2)
  );
  opacity: 0.85;
  animation: btn-audio-halo-spin 10s linear infinite;
  pointer-events: none;
}

.btn-audio__halo::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 28%, rgba(60, 18, 28, 0.5) 0%, rgba(10, 3, 8, 0.96) 62%, rgba(6, 2, 6, 1) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.14),
    inset 0 -6px 14px rgba(0, 0, 0, 0.45);
}

@keyframes btn-audio-halo-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-audio__face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  filter: drop-shadow(0 0 10px rgba(235, 200, 94, 0.25));
}

.btn-audio__svg {
  position: absolute;
  display: block;
}

.btn-audio:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.btn-audio:hover .btn-audio__halo {
  opacity: 1;
}

.btn-audio:active {
  transform: scale(0.94);
}

.btn-audio:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn-audio.is-muted {
  filter: saturate(0.55) brightness(0.92);
}

.btn-audio.is-muted .btn-audio__halo {
  opacity: 0.45;
  animation-play-state: paused;
}

.btn-audio.is-muted .btn-audio__face {
  filter: none;
  color: rgba(250, 246, 239, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .btn-audio__halo {
    animation: none;
    opacity: 0.55;
  }
}

#bgMusic {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0.01;
  pointer-events: none;
}

.site-logo {
  display: block;
  text-align: center;
  margin-bottom: 0.65rem;
  line-height: 0;
}

.site-logo img {
  width: min(280px, 88vw);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.game-title {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  font-size: clamp(1.5rem, 5.5vw, 2.15rem);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0.12rem 0 0.4rem;
  line-height: 1.08;
  background: linear-gradient(
    165deg,
    #fffcef 0%,
    #fff4c4 14%,
    #ffe08a 32%,
    var(--gold) 52%,
    #d4a83a 74%,
    #8a6520 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(42, 22, 6, 0.88);
  paint-order: stroke fill;
  text-shadow: 0 0 28px rgba(235, 200, 94, 0.4);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 14px rgba(255, 220, 140, 0.25));
}

.mult-bar {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.7rem;
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.06) 0%, transparent 45%),
    linear-gradient(165deg, rgba(0, 0, 0, 0.42) 0%, rgba(20, 8, 10, 0.55) 100%);
  border: 1px solid rgba(235, 200, 94, 0.26);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.mult-item {
  flex: 1;
  max-width: 4.75rem;
  text-align: center;
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.42rem 0.22rem;
  border-radius: 11px;
  color: rgba(250, 246, 239, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.38) 100%);
  transition: color 0.32s ease, background 0.32s ease, box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
}

.mult-item.active {
  color: #1a1205;
  background: linear-gradient(165deg, #fffce8 0%, var(--gold) 38%, #b89228 100%);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 26px rgba(235, 200, 94, 0.5),
    0 0 12px rgba(255, 236, 180, 0.25),
    0 3px 10px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: scale(1.04);
}

.payout-strip {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  max-width: 20rem;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  transition:
    opacity 0.32s ease,
    max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.32s ease,
    padding 0.32s ease,
    border-width 0.32s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
}

.payout-strip:not(.is-visible) {
  opacity: 0;
  max-height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 solid transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.payout-strip:not(.is-visible)::before,
.payout-strip:not(.is-visible)::after {
  display: none;
}

.payout-strip.is-visible {
  opacity: 1;
  max-height: 6rem;
  min-height: 1.6rem;
  margin: 0 0 0.85rem;
  padding: 0.68rem 1rem 0.74rem;
  border-width: 1px;
  border-style: solid;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 236, 180, 0.14) 0%, transparent 55%),
    linear-gradient(155deg, rgba(255, 252, 245, 0.1) 0%, transparent 38%),
    linear-gradient(180deg, rgba(235, 200, 94, 0.22) 0%, rgba(18, 12, 6, 0.92) 48%, rgba(5, 3, 2, 0.99) 100%);
  border-color: rgba(255, 224, 150, 0.42);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(235, 200, 94, 0.12) inset,
    0 0 40px rgba(235, 200, 94, 0.22),
    0 0 80px rgba(120, 60, 30, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 12px rgba(0, 0, 0, 0.25);
}

.payout-strip.is-visible::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 2px;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 248, 220, 0.12) 18%,
    rgba(255, 244, 200, 0.95) 50%,
    rgba(255, 248, 220, 0.12) 82%,
    transparent
  );
  pointer-events: none;
  z-index: 1;
  animation: payout-frame-shimmer 2.8s ease-in-out infinite;
  filter: blur(0.2px);
}

.payout-strip.is-visible::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 1px solid rgba(235, 200, 94, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

.payout-strip__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.85rem;
}


.payout-strip__amount--calc-phase {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(0.78rem, 3.35vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff9ec;
  line-height: 1.25;
  animation: calc-amount-soft 2.4s ease-in-out infinite;
  text-shadow:
    0 0 14px rgba(235, 200, 94, 0.3),
    0 0 28px rgba(255, 220, 150, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

.payout-strip__amount {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.24rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.045em;
  color: #fffcee;
  line-height: 1.2;
  transform-origin: center center;
  will-change: transform, filter;
  animation: payout-value-pulse 1.55s ease-in-out infinite;
}

.payout-strip__mult {
  flex-shrink: 0;
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: clamp(0.74rem, 2.9vw, 0.86rem);
  letter-spacing: 0.14em;
  min-width: 2.35rem;
  text-align: center;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  color: #181005;
  background: linear-gradient(165deg, #fffef0 0%, #ffeaa0 18%, var(--gold) 45%, #b88920 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 16px rgba(235, 200, 94, 0.42),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(100, 60, 10, 0.12);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
}

.payout-strip__mult:not(.is-empty) {
  animation: mult-badge-glow 2.2s ease-in-out infinite;
}

.payout-strip__mult.is-empty {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: clamp(4px, 1.4vw, 10px);
  aspect-ratio: 5 / 4;
  width: 100%;
  max-height: min(85vw, 352px);
  margin: 0 auto;
  min-height: 0;
}


.grid.grid--reels {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
}

.reel-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.reel-viewport {
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(235, 200, 94, 0.22);
  box-shadow: none;
}

.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.reel-cell {
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
}

.reel-cell .tile-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.tile {
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  user-select: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: opacity 0.28s ease, filter 0.28s var(--fall-ease);
}

.tile .tile-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  transform: translate3d(0, 0, 0);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.32));
  transition: filter 0.35s var(--fall-ease);
}

.tile.win {
  z-index: 2;
}

.tile.win .tile-img {
  filter: brightness(1.14) saturate(1.12) drop-shadow(0 0 14px rgba(235, 200, 94, 0.5))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.32));
  transition: filter 0.35s var(--fall-ease);
}


.tile.win.pop {
  pointer-events: none;
  border-radius: 12px;
  animation: tileWinAura 3.85s ease-in-out forwards;
}

.tile.win.pop .tile-img {
  animation:
    goldWinIntro 0.68s ease-out forwards,
    winScaleCelebrate 3.17s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.68s 1 forwards;
}

@keyframes tileWinAura {
  0%,
  100% {
    box-shadow:
      0 0 16px rgba(235, 200, 94, 0.35),
      inset 0 0 20px rgba(255, 220, 140, 0.08);
  }
  20% {
    box-shadow:
      0 0 32px rgba(255, 230, 150, 0.65),
      0 0 56px rgba(235, 200, 94, 0.4),
      inset 0 0 24px rgba(255, 240, 200, 0.12);
  }
  45% {
    box-shadow:
      0 0 24px rgba(235, 200, 94, 0.5),
      0 0 40px rgba(255, 215, 120, 0.35),
      inset 0 0 18px rgba(255, 220, 140, 0.1);
  }
  70% {
    box-shadow:
      0 0 36px rgba(255, 235, 160, 0.55),
      0 0 52px rgba(235, 200, 94, 0.38),
      inset 0 0 22px rgba(255, 230, 180, 0.11);
  }
}

@keyframes goldWinIntro {
  0% {
    filter: brightness(1.12) saturate(1.1) drop-shadow(0 0 12px rgba(235, 200, 94, 0.5))
      drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  }
  55% {
    filter: brightness(1.45) saturate(1.38) drop-shadow(0 0 40px rgba(255, 230, 150, 0.95))
      drop-shadow(0 0 22px rgba(235, 200, 94, 0.88)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
  }
  100% {
    filter: brightness(1.22) saturate(1.22) drop-shadow(0 0 26px rgba(255, 220, 120, 0.8))
      drop-shadow(0 4px 10px rgba(0, 0, 0, 0.26));
  }
}

@keyframes winScaleCelebrate {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  11% {
    transform: translate3d(0, 0, 0) scale(0.86);
  }
  24% {
    transform: translate3d(0, 0, 0) scale(1.16);
  }
  38% {
    transform: translate3d(0, 0, 0) scale(0.9);
  }
  52% {
    transform: translate3d(0, 0, 0) scale(1.12);
  }
  66% {
    transform: translate3d(0, 0, 0) scale(0.92);
  }
  80% {
    transform: translate3d(0, 0, 0) scale(1.08);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}


.tile.win.precrash {
  pointer-events: none;
  border-radius: 12px;
  animation: tilePrecrashAura 1.12s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tile.win.precrash .tile-img {
  animation:
    goldPrecrashIntro 0.52s ease-out forwards,
    winScalePrecrash 1.02s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.48s 1 forwards;
}

@keyframes tilePrecrashAura {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(235, 200, 94, 0.32),
      inset 0 0 16px rgba(255, 220, 140, 0.06);
  }
  38% {
    box-shadow:
      0 0 30px rgba(255, 230, 150, 0.58),
      0 0 48px rgba(235, 200, 94, 0.34),
      inset 0 0 22px rgba(255, 240, 200, 0.11);
  }
  72% {
    box-shadow:
      0 0 22px rgba(235, 200, 94, 0.44),
      0 0 38px rgba(255, 215, 120, 0.3),
      inset 0 0 18px rgba(255, 230, 180, 0.09);
  }
}

@keyframes goldPrecrashIntro {
  0% {
    filter: brightness(1.1) saturate(1.08) drop-shadow(0 0 10px rgba(235, 200, 94, 0.45))
      drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  }
  62% {
    filter: brightness(1.38) saturate(1.28) drop-shadow(0 0 32px rgba(255, 230, 150, 0.85))
      drop-shadow(0 0 16px rgba(235, 200, 94, 0.68)) drop-shadow(0 4px 9px rgba(0, 0, 0, 0.22));
  }
  100% {
    filter: brightness(1.2) saturate(1.18) drop-shadow(0 0 22px rgba(255, 220, 120, 0.72))
      drop-shadow(0 4px 10px rgba(0, 0, 0, 0.26));
  }
}

@keyframes winScalePrecrash {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  18% {
    transform: translate3d(0, 0, 0) scale(0.88);
  }
  42% {
    transform: translate3d(0, 0, 0) scale(1.14);
  }
  68% {
    transform: translate3d(0, 0, 0) scale(0.91);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.tile.fall-in {
  animation: fallIn var(--fall-dur) var(--fall-ease) forwards;
  animation-fill-mode: both;
  will-change: transform;
}

.tile.fall-in.fall-r0 {
  animation-delay: calc(var(--fall-stagger) * 0);
}
.tile.fall-in.fall-r1 {
  animation-delay: calc(var(--fall-stagger) * 1);
}
.tile.fall-in.fall-r2 {
  animation-delay: calc(var(--fall-stagger) * 2);
}

.tile.fall-in.fall-r3 {
  animation-delay: calc(var(--fall-stagger) * 3);
}

@keyframes fallIn {
  0% {
    transform: translate3d(0, -138%, 0) scale(0.96);
  }
  52% {
    transform: translate3d(0, 5%, 0) scale(1.018);
  }
  76% {
    transform: translate3d(0, -1.1%, 0) scale(0.997);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile.fall-in {
    will-change: auto;
  }

  .tile.win.pop {
    animation: none;
    box-shadow: 0 0 24px rgba(235, 200, 94, 0.45);
  }

  .tile.win.pop .tile-img {
    animation: none;
    filter: brightness(1.22) saturate(1.15) drop-shadow(0 0 20px rgba(235, 200, 94, 0.65));
  }

  .tile.win.precrash {
    animation: none;
    box-shadow: 0 0 20px rgba(235, 200, 94, 0.4);
  }

  .tile.win.precrash .tile-img {
    animation: none;
    filter: brightness(1.18) saturate(1.12) drop-shadow(0 0 16px rgba(235, 200, 94, 0.55));
  }
}

.bottom-bar {
  margin-top: 1.05rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.04) 0%, transparent 28%),
    linear-gradient(165deg, rgba(0, 0, 0, 0.32) 0%, rgba(12, 4, 6, 0.48) 100%);
  border: 1px solid rgba(235, 200, 94, 0.18);
  border-radius: 18px;
  padding: 0.8rem 0.9rem 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 6px 22px rgba(0, 0, 0, 0.22);
}

.spin-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0.58rem 0 0;
}

.payout-total {
  position: relative;
  width: 100%;
  margin-top: 0.72rem;
  padding-top: 0.62rem;
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.payout-total::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(235, 200, 94, 0.25) 22%,
    rgba(255, 236, 190, 0.45) 50%,
    rgba(235, 200, 94, 0.25) 78%,
    transparent
  );
  pointer-events: none;
}

.payout-total::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, rgba(255, 248, 220, 0.9), var(--gold));
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(235, 200, 94, 0.5);
  pointer-events: none;
}

.payout-total__amount {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: clamp(1rem, 4.2vw, 1.26rem);
  letter-spacing: 0.06em;
  color: #fff8dc;
  text-shadow:
    0 0 20px rgba(235, 200, 94, 0.45),
    0 0 40px rgba(235, 200, 94, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

.btn-spin {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: clamp(0.95rem, 3.2vw, 1.12rem);
  padding: 0.85rem 2.85rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #140c02;
  background: linear-gradient(165deg, #fffef4 0%, #ffe9a0 22%, var(--gold) 42%, #b8891a 100%);
  box-shadow:
    0 4px 0 #6d5010,
    0 0 24px rgba(235, 200, 94, 0.25),
    0 10px 32px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 8px rgba(100, 70, 10, 0.12);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-spin:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow:
    0 4px 0 #6d5010,
    0 0 32px rgba(235, 200, 94, 0.35),
    0 12px 36px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-spin:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #7a5a12,
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-spin:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.site-footer-meta {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(235, 200, 94, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
}

.site-copy {
  margin: 0;
  text-align: center;
  font-size: clamp(0.74rem, 2.05vw, 0.86rem);
  font-weight: 500;
  letter-spacing: 0.045em;
  color: rgba(250, 246, 239, 0.42);
  line-height: 1.35;
}

.site-license-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.22rem 0.32rem;
}

.site-license-img {
  display: block;
  height: clamp(13px, 3.1vw, 20px);
  width: auto;
  max-width: min(58px, 17vw);
  object-fit: contain;
  object-position: center;
  opacity: 0.95;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.38));
}


.welcome-overlay[hidden] {
  display: none !important;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 185;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(6, 2, 4, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.welcome-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.welcome-dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 1.75rem 1.35rem 1.65rem;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 100% 70% at 50% -15%, rgba(235, 200, 94, 0.18) 0%, transparent 52%),
    linear-gradient(165deg, rgba(37, 14, 48, 0.98) 0%, rgba(14, 4, 10, 0.99) 55%, rgba(8, 2, 6, 1) 100%);
  border: 1px solid rgba(235, 200, 94, 0.48);
  box-shadow:
    0 0 0 1px rgba(255, 248, 220, 0.06) inset,
    0 0 48px rgba(235, 200, 94, 0.22),
    0 18px 48px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.94) translate3d(0, 10px, 0);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome-overlay.is-open .welcome-dialog {
  transform: scale(1) translate3d(0, 0, 0);
}

.welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.welcome-logo {
  width: min(100%, min(300px, 82vw));
  height: auto;
  max-height: 78px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.welcome-title {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  font-size: clamp(1.35rem, 5.2vw, 1.85rem);
  line-height: 1.12;
  letter-spacing: 0.06em;
  text-transform: none;
  margin: 0;
  background: linear-gradient(
    165deg,
    #fffcef 0%,
    #fff4c4 14%,
    #ffe08a 32%,
    var(--gold) 52%,
    #d4a83a 74%,
    #8a6520 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(42, 22, 6, 0.88);
  paint-order: stroke fill;
  text-shadow: 0 0 24px rgba(235, 200, 94, 0.35);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 12px rgba(255, 220, 140, 0.2));
}

.btn-welcome-start {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  letter-spacing: 0.14em;
  font-size: clamp(1.05rem, 3.8vw, 1.28rem);
  padding: 0.95rem 2rem;
  width: 100%;
  max-width: 240px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(165deg, #f4feff 0%, #a0e6ff 22%, #5e98eb 42%, #1a57b8 100%);
  box-shadow:
    0 4px 0 #6d5010,
    0 0 28px rgba(235, 200, 94, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 8px rgba(100, 70, 10, 0.12);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-welcome-start:hover {
  filter: brightness(1.06);
  box-shadow:
    0 4px 0 #6d5010,
    0 0 36px rgba(235, 200, 94, 0.42),
    0 12px 32px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 8px rgba(100, 70, 10, 0.1);
}

.btn-welcome-start:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #7a5a12,
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-welcome-start:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-overlay,
  .welcome-dialog {
    transition: none;
  }

  .welcome-dialog {
    transform: none;
  }
}

.win-overlay[hidden] {
  display: none !important;
}

.win-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 2, 4, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.win-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
}

.win-fireworks {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

@keyframes fw-particle-fly {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  72% {
    opacity: 0.95;
  }
  100% {
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0.15);
    opacity: 0;
  }
}

.fw-particle {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fw-particle-fly var(--dur, 0.92s) cubic-bezier(0.12, 0.88, 0.32, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .fw-particle {
    animation-duration: 0.01s;
    opacity: 0;
  }
}

.win-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 348px;
  text-align: center;
  padding: 1.85rem 1.45rem 1.55rem;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(235, 200, 94, 0.14) 0%, transparent 55%),
    linear-gradient(165deg, rgba(52, 14, 22, 0.98) 0%, rgba(16, 4, 10, 0.99) 55%, rgba(10, 2, 6, 1) 100%);
  border: 1px solid rgba(235, 200, 94, 0.5);
  box-shadow:
    0 0 0 1px rgba(255, 248, 220, 0.06) inset,
    0 0 56px rgba(235, 200, 94, 0.2),
    0 20px 56px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(0.92) translate3d(0, 12px, 0);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.win-dialog::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(235, 200, 94, 0.15) 20%,
    rgba(255, 240, 180, 0.85) 50%,
    rgba(235, 200, 94, 0.15) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.win-overlay.is-open .win-dialog {
  transform: scale(1) translate3d(0, 0, 0);
}

.win-head {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow:
    0 0 28px rgba(235, 200, 94, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.45);
  margin-bottom: 0.5rem;
}

.win-head::after {
  content: "";
  display: block;
  width: min(72px, 28vw);
  height: 3px;
  margin: 0.65rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(235, 200, 94, 0.9), transparent);
  box-shadow: 0 0 14px rgba(255, 230, 150, 0.5);
}

.win-content {
  margin-bottom: 1.45rem;
}

.win-body-lead,
.win-body-tail {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  font-size: clamp(0.82rem, 3.4vw, 1rem);
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: rgba(250, 246, 239, 0.88);
  text-transform: uppercase;
}

.win-body-lead {
  margin-bottom: 0.35rem;
}

.win-body-tail {
  margin-top: 0.35rem;
  color: rgba(250, 246, 239, 0.72);
  font-size: clamp(0.72rem, 2.9vw, 0.84rem);
  letter-spacing: 0.05em;
}

.win-prize-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.75rem auto;
  padding: 0.62rem 1.15rem;
  max-width: 100%;
  border-radius: 16px;
  background: linear-gradient(
    155deg,
    rgba(255, 248, 220, 0.16) 0%,
    rgba(235, 200, 94, 0.1) 45%,
    rgba(120, 80, 30, 0.12) 100%
  );
  border: 1px solid rgba(255, 230, 150, 0.45);
  box-shadow:
    0 0 32px rgba(235, 200, 94, 0.28),
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

@keyframes win-prize-glow {
  0%,
  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55))
      drop-shadow(0 0 16px rgba(235, 200, 94, 0.5))
      drop-shadow(0 0 36px rgba(235, 200, 94, 0.22));
  }
  50% {
    transform: scale(1.09);
    filter:
      drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6))
      drop-shadow(0 0 28px rgba(255, 236, 160, 0.95))
      drop-shadow(0 0 52px rgba(235, 200, 94, 0.55))
      brightness(1.08);
  }
}

@keyframes win-prize-glow-fallback {
  0%,
  100% {
    transform: scale(1);
    text-shadow:
      0 0 16px rgba(255, 230, 150, 0.75),
      0 0 32px rgba(235, 200, 94, 0.45),
      0 2px 6px rgba(0, 0, 0, 0.55);
  }
  50% {
    transform: scale(1.09);
    text-shadow:
      0 0 28px rgba(255, 248, 200, 1),
      0 0 48px rgba(235, 200, 94, 0.65),
      0 0 72px rgba(235, 200, 94, 0.35),
      0 3px 8px rgba(0, 0, 0, 0.6);
    filter: brightness(1.1);
  }
}

.win-prize {
  display: inline-block;
  transform-origin: center center;
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  font-size: clamp(1.55rem, 7vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(
    180deg,
    #fffef5 0%,
    #fff2b8 22%,
    #ebc85e 48%,
    #c9a32e 72%,
    #a67c28 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 14px rgba(235, 200, 94, 0.4));
}

.win-overlay.is-open .win-prize {
  will-change: transform, filter;
  animation: win-prize-glow 1.55s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .win-overlay.is-open .win-prize {
    animation: none;
    will-change: auto;
    transform: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 20px rgba(235, 200, 94, 0.55));
  }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .win-prize {
    color: var(--gold-bright);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    filter: none;
    text-shadow:
      0 0 18px rgba(255, 230, 150, 0.85),
      0 2px 4px rgba(0, 0, 0, 0.5);
  }

  .win-overlay.is-open .win-prize {
    animation: win-prize-glow-fallback 1.55s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  @supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .win-overlay.is-open .win-prize {
      animation: none;
      filter: none;
      text-shadow:
        0 0 22px rgba(255, 230, 150, 0.9),
        0 0 40px rgba(235, 200, 94, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.55);
    }
  }
}

.btn-win-ok {
  font-family: "ChopsUey", "Chop Suey", fantasy;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-size: clamp(0.82rem, 3vw, 0.95rem);
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #1a1003;
  background: linear-gradient(165deg, #fff8dc 0%, var(--gold) 38%, #c49a28 100%);
  box-shadow:
    0 3px 0 #7a5a12,
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-win-ok:hover {
  filter: brightness(1.06);
}

.btn-win-ok:active {
  transform: translateY(2px);
}