:root {
  --color-lime: #30D158;
  --color-lime-dark: #132317;
  --color-white: #FFFFFF;
  --color-bg: #101010;
  --color-modal-bg: #141414;
  --color-secondary-btn: #284830;
  --radius-large: 24px;
  --radius-medium: 18px;
  --radius-small: 12px;
  --transition-fast: 0.18s ease-out;
  --transition-normal: 0.25s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-white);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background-color: var(--color-lime);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--color-lime);
  color: #ffffff;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 12px 24px;
  position: relative;
}

.page {
  width: 100%;
  display: block;
}

.bought-items-page {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.section-title {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.balance-card {
  position: relative;
  overflow: hidden;
  margin-top: 50px;
  background: var(--color-lime-dark);
  border-radius: 30px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.balance-logo {
  position: absolute;
  width: 350px;
  left: -100px;
  top: 70px;
  height: auto;
  transform: rotate(45deg);
  opacity: 0.1;
  pointer-events: none;
  filter:
    invert(58%)
    sepia(78%)
    saturate(839%)
    hue-rotate(86deg)
    brightness(101%)
    contrast(96%);
  z-index: 0;
}

.balance-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.balance-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.balance-value {
  font-size: 48px;
  font-weight: 700;
}

.my-items {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-lime);
}

.balance-currency {
  font-size: 38px;
  color: #808080;
  font-weight: 600;
}

.balance-label {
  font-size: 16px;
  color: rgba(48, 209, 88, 0.26);
}

.balance-actions {
  display: flex;
  flex-direction: column;
  z-index: 2;
  gap: 14px;
}

.btn {
  appearance: none;
  border: none;
  outline: none;
  padding: 12px 16px;
  border-radius: 15px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-white);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-fast), transform 0.08s ease-out, opacity 0.18s ease-out;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-lime);
}

.btn-buy {
  background: var(--color-lime);
  width: 85%;
}

.btn-secondary {
  background: var(--color-secondary-btn);
}

.btn-toggle {
  flex: 1;
  background: var(--color-secondary-btn);
  border-radius: 999px;
  font-size: 14px;
}

.btn-toggle.active {
  background: var(--color-lime);
}

.btn-wallet {
  width: 100%;
  background: #1F1F1F;
  border-radius: 16px;
  padding: 12px 14px;
  justify-content: flex-start;
  font-size: 14px;
}

.btn-wallet span {
  flex: 1;
  text-align: left;
}

.modal-submit {
  width: 100%;
  margin-top: 14px;
}

button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
}

button:focus {
  outline: none;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card {
  display: flex;
  align-items: flex-end;
  background: #1A1A1A;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  padding: 12px 14px;
  min-height: 84px;
}

.product-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-size: cover;
  background-position: center;
  filter: blur(1px);
}

.product-card-overlay {
  border-width: 0px;
  position: absolute;
  inset: 0;
  background-color: #28483077;
}

.product-card-content {
  position: relative;
  text-align: left;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card-title {
  font-size: 18px;
  font-weight: 700;
}

.product-card-platform {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.product-card-price-badge {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0px;
  border-radius: 999px;
  background: rgba(0
 255, 255, 255, 0.12);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.0);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal), background-color var(--transition-normal);
  z-index: 20;
}

.backdrop.visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.modal-wrapper {
  position: fixed;
  inset: 0;
  padding: 24px 12px 32px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  z-index: 30;
}

.modal-wrapper.modal-zoom {
  align-items: center;
}

.modal-wrapper.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--color-modal-bg);
  border-radius: 24px;
  padding: 18px 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  pointer-events: auto;
}

.modal.active {
  transform: translateY(0);
  opacity: 1;
}

.modal-zoom .modal {
  max-width: 480px;
  padding: 12px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.payment-methods {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-field-label {
  font-size: 13px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.wallet-row {
  margin-bottom: 14px;
}

.input-wrapper {
  background: #1F1F1F;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-white);
  font-size: 15px;
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.modal-product-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 10px;
  row-gap: 6px;
  margin-bottom: 14px;
  align-items: center;
}

.modal-product-name {
  font-size: 20px;
  font-weight: 700;
}

.modal-product-platform {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.modal-product-tag {
  grid-row: 1 / 3;
  align-self: center;
  background: #1F1F1F;
  border-radius: 18px;
  padding: 8px 10px;
  font-size: 13px;
}

.modal-product-safe {
  grid-row: 1 / 3;
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.safe-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--color-lime);
}

.modal-product-gallery {
  margin-bottom: 16px;
}

.gallery-main {
  border-radius: 18px;
  background: #222;
  overflow: hidden;
}

.gallery-main-inner {
  width: 100%;
  padding-top: 56%;
  position: relative;
}

.gallery-main-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.gallery-thumb {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #222;
  position: relative;
}

.gallery-thumb-inner {
  width: 100%;
  padding-top: 56%;
  position: relative;
}

.gallery-thumb-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.active {
  border-color: var(--color-lime);
}

.gallery-zoom-btn {
  margin-top: 8px;
  width: 100%;
  border-radius: 999px;
  border: none;
  background: #1F1F1F;
  color: var(--color-white);
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.modal-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-product-price {
  display: flex;
  font-size: 16px;
  font-weight: 700;
  background-color: #1F1F1F;
  align-items: center;
  border-radius: 15px;
  align-self: center;
  justify-content: center;
  width: 90px;
  height: 42px;
}

.modal-subscribe {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-subscribe-image {
  width: 100%;
  border-radius: 18px;
  background: #222;
  padding-top: 48%;
  position: relative;
  overflow: hidden;
}

.modal-subscribe-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-subscribe-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-subscribe-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.zoom-content {
  width: 100%;
  max-height: 70vh;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.zoom-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#app {
  padding-bottom: calc(16px + var(--tg-safe-area-inset-bottom, 0px));
  padding-top: calc(12px + var(--tg-safe-area-inset-top, 0px));
}
