:root {
  --app-base-width: 500px;
  --app-base-height: 437px;
  --app-scale: 1;
  --panel-text: #f4fbff;
  --panel-shadow: rgba(3, 15, 28, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden !important;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--panel-text);
  background: "transparent";
  /* background:
    radial-gradient(
      circle at 20% 20%,
      rgba(55, 125, 191, 0.24),
      transparent 26%
    ),
    radial-gradient(
      circle at 80% 15%,
      rgba(16, 62, 111, 0.28),
      transparent 24%
    ),
    linear-gradient(180deg, #081a36 0%, #040d1b 100%); */
}

body,
body * {
  -webkit-user-select: none;
  user-select: none;
}

button,
img {
  -webkit-user-drag: none;
}

.container {
  position: fixed;
  top: auto;
  bottom: max(0px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: var(--app-base-width);
  height: var(--app-base-height);
  transform: translate(-50%, 0) scale(var(--app-scale));
  transform-origin: bottom center;
  background-image: url("assets/background.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.slot-side {
  display: none;
}

.slot-side-left {
  left: -8px;
  width: 180px;
}

.slot-side-right {
  right: -2px;
  width: 120px;
}

.slot-title {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 210px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
}

.layout-top {
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.slot-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.slot-back img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.slot-back:hover {
  opacity: 0.85;
}

.mute,
#button-mute {
  border: none;
  outline: none;
  width: 40px;
  height: 40px;
  background-color: transparent;
  background-image: url("assets/volume on.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
}

.mute.unmute,
#button-mute.unmute {
  background-image: url("assets/volume off.png");
  width: 48px;
  height: 48px;
}

.layout-center {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: 320px;
  max-width: 520px;
  margin: 30px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.layout-center::before {
  content: none;
}

.layout-center::after {
  content: "";
  position: absolute;
  inset: 25px 5px 43px;
  background: url("assets/frame.png") center/100% 104% no-repeat;
  z-index: 2;
  pointer-events: none;
  transform: translatey(25px);
}

#slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  width: 430px;
  height: 234px;
  overflow: visible;
  border-radius: 10px;
  transform: translateY(12px);
}

#reels {
  display: flex;
  gap: 6px;
  width: max-content;
  height: 100%;
  margin: 0 auto;
  padding: 0;
}

.reel {
  position: relative;
  flex: 0 0 auto;
  width: 82px;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.icons {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.slot-cell {
  position: relative;
  width: calc(95% + 1px);
  flex: 1 1 0;
  min-height: 0;
  margin: -6px 5px 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 0, 0);
}

.slot-cell img {
  position: relative;
  display: block;
  width: 74px;
  height: 74px;
  max-width: none;
  max-height: none;
  object-fit: contain;
  z-index: 1;
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.slot-effect {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96%;
  height: 98%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  background-image: url("assets/slotEffect.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.slot-cell::before {
  content: "";
  position: absolute;
  inset: 10px 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slot-cell.is-highlight::before {
  opacity: 1;
}

.slot-cell.is-highlight .slot-effect {
  opacity: 1;
  visibility: visible;
  animation: slot-effect-loop 1.5s ease-in-out infinite;
}

.slot-cell.is-highlight img {
  animation: symbol-win 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 224, 117, 0.72));
}

.reel.is-spinning .icons {
  animation: reel-shimmer 0.2s linear infinite;
}

.reel.is-spinning .slot-cell img {
  filter: blur(1px) saturate(1.08);
  transform: scale(0.98);
}

.layout-points {
  display: none;
}

#value-earning {
  position: relative;
  z-index: 23;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 40px;
  padding: 6px 8px;
  background: url("assets/hud ganhos.png") center/100% 100% no-repeat;
  color: #fff;
  font-size: 14px;
}

#value-earning::before,
.item4-col-1::before,
.item4-col-2::before,
.item4-col-3::before,
.item4-col-4::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

#value-earning::before,
.item4-col-1::before,
.item4-col-3::before {
  border-radius: 12px;
}

.item4-col-2::before,
.item4-col-4::before {
  border-radius: 50%;
}

#value-earning-number,
#coins-number,
#value-bet-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px var(--panel-shadow);
  line-height: 1;
}

.layout-bottom {
  position: relative;
  z-index: 12;
  margin-top: -45px;
  margin-right: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 0 14px;
  gap: 12px;
}

.layout-bottom-group1 {
  position: relative;
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  transform: scale(0.98);
  transform-origin: left center;
  margin: 0 16px;
}

.layout-bottom-group2 {
  position: relative;
  z-index: 14;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  transform: translate(8px, 0);
  margin-right: 4px;
}

.item4-col-1,
.item4-col-3 {
  position: relative;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("assets/hud valor aposta.png") center/100% 100% no-repeat;
}

.item4-col-1 {
  min-width: 140px;
  padding: 0 12px;
}

.item4-col-3 {
  min-width: 76px;
  padding: 0 10px;
}

#coins,
#value-bet {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px var(--panel-shadow);
}

.item4-col-2,
.item4-col-4 {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("assets/hud +- aposta.png") center/contain no-repeat;
}

#increase-value-bet,
#decrease-value-bet {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  outline: none;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #2a7a9e;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#increase-value-bet:hover,
#decrease-value-bet:hover {
  background: rgba(255, 255, 255, 0.3);
}

.button-1 {
  width: 92px;
  height: 92px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

#spin {
  transform: translateY(4px);
}

.button-1-small {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin-left: -6px;
  transform: none;
}

.button-1-front {
  position: relative;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("assets/hud spin.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.button-1-small .button-1-front {
  width: 40px;
  height: 40px;
}

.button-1-front-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px);
}

.button-1-small .button-1-front-text {
  width: 28px;
  height: 28px;
  font-size: 11px;
  transform: translateY(-1px);
}

.button-1:hover {
  filter: brightness(1.1);
}

.button-1:active .button-1-front {
  transform: translateY(-2px);
}

.button-1.is-active {
  filter: grayscale(1) brightness(0.9);
}

.button-1.is-active .button-1-front,
.button-1[aria-pressed="true"] .button-1-front {
  filter: saturate(1.1);
}

.button-1:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.8;
}

.toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 180px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 24, 44, 0.92);
  border: 1px solid rgba(125, 232, 255, 0.18);
  color: #eefcff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.18s ease;
}

.toast.is-error {
  border-color: rgba(255, 124, 146, 0.28);
}

.toast.is-success {
  border-color: rgba(109, 255, 191, 0.24);
}

.win-overlay,
.result-overlay-shell {
  position: absolute;
  inset: 52px 0 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.win-overlay.is-visible,
.result-overlay-shell.is-visible {
  opacity: 1;
  visibility: visible;
}

.win-overlay::before,
.result-overlay-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(1, 10, 22, 0.34);
}

.win-overlay-lottie,
.result-lottie {
  position: relative;
  z-index: 1;
  width: 500px;
  height: 280px;
  transform: scale(1.25);
  transform-origin: center;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34));
}

.result-overlay-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-overlay-points,
#slot-earning-container {
  position: absolute;
  top: auto;
  bottom: 128px;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  z-index: 201;
  width: auto;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

#slot-earning-container::before {
  content: none;
}

#slot-earning-container > * {
  position: relative;
  z-index: 1;
}

.fatal-error {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 9, 19, 0.9);
}

.fatal-error-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 132, 132, 0.3);
  background: rgba(17, 34, 56, 0.96);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.fatal-error-card strong {
  font-size: 16px;
  font-weight: 800;
}

.fatal-error-card span {
  font-size: 13px;
  line-height: 1.4;
}

@keyframes reel-shimmer {
  0% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(6px);
  }
}

@keyframes slot-effect-loop {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
    opacity: 1;
  }

  50% {
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 1));
    opacity: 0.95;
  }
}

@keyframes symbol-win {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
