/* ═══════════════════════════════════════════════════════════
   app.css — Search Gifts v3.1
   Единая адаптивная вёрстка:
     - Мобильный Telegram (iOS/Android)
     - Telegram Desktop
     - Telegram Web (z.web.telegram.org)
     - Браузер (landing page для не-TG)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════════════════
   1. ПЕРЕМЕННЫЕ
   ══════════════════════════════════════════════════════ */
:root {
  --ff: 'Nunito', -apple-system, system-ui, sans-serif;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ton:  #0098EA;
  --grn:  #12C064;
  --red:  #E8284A;
  --amb:  #F59E0B;
  --dur-t: .42s;
  --dur:   .17s;
  --dp:    .27s;

  --hdr-h: 56px;
  --nav-h: 64px;
  --nav-pb: env(safe-area-inset-bottom, 0px);

  --app-max-w: 540px;
  --content-max-w: 900px;

  /* Динамическая высота: обновляется JS-ом через tg.viewportChanged + resize */
  --tg-vh: 100dvh;
}

[data-theme="light"] {
  --pur:  #0077C0;
  --grn:  #0F9850;
  --bg:   #E8F1FB;
  --bg2:  rgba(255,255,255,0.9);
  --bg3:  rgba(210,228,248,0.75);
  --bd:   rgba(14,60,120,0.10);
  --bd2:  rgba(14,60,120,0.18);
  --tx:   #0B1E3A;
  --sub:  #4A6690;
  --hint: #7C94B8;
  --inp:  rgba(255,255,255,0.92);
  --card: rgba(255,255,255,0.88);
  --wg1:  #3DB0FF;
  --wg2:  #0098EA;
}

[data-theme="dark"] {
  --pur:  #3DB0FF;
  --grn:  #3EE87B;
  --bg:   #010a1e;
  --bg2:  rgba(8,18,48,0.82);
  --bg3:  rgba(18,34,72,0.65);
  --bd:   rgba(100,160,255,0.13);
  --bd2:  rgba(100,160,255,0.26);
  --tx:   #EAF2FF;
  --sub:  #8DA6D8;
  --hint: #4A6090;
  --inp:  rgba(8,18,48,0.65);
  --card: rgba(8,18,55,0.6);
  --wg1:  #3DB0FF;
  --wg2:  #0077C0;
}

/* ══════════════════════════════════════════════════════
   2. БАЗОВЫЕ
   ══════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  max-height: 100%;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
img { display: block; max-width: 100%; }
button {
  cursor: pointer; font-family: var(--ff); border: none; background: none;
  -webkit-appearance: none; appearance: none;
}
input, select, textarea { font-family: var(--ff); -webkit-appearance: none; appearance: none; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  line-height: 1.5;
  transition: background var(--dur-t), color var(--dur-t);
  min-height: var(--tg-vh);
  overflow: hidden;
}

body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 100% 70% at 50% 100%, #0d2560 0%, transparent 65%),
    radial-gradient(ellipse 70%  50% at 15%  0%,  #0a1a55 0%, transparent 55%),
    radial-gradient(ellipse 50%  40% at 85% 15%,  #061240 0%, transparent 50%),
    radial-gradient(ellipse 80%  60% at 50% 50%,  #050e30 0%, transparent 80%),
    linear-gradient(180deg, #010a1e 0%, #020d28 40%, #010a1e 100%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, #BFD9F4 0%, transparent 65%),
    radial-gradient(ellipse 70% 50% at 15%  0%,  #D9E8F8 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 15%,  #CFE0F3 0%, transparent 50%),
    linear-gradient(180deg, #F1F7FE 0%, #E3EEFA 45%, #D5E4F6 100%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 25% at 25% 65%, rgba(30,80,220,0.12), transparent 70%),
    radial-gradient(ellipse 40% 35% at 75% 35%, rgba(60,30,180,0.08), transparent 65%);
}
[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 55% 25% at 25% 65%, rgba(0,152,234,0.08), transparent 70%),
    radial-gradient(ellipse 40% 35% at 75% 35%, rgba(120,130,240,0.05), transparent 65%);
}

/* ══════════════════════════════════════════════════════
   3. APP SHELL — единый контейнер для всех клиентов
   ══════════════════════════════════════════════════════ */
.app {
  width: 100%;
  max-width: 100%;
  height: var(--tg-vh);          /* явная высота: flex-дети получают 100% */
  min-height: var(--tg-vh);
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════
   DESKTOP / WIDE SCREEN LAYOUT
   Убираем floating card, делаем full-width адаптив
   ══════════════════════════════════════════════════════ */

/* Вспомогательная переменная — ширина контентной зоны */
:root {
  --content-w: 860px;
  --content-pad: clamp(16px, 2.5vw, 32px);
}

@media (min-width: 640px) {
  .app {
    max-width: 100%;
    height: var(--tg-vh);
    min-height: var(--tg-vh);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Заголовок: контент выровнен по той же ширине что и секции */
  .hdr {
    padding-left:  max(var(--content-pad), calc((100% - var(--content-w)) / 2));
    padding-right: max(var(--content-pad), calc((100% - var(--content-w)) / 2));
  }

  /* Контентные блоки: центрируем и ограничиваем ширину */
  .sec {
    max-width: var(--content-w);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--content-pad);
    padding-right: var(--content-pad);
    box-sizing: border-box;
    width: 100%;
  }

  .banner-wrap {
    max-width: var(--content-w);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--content-pad);
    padding-right: var(--content-pad);
    box-sizing: border-box;
    width: 100%;
  }

  /* Предупреждение "нет поисков" вне .sec */
  .nb-warn {
    max-width: calc(var(--content-w) - var(--content-pad) * 2);
    margin-left: auto;
    margin-right: auto;
  }

  /* Нижняя навигация: выравниваем кнопки по ширине контента */
  .bnav {
    justify-content: center;
    padding-left:  max(0px, calc((100% - var(--content-w)) / 2));
    padding-right: max(0px, calc((100% - var(--content-w)) / 2));
  }
  .nb {
    flex: 1;
    max-width: 160px;
  }

  /* Пикеры — 3 колонки и на 640px */
  .pickers-grid { grid-template-columns: repeat(3, 1fr); }

  /* Пакеты — 4 колонки всегда */
  .g2 { grid-template-columns: repeat(4, 1fr); }

  /* NFT сетка — 4 колонки */
  .nft-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Широкий экран (900px+) */
@media (min-width: 900px) {
  :root {
    --content-w: 1000px;
    --content-pad: clamp(20px, 3vw, 40px);
  }

  /* NFT сетка — 5 колонок */
  .nft-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Очень широкий экран (1200px+) */
@media (min-width: 1200px) {
  :root {
    --content-w: 1100px;
    --content-pad: clamp(24px, 3vw, 48px);
  }

  .nft-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── Header ── */
.hdr {
  position: sticky; top: 0; z-index: 80;
  background: var(--bg2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bd);
  padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
  height: var(--hdr-h);
  min-height: var(--hdr-h);
  flex-shrink: 0;
  transition: background var(--dur-t), border-color var(--dur-t);
}
[data-theme="dark"] .hdr { background: rgba(1,10,30,0.75); }

.hdr-logo { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.hdr-r    { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-name { font-size: 16px; font-weight: 900; white-space: nowrap; color: var(--tx); }

.logo-ico {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0,152,234,0.5));
}
.logo-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ══════════════════════════════════════════════════════
   4. ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ
   ══════════════════════════════════════════════════════ */
.th-tog {
  position: relative; width: 58px; height: 30px;
  flex-shrink: 0; cursor: pointer; display: block;
}
.th-tog input { opacity: 0; width: 0; height: 0; position: absolute; }

.tsl {
  position: absolute; inset: 0; border-radius: 15px; overflow: hidden;
  background: linear-gradient(135deg, #87CEEB 0%, #B0E0FF 50%, #FFD580 100%);
  border: 1.5px solid rgba(200,160,40,0.3);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
  transition: background var(--dur-t), border-color var(--dur-t), box-shadow var(--dur-t);
}
.th-tog input:checked ~ .tsl {
  background: linear-gradient(135deg, #060d28 0%, #0f1e5a 50%, #080e38 100%);
  border-color: rgba(80,140,255,0.32);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), 0 0 10px rgba(80,140,255,0.18);
}
.tsl::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 48%;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, transparent 100%);
  border-radius: 15px 15px 0 0; pointer-events: none; z-index: 2;
}

.tsl-tr {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 7px; pointer-events: none; z-index: 3;
}

.tsl-sun {
  width: 12px; height: 12px; position: relative; flex-shrink: 0;
  opacity: 1; transform: scale(1) rotate(0deg);
  transition: opacity .3s ease, transform .38s cubic-bezier(.34,1.4,.64,1);
}
.tsl-sun::before {
  content: '';
  position: absolute; inset: 2px;
  border-radius: 50%;
  background: #FFD700;
  box-shadow: 0 0 0 2px rgba(255,215,0,0.5);
}
.th-tog input:checked ~ .tsl .tsl-sun {
  opacity: 0; transform: scale(0.4) rotate(-90deg);
}

.tsl-moon {
  width: 11px; height: 11px; position: relative; flex-shrink: 0;
  opacity: 0; transform: scale(0.4) rotate(60deg);
  transition: opacity .3s ease, transform .38s cubic-bezier(.34,1.4,.64,1);
}
.tsl-moon::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: #C8E0FF;
  clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 30% 100%, 0% 70%, 0% 30%);
  box-shadow: 0 0 4px rgba(160,210,255,0.8);
}
.th-tog input:checked ~ .tsl .tsl-moon {
  opacity: 1; transform: scale(1) rotate(0deg);
}

.tsl-th {
  position: absolute; top: 50%; left: 3px;
  transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE866, #FFAE18);
  box-shadow:
    0 0 10px rgba(255,185,30,0.7),
    0 2px 4px rgba(0,0,0,0.15);
  transition: left .38s cubic-bezier(.34,1.4,.64,1), background .42s;
  pointer-events: none; z-index: 4;
}
.th-tog input:checked ~ .tsl .tsl-th {
  left: 32px;
  background: radial-gradient(circle at 38% 36%, #EEF4FF, #A8C8FF 48%, #7AAAE8 100%);
  box-shadow:
    0 0 10px rgba(140,195,255,0.72),
    0 2px 4px rgba(0,0,0,0.28);
}

/* ══════════════════════════════════════════════════════
   5. СТРАНИЦЫ И НАВИГАЦИЯ
   ══════════════════════════════════════════════════════ */
.pages {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.page {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--nav-h) + var(--nav-pb) + 12px);
}
.page.on { display: block; }

/* Bottom nav */
.bnav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(1,10,30,0.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--bd);
  display: flex; z-index: 80;
  height: calc(var(--nav-h) + var(--nav-pb));
  padding-bottom: var(--nav-pb);
  transition: background var(--dur-t), border-color var(--dur-t);
}
[data-theme="light"] .bnav { background: rgba(235,246,255,0.92); }

.nb {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: var(--hint); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  transition: color var(--dur); position: relative;
  border: none; background: none; font-family: var(--ff); cursor: pointer;
  padding: 6px 4px;
}
.nb.on { color: #7EB3FF; }
[data-theme="light"] .nb.on { color: #0077C0; }
.nb.on::before {
  content: ''; position: absolute; top: 0;
  left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg,#3DB0FF,#7EB3FF);
  box-shadow: 0 0 10px rgba(125,180,255,0.8);
  animation: ni .2s ease;
}
[data-theme="light"] .nb.on::before {
  background: #0098EA; box-shadow: 0 0 8px rgba(0,152,234,0.5);
}
@keyframes ni { from{width:0;opacity:0} to{width:28px;opacity:1} }
.nb-ico { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.nb-ico svg { width: 22px; height: 22px; }
.nb.on .nb-ico svg { filter: drop-shadow(0 0 5px rgba(125,180,255,0.65)); }
[data-theme="light"] .nb.on .nb-ico svg { filter: drop-shadow(0 0 5px rgba(0,152,234,0.5)); }

/* ══════════════════════════════════════════════════════
   6. ОБЩИЕ КОМПОНЕНТЫ
   ══════════════════════════════════════════════════════ */
.sec { padding: 12px 13px 0; }
.sec:last-child { padding-bottom: 12px; }

.stl {
  font-size: 10px; font-weight: 800; color: var(--hint);
  text-transform: uppercase; letter-spacing: .9px; margin-bottom: 8px;
}
.fl {
  font-size: 10px; font-weight: 800; color: var(--sub);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 5px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bd); border-radius: var(--r-lg); overflow: hidden;
  transition: background var(--dur-t), border-color var(--dur-t);
}
[data-theme="dark"] .card {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(80,140,255,0.06), transparent 55%),
    linear-gradient(135deg, rgba(8,20,70,0.6) 0%, rgba(4,12,40,0.75) 100%);
}
.card + .card { margin-top: 9px; }

.btn {
  width: 100%; padding: 13px; border-radius: 14px;
  font-size: 15px; font-weight: 800; font-family: var(--ff);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: #fff; border: none; cursor: pointer;
  position: relative; overflow: hidden;
  transition: opacity var(--dur), transform .1s;
}
.btn:active:not(:disabled) { opacity: .83; transform: scale(.99); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn-ton, .btn-pur {
  background: linear-gradient(135deg,#0098EA 0%,#3DB0FF 55%,#6FC8FF 100%);
  box-shadow:
    0 0 22px rgba(0,152,234,0.48),
    0 4px 14px rgba(0,80,140,0.38),
    inset 0 1px 0 rgba(255,255,255,0.28);
}
.btn-grn { background: linear-gradient(135deg,#12C064,#3EE87B); }
.btn-red {
  background: linear-gradient(135deg,#E8284A,#FF5A7A);
  box-shadow: 0 0 14px rgba(232,40,74,0.38);
}

.btn-ton::after, .btn-pur::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.32) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: sgSweep 3.5s ease-in-out infinite;
}
@keyframes sgSweep { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }

/* Сообщения в админских формах (бывший .pr-msg) */
.pr-msg { font-size: 13px; min-height: 18px; margin-top: 6px; }
.pr-msg.ok  { color: var(--grn); }
.pr-msg.err { color: var(--red); }

/* ══════════════════════════════════════════════════════
   7. SEARCH PAGE
   ══════════════════════════════════════════════════════ */
.pick-btn {
  width: 100%; background: var(--inp); backdrop-filter: blur(6px);
  border: 1.5px solid var(--bd); border-radius: 10px;
  padding: 10px 12px; color: var(--tx); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  transition: border-color var(--dur), background var(--dur-t);
  text-align: left; font-family: var(--ff);
}
.pick-btn:active:not(:disabled) { border-color: rgba(61,176,255,0.48); }
.pick-btn:disabled { opacity: .5; cursor: not-allowed; }
.pick-btn.has-val { border-color: rgba(61,176,255,0.5); background: rgba(0,152,234,0.09); }
.pick-btn-img { width: 24px; height: 24px; border-radius: 5px; object-fit: contain; flex-shrink: 0; display: none; background: var(--bg3); }
.pick-btn-ph {
  width: 24px; height: 24px; border-radius: 5px; background: var(--bg3);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: var(--hint);
}
.pick-btn-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn-arr { font-size: 10px; color: var(--hint); flex-shrink: 0; }

.pickers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 11px;
}
@media (min-width: 480px) {
  .pickers-grid { grid-template-columns: repeat(3, 1fr); }
}

.gift-picker-wrap {
  margin-bottom: 11px;
}

.sc {
  background: var(--card); backdrop-filter: blur(6px);
  border: 1px solid var(--bd); border-radius: var(--r); overflow: hidden; margin: 9px 0 0;
  transition: background var(--dur-t), border-color var(--dur-t);
}
[data-theme="dark"] .sc {
  background: linear-gradient(135deg, rgba(8,20,70,0.58), rgba(4,12,40,0.72));
}
.sr { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid var(--bd); }
.sr:last-child { border: none; }
.sk { color: var(--sub); }
.sv { font-weight: 800; }
.svp { color: #7DD1FF; }
[data-theme="light"] .svp { color: #0077C0; }
.svg2 { color: var(--grn); }

/* Компактная сводка параметров поиска */
.sc-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px 0;
}
.sc-compact .sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 11px;
  font-size: 12px;
  min-width: 0;
  border: none;
}
.sc-compact .sc-row:nth-child(odd) { border-right: 1px solid var(--bd); }
.sc-compact .sc-row:nth-child(-n+3) { border-bottom: 1px solid var(--bd); }
.sc-compact .sc-row:last-child {
  grid-column: 1 / -1;
  border-right: none;
  border-top: 1px solid var(--bd);
  justify-content: space-between;
}
.sc-k {
  color: var(--hint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.sc-v {
  font-weight: 800;
  font-size: 12px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sc-v-pur { color: #7DD1FF; }
[data-theme="light"] .sc-v-pur { color: #0077C0; }
.sc-v-grn { color: var(--grn); }

/* Кнопки доната Stars */
.don-pkg {
  padding: 11px 6px;
  border-radius: 10px;
  background: rgba(255,193,7,0.10);
  border: 1px solid rgba(255,193,7,0.28);
  color: #FFD166;
  font-family: var(--ff);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--dur), transform .1s, border-color var(--dur);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.don-pkg:active { transform: scale(.97); opacity: .85; }
.don-pkg:disabled { opacity: .55; cursor: not-allowed; }
[data-theme="light"] .don-pkg { color: #B8860B; }
@media (hover: hover) and (pointer: fine) {
  .don-pkg:hover { background: rgba(255,193,7,0.18); border-color: rgba(255,193,7,0.48); }
}

/* Иконка звёздочки внутри кнопок/бейджей. Лёгкое свечение чтобы
   маленькие иконки лучше читались на тёмном фоне. */
.star-img-xs {
  width: 14px; height: 14px;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255,210,90,0.45));
}
.star-img-sm {
  width: 18px; height: 18px;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255,210,90,0.45));
}
.star-img-md {
  width: 22px; height: 22px;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(255,210,90,0.5));
}
.star-img-lg {
  width: 28px; height: 28px;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,210,90,0.55));
}
/* Главная звезда в карточке доната — без круглого фона, крупная,
   с заметным свечением. */
.star-img-hero {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(255,200,70,0.65))
          drop-shadow(0 0 22px rgba(255,180,40,0.32));
}

/* TON-лого: показываем нужный по теме, второй прячем. */
.ton-ico-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.ton-ico-wrap .ton-ico {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0,152,234,0.35));
}
/* В тёмной теме показываем цветной (светлый) лого, в светлой — чёрный. */
[data-theme="dark"]  .ton-ico-dark  { display: none; }
[data-theme="light"] .ton-ico-light { display: none; }

/* TON-адрес — копи-блок */
.ton-addr-copy {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0,152,234,0.10);
  border: 1px solid rgba(80,180,255,0.30);
  color: var(--tx);
  font-family: var(--ff);
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform .1s;
}
.ton-addr-copy:active { transform: scale(.99); opacity: .88; }
.ton-addr-copy.copied {
  background: rgba(18,192,100,0.12);
  border-color: rgba(60,230,120,0.36);
}
.ton-addr-text {
  font-family: monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #7DD1FF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-align: left;
}
[data-theme="light"] .ton-addr-text { color: #0077C0; }
.ton-addr-copy.copied .ton-addr-text { color: var(--grn); }
.ton-addr-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  flex-shrink: 0;
}
.ton-addr-copy.copied .ton-addr-ico { color: var(--grn); }
@media (hover: hover) and (pointer: fine) {
  .ton-addr-copy:hover {
    background: rgba(0,152,234,0.16);
    border-color: rgba(80,180,255,0.5);
  }
}

/* Кнопка «Сбросить» рядом с «Найти подарки» */
.btn-reset {
  width: auto;
  padding: 13px 14px;
  background: var(--bg3);
  color: var(--sub);
  border: 1px solid var(--bd2);
  box-shadow: none;
  font-size: 13px;
}
.btn-reset:active:not(:disabled) { opacity: .8; }
.btn-reset:disabled { opacity: .42; }
.btn-reset svg { flex-shrink: 0; }

.nb-warn {
  background: rgba(232,40,74,0.08); border: 1px solid rgba(232,40,74,0.2);
  border-radius: var(--r); padding: 10px 13px;
  display: flex; align-items: center; gap: 8px; margin: 12px 13px 0;
  font-size: 13px; font-weight: 700; color: var(--red); cursor: pointer;
}
.nb-warn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   9. NFT КАРТОЧКИ
   ══════════════════════════════════════════════════════ */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
@media (min-width: 420px) {
  .nft-grid { grid-template-columns: repeat(3, 1fr); }
}

.nft-card {
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, rgba(16,30,68,0.68), rgba(6,14,45,0.78));
  border: 1.5px solid var(--bd);
  transition: border-color var(--dur), transform .1s; animation: fi .22s ease;
}
[data-theme="light"] .nft-card { background: #fff; box-shadow: 0 2px 8px rgba(14,60,120,0.07); }
.nft-card:active { border-color: rgba(61,176,255,0.48); transform: scale(.98); }
@keyframes fi { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }

.nft-img-wrap { position: relative; padding-top: 100%; background: linear-gradient(135deg,#1a3078,#0a1850); overflow: hidden; }
[data-theme="light"] .nft-img-wrap { background: linear-gradient(135deg,#e8f1fb,#d4e4f7); }
.nft-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nft-img-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: var(--hint); }
.nft-num {
  position: absolute; top: 6px; left: 6px;
  background: rgba(1,10,30,0.62); color: #cfe3ff;
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 20px;
  backdrop-filter: blur(4px); border: 1px solid var(--bd);
}
[data-theme="light"] .nft-num { background: rgba(0,0,0,0.42); color: #fff; }
.nft-body { padding: 8px 9px 10px; }
.nft-name { font-size: 12px; font-weight: 800; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nft-attrs { display: flex; flex-wrap: wrap; gap: 3px; }
.nft-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  background: rgba(80,140,255,0.11); color: var(--sub); border: 1px solid var(--bd); font-weight: 600;
}
[data-theme="light"] .nft-tag { background: rgba(0,152,234,0.08); border-color: rgba(14,60,120,0.08); }

/* NFT Detail */
.nft-detail-bd { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 210; align-items: flex-end; justify-content: center; }
.nft-detail-bd.on { display: flex; }
.nft-detail {
  background: var(--bg2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: min(560px, 96vw); max-height: 92vh; overflow-y: auto;
  animation: pmu .26s cubic-bezier(.34,1.2,.64,1); border: 1px solid var(--bd); border-bottom: none;
}
[data-theme="dark"] .nft-detail { background: rgba(4,12,45,0.96); }
@media (min-width: 640px) {
  .nft-detail-bd { align-items: center; }
  .nft-detail {
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--bd);
    max-height: 88vh;
    max-width: min(560px, 92vw);
  }
}
@keyframes pmu { from{transform:translateY(100%)} to{transform:none} }
.nd-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg3); }
.nd-img-ph { width: 100%; aspect-ratio: 1; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 52px; font-weight: 900; color: var(--hint); }
.nd-body { padding: 16px; }
.nd-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.nd-num { font-size: 14px; color: var(--sub); margin-bottom: 14px; }
.nd-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.nd-attr { background: var(--bg3); border-radius: var(--r); padding: 9px 11px; }
.nd-attr-k { font-size: 11px; color: var(--hint); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.nd-attr-v { font-size: 13px; font-weight: 800; color: var(--tx); }
.nd-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.48); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; backdrop-filter: blur(6px); border: none; z-index: 5; }
.nd-img-wrap { position: relative; }

/* ══════════════════════════════════════════════════════
   10. ПРОФИЛЬ
   ══════════════════════════════════════════════════════ */
.ph-hero {
  background: var(--card); backdrop-filter: blur(8px);
  border: 1px solid var(--bd); border-radius: var(--r-lg);
  padding: 16px 13px; display: flex; align-items: center; gap: 12px;
  transition: background var(--dur-t), border-color var(--dur-t);
}
[data-theme="dark"] .ph-hero {
  background: linear-gradient(135deg, rgba(8,20,70,0.62), rgba(4,12,42,0.78));
}
.av {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg,#3DB0FF,#0077C0);
  box-shadow: 0 0 18px rgba(61,176,255,0.48);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fff; flex-shrink: 0; overflow: hidden;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.pn { font-size: 16px; font-weight: 900; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-sub { font-size: 13px; color: var(--sub); margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stg { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stc {
  background: var(--bg3); backdrop-filter: blur(6px);
  border-radius: var(--r); padding: 12px; border: 1px solid var(--bd);
  transition: background var(--dur-t);
}
[data-theme="dark"] .stc {
  background: linear-gradient(135deg, rgba(8,20,70,0.58), rgba(4,12,40,0.68));
}
.stn { font-size: 24px; font-weight: 900; color: #7DD1FF; filter: drop-shadow(0 0 7px rgba(125,180,255,0.38)); }
[data-theme="light"] .stn { color: #0077C0; filter: none; }
.stl2 { font-size: 11px; color: var(--sub); margin-top: 2px; font-weight: 700; }

.set-r { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; transition: background var(--dur); }
.set-r + .set-r { border-top: 1px solid var(--bd); }
.set-r.tap { cursor: pointer; }
.set-r.tap:active { background: var(--bg3); }
.set-l { display: flex; align-items: center; gap: 9px; }
.set-ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.set-ico svg { width: 18px; height: 18px; }
.set-t { font-size: 14px; font-weight: 700; }
.set-s { font-size: 12px; color: var(--sub); margin-top: 1px; }
.arr { font-size: 13px; color: var(--hint); }

/* ══════════════════════════════════════════════════════
   11. БЕЙДЖИ, ТЕГИ
   ══════════════════════════════════════════════════════ */
.bdg { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 20px; display: inline-block; }
.bdg-pur { background: rgba(61,176,255,0.14); color: #7DD1FF; border: 1px solid rgba(80,180,255,0.28); }
.bdg-grn { background: rgba(18,192,100,0.13); color: var(--grn); border: 1px solid rgba(60,230,120,0.22); }
.bdg-ton { background: rgba(0,152,234,0.14); color: #7DD1FF; border: 1px solid rgba(80,180,255,0.28); }
.bdg-red { background: rgba(232,40,74,0.09); color: var(--red); border: 1px solid rgba(232,40,74,0.2); }
[data-theme="light"] .bdg-pur, [data-theme="light"] .bdg-ton { color: #0077C0; }
[data-theme="light"] .bdg-grn { color: var(--grn); }

.row { padding: 11px 13px; display: flex; align-items: center; gap: 11px; }
.row + .row { border-top: 1px solid var(--bd); }

/* ══════════════════════════════════════════════════════
   12. ОВЕРЛЕИ И ШТОРКИ
   ══════════════════════════════════════════════════════ */
.ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: flex-end; justify-content: center; }
.ov.on { display: flex; }
.sh {
  background: var(--bg2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 19px 19px 28px;
  width: 100%; max-width: min(560px, 96vw); text-align: center;
  animation: su .25s cubic-bezier(.34,1.2,.64,1);
  border: 1px solid var(--bd); border-bottom: none;
  transition: background var(--dur-t);
  padding-bottom: calc(28px + var(--nav-pb));
}
[data-theme="dark"] .sh { background: rgba(3,10,40,0.97); }
@media (min-width: 640px) {
  .ov { align-items: center; }
  .sh { border-radius: var(--r-xl); border-bottom: 1px solid var(--bd); padding-bottom: 28px; }
}
@keyframes su { from{transform:translateY(100%)} to{transform:none} }
.sh-drag { width: 34px; height: 4px; border-radius: 2px; background: var(--bd2); margin: 0 auto 16px; }
.sh-th { width: 60px; height: 60px; border-radius: 15px; background: rgba(80,140,255,0.11); border: 1px solid var(--bd); display: flex; align-items: center; justify-content: center; margin: 0 auto 13px; }
.sh-th svg { width: 32px; height: 32px; }
.sh-ti { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.sh-su { color: var(--sub); font-size: 13px; line-height: 1.65; }
.sh-btn {
  display: block; width: 100%; margin-top: 11px; color: #fff;
  border-radius: var(--r); padding: 13px; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: var(--ff); border: none;
  background: linear-gradient(135deg,#0098EA,#3DB0FF);
  box-shadow: 0 0 16px rgba(0,152,234,0.42); transition: opacity var(--dur);
}
.sh-btn:active { opacity: .83; }
.sh-btn.sec { background: transparent; color: var(--sub); border: 1px solid var(--bd2); box-shadow: none; margin-top: 7px; }
.txp { margin: 13px 0; text-align: left; }
.tx-s { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; }
.tx-d { width: 7px; height: 7px; border-radius: 50%; background: var(--bd2); flex-shrink: 0; }
.tx-d.done { background: var(--grn); }
.tx-d.act  { background: #3DB0FF; animation: pu 1.2s infinite; }
@keyframes pu { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ══════════════════════════════════════════════════════
   13. PICKER MODAL
   ══════════════════════════════════════════════════════ */
.pm-bd { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 200; align-items: flex-end; justify-content: center; }
.pm-bd.on { display: flex; }
.pm {
  background: var(--bg2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: min(640px, 96vw);
  display: flex; flex-direction: column; height: 82vh; max-height: 82dvh;
  animation: pmu .25s cubic-bezier(.34,1.1,.64,1); border: 1px solid var(--bd); border-bottom: none;
  padding-bottom: var(--nav-pb);
}
@media (min-width: 640px) {
  .pm-bd { align-items: center; }
  .pm { height: 70vh; max-height: 600px; border-radius: var(--r-xl); border-bottom: 1px solid var(--bd); padding-bottom: 0; }
}
[data-theme="dark"] .pm { background: rgba(3,10,42,0.97); }
.pm-hdr { padding: 13px 14px 9px; display: flex; align-items: center; gap: 9px; flex-shrink: 0; border-bottom: 1px solid var(--bd); }
.pm-title { font-size: 16px; font-weight: 900; flex: 1; }
.pm-close { width: 28px; height: 28px; border-radius: 7px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--sub); border: none; cursor: pointer; }
.pm-sw { padding: 9px 13px 7px; flex-shrink: 0; }
.pm-si {
  width: 100%; background: var(--inp); border: 1.5px solid var(--bd);
  border-radius: 10px; padding: 9px 11px 9px 34px;
  color: var(--tx); font-size: 14px; outline: none; font-family: var(--ff);
  transition: border-color var(--dur), background var(--dur-t);
}
.pm-si:focus { border-color: rgba(61,176,255,0.48); box-shadow: 0 0 0 3px rgba(61,176,255,0.09); }
.pm-si::placeholder { color: var(--hint); }
.pm-si-rel { position: relative; }
.pm-si-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--hint); }
.pm-si-ico svg { width: 15px; height: 15px; }
.pm-list { flex: 1; overflow-y: auto; padding: 5px 9px 18px; }
.pm-any { display: flex; align-items: center; gap: 9px; padding: 9px 7px; border-radius: var(--r); cursor: pointer; font-size: 14px; font-weight: 700; color: var(--sub); transition: background var(--dur); margin-bottom: 3px; }
.pm-any:active { background: var(--bg3); }
.pm-any.sel { color: #7DD1FF; background: rgba(61,176,255,0.09); }
[data-theme="light"] .pm-any.sel { color: #0077C0; }
.pm-item { display: flex; align-items: center; gap: 9px; padding: 8px 7px; border-radius: var(--r); cursor: pointer; transition: background var(--dur); }
.pm-item:active { background: var(--bg3); }
.pm-item.sel { background: rgba(61,176,255,0.09); }
.pm-item-img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; flex-shrink: 0; background: var(--bg3); }
.pm-item-ph { width: 34px; height: 34px; border-radius: 8px; background: var(--bg3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: var(--hint); }
.pm-item-name { flex: 1; font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-item-check { width: 18px; height: 18px; border-radius: 50%; background: #3DB0FF; flex-shrink: 0; display: none; align-items: center; justify-content: center; }
.pm-item-check svg { width: 10px; height: 10px; }
.pm-item.sel .pm-item-check { display: flex; }

/* ══════════════════════════════════════════════════════
   14. ИНПУТЫ, ТОСТ, СПИННЕР, EMPTY
   ══════════════════════════════════════════════════════ */
.inp {
  width: 100%; background: var(--inp); backdrop-filter: blur(6px);
  border: 1.5px solid var(--bd); border-radius: 10px;
  padding: 10px 12px; color: var(--tx); font-size: 14px;
  outline: none; font-family: var(--ff);
  transition: border-color var(--dur), background var(--dur-t);
}
.inp:focus { border-color: rgba(61,176,255,0.52); box-shadow: 0 0 0 3px rgba(61,176,255,0.09); }
.inp::placeholder { color: var(--hint); }

.toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: linear-gradient(135deg,rgba(6,14,50,0.96),rgba(3,10,38,0.98));
  color: #EAF2FF; border: 1px solid rgba(80,180,255,0.22);
  padding: 9px 18px; border-radius: 22px; font-size: 13px; font-weight: 700; z-index: 500;
  pointer-events: none; opacity: 0; backdrop-filter: blur(14px);
  transition: opacity .2s, transform .2s; white-space: nowrap; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 18px rgba(0,0,0,0.38);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin {
  width: 24px; height: 24px; border: 3px solid var(--bd2);
  border-top-color: #3DB0FF; border-radius: 50%;
  animation: rot .7s linear infinite; margin: 0 auto 9px;
}
@keyframes rot { to{transform:rotate(360deg)} }

.ebox { text-align: center; padding: 26px 18px; color: var(--sub); font-size: 14px; line-height: 1.7; }
.eico { width: 42px; height: 42px; border-radius: 11px; background: var(--bg3); margin: 0 auto 11px; display: flex; align-items: center; justify-content: center; }
.eico svg { width: 22px; height: 22px; }

.set-ico svg,
.adm-ico svg,
.nb-ico svg,
.eico svg,
.sh-th svg {
  display: block;
  flex-shrink: 0;
  flex-grow: 0;
  max-width: 100%;
  max-height: 100%;
}
.set-ico,
.adm-ico { overflow: hidden; }

/* ══════════════════════════════════════════════════════
   15. ADMIN PANEL
   ══════════════════════════════════════════════════════ */
.admin-panel {
  background: var(--card); backdrop-filter: blur(6px);
  border: 1.5px solid rgba(61,176,255,0.22); border-radius: var(--r-lg); overflow: hidden;
}
.admin-hdr {
  background: linear-gradient(135deg,#0098EA,#3DB0FF);
  padding: 11px 14px; color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; height: 44px; min-height: 44px;
}
.admin-hdr svg {
  width: 18px !important; height: 18px !important;
  flex: 0 0 18px; display: block;
}
.adm-row {
  padding: 11px 13px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background var(--dur);
}
.adm-row + .adm-row { border-top: 1px solid var(--bd); }
.adm-row:active { background: var(--bg3); }
.adm-ico {
  width: 32px; height: 32px;
  border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 32px;
}
.adm-ico svg {
  width: 17px !important; height: 17px !important;
  flex: 0 0 17px; display: block;
}
.adm-t { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.adm-form { padding: 14px; }
.adm-form .fl { margin-top: 10px; }
.adm-form .fl:first-child { margin-top: 0; }

/* ══════════════════════════════════════════════════════
   16. BANNER SLIDER
   ══════════════════════════════════════════════════════ */
.banner-wrap { padding: 10px 13px 6px; }

.banner-slider {
  overflow: hidden;
  position: relative;
  border-radius: 14px;
  background: var(--bg3);
  box-shadow: 0 0 14px rgba(0,0,0,0.2);
  /* aspect-ratio вместо фиксированной высоты — баннер сам подстроится под ширину */
  aspect-ratio: 2.5 / 1;
  width: 100%;
}

.banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .42s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg3);
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}
.banner-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  pointer-events: none;
}
.banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.32);
  transition: background .2s, width .2s;
}
.banner-dot.on { background: #fff; width: 14px; }

/* Баннер: на десктопе площе и не выше 240px */
@media (min-width: 640px) {
  .banner-wrap { padding: 10px 0 6px; }
  .banner-slider {
    aspect-ratio: 4 / 1;
    max-height: 240px;
  }
}
@media (min-width: 900px) {
  .banner-slider {
    aspect-ratio: 5 / 1;
    max-height: 220px;
  }
}

/* ══════════════════════════════════════════════════════
   17. LOADING CURTAIN
   ══════════════════════════════════════════════════════ */
#curtain {
  position: fixed; inset: 0; background: #010a1e;
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  transition: opacity 0.7s ease, visibility 0.7s ease;
  opacity: 1; visibility: visible; overflow: hidden;
}
#curtain.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.curtain-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 100%, #0d2560 0%, transparent 65%),
    radial-gradient(ellipse 70%  50% at 15%  0%,  #0a1a55 0%, transparent 55%),
    radial-gradient(ellipse 50%  40% at 85% 15%,  #061240 0%, transparent 50%),
    linear-gradient(180deg, #010a1e 0%, #020d28 40%, #010a1e 100%);
}
.curtain-nebula {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 25% at 25% 65%, rgba(30,80,220,.13) 0%, transparent 70%),
    radial-gradient(ellipse 40% 35% at 75% 35%, rgba(60,30,180,.09) 0%, transparent 65%);
  animation: nebulaDrift 12s ease-in-out infinite alternate;
}
@keyframes nebulaDrift {
  from { transform: scale(1) translateX(0px); }
  to   { transform: scale(1.06) translateX(12px); }
}
#curtain-stars-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.curtain-content {
  position: relative; z-index: 10; width: 100%; height: 100%;
  text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 48px 20px 60px; box-sizing: border-box;
  animation: fadeInUp 0.9s cubic-bezier(.25,.8,.25,1);
}
.curtain-namelogo {
  width: 220px; height: auto; position: relative; z-index: 2; margin-top: -50px;
  filter: drop-shadow(0 0 12px rgba(80,140,255,.7)) brightness(1.1);
}
.curtain-logo-wrap {
  position: relative; width: 230px; height: 230px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: -150px;
}
.curtain-body { flex: 1; display: flex; align-items: center; justify-content: center; }
.curtain-glow-ring {
  position: absolute; width: 226px; height: 226px; border-radius: 50%;
  border: 1.5px solid rgba(80,140,255,.22); animation: ringCW 10s linear infinite;
}
.curtain-glow-ring::before {
  content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: #aad4ff;
  box-shadow: 0 0 10px 5px rgba(100,170,255,.9);
}
.curtain-glow-ring-2 {
  position: absolute; width: 196px; height: 196px; border-radius: 50%;
  border: 1px solid rgba(60,100,220,.18); animation: ringCCW 7s linear infinite;
}
.curtain-glow-ring-2::before {
  content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #90c0ff;
  box-shadow: 0 0 7px 3px rgba(80,150,255,.8);
}
@keyframes ringCW  { to { transform: rotate(360deg); } }
@keyframes ringCCW { to { transform: rotate(-360deg); } }
.curtain-glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(40,100,255,.55) 0%, rgba(20,70,200,.3) 40%, transparent 80%);
  filter: blur(10px); animation: glowPulse 2.8s ease-in-out infinite alternate;
}
.curtain-glow-outer {
  position: absolute; width: 245px; height: 245px; border-radius: 50%;
  background: radial-gradient(circle, rgba(30,80,220,.2) 0%, transparent 70%);
  filter: blur(18px);
}
@keyframes glowPulse {
  from { transform: scale(.88); opacity: .5; }
  to   { transform: scale(1.1); opacity: 1; }
}
.curtain-pepe {
  width: 205px; height: 205px; object-fit: contain; position: relative; z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(10,40,120,.7)) brightness(1.05);
  animation: pepeBounce 3.5s ease-in-out infinite;
}
@keyframes pepeBounce {
  0%,100% { transform: translateY(0) scale(1); }
  45%     { transform: translateY(-9px) scale(1.02); }
}
.curtain-bar-wrap { width: 210px; }
.curtain-bar-track {
  width: 100%; height: 4px; background: rgba(255,255,255,.07);
  border-radius: 10px; overflow: hidden; position: relative;
}
.curtain-bar-fill {
  height: 100%; width: 0%; border-radius: 10px;
  background: linear-gradient(90deg, #1535a0, #3d6fef, #7eb3ff);
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px rgba(80,140,255,.8);
  position: relative; overflow: hidden;
}
.curtain-text {
  margin-top: 9px; font-size: 10px; font-weight: 700;
  color: rgba(120,170,255,.5); letter-spacing: 2.5px; text-transform: uppercase;
}
@keyframes fadeInUp { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════
   18. STATS / LEADERBOARD
   ══════════════════════════════════════════════════════ */
.stats-sw {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.stats-sw-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--ff);
  border: none;
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  transition: all var(--dur);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
.stats-sw-star {
  width: 16px; height: 16px;
  display: block; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255,210,90,0.45));
}
@media (max-width: 420px) {
  .stats-sw-btn { font-size: 12px; padding: 9px 6px; }
  .stats-sw-star { width: 14px; height: 14px; }
}
.stats-sw-btn.on {
  background: var(--bg2);
  color: var(--tx);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
[data-theme="dark"] .stats-sw-btn.on {
  background: rgba(61,176,255,0.15);
  color: #7DD1FF;
}
[data-theme="light"] .stats-sw-btn.on {
  background: #fff;
  color: #0077C0;
}

.lb-gift-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; cursor: pointer;
  transition: background var(--dur);
}
.lb-gift-row + .lb-gift-row { border-top: 1px solid var(--bd); }
.lb-gift-row:active { background: var(--bg3); }

.lb-rank {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
}
.lb-rank-n { background: var(--bg3); border: 1px solid var(--bd); color: var(--hint); }

.lb-gift-info { flex: 1; min-width: 0; }
.lb-gift-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.lb-bar-wrap { height: 3px; background: var(--bg3); border-radius: 2px; overflow: hidden; margin-bottom: 3px; }
.lb-bar { height: 100%; background: linear-gradient(90deg,#0098EA,#3DB0FF); border-radius: 2px; min-width: 3px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.lb-gift-sub { font-size: 10px; color: var(--hint); font-weight: 700; }
.lb-gift-val { font-size: 15px; font-weight: 900; color: #3DB0FF; flex-shrink: 0; }
[data-theme="light"] .lb-gift-val { color: #0077C0; }

.lb-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--hint); font-weight: 600; }

/* Топ донатеров (Stars) */
.don-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
}
.don-row + .don-row { border-top: 1px solid var(--bd); }
.don-rank {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
  color: #fff;
}
.don-rank.r1 { background: linear-gradient(135deg,#FFD700,#FFA500); box-shadow: 0 0 8px rgba(255,180,0,0.45); }
.don-rank.r2 { background: linear-gradient(135deg,#B0B0B0,#787878); }
.don-rank.r3 { background: linear-gradient(135deg,#CD7F32,#8B4513); }
.don-rank.rN { background: var(--bg3); border: 1px solid var(--bd); color: var(--hint); }
.don-av {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#3DB0FF,#0077C0);
  color: #fff; font-weight: 900; font-size: 14px;
}
.don-av img { width: 100%; height: 100%; object-fit: cover; }
.don-info { flex: 1; min-width: 0; }
.don-name {
  font-size: 13px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.don-sub {
  font-size: 10px; color: var(--hint); font-weight: 700;
  margin-top: 1px;
}
.don-stars-val {
  display: flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 900;
  color: #FFD166; flex-shrink: 0;
}
[data-theme="light"] .don-stars-val { color: #B8860B; }
.don-stars-val img {
  width: 28px; height: 28px; display: block;
  filter: drop-shadow(0 0 6px rgba(255,210,90,0.55));
}


/* ══════════════════════════════════════════════════════
   19. LANDING PAGE (для не-Telegram браузеров)
   ══════════════════════════════════════════════════════ */
#landing-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--ff);
  color: #EAF2FF;
}

.landing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 100%, #0d2560 0%, transparent 65%),
    radial-gradient(ellipse 70% 50% at 15% 0%, #0a1a55 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 15%, #061240 0%, transparent 50%),
    linear-gradient(180deg, #010a1e 0%, #020d28 40%, #010a1e 100%);
}
.landing-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 25% at 25% 65%, rgba(30,80,220,0.12), transparent 70%),
    radial-gradient(ellipse 40% 35% at 75% 35%, rgba(60,30,180,0.08), transparent 65%);
}

.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  max-width: 480px;
  width: 100%;
  animation: landingFade 0.7s cubic-bezier(.25,.8,.25,1);
}

@keyframes landingFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

.landing-logo-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40,100,255,.55) 0%, rgba(20,70,200,.3) 40%, transparent 80%);
  filter: blur(20px);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.landing-logo {
  position: relative;
  z-index: 2;
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(10,40,120,.7)) brightness(1.05);
  animation: pepeBounce 3.5s ease-in-out infinite;
}

.landing-title {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFFFFF 0%, #9ED4FF 60%, #3DB0FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(61,176,255,0.5));
  letter-spacing: -0.5px;
}

.landing-sub {
  font-size: 15px;
  color: #8DA6D8;
  margin-bottom: 32px;
  line-height: 1.55;
  font-weight: 500;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.landing-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8,18,48,0.6);
  border: 1px solid rgba(100,160,255,0.18);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #C5D6F5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.landing-feat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px currentColor);
}

.landing-feat-ico svg {
  width: 100%;
  height: 100%;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px 32px;
  background: linear-gradient(135deg,#0098EA 0%,#3DB0FF 100%);
  color: #fff;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow:
    0 0 28px rgba(0,152,234,0.5),
    0 6px 18px rgba(0,80,140,0.4),
    inset 0 1px 0 rgba(255,255,255,0.28);
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.landing-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.32) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: sgSweep 3.5s ease-in-out infinite;
}

.landing-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 36px rgba(0,152,234,0.65),
    0 10px 24px rgba(0,80,140,0.5);
}

.landing-btn:active {
  transform: translateY(0);
}

/* Иконки внутри основной кнопки — Telegram логотип (.svg) и SVG-иконка канала */
.landing-btn-ico {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* pepelogo внутри кнопки «Наш канал» — крупный, круглый, лёгкое свечение */
.landing-btn-ico-logo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(124,109,240,0.55));
}

.landing-btn-ico-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.landing-btn-ico-svg svg {
  width: 100%;
  height: 100%;
}

/* Вторичная кнопка «Наш канал» — приглушённая.
   Меньший vertical padding, чтобы кнопка не раздувалась под крупный pepelogo. */
.landing-btn-sec {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  padding: 8px 32px;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
}

.landing-btn-sec::after { display: none; }

.landing-btn-sec:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.landing-foot {
  margin-top: 24px;
  font-size: 13px;
  color: rgba(141,166,216,0.6);
  font-family: monospace;
}

@media (max-width: 380px) {
  .landing-title { font-size: 28px; }
  .landing-logo-wrap { width: 140px; height: 140px; }
  .landing-logo { width: 120px; height: 120px; }
}

/* ══════════════════════════════════════════════════════
   21. БЕЗОПАСНЫЕ ЗОНЫ И СПЕЦИФИКА КЛИЕНТОВ
   ══════════════════════════════════════════════════════ */

/* iOS Safari notch + Desktop выравнивание заголовка */
@supports (padding: max(0px)) {
  .hdr {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  @media (min-width: 640px) {
    .hdr {
      padding-left:  max(var(--content-pad), calc((100% - var(--content-w)) / 2));
      padding-right: max(var(--content-pad), calc((100% - var(--content-w)) / 2));
    }
  }
}

/* Запрет зума на инпутах в iOS — input font-size минимум 16px */
@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: 16px;
  }
  /* Но переопределяем для специфичных компонентов */
  .pr-inp, .pm-si, .inp { font-size: 14px; }
}

/* Hover-эффекты для устройств с мышью (десктоп) */
@media (hover: hover) and (pointer: fine) {
  .nft-card:hover {
    border-color: rgba(61,176,255,0.4);
    transform: translateY(-2px);
    transition: transform 0.15s, border-color var(--dur);
  }
  .pick-btn:hover:not(:disabled) {
    border-color: rgba(61,176,255,0.4);
  }
  .adm-row:hover {
    background: var(--bg3);
  }
  .set-r.tap:hover {
    background: var(--bg3);
  }
  .pm-item:hover {
    background: var(--bg3);
  }
}

/* Очень маленькие экраны (узкий iPhone SE и т.п.) */
@media (max-width: 360px) {
  .sec { padding-left: 10px; padding-right: 10px; }
  .logo-name { font-size: 14px; }
}

/* Telegram-специфика: убираем pull-to-refresh */
html { overscroll-behavior-y: none; }


/* ══════════════════════════════════════════════════════
   22. СКРЫТЫЙ СКРОЛЛБАР
   ══════════════════════════════════════════════════════ */

/* Firefox */
.page,
.pm-list,
.sh,
.nft-detail,
body {
  scrollbar-width: none;
}

/* Chrome, Safari, Edge, Telegram WebView */
.page::-webkit-scrollbar,
.pm-list::-webkit-scrollbar,
.sh::-webkit-scrollbar,
.nft-detail::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* IE */
.page,
.pm-list,
.sh,
.nft-detail {
  -ms-overflow-style: none;
}