:root {
  color-scheme: dark;
  font-family: Georgia, 'Times New Roman', serif;
  background: #010705;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --gold: #f2cf69;
  --gold-soft: #ffe7a2;
  --emerald: #1fd893;
  --obsidian: #020806;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #010705;
  touch-action: manipulation;
  overscroll-behavior: none;
  user-select: none;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid #75ffd0;
  outline-offset: 3px;
}

#app {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.desktop-ambience {
  position: fixed;
  inset: -6vmax;
  z-index: -2;
  background:
    linear-gradient(rgba(0, 10, 7, .42), rgba(0, 4, 3, .76)),
    url('/assets/stage3/desktop-background.webp') center / cover no-repeat;
  filter: blur(16px) saturate(.9) brightness(.62);
  transform: scale(1.08);
}

.desktop-ambience::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(24, 136, 91, .2), transparent 36%),
    radial-gradient(circle at 50% 80%, rgba(170, 95, 18, .12), transparent 28%),
    linear-gradient(90deg, rgba(0,0,0,.72), transparent 28%, transparent 72%, rgba(0,0,0,.72));
}

.game-stage {
  position: relative;
  width: min(100vw, calc(100dvh * 941 / 1672));
  height: min(100dvh, calc(100vw * 1672 / 941));
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: #020806;
  box-shadow:
    0 0 0 1px rgba(241, 199, 91, .3),
    0 20px 100px rgba(0, 0, 0, .84),
    0 0 90px rgba(26, 131, 85, .16);
}

.base-screen,
.loading-overlay > img,
.win-overlay > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.base-screen {
  z-index: 0;
}

.brand-logo {
  position: absolute;
  z-index: 9;
  top: 1.15%;
  left: 1.7%;
  width: 20%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .82));
  pointer-events: none;
}

.reels-window {
  position: absolute;
  z-index: 4;
  top: 41.62%;
  left: 11.25%;
  width: 77.55%;
  height: 36.12%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: clamp(1px, .22vw, 3px) solid rgba(234, 192, 77, .86);
  border-radius: 1.1%;
  background:
    radial-gradient(circle at 50% 46%, rgba(14, 73, 50, .38), transparent 58%),
    linear-gradient(180deg, #07120d, #020504 54%, #0a120d);
  box-shadow:
    inset 0 0 0 2px rgba(67, 35, 4, .9),
    inset 0 0 28px rgba(0,0,0,.86),
    0 0 18px rgba(0,0,0,.55);
}

.reel-column {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(217, 169, 58, .62);
}

.reel-column:last-of-type {
  border-right: 0;
}

.reel-track {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 166.6667%;
  display: flex;
  flex-direction: column;
  will-change: transform, filter;
}

.reel-track.is-spinning {
  filter: blur(.65px) saturate(.92) brightness(.9);
}

.reel-track.is-settling {
  animation: reel-settle .34s cubic-bezier(.2, .72, .18, 1);
}

.symbol-cell {
  position: relative;
  flex: 0 0 20%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(237, 192, 68, .07), transparent 14%, transparent 86%, rgba(237, 192, 68, .07)),
    radial-gradient(circle at 50% 42%, rgba(23, 102, 70, .24), rgba(2, 7, 5, .95) 72%);
  border-bottom: 1px solid rgba(204, 151, 42, .52);
  transition: opacity .28s ease, filter .28s ease;
}

.symbol-cell img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  transform: translateZ(0) scale(.96);
  filter:
    drop-shadow(0 6px 7px rgba(0,0,0,.76))
    drop-shadow(0 0 3px rgba(255,221,116,.2));
  transition: transform .28s ease, filter .28s ease;
  pointer-events: none;
}

.symbol-cell.is-dimmed {
  opacity: .28;
  filter: grayscale(.28) brightness(.58);
}

.symbol-cell.is-winning {
  z-index: 2;
  background:
    radial-gradient(circle, rgba(42, 238, 159, .26), rgba(255, 197, 58, .11) 55%, rgba(4, 10, 7, .94) 78%);
  box-shadow: inset 0 0 0 2px rgba(255, 220, 95, .88), inset 0 0 24px rgba(31, 216, 147, .3);
}

.symbol-cell.is-winning img {
  animation: symbol-win 1s ease-in-out infinite;
  filter:
    drop-shadow(0 8px 8px rgba(0,0,0,.82))
    drop-shadow(0 0 13px rgba(255,224,106,.72));
}

.reel-sheen {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.46), transparent 9%, transparent 91%, rgba(0,0,0,.5)),
    linear-gradient(115deg, transparent 26%, rgba(255,255,255,.045) 42%, transparent 58%);
  mix-blend-mode: screen;
}

.status-banner {
  position: absolute;
  z-index: 7;
  top: 78.38%;
  left: 16%;
  width: 68%;
  min-height: 3.15%;
  display: grid;
  place-items: center;
  padding: .5% 2%;
  overflow: hidden;
  border: 1px solid rgba(237, 195, 84, .7);
  border-radius: 999px;
  color: #ffeab0;
  background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(4, 26, 18, .93), rgba(0,0,0,.72));
  box-shadow: 0 5px 16px rgba(0,0,0,.56), inset 0 0 14px rgba(28, 158, 105, .08);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(7px, 1.15vw, 15px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0,0,0,.9);
}

.status-banner.is-changing {
  animation: status-change .45s ease;
}

.hud {
  position: absolute;
  z-index: 8;
  top: 92.14%;
  left: 6.8%;
  width: 86.4%;
  height: 6.15%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65%;
  pointer-events: none;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid rgba(212, 168, 57, .36);
  background: linear-gradient(180deg, rgba(1, 11, 8, .93), rgba(1, 5, 4, .97));
  box-shadow: inset 0 0 14px rgba(0,0,0,.65);
  text-shadow: 0 2px 5px rgba(0,0,0,.95);
}

.hud-item:first-child {
  clip-path: polygon(5% 0, 100% 0, 100% 100%, 5% 100%, 0 50%);
}

.hud-item:last-child {
  clip-path: polygon(0 0, 95% 0, 100% 50%, 95% 100%, 0 100%);
}

.hud-item span {
  color: #d9ac46;
  font-size: clamp(7px, 1.1vw, 14px);
  font-weight: 700;
  letter-spacing: .08em;
}

.hud-item strong {
  max-width: 94%;
  overflow: hidden;
  color: #f6dd8a;
  font-size: clamp(13px, 2.7vw, 35px);
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotspot,
.spin-button {
  position: absolute;
  z-index: 12;
  border-radius: 50%;
  touch-action: manipulation;
}

.hotspot::after {
  content: '';
  position: absolute;
  inset: 17%;
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(80, 255, 185, .85), 0 0 22px rgba(40, 230, 158, .72);
  transition: opacity .2s ease;
}

.hotspot:active::after,
.hotspot.is-active::after {
  opacity: 1;
}

.hotspot--turbo { left: 5.4%; top: 82.85%; width: 15.3%; height: 8.3%; }
.hotspot--minus { left: 20.5%; top: 82.85%; width: 14.4%; height: 8.3%; }
.hotspot--plus { left: 65.3%; top: 82.85%; width: 14.4%; height: 8.3%; }
.hotspot--auto { left: 79.8%; top: 82.85%; width: 15.2%; height: 8.3%; }

.spin-button {
  left: 37.1%;
  top: 80.05%;
  width: 25.9%;
  height: 14.6%;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.72));
}

.spin-button img {
  width: 112%;
  height: 112%;
  object-fit: contain;
  animation: spin-idle 9s linear infinite;
  transition: filter .2s ease, transform .2s ease;
  pointer-events: none;
}

.spin-button:active img {
  transform: scale(.94);
  filter: brightness(1.14) drop-shadow(0 0 11px rgba(60,255,184,.8));
}

.spin-button.is-spinning img {
  animation: spin-active .62s linear infinite;
  filter: brightness(1.08) drop-shadow(0 0 15px rgba(54, 247, 175, .65));
}

.sound-button {
  position: absolute;
  z-index: 15;
  top: 1.2%;
  right: 2.2%;
  width: 7.2%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 198, 82, .65);
  border-radius: 50%;
  color: #ffe9a7;
  background: rgba(2, 10, 7, .8);
  box-shadow: 0 4px 13px rgba(0,0,0,.55);
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 2.3vw, 28px);
  font-weight: 900;
}

.sound-button.is-muted {
  color: #a18d61;
  opacity: .72;
}

.free-spins,
.demo-badge {
  position: absolute;
  z-index: 9;
  color: rgba(255, 232, 160, .76);
  font-family: Arial, sans-serif;
  font-size: clamp(5px, .8vw, 10px);
  font-weight: 800;
  letter-spacing: .08em;
  text-shadow: 0 2px 4px rgba(0,0,0,.9);
}

.free-spins { bottom: .45%; left: 2.5%; }
.demo-badge { right: 2.5%; bottom: .45%; }

.feature-card {
  position: absolute;
  z-index: 20;
  top: 27.5%;
  right: 2.1%;
  width: 15%;
  aspect-ratio: 2 / 3;
  opacity: 0;
  transform: translateY(-10%) scale(.76);
  transition: opacity .34s ease, transform .5s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  perspective: 700px;
}

.feature-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feature-card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.feature-card.is-flipping .feature-card__inner {
  animation: card-flip 1.15s cubic-bezier(.35,.03,.22,1) 2;
}

.feature-card__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  filter: drop-shadow(0 7px 7px rgba(0,0,0,.74));
}

.feature-card__back { transform: rotateY(180deg); }

.feature-card__multiplier {
  position: absolute;
  right: -5%;
  bottom: -7%;
  display: grid;
  place-items: center;
  min-width: 43%;
  aspect-ratio: 1;
  border: 1px solid #ffe398;
  border-radius: 50%;
  color: #082217;
  background: radial-gradient(circle at 35% 30%, #9dffd5, #21c789 55%, #a77719 100%);
  box-shadow: 0 0 17px rgba(49, 246, 173, .65);
  font-size: clamp(10px, 2vw, 25px);
  font-weight: 900;
}

.loading-overlay,
.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background: #010503;
  transition: opacity .62s ease, transform .62s ease;
}

.loading-overlay.is-leaving {
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
}

.loading-progress {
  position: absolute;
  z-index: 3;
  left: 18.1%;
  top: 76.75%;
  width: 63.8%;
  height: 2.1%;
  overflow: hidden;
  border: 1px solid rgba(255,224,127,.92);
  border-radius: 999px;
  background: rgba(2, 5, 3, .94);
  box-shadow: inset 0 0 7px rgba(0,0,0,.9), 0 0 8px rgba(229, 183, 55, .28);
}

.loading-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b8f5c, #31e6a3 56%, #f3cc5f);
  box-shadow: 0 0 10px rgba(48, 233, 164, .58);
  transition: width .28s ease;
}

.loading-label {
  position: absolute;
  z-index: 4;
  top: 73.6%;
  left: 22%;
  width: 56%;
  padding: .7% 1%;
  color: #f6dc8c;
  background: rgba(0, 7, 5, .7);
  font-family: Arial, sans-serif;
  font-size: clamp(7px, 1.35vw, 17px);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,.9);
}

.enter-button {
  position: absolute;
  z-index: 5;
  top: 83.4%;
  left: 16.5%;
  width: 67%;
  height: 9.1%;
  border-radius: 3%;
}

.enter-button:disabled {
  cursor: progress;
}

.loading-overlay.is-ready .enter-button {
  animation: enter-pulse 1.8s ease-in-out infinite;
}

.loading-overlay.has-error::after {
  content: 'FALHA AO CARREGAR';
  position: absolute;
  z-index: 8;
  left: 20%;
  top: 76%;
  width: 60%;
  padding: 2%;
  border: 1px solid #df7d60;
  color: #ffe2d7;
  background: rgba(62, 8, 4, .9);
  font: 800 clamp(9px, 1.5vw, 18px) Arial, sans-serif;
  text-align: center;
}

.win-overlay[hidden] {
  display: none;
}

.win-overlay {
  opacity: 0;
  transform: scale(1.025);
}

.win-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.win-amount {
  position: absolute;
  z-index: 4;
  top: 43.7%;
  left: 15%;
  width: 70%;
  min-height: 8.4%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 219, 106, .88);
  color: #ffe47f;
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 96, 60, .84), rgba(1, 13, 9, .98) 76%);
  box-shadow: inset 0 0 22px rgba(0,0,0,.7), 0 0 18px rgba(235, 189, 55, .36);
  font-size: clamp(28px, 8.5vw, 104px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 7px rgba(0,0,0,.9), 0 0 9px rgba(255,205,71,.36);
}

.win-subtitle {
  position: absolute;
  z-index: 4;
  left: 18%;
  bottom: 1.8%;
  width: 64%;
  padding: 1.2%;
  border-radius: 999px;
  color: #ffe6a2;
  background: rgba(0, 8, 5, .7);
  font-family: Arial, sans-serif;
  font-size: clamp(7px, 1.2vw, 15px);
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
}

.win-close {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.toast {
  position: absolute;
  z-index: 80;
  top: 3.6%;
  left: 10%;
  width: 80%;
  padding: 2.2% 3%;
  border: 1px solid rgba(255, 216, 103, .72);
  border-radius: 999px;
  opacity: 0;
  color: #ffe8ab;
  background: rgba(2, 19, 13, .94);
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  transform: translateY(-140%);
  transition: opacity .28s ease, transform .36s cubic-bezier(.2,.75,.2,1);
  font-family: Arial, sans-serif;
  font-size: clamp(8px, 1.35vw, 17px);
  font-weight: 700;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes reel-settle {
  0% { transform: translate3d(0, -33.333%, 0); }
  45% { transform: translate3d(0, -31.8%, 0); }
  72% { transform: translate3d(0, -33.8%, 0); }
  100% { transform: translate3d(0, -33.333%, 0); }
}

@keyframes symbol-win {
  0%, 100% { transform: scale(.95) translateY(0); }
  50% { transform: scale(1.04) translateY(-1.5%); }
}

@keyframes spin-idle {
  to { transform: rotate(360deg); }
}

@keyframes spin-active {
  to { transform: rotate(360deg); }
}

@keyframes status-change {
  0% { opacity: .15; transform: scale(.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes card-flip {
  to { transform: rotateY(360deg); }
}

@keyframes enter-pulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(0,0,0,0), 0 0 0 rgba(44,234,164,0); }
  50% { box-shadow: inset 0 0 22px rgba(95,255,205,.16), 0 0 25px rgba(44,234,164,.3); }
}

@media (max-width: 560px) {
  .game-stage {
    box-shadow: 0 0 35px rgba(0,0,0,.75);
  }

  .brand-logo {
    width: 22%;
  }

  .status-banner {
    font-size: clamp(6px, 1.7vw, 11px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
