/* ── Body baseline ─────────────────────────────────────────────────── */
html {
  background: var(--tg-theme-bg-color, #0f0f10);
  min-height: 100vh;
}

/* ── no-tg adjustments ─────────────────────────────────────────────── */
body.no-tg .app-navbar {
  padding: 12px 0;
}


/* ── Layout utility ────────────────────────────────────────────────── */
.page-wrap-narrow {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Auth overlay ──────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

@media (min-width: 480px) {
  .auth-overlay { align-items: center; }
}

.auth-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.auth-sheet {
  background: var(--tg-theme-secondary-bg-color, #16171a);
  border-radius: 1.25rem 1.25rem 0 0;
  width: 100%;
  max-width: 400px;
  padding: 1rem 1.5rem 2rem;
  transform: scale(.95) translateY(12px);
  transition: transform .2s ease;
}

@media (min-width: 480px) {
  .auth-sheet {
    border-radius: 1.25rem;
    transform: scale(.95) translateY(12px);
  }
}

.auth-overlay.is-open .auth-sheet {
  transform: scale(1) translateY(0);
}

.auth-sheet-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .5rem;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 .25rem;
  color: var(--tg-theme-text-color, #eaeaea);
}

/* ── Auth states ───────────────────────────────────────────────────── */
.auth-state {
  display: flex;
  flex-direction: column;
}

.auth-state--hidden {
  display: none !important;
}

/* ── Method picker ─────────────────────────────────────────────────── */
.auth-methods {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.auth-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  background: var(--tg-theme-bg-color, #0f0f10);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .75rem;
  padding: .9rem 1.2rem;
  color: var(--tg-theme-text-color, #eaeaea);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-width: 90px;
}

.auth-method-btn:hover {
  border-color: #fcc000;
  background: rgba(252,192,0,.07);
}

.auth-method-icon {
  font-size: 1.6rem;
}

.auth-method-label {
  font-size: .8rem;
}

/* ── Input ─────────────────────────────────────────────────────────── */
.auth-input {
  width: 100%;
  background: var(--tg-theme-bg-color, #0f0f10);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: .6rem;
  color: var(--tg-theme-text-color, #eaeaea);
  padding: .7rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
  margin-top: .75rem;
}

.auth-input:focus {
  border-color: #fcc000;
}

.auth-hint {
  color: var(--tg-theme-hint-color, #a0a0a0);
  font-size: .88rem;
  margin-bottom: .25rem;
}

.auth-error {
  color: #f55;
  font-size: .82rem;
  min-height: 1.1rem;
  margin-top: .3rem;
}

/* ── Shared buttons ────────────────────────────────────────────────── */
.btn-primary-big {
  display: block;
  width: 100%;
  background: #fcc000;
  color: #000;
  border: none;
  border-radius: 2rem;
  padding: .75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity .15s;
}

.btn-primary-big:hover { opacity: .9; }
.btn-primary-big:disabled { opacity: .5; cursor: not-allowed; }

.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.1);
  color: var(--tg-theme-text-color, #eaeaea);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  font-size: .9rem;
}

.close-btn:hover { background: rgba(255,255,255,.18); }

/* Shared purchase controls */
.web-btn-bar {
  display: flex;
  justify-content: center;
  position: fixed;
  bottom: var(--bottom-nav-height);
  left: 0;
  right: 0;
  padding: .8rem 1rem;
  background: var(--tg-bg, #0f0f10);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}

body.no-tg .web-btn-bar {
  display: flex;
  justify-content: center;
}

/* size the button — centered, reasonable on both mobile and desktop */
.web-btn-bar .btn {
  max-width: 520px;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  border-radius: .75rem;
}

/* avoid content hiding behind the fixed bar */
body:has(.web-btn-bar) {
  padding-bottom: calc(var(--bottom-nav-height) + 80px);
}

/* Apply the light palette before body exists; Telegram supplies its own colors. */
:root[data-bs-theme="light"] {
  --tg-bg: var(--tg-theme-bg-color, #f5f5f5);
  --tg-text: var(--tg-theme-text-color, #111111);
  --tg-hint: var(--tg-theme-hint-color, #777777);
  --tg-link: var(--tg-theme-link-color, #0055cc);
  --tg-btn: var(--tg-theme-button-color, #0066ff);
  --tg-btn-txt: var(--tg-theme-button-text-color, #ffffff);
  --card-bg: var(--tg-theme-secondary-bg-color, #ffffff);
  --border-softer: rgba(0,0,0,.09);
  --border-soft: rgba(0,0,0,.15);
  --shadow-soft: 0 4px 16px rgba(0,0,0,.10);
}

[data-bs-theme="light"] body.no-tg .auth-sheet {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.12);
}

[data-bs-theme="light"] body.no-tg .auth-method-btn {
  background: #f0f0f0;
  border-color: rgba(0,0,0,.15);
  color: #111;
}

[data-bs-theme="light"] body.no-tg .auth-input {
  background: #ffffff;
  border-color: rgba(0,0,0,.2);
  color: #111;
}

[data-bs-theme="light"] body.no-tg .web-btn-bar {
  border-top-color: rgba(0,0,0,.10);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

/* ── Bootstrap 5.3 dark-mode fix: btn-outline-light actually appears light ────────────
   Bootstrap redefines --bs-light as a dark grey (~#3f4346) in dark mode, making
   btn-outline-light render with a dark border — invisible on a dark background.
   Override the button-level CSS vars so the outline is visibly light at all times.    */
[data-bs-theme="dark"] .btn-outline-light {
  --bs-btn-color:              #eaeaea;
  --bs-btn-border-color:       rgba(234,234,234,.6);
  --bs-btn-hover-color:        #111;
  --bs-btn-hover-bg:           #eaeaea;
  --bs-btn-hover-border-color: #eaeaea;
  --bs-btn-active-color:       #111;
  --bs-btn-active-bg:          #fff;
  --bs-btn-active-border-color:#eaeaea;
  --bs-btn-disabled-color:     rgba(234,234,234,.35);
  --bs-btn-disabled-border-color: rgba(234,234,234,.35);
  --bs-btn-focus-shadow-rgb:   234,234,234;
}

/* Shared surfaces follow the active theme in web and Telegram. */
body .toolbar, body .site-footer {
  background: var(--tg-bg);
  color: var(--tg-text);
  border-color: var(--bs-border-color);
}
body .site-footer { color: var(--tg-hint); }
body #searchInput {
  background-color: var(--card-bg);
  border-color: var(--bs-border-color);
  color: var(--tg-text);
}
body #searchInput::placeholder { color: var(--tg-hint); opacity: .9; }
/* Keep the icon and button surface in the same theme on hover and focus. */
.toolbar .header-btn, .toolbar .flag-btn {
  --bs-btn-color: var(--tg-text);
  --bs-btn-bg: var(--card-bg);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: var(--tg-text);
  --bs-btn-hover-bg: var(--bs-tertiary-bg);
  --bs-btn-hover-border-color: var(--tg-hint);
  --bs-btn-active-color: var(--tg-text);
  --bs-btn-active-bg: var(--bs-tertiary-bg);
  --bs-btn-active-border-color: var(--tg-link);
}
.toolbar .flag-btn.active {
  border-color: var(--tg-link);
  box-shadow: 0 0 0 .15rem rgba(106,177,255,.25);
}
.toolbar .header-btn:focus-visible, .toolbar .flag-btn:focus-visible {
  outline: 2px solid var(--tg-link);
  outline-offset: 2px;
}

/* Persistent navigation and catalog presentation */
:root { --bottom-nav-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
body { padding-bottom: var(--bottom-nav-height); }
html { scroll-padding-bottom: calc(var(--bottom-nav-height) + 80px); }
.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 1040;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--tg-bg, #f7f7f7);
  box-shadow: 0 -3px 18px rgba(0,0,0,.10);
}
.bottom-nav .nav-inner { display: flex; align-items: center; height: 64px; }
.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 42px;
  color: var(--tg-hint, #777);
  font-size: 1.4rem;
  text-decoration: none;
}
.bottom-nav a[aria-current="page"], .bottom-nav a:hover { color: var(--tg-text, #111); }
.bottom-nav a:focus-visible { outline: 2px solid var(--tg-link); outline-offset: -2px; border-radius: .5rem; }
@media (min-width: 992px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    width: 420px;
    transform: translateX(-50%);
    border-radius: 1rem 1rem 0 0;
  }
}
body .game-card, body .sub-card, body .hero-card, body .addon-card {
  border: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
}
body .game-card { height: auto; min-height: 340px; }
body .game-meta .price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.old-price { color: var(--tg-hint); font-size: .85em; font-weight: 400; }
.subscription-icon { width: 30px; height: 30px; margin-right: .4rem; vertical-align: middle; }

.swiper{
  padding-bottom: 1rem;
}
