/* ============================================================
 * Galaxy 71 — Gallery page (/gallery).
 * Дизайн утв. Ехе 2026-05-18 (взято из mockup_stars_page.html).
 * Шрифты/цвета — 1-в-1 с auth/_base.html + craft.html.
 * ============================================================ */

/* === Топбар nav-btn / nav-nick — копия из cabinet.html строки 180-202.
   Эти стили на проде ИНЛАЙН в cabinet.html, в общем CSS их нет.
   Любая страница что наследует auth/_base.html и хочет такой же топбар —
   обязана дублировать. (TODO: вынести в landing/base.css единым местом.) */
.nav-btn {
  display: inline-flex; align-items: center;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  background: rgba(138,180,255,0.08);
  border: 1px solid rgba(138,180,255,0.3);
  color: #8ab4ff;
  border-radius: 8px; cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
  min-height: 32px;
}
.nav-btn:hover {
  background: rgba(138,180,255,0.18);
  border-color: #8ab4ff; color: #c8d8ff;
}
.nav-nick {
  color: #c8d8ff; font-size: 13px; font-weight: 600;
  padding: 0 6px; white-space: nowrap;
}
/* Кнопка-Выход — это <button> внутри <form> в .auth-topbar. Чтобы её НЕ
   зацепил `.auth-card button` глобал, заодно гасим тот стиль (топбар вообще
   ВНЕ .auth-card, но на всякий случай). */
.auth-topbar button.nav-btn {
  width: auto !important; margin: 0 !important;
  min-height: 32px !important;
  padding: 6px 12px !important;
  font-size: 13px !important; font-weight: 600 !important;
  background: rgba(138,180,255,0.08) !important;
  color: #8ab4ff !important;
  border: 1px solid rgba(138,180,255,0.3) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
@media (max-width: 700px) {
  .nav-btn, .auth-topbar button.nav-btn {
    font-size: 12px !important;
    padding: 5px 10px !important;
    min-height: 28px !important;
  }
  .nav-nick { font-size: 12px; }
}

/* === Override auth-main/auth-card на этой странице ===
   Дефолт (auth/_base.html) — 440px центрованная карточка.
   На /gallery нужна полная ширина окна (фильтр прижат к левому краю,
   grid тянется до правого). Тот же подход что в cabinet.html
   (display:contents убирает обёртку, чтобы контент встал в grid напрямую). */
.auth-main {
  display: block !important;
  padding: 24px 20px 40px !important;
  align-items: stretch !important;
}
.auth-card {
  display: contents !important;
}

/* Full-width layout — фильтр слева, grid справа тянется до правого края.
   Без max-width центрирования, чтобы на широких мониторах вместо пустых
   полей по бокам помещалось больше карточек в ряд (ТЗ Ехе 2026-05-18). */
.gallery-wrap {
  width: 100%; margin: 0;
  display: flex; flex-direction: column; gap: 16px;
}

/* === Заголовок страницы === */
.page-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: 28px; margin: 0; color: #58a6ff;
  font-weight: 800; letter-spacing: 0.3px;
}
.page-head .page-sub {
  flex: 1; min-width: 220px; font-size: 14px;
  color: #c8c8d8; line-height: 1.55;
}
.page-head .total-info {
  font-size: 13px; color: #8090a8;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.page-head .total-info b { color: #e8e8f0; }

/* === Двух-колоночный layout: filter (220px) + cards === */
.stars-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px; align-items: start;
}
@media (max-width: 900px) {
  .stars-row { grid-template-columns: 1fr; }
}

/* === LEFT: filter (1-в-1 с craft.html .tier-tabs-v) === */
.filter-side {
  background: rgba(20, 20, 42, 0.7);
  border: 1px solid #2a2a48; border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(8px);
  position: sticky; top: 16px;
}
.filter-side .ttl {
  font-size: 13px; color: #ffd369; margin: 0 0 12px;
  border-left: 3px solid #ffd369; padding-left: 10px;
  text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}
.tier-tabs-v { display: flex; flex-direction: column; gap: 6px; }
/* Override глобала `.auth-card button:where(:not(...))` (width:100% + margin-top:22px +
   жёлтый bg + padding 14px 16px). Specificity (0,2,0) > (0,1,1). */
.auth-card .tier-tabs-v button.tier-tab,
.tier-tabs-v button.tier-tab {
  width: 100% !important;       /* в колонке фильтра — хочется чтоб тянулось на 100% контейнера */
  margin: 0 !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .4px;
  background: rgba(10,10,24,0.5) !important;
  color: var(--tcol, #9090a8) !important;
  border: 1px solid color-mix(in srgb, var(--tcol, #2a2a48) 30%, transparent) !important;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  display: flex;
  align-items: center; gap: 6px; text-align: left;
  box-shadow: none !important;
}
.auth-card .tier-tabs-v button.tier-tab:hover,
.tier-tabs-v button.tier-tab:hover {
  background: color-mix(in srgb, var(--tcol, #58a6ff) 14%, rgba(10,10,24,0.5)) !important;
}
.auth-card .tier-tabs-v button.tier-tab.is-active,
.tier-tabs-v button.tier-tab.is-active {
  background: color-mix(in srgb, var(--tcol, #ffd369) 18%, transparent) !important;
  border-color: var(--tcol, #ffd369) !important;
  color: var(--tcol, #ffd369) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--tcol, #ffd369) 26%, transparent) !important;
}
.tier-tab .ico { font-size: 12px; }
.tier-tab .cnt { margin-left: auto; opacity: 0.65; font-size: 10px; }

/* === RIGHT: cards grid + pagination === */
.stars-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.cards-grid {
  display: grid;
  /* Карты ровно 330px (нативная ширина прод .nft-card), auto-fill —
     браузер сам распределяет столько колонок, сколько влезает в доступную
     ширину. На широких мониторах = больше карточек в ряд. */
  grid-template-columns: repeat(auto-fill, 330px);
  justify-content: start;     /* выравнивание влево, без центрования */
  align-items: start;
  gap: 16px;
  min-height: 200px;
}
.cards-grid .card-mount { width: 330px; }

/* Disabled «Забрать» (owned) — прод .nft-card-btn не определяет [disabled],
   нужен override. */
.cards-grid .nft-card-btn[disabled] {
  background: rgba(40, 40, 60, 0.5);
  border-color: #2a2a48; color: #5a6080;
  cursor: not-allowed; opacity: 0.65;
  pointer-events: none;
}
.cards-grid .nft-card-btn[disabled]:hover {
  background: rgba(40, 40, 60, 0.5); border-color: #2a2a48; color: #5a6080;
}

/* Marketplace «Купить» — зелёная кнопка (active). */
.cards-grid .nft-card-btn.mk-buy:not([disabled]) {
  background: #5fd38a; border-color: #5fd38a; color: #04200f;
}
.cards-grid .nft-card-btn.mk-buy:not([disabled]):hover {
  background: #76e09e; border-color: #76e09e;
}

/* Модалка marketplace (.dep-modal) — стили вынесены в общий static/modal.css. */

.cards-empty {
  text-align: center; color: #b0b0c8; font-style: italic; font-size: 13px;
  padding: 28px; background: rgba(10,10,24,0.3); border-radius: 8px;
}

/* === Pagination (стрелки + счётчик, ТЗ Ехе 2026-05-18) ===
   ВАЖНО: в auth/_base.html глобал `.auth-card button:where(:not(...))` ставит
   width:100% + min-height:48px + жёлтый фон + huge padding на ВСЕ кнопки внутри
   .auth-card. Поскольку .gallery-wrap внутри .auth-card (display:contents),
   эти стили утекают на .page-btn → растягивает на всю ширину строки.
   Override через увеличенную specificity (0,2,1) > глобал (0,1,1). */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 16px;
  flex-wrap: nowrap;  /* одна строка, без переноса (растягивания не будет) */
}
.auth-card button.page-btn,
.pagination button.page-btn {
  width: auto !important;     /* перебить width:100% из глобала */
  margin: 0 !important;       /* перебить margin-top:22px */
  min-height: 34px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: rgba(10,10,24,0.5) !important;
  color: #8ab4ff !important;
  border: 1px solid #2a2a48 !important;
  border-radius: 6px !important;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
  box-shadow: none !important;
}
.auth-card button.page-btn:hover:not(:disabled),
.pagination button.page-btn:hover:not(:disabled) {
  border-color: #8ab4ff !important; color: #c8d8ff !important;
  box-shadow: none !important;
}
.auth-card button.page-btn:disabled,
.pagination button.page-btn:disabled {
  opacity: .3; cursor: not-allowed;
}
.pagination .page-counter {
  color: #c8d8ff; font-size: 14px; font-weight: 600;
  padding: 0 14px; min-width: 64px; text-align: center;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  user-select: none;
}

/* === GUEST: заглушка для незареганных === */
.guest-prompt {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.guest-card {
  width: 100%; max-width: 460px;
  background: linear-gradient(165deg, #1a1838 0%, #0c0a1e 100%);
  border: 1px solid rgba(255,211,105,0.4);
  border-radius: 16px;
  padding: 36px 28px 26px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 211, 105, 0.15);
}
.guest-card .emoji {
  font-size: 56px; line-height: 1; margin-bottom: 12px;
}
.guest-card h2 {
  font-size: 22px; color: #ffd369; margin: 0 0 12px;
  font-weight: 800; letter-spacing: .3px;
}
.guest-card p {
  font-size: 15px; line-height: 1.6; color: #c8d8ff; margin: 0 0 12px;
}
.guest-card .total-found {
  font-size: 13px; color: #9090a8; margin: 12px 0 22px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.guest-card .total-found b { color: #ffd369; }
.guest-card .btn-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.guest-card .btn-primary,
.guest-card .btn-secondary {
  flex: 1; min-width: 130px;
  padding: 13px 16px; font-size: 14px; font-weight: 700;
  border-radius: 10px; cursor: pointer;
  transition: all .15s; font-family: inherit;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.guest-card .btn-primary {
  background: #ffd369; color: #0a0a18; border: 1px solid #ffd369;
}
.guest-card .btn-primary:hover {
  background: #ffde85; box-shadow: 0 0 20px rgba(255,211,105,0.5);
}
.guest-card .btn-secondary {
  background: rgba(138,180,255,0.08); color: #8ab4ff;
  border: 1px solid rgba(138,180,255,0.4);
}
.guest-card .btn-secondary:hover {
  background: rgba(138,180,255,0.16); color: #c8d8ff;
}
.guest-card .hint {
  font-size: 12px; color: #7070a0; margin: 16px 0 0;
}

/* ──────────────────────────────────────────────────────────────────────────
 * Этап 5.3 (Ехе 2026-05-18): blurred псевдо-grid + центральный overlay с CTA
 * для guest-страницы /gallery (вместо одинокой CTA-card).
 * Юзер видит «галактику звёзд» в размытии → сильнее тянет зарегаться чтобы
 * увидеть чётко. Карточки SSR-фейковые (без подключения к бэку, никаких
 * данных не утекает), но с реалистичной rarity-распределением.
 * ────────────────────────────────────────────────────────────────────────── */

/* Шапка (логотип/язык/Войти/На главную) поверх fixed-слоёв гостевого гейта:
 * guest-blur/guest-dim z-index:1 перекрывали статичный .auth-topbar (ТЗ Ехе 06.07). */
.auth-topbar { position: relative; z-index: 10; }

.guest-wrap {
  position: relative;
  width: 100%;
  min-height: calc(100svh - 120px);
  padding: 24px 18px;
  box-sizing: border-box;
}

/* Заблюренный фон-снимок (Ехе сам отрендерил JPG в редакторе 2026-05-18).
 * <img> в overflow:hidden контейнере + чуть больше 100% — чтобы blur-fringe
 * не давал кайму по краям, при этом картинка визуально НЕ масштабируется. */
.guest-blur {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #0a0a18;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.guest-blur-img {
  position: absolute;
  top: -5%; left: -5%;
  width: 110%; height: 110%;
  object-fit: cover;
  /* Лёгкий доп. blur поверх уже размытого JPG. */
  filter: blur(6px);
}

/* Затемняющий слой поверх блюр-фона. Радиальный градиент: светлее
 * в центре (видна цветная подложка), темнее по краям (фокус на модалке). */
.guest-dim {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(10, 10, 24, 0.30) 0%,
    rgba(10, 10, 24, 0.65) 55%,
    rgba(10, 10, 24, 0.88) 100%
  );
  pointer-events: none;
  z-index: 5;
}

/* Псевдо-карточка — мимикрия под real card (badge сверху, visual в центре,
 * имя + мета снизу, кнопка). Все размеры в относительных юнитах чтобы
 * под blur выглядело одинаково на любых разрешениях. */
.fake-card {
  background: rgba(20, 20, 42, 0.72);
  border: 1px solid #2a2a48;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  aspect-ratio: 1 / 1.45;
  position: relative;
  overflow: hidden;
}
.fake-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
  background: rgba(20,20,42,0.65); color: #b0b0c8;
}
.fake-brand {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; color: #8ab4ff; opacity: 0.7;
}
.fake-visual {
  flex: 1;
  min-height: 130px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
  background: #000;
  /* Яркий glow rarity-цвета (var --col из .rarity-*). В CSS-blur(10px) даёт
   * характерный «галактический» blob-эффект как в скриншоте Ехе 2026-05-18. */
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--col, #9090a8) 0%,
    color-mix(in oklab, var(--col, #9090a8) 65%, transparent) 18%,
    rgba(0,0,0,0) 55%
  );
}
.fake-name {
  height: 14px; width: 80%;
  background: rgba(232,232,240,0.18);
  border-radius: 3px;
}
.fake-meta {
  display: flex; flex-direction: column; gap: 4px;
}
.fake-row {
  display: flex; justify-content: space-between; gap: 8px;
}
.fake-lbl {
  height: 8px; width: 40%;
  background: rgba(112,112,160,0.35);
  border-radius: 2px;
}
.fake-val {
  height: 8px; width: 45%;
  background: rgba(255,211,105,0.35);
  border-radius: 2px;
}
.fake-btn {
  height: 28px;
  background: rgba(138,180,255,0.18);
  border: 1px solid rgba(138,180,255,0.32);
  border-radius: 8px;
}

/* Rarity-цвета (border + glow visual'а) — те же что в реальных карточках,
 * чтобы силуэт в блюре соответствовал общей палитре. */
.fake-card.rarity-common    { border-color: rgba(144,144,168,0.35); --col: #8090a8; }
.fake-card.rarity-uncommon  { border-color: rgba(127,255,212,0.4);  --col: #7fffd4; }
.fake-card.rarity-rare      { border-color: rgba(106,227,255,0.45); --col: #6ae3ff; }
.fake-card.rarity-epic      { border-color: rgba(179,136,255,0.55); --col: #b388ff; }
.fake-card.rarity-legendary { border-color: rgba(255,211,105,0.65); --col: #ffd369; }
.fake-card.rarity-mythic    { border-color: rgba(255,110,199,0.65); --col: #ff6ec7; }

/* Overlay-card — fixed по центру viewport (top/left 50% + translate). Так
 * card всегда строго посередине окна, независимо от высоты .guest-blur
 * и положения скролла. .guest-overlay сам — невидимая обёртка для a11y. */
.guest-overlay {
  pointer-events: none;
}
.guest-overlay-card {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: calc(100% - 48px);
  max-width: 440px;
  padding: 32px 28px;
  text-align: center;
  background: #0f0f20;          /* непрозрачный — фон через модалку не просвечивает */
  border: 1px solid rgba(138,180,255,0.4);
  border-radius: 18px;
  box-shadow: 0 0 80px rgba(138,180,255,0.22), 0 20px 60px rgba(0,0,0,0.7);
  z-index: 50;
}
.guest-overlay-card .emoji {
  font-size: 56px; margin-bottom: 8px;
}
.guest-overlay-card h2 {
  font-size: 22px; line-height: 1.3;
  color: #c8d8ff; margin: 0 0 18px;
  font-weight: 700;
}
.guest-overlay-card .total-found {
  font-size: 14px; color: #9090a8;
  margin: 0 0 22px;
}
.guest-overlay-card .total-found b {
  color: #ffd369; font-weight: 700;
}
.guest-overlay-card .btn-row {
  display: flex; flex-direction: column; gap: 10px;
}
.guest-overlay-card .btn-primary,
.guest-overlay-card .btn-secondary {
  padding: 14px 18px; border-radius: 10px;
  text-decoration: none; text-align: center;
  font-weight: 700; font-size: 15px;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.guest-overlay-card .btn-primary {
  background: #ffd369; color: #0a0a18;
}
.guest-overlay-card .btn-primary:hover {
  box-shadow: 0 0 24px rgba(255,211,105,0.4);
}
.guest-overlay-card .btn-secondary {
  background: rgba(138,180,255,0.08);
  color: #8ab4ff;
  border: 1px solid rgba(138,180,255,0.4);
}
.guest-overlay-card .btn-secondary:hover {
  background: rgba(138,180,255,0.18);
  color: #c8d8ff;
}
.guest-overlay-card .hint {
  font-size: 11px; color: #5a5a78;
  margin: 16px 0 0;
}
