:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #fff;
  background: #280843;
  --gold: #ffe951;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #fff4b8; outline-offset: 5px; }
.game {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  overflow: clip;
  padding: 13px max(12px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: url("assets/images/background.webp") center / cover no-repeat;
}
.game::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: clamp(58px, 12vw, 160px);
  background: url("assets/images/coin-pile.webp") center bottom / auto 100% repeat-x;
  opacity: .73;
}
.brand { display: block; width: clamp(151px, min(46vw, 32svh), 257px); height: auto; margin: 0; }
.brand img { display: block; width: 100%; height: auto; }
.sound {
  position: absolute;
  z-index: 6;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #fbe79777;
  border-radius: 50%;
  background: #25073bd9;
  color: #fff19b;
}
.speaker {
  position: absolute;
  left: 10px;
  width: 13px;
  height: 15px;
  background: currentColor;
  clip-path: polygon(0 32%, 37% 32%, 100% 0, 100% 100%, 37% 68%, 0 68%);
}
.waves { position: absolute; left: 18px; width: 13px; height: 19px; border-right: 2px solid; border-radius: 50%; }
.sound[aria-pressed="false"] .waves { left: 12px; width: 18px; height: 2px; border: 0; border-radius: 0; transform: rotate(-46deg); background: #fff19b; box-shadow: 0 2px #25073b; }
.decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.float { position: absolute; height: auto; animation: float 3.4s ease-in-out infinite alternate; }
.float-small { left: max(2%, calc(50% - 585px)); top: 23%; width: min(13vw, 154px); }
.float-pink { left: max(9%, calc(50% - 475px)); top: 43%; width: min(18vw, 230px); animation-delay: -.95s; }
.float-gold { right: max(-2%, calc(50% - 620px)); top: 24%; width: min(28vw, 350px); animation-delay: -1.4s; }
@keyframes float { to { transform: translateY(12px) rotate(4deg); } }
.board {
  position: relative;
  width: min(100%, 630px, max(285px, calc((100svh - 190px) * 1.32)));
  aspect-ratio: 1.43;
  margin-top: 6px;
}
.pegs, .balls, .slots { position: absolute; inset: 0; pointer-events: none; }
.peg, .ball { position: absolute; border-radius: 50%; }
.peg {
  translate: -50% -50%;
  width: clamp(7px, 1.23vw, 12px);
  aspect-ratio: 1;
  background: #fff;
  box-shadow: 0 1.5px #aaa0b4, 0 0 6px #f5defd40;
}
.peg.hit::after {
  content: "";
  position: absolute;
  inset: -12px;
  background: url("assets/images/peg-flash.webp") center / contain no-repeat;
  animation: peg-flash .27s ease-out both;
}
@keyframes peg-flash { from { transform: scale(.65); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.balls { z-index: 2; }
.ball {
  width: clamp(13px, 2.2vw, 23px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: url("assets/images/ball.webp") center / cover no-repeat;
  box-shadow: 0 0 12px #ff3dba87;
}
.ball.parked { left: 50%; top: 2.8%; }
.ball.in-play { top: 0; left: 0; will-change: transform; }
.slots { z-index: 1; }
.slot {
  position: absolute;
  top: 94%;
  width: 9.4%;
  height: clamp(26px, 4.6vw, 43px);
  translate: -50% -50%;
  display: grid;
  place-items: center;
  padding-top: 5px;
  color: #200d08;
  font-weight: 900;
  font-size: clamp(11px, 1.9vw, 15px);
  font-variant-numeric: tabular-nums;
  background: var(--slot-image) center / 100% 100% no-repeat;
}
.slot[data-color="red"] { --slot-image: url("assets/images/slot-red.webp"); }
.slot[data-color="orange"] { --slot-image: url("assets/images/slot-orange.webp"); }
.slot[data-color="yellow"] { --slot-image: url("assets/images/slot-yellow.webp"); }
.slot[data-color="gold"] { --slot-image: url("assets/images/slot-gold.webp"); }
.slot.hit { animation: slot-hit .35s ease-out; }
.slot.winner { filter: brightness(1.28) drop-shadow(0 0 12px #ffcf4d); transform: scale(1.09); }
@keyframes slot-hit { 45% { transform: translateY(3px) scale(1.09); filter: brightness(1.6); } }
.controls {
  width: min(100%, 660px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(102px, 30vw, 176px) minmax(0, 1fr);
  gap: clamp(5px, 2vw, 16px);
  align-items: center;
  margin-top: 8px;
}
.stat {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 7px 4px;
  text-align: center;
  border: 1px solid #ffefab9e;
  border-radius: 16px;
  background: linear-gradient(130deg,#4e165fdc,#8e159fb5);
  overflow-wrap: anywhere;
}
.rate { grid-column: 1; }
.balance { grid-column: 3; }
.stat-label { font-size: clamp(11px, 2.2vw, 14px); color: #fff1d1; }
.stat strong { color: var(--gold); font-weight: 900; font-size: clamp(15px, 3.6vw, 26px); line-height: 1.1; }
.action {
  position: relative;
  min-height: 56px;
  max-width: min(100%, 360px);
  padding: 10px clamp(16px, 5vw, 43px);
  border: 0;
  border-radius: 16px;
  background:
    url("assets/images/button-left.webp") left center / 37px 100% no-repeat,
    url("assets/images/button-right.webp") right center / 37px 100% no-repeat,
    url("assets/images/button-middle.webp") center / calc(100% - 70px) 100% no-repeat;
  color: #fff;
  font-size: clamp(20px, 4.5vw, 32px);
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 0 2px #481075, 0 -1px #481075, 1px 0 #481075, -1px 0 #481075;
  overflow-wrap: anywhere;
  transition: filter .15s, scale .15s;
}
.action:enabled:hover { filter: brightness(1.12); }
.action:enabled:active { scale: .97; }
#spin { grid-column: 2; grid-row: 1; width: 100%; }
#spin:disabled { cursor: default; filter: saturate(.63); opacity: .77; }
.status, .footer { margin: 7px 0 0; padding: 2px 8px; border-radius: 8px; background: #260638dd; text-align: center; }
.status { color: #fff7e5; font-size: 13px; font-weight: 700; }
.footer { color: #f6ddef; font-size: 11px; }
.game[data-phase="final"] > :is(.brand, .board, .controls, .status, .footer) { visibility: hidden; }
.offer {
  width: min(100% - 22px, 670px);
  max-width: 100%;
  max-height: 100svh;
  margin: auto;
  padding: 16px 4px;
  overflow: auto;
  color: #fff;
  border: 0;
  background: transparent;
  text-align: center;
}
.offer::backdrop { background: #280440e8; }
.offer[open] { animation: reveal .32s cubic-bezier(.18,.67,.25,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.offer-content { position: relative; isolation: isolate; display: grid; justify-items: center; gap: clamp(11px, 3vw, 22px); }
.offer-panel {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: min(100%, 556px);
  padding: clamp(14px, 4vw, 30px);
  border: 3px solid #ffe074;
  border-radius: 24px;
  background: linear-gradient(130deg,#580b79,#9e118b 64%,#6a147c);
  box-shadow: inset 0 0 25px #fb67ff42, 0 10px 45px #1901297a;
}
.offer-panel h2, .offer-panel p { margin: 0; }
.offer h2 {
  font-size: clamp(24px, 6.6vw, 40px);
  text-transform: uppercase;
  line-height: 1.08;
  color: #fff8e4;
  text-shadow: 0 3px #620087;
  overflow-wrap: anywhere;
}
.offer-prize { display: grid; justify-items: center; width: 100%; }
.offer-label { color: #fff6dc; font-weight: 750; overflow-wrap: anywhere; }
.offer-amount { max-width: 100%; color: var(--gold); font-size: clamp(34px, 11vw, 65px); line-height: 1.08; text-shadow: 0 3px #640099; overflow-wrap: anywhere; }
.offer-extra { color: #fff8d3; font-size: clamp(14px, 3.9vw, 20px); overflow-wrap: anywhere; }
.offer-extra b { color: #ffe47c; }
.coin-shower { position: absolute; z-index: -1; bottom: 0; width: min(36vw, 200px); pointer-events: none; }
.shower-left { left: 0; }
.shower-right { right: 0; transform: scaleX(-1); }
[data-pwa-help], [data-pwa-inapp] { max-width: 430px; margin: 0; padding: 0 6px; color: #fff6d9; font-size: 15px; }
@media (max-width: 570px) {
  .game { justify-content: center; }
  .board { width: min(100%, 430px, max(275px, (100svh - 205px) * .96)); aspect-ratio: .98; }
  .float-small { left: -3%; top: 20%; width: 23vw; }
  .float-pink { left: -6%; top: 43%; width: 29vw; opacity: .6; }
  .float-gold { right: -13%; top: 26%; width: 45vw; }
  .controls { width: min(100%, 430px); }
  .action { min-height: 51px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .coin-shower { display: none; }
}
