/* =========================================================================
   guild-hall-scene.css — оверлеи зала гильдии (Pixi v8 сцена под канвасом).
   Канвас рисует Pixi; здесь — DOM поверх: реплика Архивариуса, панель
   доски рангов, «скоро» панели, DOM-фолбэк навигации.
   ========================================================================= */

/* ── Структура шапки/мобильной навигации ───────────────────────────────────
   theme.css только ДЕКОРИРУЕТ шапку (фон/бордер/.nav-link); раскладку (flex-ряд)
   страница задаёт сама. На мобиле панель/оверлей берёт на себя js/mobile-nav.js
   (его @media-инъекция с position:fixed + transform). Здесь — десктопная база. */
/* theme.css задаёт `main { width:min(100%,1240px)!important; margin:0 auto!important;
   padding:clamp(...)!important }` — это боксит full-bleed зал. Перебиваем с !important
   и page-scoped селектором, иначе зал капается на 1240px + большие отступы. */
body.guild-hall-page main.gs-main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.header-left { display: inline-flex; align-items: center; gap: 14px; }
.desktop-nav { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mobile-nav-overlay,
.mobile-nav-panel { display: none; }
.mobile-nav-btn { display: none; }
@media (max-width: 760px), (pointer: coarse) and (max-width: 980px) {
  .desktop-nav { display: none; }
  .mobile-nav-btn { display: inline-flex; }
}

.gs-hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 72px);   /* шапка ≈72px; dvh-вариант ниже учитывает мобильный chrome */
  height: calc(100dvh - 72px);
  min-height: 520px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #14102a 0%, #07070f 60%, #03040a 100%);
}

#guildHallCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ── Оверлей-слой (DOM поверх канваса) ─────────────────────────────────── */
.gs-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.gs-overlay > * { pointer-events: auto; }
/* Реплика куратора — чисто декоративный текст: пропускаем клики сквозь неё на
   хотспоты канваса (специфичность 0,2,0 бьёт .gs-overlay>* = 0,1,1). */
.gs-overlay > .gs-curator { pointer-events: none; }

/* ── Реплика Архивариуса ───────────────────────────────────────────────── */
.gs-curator {
  position: absolute;
  left: clamp(16px, 13vw, 230px);
  bottom: clamp(120px, 22vh, 230px);
  max-width: min(340px, 70vw);
  padding: 14px 18px;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(180deg, rgba(20, 14, 36, 0.92), rgba(11, 8, 22, 0.92));
  border: 1px solid rgba(200, 162, 74, 0.32);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: #efe6d2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gs-curator.is-on { opacity: 1; transform: translateY(0); }
.gs-curator__who {
  font: 700 12px Georgia, serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #d9b65a;
  margin-bottom: 5px;
}
.gs-curator__line { margin: 0; font: 400 15px/1.5 Georgia, serif; color: #e9ddc6; }

/* ── Панель (модал) ────────────────────────────────────────────────────── */
.gs-panel {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gs-panel[hidden] { display: none; }
.gs-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 10, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.gs-panel.is-open .gs-panel__backdrop { opacity: 1; }
.gs-panel__sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 28px 28px 30px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% -10%, rgba(176, 131, 216, 0.18), transparent 50%),
    linear-gradient(180deg, #110d22 0%, #0a0816 100%);
  border: 1px solid rgba(200, 162, 74, 0.26);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}
.gs-panel.is-open .gs-panel__sheet { transform: translateY(0) scale(1); opacity: 1; }
.gs-panel__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e7dcc6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.gs-panel__close:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }

.gs-panel__head { margin-bottom: 18px; }
.gs-panel__kicker { font: 700 11px Georgia, serif; letter-spacing: 3px; text-transform: uppercase; color: #b78bdd; }
.gs-panel__title { margin: 4px 0 0; font: 800 27px/1.1 Georgia, serif; color: #f4ecd9; }

/* ── Карточка ранга ────────────────────────────────────────────────────── */
.gs-rankcard { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.gs-rankcard__meta { flex: 1; min-width: 0; }
.gs-rankcard__name { font: 800 19px Georgia, serif; color: #f0e6d0; }
.gs-rankcard__who { font: 600 13px Arial, sans-serif; color: #a98fce; margin-top: 2px; }
.gs-rankcard__desc { margin: 8px 0 10px; font: 400 14px/1.55 Arial, sans-serif; color: #cdbfe6; }

.gs-tags, .gs-soon__body + * { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-tag {
  font: 600 12px Arial, sans-serif;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176, 131, 216, 0.14);
  border: 1px solid rgba(176, 131, 216, 0.3);
  color: #d9c6f0;
}

/* ── Медали рангов ─────────────────────────────────────────────────────── */
.gs-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 800;
  color: #1a1320;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -3px 6px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.45);
}
.gs-medal--sm { width: 30px; height: 30px; font-size: 13px; }
.gs-medal--lg { width: 72px; height: 72px; font-size: 30px; }
.gs-medal--g { background: radial-gradient(circle at 35% 30%, #b7b9bd, #6c6e74); }
.gs-medal--f { background: radial-gradient(circle at 35% 30%, #d6a26a, #97602f); }
.gs-medal--e { background: radial-gradient(circle at 35% 30%, #e6e9ef, #9aa0ad); }
.gs-medal--d { background: radial-gradient(circle at 35% 30%, #f6d97a, #c69a2a); color: #2a2008; }
.gs-medal--c { background: radial-gradient(circle at 35% 30%, #bdeaf0, #6fb6c4); }
.gs-medal--b { background: radial-gradient(circle at 35% 30%, #b9d6ff, #6f96e6); }
.gs-medal--a { background: radial-gradient(circle at 35% 30%, #e3bcff, #a866e0); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.gs-medal--s { background: radial-gradient(circle at 35% 30%, #ffe6a6, #f0a93a); color: #3a2406; }
.gs-medal--founder { background: radial-gradient(circle at 35% 30%, #ffffff, #d6b6ff); color: #5a2d8a; box-shadow: inset 0 2px 4px rgba(255,255,255,0.6), 0 0 18px rgba(214,182,255,0.7), 0 4px 12px rgba(0,0,0,0.45); }

/* ── Прогресс ──────────────────────────────────────────────────────────── */
.gs-progress { margin: 6px 0 16px; }
.gs-progress__row { display: flex; justify-content: space-between; font: 700 13px Arial, sans-serif; color: #d3c2ec; margin-bottom: 6px; }
.gs-progress__bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.gs-progress__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #b083d8, #ff66c8); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ── Чеклист требований ────────────────────────────────────────────────── */
.gs-checks { display: grid; gap: 8px; margin-bottom: 18px; }
.gs-check {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font: 600 13px Arial, sans-serif;
  color: #c8b9e2;
}
.gs-check.is-done { background: rgba(120, 220, 150, 0.08); border-color: rgba(120, 220, 150, 0.26); color: #d6efd9; }
.gs-check__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: #7be08a; font-weight: 800; font-size: 13px;
}
.gs-check.is-done .gs-check__mark { background: rgba(120, 220, 150, 0.22); }
.gs-check__label { min-width: 0; }
.gs-check strong { color: #efe6d2; font-variant-numeric: tabular-nums; }

/* ── Лестница рангов ───────────────────────────────────────────────────── */
.gs-ladder { display: flex; flex-wrap: wrap; gap: 8px; }
.gs-rung {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font: 700 12px Georgia, serif; color: #a594c2;
  opacity: 0.55;
}
.gs-rung.is-passed { opacity: 0.8; }
.gs-rung.is-current { opacity: 1; border-color: rgba(255, 102, 200, 0.5); background: rgba(255, 102, 200, 0.1); color: #f6e9d4; box-shadow: 0 0 0 1px rgba(255, 102, 200, 0.2); }

.gs-cta {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(120deg, #ff66c8, #b083d8);
  color: #1a0d1a;
  font: 800 14px Arial, sans-serif;
  text-decoration: none;
}
.gs-cta:hover { filter: brightness(1.08); }

/* ── «Скоро» панели ────────────────────────────────────────────────────── */
.gs-soon__body { font: 400 15px/1.6 Arial, sans-serif; color: #cdbfe6; margin: 0 0 16px; }
.gs-soon__badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(200, 162, 74, 0.14);
  border: 1px solid rgba(200, 162, 74, 0.34);
  color: #e6c878;
  font: 700 12px Arial, sans-serif;
  letter-spacing: 1px;
}

/* ── Доступная навигация / DOM-фолбэк ──────────────────────────────────────
   #gsFallback присутствует ВСЕГДА (канвас aria-hidden, хотспоты не доступны с
   клавиатуры). По умолчанию — sr-only: пункты в tab-order, каждый «всплывает»
   при фокусе (skip-link). При отказе WebGL JS вешает .gs-fallback--shown —
   полноценная видимая навигация по центру зала. */
.gs-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  z-index: 8;
}
.gs-fallback__title { font: 800 26px Georgia, serif; color: #f0e6d0; }
.gs-fallback__nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.gs-fallback__nav a,
.gs-fallback__nav button {
  padding: 12px 18px; border-radius: 14px;
  border: 1px solid rgba(200, 162, 74, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #e9ddc6; font: 700 15px Georgia, serif; text-decoration: none; cursor: pointer;
}
.gs-fallback__nav a:hover,
.gs-fallback__nav button:hover { background: rgba(255, 255, 255, 0.09); }

/* sr-only режим (WebGL работает): контейнер не виден и не блокирует канвас */
.gs-fallback:not(.gs-fallback--shown) {
  inset: auto; top: 0; left: 0; width: 0; height: 0;
  padding: 0; overflow: visible; pointer-events: none; place-content: start;
}
.gs-fallback:not(.gs-fallback--shown) .gs-fallback__title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gs-fallback:not(.gs-fallback--shown) .gs-fallback__nav a,
.gs-fallback:not(.gs-fallback--shown) .gs-fallback__nav button {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; pointer-events: auto;
}
/* фокус → видимый «чип» в левом верхнем углу */
.gs-fallback:not(.gs-fallback--shown) .gs-fallback__nav a:focus,
.gs-fallback:not(.gs-fallback--shown) .gs-fallback__nav button:focus {
  position: fixed; left: 16px; top: 16px; width: auto; height: auto; clip: auto;
  padding: 11px 17px; border: 1px solid rgba(200, 162, 74, 0.55); border-radius: 13px;
  background: #14102a; color: #f0e6d0; z-index: 7000; box-shadow: 0 10px 36px rgba(0, 0, 0, 0.62);
}

/* ── Мобильный fallback-навигатор (как на главной) ─────────────────────── */
.gs-mobile-nav { display: none; }

@media (max-width: 768px) {
  .gs-hero { height: calc(100vh - 64px); height: calc(100dvh - 64px); min-height: 460px; }
  .gs-curator { left: 12px; right: 12px; bottom: 14px; max-width: none; }
  .gs-panel__sheet { padding: 22px 18px 24px; }
}
