/* Catalog redesign */
:root {
  --bg: #08090c;
  --bg-gradient-top: #142042;
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-elevated-hover: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-sticky: rgba(8, 9, 12, 0.86);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-blue: rgba(74, 124, 255, 0.4);
  --text: #f5f6f8;
  --text-muted: #8a92a8;
  --text-dim: #4f6080;
  --gold: #d4af6a;
  --gold-bright: #e8c47e;
  --blue: #4a7cff;
  --blue-bright: #6b94ff;
  --red-bright: #ff7878;
  --orange-bright: #ffb05c;
  --green-bright: #5ed4a3;
  --purple-bright: #a877ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --tg-safe-area-inset-top: 0px;
  --tg-content-safe-area-inset-top: 0px;
  --app-safe-area-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px)
  );
  --app-safe-area-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-safe-area-inset-bottom, 0px),
    var(--tg-content-safe-area-inset-bottom, 0px)
  );
  --topbar-control-height: 42px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02";
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1118;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.page-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__spinner,
.search-loader__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phone {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: var(--tg-viewport-stable-height, 100vh);
  background: radial-gradient(ellipse at top, var(--bg-gradient-top) 0%, var(--bg) 60%);
  overflow: hidden;
  padding-bottom: calc(112px + var(--app-safe-area-bottom));
}

.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 18px;
  margin-top: var(--app-logo-content-gap);
  background: var(--bg-sticky);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.tg-desktop .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  z-index: 20;
}

.tg-desktop .phone {
  padding-top: 70px;
}

html:not(.tg-desktop) .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
  top: unset;
  margin-top: 49px; /* logo is absolute on mobile: compensate its 36px flow + 13px gap */
}

html:not(.tg-desktop) .logo-block {
  position: fixed;
  top: var(--app-header-top-padding);
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  z-index: 101;
  transition: opacity 0.2s ease;
}
html.shutter-visible:not(.tg-desktop) .logo-block {
  opacity: 0;
  pointer-events: none;
}

/* ── Search shutter (mobile only) ── */
.search-shutter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--app-header-top-padding) + 14px) 18px 12px;
  background: var(--bg-sticky);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
html.shutter-visible .search-shutter {
  transform: translateY(0);
}
html.tg-desktop .search-shutter {
  display: none;
}
.search-shutter__inner {
  display: flex;
  align-items: center;
  gap: 52px;
}
.search-shutter__ghost {
  color: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.0325rem;
  pointer-events: none;
  user-select: none;
}
.search-shutter__btn {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.search-shutter__icon {
  position: absolute;
  width: 14px;
  height: 14px;
  color: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.search-shutter__icon--search { opacity: 1; transform: scale(1); }
.search-shutter__icon--close  { opacity: 0; transform: scale(0.7); }
html.shutter-search-active .search-shutter__icon--search { opacity: 0; transform: scale(0.7); }
html.shutter-search-active .search-shutter__icon--close  { opacity: 1; transform: scale(1); }
/* In shutter-search mode keep catalog in flow (invisible) so page height stays and scroll is preserved */
html.shutter-search-active .content.is-hidden {
  display: block !important;
  opacity: 0;
  pointer-events: none;
}
/* Topbar (search input) fixed below shutter when triggered from shutter */
html.shutter-search-active:not(.tg-desktop) #searchTopbar {
  position: fixed;
  top: calc(var(--app-header-top-padding) + 56px);
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  z-index: 100;
  background: var(--bg-sticky);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
/* Search surface as fixed overlay when triggered from shutter */
/* shutter: --app-header-top-padding + 56px; topbar: 70px → total 126px */
html.shutter-search-active .search-surface.is-active {
  position: fixed;
  top: calc(var(--app-header-top-padding) + 126px);
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  bottom: 0;
  z-index: 99;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-right: none;
  border-top-color: rgba(255, 255, 255, 0.12);
  border-radius: 11px 0 0 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.search-input:focus-within {
  border-color: var(--border-blue);
  background: rgba(255, 255, 255, 0.05);
}

.search-input svg {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-input input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.search-input input::placeholder {
  color: var(--text-dim);
}

.balance-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  padding: 0 14px;
  background: linear-gradient(135deg, rgba(212, 175, 106, 0.1) 0%, rgba(212, 175, 106, 0.03) 100%);
  border: 1px solid rgba(212, 175, 106, 0.2);
  border-top-color: rgba(212, 175, 106, 0.3);
  border-radius: 0 11px 11px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 60%, #8a6d30 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.coin::after {
  content: "₽";
  font-size: 10px;
  font-weight: 800;
  color: #5a4520;
  line-height: 1;
}

.balance-pill-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  line-height: 1;
  white-space: nowrap;
}

.balance-pill-value .currency,
.sub-price .currency {
  margin-left: 2px;
  color: inherit;
}

.search-surface {
  position: relative;
  z-index: 2;
  display: none;
  padding: 18px 0 0;
}

.search-surface.is-active {
  display: block;
}

.search-surface .section-head {
  margin-bottom: 10px;
}

.search-loader {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 8px;
}

.search-loader.is-active {
  display: flex;
}

.search-empty {
  display: none;
  padding: 18px 20px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.search-empty.is-active {
  display: block;
}

.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 0 0;
}

.search-group {
  display: none;
}

.search-group.is-active {
  display: block;
}

.search-group-title {
  padding: 0 20px;
  margin: 10px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content {
  position: relative;
  z-index: 2;
}

.content.is-hidden {
  display: none;
}

.promo {
  margin-top: 20px;
  padding-bottom: 8px;
}

.promo-track {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 0 6px;
  scrollbar-width: none;
}

.promo-track::-webkit-scrollbar,
.games-track::-webkit-scrollbar {
  display: none;
}

.promo-card {
  position: relative;
  flex-shrink: 0;
  width: 17.0625rem;
  height: 21.3125rem;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border-strong);
  background: #12151c;
  transform: scale(0.9);
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

.promo-card.active {
  transform: scale(1);
}

.promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.promo-card--sm {
  width: 10.875rem;
  height: 13.5625rem;
}


.promo-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.promo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.25s ease;
}

.promo-dot.active {
  width: 20px;
  border-radius: 999px;
  background: var(--gold);
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 20px 0;
  padding: 14px 16px;
  width: calc(100% - 40px);
  border-radius: 14px;
  border: 1px solid rgba(74, 124, 255, 0.25);
  background: linear-gradient(135deg, rgba(74, 124, 255, 0.12) 0%, rgba(74, 124, 255, 0.04) 100%);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.help-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.section {
  margin-top: 28px;
  padding: 0 1rem;
}

.section-framed {
  padding: 18px 0 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 50%, rgba(255, 255, 255, 0.004) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 -1px 0 rgba(0, 0, 0, 0.12) inset;
}

.section + .section {
  position: relative;
  margin-top: 24px;
}

.section + .section::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.section.sub-section + .section::before,
.section + .section.sub-section::before {
  display: none;
}

.leaders-section {
  position: relative;
  margin-top: 24px;
  margin-bottom: 24px;
}

.leaders-section::before,
.leaders-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.leaders-section::before {
  top: -12px;
}

.leaders-section::after {
  bottom: -12px;
}

.section.top-divider::before {
  content: "" !important;
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  display: block !important;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin-bottom: 14px;
}

.section-copy {
  min-width: 0;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.section-title.lg {
  font-size: 22px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.section-link:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.section-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.games-track {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0 0 8px;
  scrollbar-width: none;
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.games-track:has(.preorder-timer) {
  align-items: stretch;
}

.subs-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0.005) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.subs-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  padding: 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.subs-tab:hover {
  color: var(--text);
}

.subs-tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: #0a0c12;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(212, 175, 106, 0.25);
}

.subs-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sub-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.sub-card:hover {
  opacity: 0.8;
}

.sub-card:last-child {
  border-bottom: none;
}

.sub-thumb {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  height: 86px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  isolation: isolate;
}

.sub-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: scale(1.5);
  transform-origin: center;
}

.sub-info {
  flex: 1;
  min-width: 0;
}

.sub-price {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}

.sub-name {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.sub-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sub-price-old {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  text-decoration: line-through;
}

.sub-discount-inline {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 3px;
  background: linear-gradient(135deg, #2f5cd8 0%, #6a91ff 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Если скидки нет — не рисуем ни strike-through, ни бейдж. */
.sub-price-old[hidden],
.sub-discount-inline[hidden] { display: none !important; }

.preorder-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  margin-bottom: 1px;
  padding: 5px 11px;
  border: 1px solid rgba(107, 148, 255, 0.22);
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(74, 124, 255, 0.18) 0%, rgba(74, 124, 255, 0.18) 50%, rgba(255, 255, 255, 0.04) 50.01%, rgba(255, 255, 255, 0.04) 100%);
  line-height: 1;
  transform: translateY(5px);
}

.preorder-timer .lbl {
  color: var(--blue-bright);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.preorder-timer .val {
  color: #fff;
  font-family: "Geist Mono", "Geist", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.preorder-timer.today {
  justify-content: center;
  border: 1px solid rgba(212, 175, 106, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px rgba(212, 175, 106, 0.15);
}

.preorder-timer.today .today-text {
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price,
.sub-price {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.price .sep,
.sub-price .sep {
  display: inline-block;
  width: 0.2em;
}

.price .currency,
.sub-price .currency {
  color: inherit;
  margin-left: 0.15em;
}

.sub-discount-inline {
  font-size: 11px !important;
}

.bottom-spacer {
  height: 24px;
}


@media (min-width: 768px) {
  body {
    padding: 0 16px;
  }

  .phone {
    max-width: 440px;
  }

  .promo-card {
    width: 286px;
    height: 392px;
  }
}

/* ============ INDIA ACCOUNT POPUP ============ */
.india-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.india-popup.is-open { display: flex; }
.india-popup__box {
  background: #1c2035;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  max-width: 360px;
  width: 100%;
}
.india-popup__img {
  width: 100%;
  border-radius: 14px;
  display: block;
  margin-bottom: 16px;
}
.india-popup__text {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
  margin-bottom: 18px;
}
.india-popup__close {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--blue);
  border: none;
  border-radius: 13px;
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.india-popup__close:hover { background: var(--blue-bright); }
.help-btn { cursor: pointer; }
