:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #171b13;
  color: #fff2cd;
  --gold: #ffe483;
  --edge: #d69b40;
  --dark: #211408;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #fff4bd; outline-offset: 4px; }
.game {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  overflow: clip;
  background: linear-gradient(180deg,#1c140838 0%,#1e170900 28%,#18100412 48%,#130f09e6 100%), url("assets/temple.webp") center / cover no-repeat;
}
.top { position: relative; display: grid; place-items: center; width: min(100%, 940px); min-height: 54px; }
.top h1 { margin: 0; padding-inline: 42px; }
.logo { display: block; width: min(100%, 410px); height: auto; filter: drop-shadow(0 5px 5px #150900aa); }
.sound {
  position: absolute; right: 0; top: 4px; display: grid; place-items: center;
  width: 42px; height: 42px; border: 1px solid #ffcc73ae; border-radius: 50%;
  background: #2a1a12ed; color: #ffe99d;
}
.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: 11px; width: 20px; height: 2px; border: 0; border-radius: 0; transform: rotate(-46deg); background: currentColor; box-shadow: 0 2px #2a1a12; }
.stage { align-self: center; width: min(100%, 760px, max(520px, (100svh - 302px) * 1.95)); }
.main-stage { width: 100%; display: grid; justify-items: center; position: relative; }
.hero-symbol {
  display: block; width: clamp(73px, 17svh, 135px); height: auto;
  filter: drop-shadow(0 0 12px #ffcc67d9) drop-shadow(0 6px 8px #3e240caa);
  animation: float 2.8s ease-in-out infinite alternate;
}
@keyframes float { to { transform: translateY(-6px); } }
.cabinet {
  margin-top: 6px;
  width: 100%; padding: clamp(4px, .65vw, 9px); border-radius: 14px;
  box-shadow: 0 14px 35px #140e08a0, 0 0 0 1px #70603c;
  background: linear-gradient(145deg,#4b341e,#170f0a 68%);
  position: relative;
}
.cabinet::after {
  content: ""; position: absolute; z-index: 2; inset: 0;
  background: url("assets/frame.webp") center / 100% 100% no-repeat;
  pointer-events: none;
}
.reels { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; height: clamp(180px, 40svh, 352px); }
.reel {
  position: relative; overflow: hidden; min-width: 0;
  background: radial-gradient(ellipse at center,#936236,#503217 62%,#312011);
  box-shadow: inset 0 8px 12px #2e190f8f, inset 0 -8px 12px #2e190f8f;
  border-radius: 5px;
}
.reel-face, .reel-strip { position: absolute; inset: 0; }
.reel-strip { display: none; }
.rolling .reel-face { visibility: hidden; }
.rolling .reel-strip { display: block; will-change: transform; }
.symbol { display: grid; place-items: center; height: 33.333333%; position: relative; }
.symbol img { display: block; width: 94%; height: 96%; min-height: 0; object-fit: contain; filter: drop-shadow(0 3px 2px #38210d90); }
.reel.anticipating { z-index: 1; box-shadow: inset 0 0 0 2px #ffe89b, inset 0 0 17px #ffb334; }
.symbol.winner { background: #ffdd5c39; box-shadow: inset 0 0 0 1px #fff2a6, inset 0 0 13px #fff28a; }
.symbol.winner img { animation: win-pop .45s cubic-bezier(.18,.66,.35,1.24); }
@keyframes win-pop { 50% { transform: scale(1.13); } }
.win-beam { position: absolute; z-index: 3; inset: 33.4% 1.5%; pointer-events: none; opacity: 0; }
.game[data-phase="celebrating"] .win-beam {
  border: 2px solid #fff4ba;
  background: linear-gradient(90deg,#ff8b1400,#ffcc5433,#fff3a130,#ffcc5433,#ff8b1400);
  box-shadow: 0 0 18px #ffd343, inset 0 0 16px #ffb52a;
  animation: sweep .94s ease-out both;
}
@keyframes sweep {
  0% { opacity: 0; transform: scaleX(.08) scaleY(.48); }
  26% { opacity: 1; transform: scaleX(1) scaleY(1); }
  68% { opacity: .86; }
  100% { opacity: 0; }
}
.game[data-phase="celebrating"] .hero-symbol { animation: crown-glow 1s ease-out both; }
@keyframes crown-glow {
  35% { transform: scale(1.21); filter: drop-shadow(0 0 29px #ffe379) drop-shadow(0 6px 9px #874a10); }
  100% { transform: scale(1.03); }
}
.spark-layer { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.spark-layer i {
  position: absolute; top: 50%; left: 50%; width: var(--size); height: var(--size);
  background: #fff1a3; box-shadow: 0 0 7px #ffc636, 0 0 15px #ffac2d;
  animation: spark .86s ease-out var(--delay) both;
}
.spark-layer i:nth-child(3n) { border-radius: 50%; background: #ffb334; }
@keyframes spark {
  0% { opacity: 0; transform: scale(.45) rotate(45deg); }
  17% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x),var(--y)) scale(.23) rotate(160deg); }
}
.console { display: grid; justify-items: center; gap: 7px; margin-top: 8px; width: min(100%, 440px); text-align: center; }
.status { margin: 0; min-height: 1.3em; font-size: clamp(13px, 3.6vw, 16px); font-weight: 750; text-shadow: 0 2px 4px #140c06; }
.action {
  min-width: min(170px,100%); min-height: 58px; max-width: 100%; padding: 8px clamp(22px, 7vw, 40px);
  border: 0; border-radius: 10px;
  background: url("assets/button-left.webp") left center / 76px 100% no-repeat, url("assets/button-right.webp") right center / 76px 100% no-repeat, url("assets/button-center.webp") center / calc(100% - 148px) 100% no-repeat;
  color: #fff8bc; font-size: clamp(19px, 5vw, 27px); font-weight: 950;
  text-shadow: 0 2px #7e220b, 0 1px 4px #45180f; text-transform: uppercase; overflow-wrap: anywhere;
}
.action:disabled { opacity: .7; cursor: default; }
.action:enabled:hover { filter: brightness(1.11); }
.action:enabled:active { transform: translateY(1px); }
.stats { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 7px; }
.stats div { display: grid; gap: 2px; padding: 4px; border: 1px solid #99744a; border-radius: 8px; background: #20170dd9; overflow-wrap: anywhere; }
.stats span { color: #ffda8b; font-size: 11px; }
.stats strong { font-size: 15px; }
footer { align-self: end; margin-top: 7px; font-size: 10px; color: #e4cfb6; text-align: center; }
.offer { position: fixed; width: min(100% - 24px, 680px); max-height: calc(100svh - 20px); padding: 15px 3px; margin: auto; border: 0; background: transparent; color: inherit; overflow: auto; text-align: center; }
.offer::backdrop { background: #190e08de; }
.offer[open] { animation: appear .4s cubic-bezier(.19,.68,.24,1) both; }
@keyframes appear { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.offer-content { position: relative; display: grid; justify-items: center; gap: 11px; isolation: isolate; }
.offer-content::before, .offer-content::after { content: ""; position: absolute; z-index: -1; bottom: 1%; width: min(33vw, 143px); height: 95%; background: url("assets/wings.webp") center / contain no-repeat; opacity: .63; pointer-events: none; }
.offer-content::before { left: 0; }
.offer-content::after { right: 0; transform: scaleX(-1); }
.offer .logo { width: min(78%, 385px); }
.win-title { margin: 0; color: #ffe561; font-weight: 1000; font-size: clamp(38px, 11vw, 76px); line-height: 1.05; text-transform: uppercase; text-shadow: 0 3px 0 #9e3515, 0 0 22px #efad48bb; }
.offer-card { width: min(89%, 500px); display: grid; justify-items: center; gap: 10px; padding: clamp(12px,4vw,24px); background: linear-gradient(145deg,#4e2c17f4,#241408f7); border: 2px solid var(--edge); border-radius: 17px; box-shadow: inset 0 0 20px #e4962b44; overflow-wrap: anywhere; }
.offer-card h2 { margin: 0; font-size: clamp(22px, 6vw, 35px); line-height: 1.09; }
.offer-card p { margin: 0; }
.offer-card b { color: var(--gold); }
.prize { width: 100%; min-width: 0; display: grid; justify-items: center; }
.prize strong { color: var(--gold); font-size: clamp(35px, 11vw, 65px); line-height: 1.08; }
.replay { border: 0; background: none; padding: 7px 12px; text-decoration: underline; text-underline-offset: 3px; }
[data-pwa-help], [data-pwa-inapp] { margin: 0; width: min(100%, 430px); }
@media (max-width: 590px) {
  .game { background-image: linear-gradient(180deg,#191b133b,#351f0900 29%,#23150920 50%,#191006ed 100%),url("assets/temple-mobile.webp"); }
  .stage { width: min(100%, 450px); }
  .top h1 { padding-inline: 26px 46px; }
  .hero-symbol { width: clamp(83px, 19svh, 140px); }
  .cabinet::after { background-image: url("assets/frame-mobile.webp"); }
  .reels { grid-template-columns: repeat(3,minmax(0,1fr)); height: clamp(192px, 34svh, 330px); }
  .reel.edge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

