:root {
  --black: #14110d;
  --charcoal: #1e1912;
  --panel: #241e15;
  --panel-2: #2b241a;
  --hairline: rgba(212, 175, 55, 0.22);
  --gold: #d4af37;
  --gold-light: #f1de9b;
  --gold-dim: #8c7328;
  --champagne: #f2e6c9;
  --muted: #a69b87;
  --win-green: #3fbe7a;
  --cell: 52px;
}
* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor:
    url("./assets/cursor.png") 5 2,
    pointer !important;
}

*::-webkit-scrollbar {
  display: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--champagne);
  font-family: "Manrope", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  cursor:
    url("./assets/cursor.png") 5 2,
    pointer !important;
}
body {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0px 16px 50px 16px;
}

/* html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.video-bg {
  position: fixed;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.video-bg video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
} */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url(./assets/background.webp) center / cover no-repeat;

  /* background-image: var(--game-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat; */

  will-change: transform;
}
.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-light);
  opacity: 0;
  box-shadow: 0 0 4px 1px var(--gold);
  animation: twinkle 5.5s ease-in-out infinite;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
  50% {
    opacity: 0.75;
    transform: scale(1);
  }
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 160px;
  opacity: 0;
}

#app.active {
  animation: easein 0.5s linear;
}

@keyframes easein {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

header {
  text-align: center;
  position: absolute;
  top: -140px;
  z-index: -1;
}
header img {
  width: 300px;
}
header .crest {
  font-size: 20px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 2px;
}
h1 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(30px, 8.5vw, 42px);
  line-height: 1;
  margin: 0;
  background: linear-gradient(
    180deg,
    var(--gold-light) 10%,
    var(--gold) 55%,
    var(--gold-dim) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(212, 175, 55, 0.25);
}
header .tagline {
  margin: 6px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}
header .tagline::before,
header .tagline::after {
  content: "◆";
  color: var(--gold-dim);
  margin: 0 8px;
  font-size: 8px;
  vertical-align: middle;
}

.stats-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  /* background: linear-gradient(180deg, var(--panel-2), var(--panel)); */
  position: relative;
  /* border: 1px solid var(--hairline); */
  border-radius: 14px;

  /* box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03); */
}

.stats-bar img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: auto;
  z-index: -2;
  filter: saturate(1.2);
}

.stat {
  padding: 9px 6px;
  text-align: center;
  border-right: 1px solid var(--hairline);
}
.stat:last-child {
  border-right: none;
}
.stat .label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 3px;
  font-weight: 700;
}
.stat .value {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--champagne);
  font-variant-numeric: tabular-nums;
}
.stat.win .value {
  color: var(--win-green);
}
.stat.win .value.pulse {
  animation: pulseWin 0.5s ease;
}
@keyframes pulseWin {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

#machine {
  position: relative;
  width: 100%;
  padding: 12px;
  border-radius: 22px;
  /* background: linear-gradient(155deg, #332918, #1c170f 60%); 
  border: 1px solid var(--gold-dim); 
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(212, 175, 55, 0.15),
    inset 0 2px 10px rgba(0, 0, 0, 0.5); */
}

.back {
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 185%; /* % of #machine's width — tune this number to taste */
  height: auto; /* preserves the image's real aspect ratio, no crop */
  pointer-events: none;
  z-index: -5;
  /* saturate/contrast are baked into machine-back.webp */
}

#machine::before {
  content: "";
  position: absolute;
  inset: 6px;
  /* border: 1px solid rgba(212, 175, 55, 0.35); */
  border-radius: 16px;
  pointer-events: none;
}

#banner {
  position: relative;
  text-align: center;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #3a3120, #241d13);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 9px 10px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 14px;
  color: var(--gold-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: color 0.2s ease;
}
#banner.win-mode {
  color: var(--win-green);
}

#board {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  /* background: radial-gradient(ellipse at 50% 15%, #241d14, #150f0a 75%); */

  border-radius: 14px;
  overflow: hidden;
}

#board img {
  /* brightness/contrast are baked into assets/gems/*.webp (a live filter on
     every tile forced an offscreen pass per gem, per frame) */
  user-select: none;
  -webkit-user-drag: none;
}

.tile {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cell);
  height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.34s cubic-bezier(0.4, 0.7, 0.3, 1);
  will-change: transform;

  /* filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); */
}
.tile.dealing {
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}
.tile img {
  width: 76%;
  height: 76%;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}
.tile.popping img {
  transform: scale(1.35);
  opacity: 0;
}
.tile.cluster-glow img {
  /* filter: drop-shadow(0 0 5px var(--gold-light))
    drop-shadow(0 0 10px rgba(212, 175, 55, 0.85))
    drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); */
}

.float-pop {
  position: absolute;
  pointer-events: none;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-style: italic;
  color: var(--gold-light);
  font-size: 14px;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(212, 175, 55, 0.5);
  transform: translate(-50%, -50%);
  animation: floatUp 1s ease-out forwards;
  white-space: nowrap;
  z-index: 5;
}
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1);
  }
}

.mult-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1408;
  font-family: "Playfair Display", serif;
  font-weight: 800;
  font-style: italic;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-6px) scale(0.8);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.mult-badge.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#betRow {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

#betRow img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-180deg);
  width: 140%;
  height: auto;
  z-index: -2;
  filter: saturate(1.2);
}

#betPlus {
  background-image: url(/assets/plus.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#betPlus:active {
  transform: scale(0.96);
  background-color: transparent;
}

#betMinus {
  background-image: url(/assets/minus.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#betMinus:active {
  transform: scale(0.96);
  background-color: transparent;
}

.bet-adj {
  display: flex;
  padding: 5px;
  align-items: center;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  flex: 1;
}
.bet-adj button {
  width: 46px;
  height: 46px;
  background: transparent;
  border: none;
  color: var(--gold-light);
  font-size: 20px;
  font-weight: 700;
  /* cursor:
    url("./assets/cursor.png") 12 12,
    auto; */
  flex: none;
}
.bet-adj button:active {
  background: rgba(212, 175, 55, 0.12);
}
.bet-mid {
  flex: 1;
  text-align: center;
}
.bet-mid .label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}
.bet-mid .amt {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--champagne);
}

#paytableBtn {
  background-image: url(assets/layer.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#autoBtn {
  background-image: url(assets/layer.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#muteBtn {
  background-image: url(assets/layer.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#playBtn {
  flex: none;
  width: 58px;
  height: 58px;
  background-image: url(/assets/btn.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  /* cursor:
    url("./assets/cursor.png") 5 2,
    auto; */
  transition:
    transform 0.12s ease,
    opacity 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  filter: contrast(1.3) brightness(1.3);
}

#playBtn:active {
  transform: scale(0.96);
}
#playBtn:disabled {
  opacity: 0.45;
}
#playBtn .tri {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #082613;
}

.controls-row {
  width: 100%;
  display: flex;
  gap: 10px;
}
.ghost-btn {
  flex: 1;
  background-color: transparent;
  color: var(--champagne);
  border: 0;
  padding: 11px 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* cursor:
    url("./assets/cursor.png") 12 12,
    auto; */
}
.ghost-btn:active {
  transform: scale(0.97);
}
.ghost-btn.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1408;
  border-color: transparent;
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(10, 8, 5, 0.82);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0s linear 0.28s;
}
#overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.modal {
  width: min(88vw, 360px);
  background: linear-gradient(160deg, #2b2314, #181209);
  border: 1px solid var(--gold-dim);
  border-radius: 18px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(212, 175, 55, 0.15);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal .close {
  /* cursor:
    url("./assets/cursor.png") 12 12,
    auto; */
  position: fixed;
  top: -15px;
  right: -15px;
  z-index: 1000;
  width: 35px;
}

#overlay.show .modal {
  transform: translateY(0) scale(1);
}
.modal .icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.modal h2 {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--gold-light);
}
.modal p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.modal button.primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(
    180deg,
    var(--gold-light),
    var(--gold) 55%,
    var(--gold-dim)
  );
  color: #1a1408;
  /* cursor:
    url("./assets/cursor.png") 12 12,
    auto; */
}
.pay-table {
  text-align: left;
  margin: 0 0 18px;
}

.modal {
  overflow-y: auto;

  /* Firefox */
  scrollbar-width: none;

  /* Chrome, Edge, Safari */
  -ms-overflow-style: none;
}

.modal::-webkit-scrollbar {
  display: none;
}

.pay-section-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 12px 0 4px;
}
.pay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline);
}
.pay-row:last-child {
  border-bottom: none;
}
.pay-row img {
  width: 26px;
  height: 26px;
  flex: none;
}
.pay-row .pname {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--champagne);
}
.pay-row .pmult {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  color: var(--gold-light);
  font-size: 12.5px;
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1408;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 9px 18px;
  border-radius: 30px;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

footer.hint {
  text-align: center;
  font-size: 11px;
  color: white;
  letter-spacing: 0.03em;
  max-width: 340px;
  line-height: 1.6;
}
footer.hint b {
  color: var(--gold-light);
  font-weight: 700;
}

.coin-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}
.coin {
  position: absolute;
  top: -30px;
  font-size: 22px;
  will-change: transform;
  animation: coinFall linear forwards;
}

@keyframes coinFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.9;
  }
}

/* -----------------------------------playtable-------------------------------------- */

#paytableOverlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(10, 8, 5, 0.82);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.28s ease;
}
.pt-modal-out {
  position: relative;
  max-height: 80vh;
}

#closebtn {
  position: absolute;
  top: 20px;
  right: -5px;
  width: 30px;
  height: 30px;
  z-index: 2;
}

.pt-modal {
  position: relative;
  width: min(88vw, 360px);
  max-height: 80vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #2b2314, #181209);
  border: 1px solid var(--gold-dim);
  border-radius: 18px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(212, 175, 55, 0.15);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.pt-modal::-webkit-scrollbar {
  display: none;
}
.pt-toggle:checked ~ #paytableOverlay .pt-modal {
  transform: translateY(0) scale(1);
}

.pt-header {
  margin-bottom: 16px;
}
.pt-title {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--gold-light);
}
.pt-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.pt-table {
  text-align: left;
}
.pt-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 12px 0 4px;
}
.pt-section-title img {
  width: 22px;
  height: 22px;
}
.pt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline);
}
.pt-row:last-child {
  border-bottom: none;
}
.pt-row .pt-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--champagne);
}
.pt-row .pt-mult {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  color: var(--gold-light);
  font-size: 12.5px;
}

@media (max-width: 400px) {
  :root {
    --cell: 44px;
  }
  #betRow img {
    height: 100px;
  }
}

/* ================================
   COMBO ANIMATION
================================ */

.combo-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;

  width: 220px;
  height: 150px;

  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;

  pointer-events: none;

  display: flex;
  align-items: center;
  justify-content: center;
}

.combo-content {
  position: relative;
  z-index: 3;

  display: flex;
  flex-direction: column;
  align-items: center;

  font-family: "Playfair Display", serif;

  text-shadow:
    0 3px 0 #5b3300,
    0 0 10px rgba(255, 210, 70, 0.9),
    0 0 30px rgba(255, 170, 0, 0.8);

  animation: comboContent 0.8s cubic-bezier(0.17, 0.89, 0.32, 1.3) forwards;
}

.combo-label {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.18em;

  color: #fff4b0;
}

.combo-content strong {
  margin-top: -8px;

  font-size: 64px;
  line-height: 1;

  color: #ffd84a;

  -webkit-text-stroke: 2px #8a4f00;
}

.combo-rays {
  position: absolute;
  inset: -50px;

  border-radius: 50%;

  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 220, 80, 0) 0deg 8deg,
    rgba(255, 220, 80, 0.35) 9deg 11deg,
    rgba(255, 220, 80, 0) 12deg 20deg
  );

  animation:
    comboRays 1s linear forwards,
    comboRaysScale 0.8s ease-out forwards;
}

.combo-animation.show {
  animation: comboAppear 0.85s cubic-bezier(0.17, 0.89, 0.32, 1.3) forwards;
}

@keyframes comboAppear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
  }

  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
  }

  45% {
    transform: translate(-50%, -50%) scale(0.92);
  }

  65% {
    transform: translate(-50%, -50%) scale(1.05);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes comboContent {
  0% {
    transform: scale(0.2) rotate(-8deg);
  }

  30% {
    transform: scale(1.2) rotate(3deg);
  }

  55% {
    transform: scale(0.95) rotate(-1deg);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes comboRays {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes comboRaysScale {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  25% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.combo-animation.combo-big .combo-content strong {
  font-size: 76px;
}

.combo-animation.combo-big .combo-content {
  filter: drop-shadow(0 0 18px rgba(255, 210, 50, 0.9));
}

.combo-animation.combo-mega .combo-content strong {
  font-size: 88px;
}

.combo-animation.combo-mega .combo-content {
  filter: drop-shadow(0 0 15px rgba(255, 220, 80, 1))
    drop-shadow(0 0 35px rgba(255, 130, 0, 0.8));
}

.combo-animation.combo-mega .combo-label::after {
  content: " MEGA!";
}

/* =========================================
   BIG WIN OVERLAY
========================================= */

.big-win-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.45);

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  overflow: hidden;
}

/* Active state */

.big-win-overlay.active {
  visibility: visible;
  opacity: 1;
}

/* =========================================
   CONTENT
========================================= */

.big-win-content {
  position: relative;

  width: min(700px, 90vw);
  height: 600px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transform: scale(1);
}

/* =========================================
   PIRATE
========================================= */

.big-win-pirate {
  position: absolute;

  width: 100%;
  /* max-width: 55vw; */

  top: 20px;

  z-index: 3;

  opacity: 0;

  transform: translateY(300px) scale(0.5) rotate(-8deg);
}

/* Pirate entrance */

.big-win-overlay.active .big-win-pirate {
  animation:
    pirateEntrance 0.8s cubic-bezier(0.17, 0.67, 0.35, 1.35) forwards,
    pirateFloat 1.8s ease-in-out 0.9s infinite;
}

@keyframes pirateEntrance {
  0% {
    opacity: 0;
    transform: translateY(300px) scale(0.5) rotate(-8deg);
  }

  70% {
    opacity: 1;
    transform: translateY(-20px) scale(1.08) rotate(3deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes pirateFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-12px) scale(1.02);
  }
}

/* =========================================
   BIG WIN TEXT
========================================= */

.big-win-text {
  position: absolute;

  top: 280px;

  z-index: 5;

  font-family: Arial, sans-serif;

  font-size: clamp(55px, 9vw, 110px);

  font-weight: 1000;

  font-style: italic;

  color: #ffd43b;

  -webkit-text-stroke: 5px #7b1600;

  text-shadow:
    0 5px 0 #9b2500,
    0 8px 15px rgba(0, 0, 0, 0.7),
    0 0 25px #ffb300,
    0 0 50px #ff7b00;

  opacity: 0;

  transform: scale(0) rotate(-8deg);
}

/* Text animation */

.big-win-overlay.active .big-win-text {
  animation: bigWinText 0.7s cubic-bezier(0.17, 0.67, 0.35, 1.4) 0.45s forwards;
}

@keyframes bigWinText {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-10deg);
  }

  65% {
    opacity: 1;
    transform: scale(1.25) rotate(3deg);
  }

  85% {
    transform: scale(0.95) rotate(-1deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* =========================================
   WIN AMOUNT
========================================= */

.big-win-amount {
  position: absolute;

  top: 400px;

  z-index: 6;

  padding: 12px 40px;

  min-width: 220px;

  text-align: center;

  font-family: Arial, sans-serif;

  font-size: clamp(32px, 5vw, 60px);

  font-weight: 900;

  color: white;

  background: linear-gradient(180deg, #8b2500, #4c1000);

  border: 4px solid #ffd33d;

  border-radius: 20px;

  box-shadow:
    0 0 15px #ffcc00,
    inset 0 0 15px rgba(255, 255, 255, 0.2);

  opacity: 0;

  transform: scale(0.5);
}

.big-win-overlay.active .big-win-amount {
  animation: amountEntrance 0.5s cubic-bezier(0.17, 0.67, 0.35, 1.4) 0.9s
    forwards;
}

@keyframes amountEntrance {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  70% {
    opacity: 1;
    transform: scale(1.15);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================
   COINS / GEMS
========================================= */

.big-win-particles {
  position: absolute;

  inset: 0;

  overflow: hidden;

  pointer-events: none;

  z-index: 10;
}

.big-win-coin {
  position: absolute;

  width: 38px;
  height: 38px;

  background: radial-gradient(
    circle,
    #fff1a8 0%,
    #ffd52e 30%,
    #f29b00 65%,
    #b85b00 100%
  );

  border: 3px solid #ffea71;

  border-radius: 50%;

  box-shadow: 0 0 10px #ffb700;

  animation: coinBurst var(--duration) cubic-bezier(0.15, 0.75, 0.3, 1) forwards;
}

.big-win-coin::after {
  content: "☠️";

  position: absolute;

  inset: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  font-size: 20px;

  color: #b86b00;
}

@keyframes coinBurst {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.2);
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;

    transform: translate(var(--x), var(--y)) rotate(var(--rotation)) scale(1);
  }
}

/* =========================================
   SPARKLES
========================================= */

.big-win-spark {
  position: absolute;

  width: 10px;
  height: 10px;

  background: #fff7a0;

  border-radius: 50%;

  box-shadow:
    0 0 10px #fff,
    0 0 25px #ffc400;

  animation: sparkle 0.9s ease-out forwards;
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  30% {
    opacity: 1;
    transform: scale(2);
  }

  100% {
    opacity: 0;
    transform: scale(0);
  }
}

/* =========================================
   SCREEN FLASH
========================================= */

.big-win-overlay::after {
  content: "";

  position: absolute;

  inset: 0;

  background: white;

  opacity: 0;

  pointer-events: none;
}

.big-win-overlay.flash::after {
  animation: screenFlash 0.35s ease-out;
}

@keyframes screenFlash {
  0% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
  }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {
  .big-win-content {
    height: 400px;
  }

  .big-win-pirate {
    width: 110%;
  }

  .big-win-text {
    top: 250px;
  }

  .big-win-amount {
    top: 250px;
    transform: scale(0.6);
  }

  .big-win-coin {
    width: 28px;
    height: 28px;
  }
}
