*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font: Montserrat, system-ui, sans-serif;
  --background_default: radial-gradient(182% 85% at 50% 50%, #4a505a, #0c0d0e 100%);
  --tab-active: #296eff;
  --tab-inactive: #8b9198;
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;
  --tg-content-safe-top: 0px;
  --tg-content-safe-bottom: 0px;
  --tg-viewport-height: 100dvh;
  --tabbar-height: 64px;
  --app-header-h: calc(
    var(--tg-safe-top) + max(24px, var(--tg-content-safe-top)) + 10px + 56px + 14px
  );
}

html,
body {
  height: var(--tg-viewport-height, 100dvh);
  min-height: var(--tg-viewport-height, 100dvh);
  background-color: #000;
  background-image: none;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: #fff;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}

.app-scroll {
  height: var(--tg-viewport-height, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#screen-home {
  position: relative;
  isolation: isolate;
  min-height: calc(var(--tg-viewport-height, 100dvh) - var(--app-header-h));
  background: #000;
  overflow-x: hidden;
}

#screen-home[hidden] {
  display: none;
}

#screen-home > .app {
  position: relative;
  z-index: 1;
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: var(--font);
}

.app {
  min-height: calc(var(--tg-viewport-height, 100dvh) - var(--app-header-h));
  padding:
    16px
    16px
    calc(24px + var(--tabbar-height) + var(--tg-safe-bottom) + var(--tg-content-safe-bottom));
}

.app-topbar {
  padding: var(--tg-safe-top) 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.app-topbar[hidden] {
  display: none;
}

.balance-card[hidden] {
  display: none;
}

.balance-row {
  width: auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: max(24px, var(--tg-content-safe-top));
  gap: 12px;
  pointer-events: none;
}

.balance-card {
  width: min(100%, 420px);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff14;
  border: 1px solid #ffffff1a;
  border-radius: 18px;
  padding: 8px 8px 8px 10px;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

.balance-card__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.balance-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: #ffffff1a;
}

.balance-card__amount {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.balance-card__star {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.balance-card.is-demo {
  border-color: #ffd54a55;
  background: #ffd54a1a;
}

.balance-card__demo-badge {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1300;
  background: #ffd54a;
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 4px;
  flex-shrink: 0;
}

.balance-card.is-demo .balance-card__demo-badge {
  display: inline-block;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #ffffff26;
  background: #ffffff12;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.demo-toggle.is-on {
  background: #ffd54a;
  border-color: #ffd54a;
  color: #1a1300;
}

.balance-card__amount p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-card__topup {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e53935;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border-radius: 14px;
  padding: 9px 14px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.balance-card__topup .Icon {
  flex-shrink: 0;
}

.balance-card__topup:active {
  filter: brightness(0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 18px;
}

.brand-logo {
  width: 1em;
  height: 1em;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.brand-title {
  font-family: var(--font);
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}

.BalanceItem--container {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: max-content;
  background: #ffffff1a;
  color: #fff;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

.BalanceItem--size-md {
  border-radius: 24px;
  gap: 4px;
  height: 42px;
  padding: 0 12px 0 14px;
}

.BalanceItem--size-md img {
  height: 20px;
  width: 20px;
  display: block;
  flex-shrink: 0;
}

.BalanceItem__value {
  display: flex;
  align-items: center;
  gap: 12px;
}

.BalanceItem--size-md p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.BalanceItem--after {
  appearance: none;
  border: none;
  display: grid;
  place-items: center;
  background: #e53935;
  border-radius: 100%;
  padding: 4px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.BalanceItem--size-md .BalanceItem--after .Icon {
  width: 14px;
  height: 14px;
  stroke-width: 4px;
}

.BalanceItem--after:active {
  filter: brightness(0.92);
}

.modes {
  width: min(100%, 420px);
  margin: 0 auto;
}

.modes .GameCard--spacer:last-child {
  display: none;
}

.GameCard--container:active {
  filter: brightness(0.95);
  transform: scale(0.99);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 0 20px calc(14px + var(--tg-safe-bottom) + var(--tg-content-safe-bottom));
  background: transparent;
  pointer-events: none;
}

.tabbar__content {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-evenly;
  gap: 4px;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(28, 28, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  isolation: isolate;
}

.tabbar__content::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 80% at 20% 0%,
    rgba(255, 255, 255, 0.35) 0%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 0;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  position: relative;
  z-index: 1;
  border-radius: 999px;
  transition: color 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab__icon .Icon {
  display: block;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  transition: filter 0.35s ease;
}

.tab__label {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: inherit;
  transition:
    color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 0.35s ease,
    opacity 0.35s ease;
}

.tab.is-active {
  color: #fff;
}

.tab.is-active .tab__icon {
  transform: translateY(-1px) scale(1.06);
}

.tab.is-active .tab__label {
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.28);
}

.tabbar__thumb {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.36) 0%,
      rgba(255, 255, 255, 0.12) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, width;
}

.tab__badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff2d46;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(12, 13, 14, 0.4);
}

.tab:active {
  transform: scale(0.97);
}

.free-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  padding-top: calc(16px + var(--tg-safe-top) + var(--tg-content-safe-top));
  padding-bottom: calc(16px + var(--tg-safe-bottom) + var(--tg-content-safe-bottom));
}

.free-modal[hidden] {
  display: none !important;
}

.free-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}

.free-modal__sheet {
  position: relative;
  width: min(100%, 420px);
  background: #1c1c1e;
  border-radius: 24px;
  padding: 18px 16px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.free-modal__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 28px;
}

.free-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.free-modal__close {
  appearance: none;
  border: none;
  background: transparent;
  color: #8e8e93;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 10px;
}

.free-modal__close:active {
  background: #ffffff12;
}

.free-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.free-card {
  appearance: none;
  border: none;
  background: #2c2c2e;
  border-radius: 20px;
  padding: 14px 12px 12px;
  cursor: pointer;
  color: #fff;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.free-card:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.free-card--wheel .free-card__art img {
  object-fit: contain;
  object-position: center;
}

.free-card__art {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
}

.free-card__art img,
.free-card__art .lottie-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  display: block;
}

.free-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.free-card__label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.free-card__price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #ffbf32;
  line-height: 1;
}

.free-card__star {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.topup-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 16px;
  padding-top: calc(16px + var(--tg-safe-top) + var(--tg-content-safe-top));
  padding-bottom: calc(16px + var(--tg-safe-bottom) + var(--tg-content-safe-bottom));
}

.topup-modal[hidden] {
  display: none !important;
}

.topup-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.topup-modal__sheet {
  position: relative;
  width: min(100%, 360px);
  background: #1a1d22;
  border-radius: 24px;
  padding: 20px 18px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.topup-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topup-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.topup-modal__close {
  appearance: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff14;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.topup-modal__hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #ffffff88;
  line-height: 1.35;
}

.topup-modal__presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.topup-preset {
  appearance: none;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: #ffffff10;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  height: 40px;
  cursor: pointer;
}

.topup-preset:active {
  transform: scale(0.97);
}

.topup-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff77;
}

.topup-modal__field input {
  appearance: none;
  -moz-appearance: textfield;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  background: #00000044;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
}

.topup-modal__field input::-webkit-outer-spin-button,
.topup-modal__field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.topup-modal__field input:focus {
  border-color: #296eff;
}

.topup-modal__ton-preview {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0098ea18;
  border: 1px solid #0098ea33;
  color: #9fdfff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.topup-modal__credit-preview {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #73ff9d18;
  border: 1px solid #73ff9d33;
  color: #b8ffd0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.star-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-left: 1px;
  display: inline-block;
}

.topup-modal__hint .star-icon,
.topup-modal__credit-preview .star-icon,
.topup-modal__ton-preview .star-icon,
.topup-promo__active .star-icon {
  width: 13px;
  height: 13px;
}

.topup-promo {
  margin-bottom: 12px;
}

.topup-promo__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff77;
}

.topup-promo__row {
  display: flex;
  gap: 8px;
}

.topup-promo__input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  background: #00000044;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 11px 12px;
  outline: none;
}

.topup-promo__input::placeholder {
  color: #ffffff4d;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.topup-promo__input:focus {
  border-color: #73ff9d;
}

.topup-promo__btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  color: #0c0d0e;
  background: #73ff9d;
  flex-shrink: 0;
}

.topup-promo__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.topup-promo__btn:active:not(:disabled) {
  opacity: 0.85;
  transform: scale(0.98);
}

.topup-promo__active {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 650;
  color: #73ff9d;
  line-height: 1.35;
}

.topup-promo__active[hidden] {
  display: none !important;
}

.topup-modal__actions {
  display: grid;
  gap: 8px;
}

.mines-btn--ton {
  background: linear-gradient(135deg, #0098ea, #0077b6);
  color: #fff;
  border: none;
}

.mines-btn--ton:disabled {
  opacity: 0.55;
}

.topup-modal__status {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff99;
}

.is-nft-gift {
  border-radius: 22%;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
}

.is-nft-gift canvas,
.is-nft-gift svg,
.is-nft-gift img {
  border-radius: inherit;
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  background: transparent;
}

.rwheel__icon.is-nft-gift,
.rfeed__prize-lottie.is-nft-gift,
.mines-ladder__lottie.is-nft-gift,
.MineCell--lottie.is-nft-gift,
.slots-cell__lottie.is-nft-gift {
  border-radius: 0;
  overflow: visible;
  background: transparent !important;
}

.rwheel__icon.is-nft-gift img,
.rwheel__icon.is-nft-gift canvas,
.rfeed__prize-lottie.is-nft-gift img,
.rfeed__prize-lottie.is-nft-gift canvas,
.mines-ladder__lottie.is-nft-gift img,
.mines-ladder__lottie.is-nft-gift canvas,
.MineCell--lottie.is-nft-gift img,
.MineCell--lottie.is-nft-gift canvas,
.slots-cell__lottie.is-nft-gift img,
.slots-cell__lottie.is-nft-gift canvas {
  border-radius: 0;
  object-fit: contain;
}

.slots-prize-card__art.is-nft-gift,
.profile-inv__art.is-nft-gift,
.slots-modal__lottie.is-nft-gift,
.mines-modal__lottie.is-nft-gift,
.roulette-modal__lottie.is-nft-gift {
  border-radius: 16px;
  background: transparent !important;
}

.subscribe-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(16px + var(--tg-safe-top) + var(--tg-content-safe-top))
    16px
    calc(16px + var(--tg-safe-bottom) + var(--tg-content-safe-bottom));
  background: #000;
}

.subscribe-gate[hidden] {
  display: none !important;
}

.subscribe-gate__card {
  width: min(100%, 360px);
  padding: 28px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.35) 0%, rgba(24, 10, 36, 0.95) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  text-align: center;
}

.subscribe-gate__logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  object-fit: cover;
}

.subscribe-gate__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.subscribe-gate__text {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.subscribe-gate__text strong {
  color: #fff;
  font-weight: 700;
}

.subscribe-gate__btn {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.subscribe-gate__btn:last-of-type {
  margin-bottom: 0;
}

.subscribe-gate__btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
}

.subscribe-gate__btn--secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.subscribe-gate__btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.subscribe-gate__status {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

