:root {
  --app-base-width: 560px;
  --app-base-height: 490px;
  --app-scale: 1;
  --viewport-gap: 12px;
  --panel-text: #f4fbff;
  --panel-shadow: rgba(4, 27, 50, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 100vh;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: "transparent";
  /* background:
    radial-gradient(circle at 20% 20%, rgba(51, 155, 196, 0.25), transparent 28%),
    radial-gradient(circle at 80% 15%, rgba(9, 80, 138, 0.3), transparent 25%),
    linear-gradient(180deg, #0c2147 0%, #061326 58%, #030a14 100%); */
  color: var(--panel-text);
}

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

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

.container {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--app-base-width);
  height: var(--app-base-height);
  transform: scale(var(--app-scale));
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background-image: url("assets/fundo.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border-radius: 22px 22px 0 0;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.app-stage {
  position: relative;
  width: calc(var(--app-base-width) * var(--app-scale));
  height: calc(var(--app-base-height) * var(--app-scale));
  flex: 0 0 auto;
  margin-top: 0;
  align-self: flex-end;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(
      circle at 50% 100%,
      rgba(56, 214, 255, 0.12),
      transparent 36%
    );
  pointer-events: none;
}

.slot-side {
  position: absolute;
  bottom: 6px;
  z-index: 3;
  pointer-events: none;
}

.slot-side-left {
  left: -10px;
  bottom: -14px;
  width: 230px;
}

.slot-side-right {
  right: -8px;
  width: 164px;
  bottom: -2px;
}

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

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

.slot-back {
  z-index: 6;
  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 {
  border: none;
  outline: none;
  width: 40px;
  height: 40px;
  background-color: transparent;
  background-image: url("assets/ocean vol on.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  z-index: 6;
}

.mute.unmute {
  background-image: url("assets/ocean vol off.png");
}

.layout-center {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: 356px;
  max-width: 560px;
  margin: 34px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-left: 0;
}

.layout-center::before {
  content: "";
  position: absolute;
  inset: 34px 48px 31px;
  background-image: url("assets/moldura 2.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  z-index: 0;
  pointer-events: none;
  transform: scaleX(1.04) scaleY(1.04);
}

.layout-center::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/moldura.png") center/contain no-repeat;
  z-index: 2;
  pointer-events: none;
  transform: translateY(11px) scaleX(1.04) scaleY(1.04);
}

#slot {
  margin-top: -8px;
  position: relative;
  z-index: 1;
  width: min(472px, 84.3%);
  height: min(286px, 80.3%);
  overflow: visible;
  border-radius: 10px;
  transform: translateY(10px);
}

#reels {
  display: flex;
  gap: 0;
  width: 100%;
  height: 100%;
  max-height: calc(90vh - 50px - 40px);
  padding-left: 4px;
  padding-right: 6px;
  box-sizing: border-box;
}

.reel {
  overflow: hidden;
  flex: 1 1 20%;
  position: relative;
  height: 100%;
  padding: 0 2px;
  box-sizing: border-box;
}

.icons {
  position: relative;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  height: 100%;
  width: 100%;
}

.slot-cell {
  position: relative;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 2px;
  border-radius: 16px;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  box-sizing: border-box;
}

.slot-cell::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%),
    rgba(4, 39, 74, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slot-cell img {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  width: 90%;
  height: 90%;
  padding: 0;
  object-fit: contain;
  z-index: 1;
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.slot-effect {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  background-image: url("assets/slotEffect.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 92% 92%;
  transform: translateY(0);
  transition:
    opacity 0.16s ease,
    visibility 0.16s ease;
  visibility: hidden;
}

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

.slot-cell.is-highlight .slot-effect {
  opacity: 1;
  visibility: visible;
  animation: effect-pulse 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.75));
}

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

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

.layout-points {
  position: relative;
  z-index: 10;
  margin-top: -40px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
}

#value-earning {
  position: relative;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 132px;
  max-height: 40px;
  padding: 6px 12px;
  color: white;
  font-size: 14px;
  background: url("assets/ocean retan.png") center/100% 100% no-repeat;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

#value-earning::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.item4-col-1::before,
.item4-col-3::before,
.item4-col-2::before,
.item4-col-4::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: transparent;
  pointer-events: none;
}

.panel-label {
  position: relative;
  z-index: 1;
  display: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

#value-earning-number,
#coins-number,
#value-bet-number {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.layout-bottom {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 37px;
  margin-right: 18px;
  padding: 8px 0 16px;
  gap: 12px;
}

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

.layout-bottom-group2 {
  position: absolute;
  right: 6px;
  bottom: 32px;
  z-index: 14;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  transform: none;
}

.item4-col-1,
.item4-col-3 {
  position: relative;
  height: 40px;
  padding: 0 12px;
  border-radius: 16px;
  overflow: hidden;
  background: url("assets/ocean retan.png") center/100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

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

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

#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: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

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

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

.button-1-small {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  margin-left: 0;
  transform: translateY(-4px);
}

.button-1-front {
  position: relative;
  width: 102px;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("assets/ocean 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: 60px;
  height: 60px;
}

.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: 42px;
  height: 42px;
  font-size: 15px;
  transform: translateY(-2px);
}

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

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

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

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

.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;
}

.win-overlay,
.result-overlay-shell {
  position: absolute;
  inset: 72px 0 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  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);
  pointer-events: none;
}

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

.win-overlay-points,
#slot-earning-container {
  position: absolute;
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  min-width: 170px;
  min-height: 46px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

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

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

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

.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 effect-pulse {
  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);
  }
}

@media (max-width: 768px) {
  :root {
    --viewport-gap: 8px;
  }

  .layout-bottom-group1 {
    max-width: 320px;
    gap: 8px;
  }

  .item4-col-1 {
    min-width: 120px;
  }

  .item4-col-3 {
    min-width: 68px;
  }

  .toast-container {
    top: 8px;
    right: 8px;
  }

  .toast {
    min-width: 150px;
    max-width: min(72vw, 240px);
  }
}

@media (max-width: 480px) {
  #slot {
    width: 88%;
    height: 82%;
  }

  #reels {
    padding-left: 2px;
    padding-right: 2px;
  }

  .reel {
    padding: 0 1px;
  }

  .slot-cell {
    padding: 1px;
  }

  .slot-cell img {
    width: 94%;
    height: 94%;
  }

  .layout-bottom {
    margin-right: 10px;
    margin-top: 30px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .layout-bottom-group1 {
    margin-left: 10px;
    max-width: 290px;
    transform: scale(0.95) translateY(-14px);
  }

  .layout-bottom-group2 {
    right: 4px;
    bottom: 24px;
    gap: 8px;
  }
}
