/* Tower of Random — вкладка «Гильдия».
   Золотой акцент базы (hue 42) против purple алтаря. Токены — из styles.css. */

#panel-guild,
#guild-info-modal {
  --g-hue: 42;
  --g-gold: hsl(42 78% 62%);
  --g-gold-soft: hsl(42 70% 60% / 0.14);
  --g-gold-border: hsl(42 60% 58% / 0.34);
  --g-accent: hsl(var(--g-hue) 78% 62%);
  --g-accent-soft: hsl(var(--g-hue) 70% 60% / 0.14);
  --g-accent-border: hsl(var(--g-hue) 60% 58% / 0.32);
  --g-surface: rgba(17, 22, 31, 0.72);
  --g-surface-2: rgba(24, 30, 41, 0.6);
  --g-line: rgba(255, 255, 255, 0.07);

  /* Mobile safe areas для iPhone notch и Android navigation */
  --g-safe-top: env(safe-area-inset-top, 0px);
  --g-safe-right: env(safe-area-inset-right, 0px);
  --g-safe-bottom: env(safe-area-inset-bottom, 0px);
  --g-safe-left: env(safe-area-inset-left, 0px);
}

.g-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 8px;
  /* Оптимизация для GPU acceleration */
  transform: translateZ(0);
  will-change: auto;
}

/* ---- Навигация push-экранов ----
   Оптимизированные анимации без blur для производительности.
   Анимации вешаются классом прямо на свежую разметку и проигрываются РОВНО ОДИН
   РАЗ за переход. Повторные рендеры (пришли данные, обновился хаб, снялся busy)
   класс не получают, поэтому ничего не мигает и не дёргается дважды.
   opacity:0 на классе — страховка от «мигания» первого кадра, если one-shot
   класс попал в innerHTML до старта анимации. */
@keyframes g-nav-fwd {
  from {
    opacity: 0;
    transform: translate3d(34px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes g-nav-back {
  from {
    opacity: 0;
    transform: translate3d(-34px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.g-wrap.is-nav-forward {
  animation: g-nav-fwd 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.g-wrap.is-nav-back {
  animation: g-nav-back 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---- Баннер / метрики: enter вместе с каскадом карточек ---- */
@keyframes g-hub-banner-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes g-hub-metrics-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.g-wrap.is-hub-enter .g-banner {
  animation: g-hub-banner-in 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.02s;
}
.g-wrap.is-hub-enter .g-metrics,
.g-wrap.is-hub-enter .g-social {
  animation: g-hub-metrics-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

/* ---- Баннер зала (монолитная карточка идентичности) ---- */
.g-banner {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: default;
  background: linear-gradient(160deg, #1b1408 0%, #0a0d13 62%);
  border: 1px solid var(--g-gold-border);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(212, 168, 84, 0.08) inset;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.g-banner--empty {
  background: radial-gradient(120% 90% at 50% 0%, rgba(212, 168, 84, 0.16), transparent 70%),
    linear-gradient(160deg, #161a22 0%, #0a0d13 70%);
}
.g-banner-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
  border: 0;
  z-index: 0;
  transform: scale(1.04);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.g-banner--hall .g-banner-art {
  background-image: url("/assets/guild/hall-castle.jpg?v=1");
}
.g-banner--tavern .g-banner-art {
  background-image: url("/assets/guild/hall-tavern.jpg?v=2");
  object-position: center 48%;
  background-position: center 48%;
}
.g-banner-shade {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(8, 10, 14, 0.3) 0%,
      rgba(8, 10, 14, 0.38) 36%,
      rgba(8, 10, 14, 0.52) 58%,
      rgba(6, 8, 12, 0.9) 100%
    );
}
.g-banner--tavern .g-banner-shade {
  background:
    linear-gradient(
      180deg,
      rgba(8, 10, 14, 0.05) 0%,
      rgba(8, 10, 14, 0.14) 34%,
      rgba(8, 10, 14, 0.38) 64%,
      rgba(6, 8, 12, 0.78) 100%
    );
}
.g-banner-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: block;
}
.g-orn {
  position: absolute;
  width: 58px;
  height: auto;
  opacity: 1;
  mix-blend-mode: screen;
  filter: none;
}
.g-orn--tl { top: 0; left: 0; }
.g-orn--tr { top: 0; right: 0; transform: scaleX(-1); }
.g-orn--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.g-orn--br { bottom: 0; right: 0; transform: scale(-1); }

.g-banner-content {
  position: relative;
  z-index: 2;
  min-height: 188px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 16px 14px;
  text-align: center;
}
.g-banner-identity {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  bottom: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  pointer-events: none;
}
.g-banner-identity .g-banner-name,
.g-banner-identity .g-banner-kicker {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  margin: 0;
  transform: none;
}
.g-banner-kicker {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  text-transform: uppercase;
  color: hsl(42 55% 78% / 0.88);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  text-align: center;
}
.g-banner-name {
  margin: 0;
  display: block;
  font-size: clamp(1.42rem, 6vw, 1.92rem);
  font-weight: 600;
  line-height: 1.12;
  color: #f7f0e2;
  text-shadow: 0 1px 0 rgba(255, 236, 190, 0.22), 0 8px 22px rgba(0, 0, 0, 0.55);
  overflow-wrap: anywhere;
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: 0.01em;
}
.g-banner-rule {
  display: block;
  width: 56px;
  height: 1px;
  margin: 2px 0 0;
  border: 0;
  background: linear-gradient(90deg, transparent, hsl(42 50% 62% / 0.55), transparent);
}
.g-banner-divider {
  display: none;
}
.g-banner-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.g-banner-chip {
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #e8dcc4;
  background: rgba(10, 12, 16, 0.42);
  border: 1px solid rgba(232, 205, 150, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.g-banner-status {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  color: #cbd5e1;
}
.g-banner-hint {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(42 40% 72% / 0.72);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  transition: color 0.2s ease, transform 0.2s ease;
}
.g-banner-hint svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.g-banner--live {
  cursor: pointer;
}
.g-banner--live:focus {
  outline: none;
}
.g-banner--live:focus-visible {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 0 2px hsl(42 78% 62% / 0.7);
}
.g-banner--live:active {
  transform: scale(0.988);
}

@media (hover: hover) and (pointer: fine) {
  .g-banner--live:hover {
    border-color: hsl(42 70% 62% / 0.55);
    box-shadow:
      0 14px 36px rgba(0, 0, 0, 0.38),
      0 0 0 1px rgba(212, 168, 84, 0.16) inset;
  }
  .g-banner--live:hover .g-banner-art {
    transform: scale(1.07);
  }
  .g-banner--live:hover .g-banner-hint {
    color: var(--g-gold);
  }
}

/* ---- Полоса метрик ---- */
.g-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.g-metrics .g-stat {
  align-items: center;
  text-align: center;
  padding: 9px 6px;
}

/* ---- Статы и сетки ---- */
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}
.g-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-grid--res {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.g-grid--res > .g-stat {
  align-items: center;
  text-align: center;
  padding: 8px 4px;
  min-width: 0;
}
.g-grid--res .g-stat-value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.g-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border-radius: 11px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  min-width: 0;
}
.g-stat-label {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #8b949e);
}
.g-stat-short { display: none; }

/* Эмодзи ресурса: свой шрифт, чтобы не тянуть за собой метрики цифр */
.g-res-emoji {
  margin-right: 4px;
  font-family: var(--font-emoji), sans-serif;
  font-size: 0.92em;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}
.g-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.g-stat.is-accent { border-color: var(--g-accent-border); background: var(--g-accent-soft); }
.g-stat.is-accent .g-stat-value { color: var(--g-accent); }
.g-stat.is-muted .g-stat-value { color: var(--text-muted, #8b949e); font-weight: 500; }
.g-stat.is-lacking { border-color: rgba(239, 68, 68, 0.4); }
.g-stat.is-lacking .g-stat-value { color: #f87171; }

/* ---- Блоки ---- */
.g-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--g-surface);
  border: 1px solid var(--g-line);
}
.g-block-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(42 45% 70% / 0.85);
}
.g-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.42;
  color: #cbd5e1;
}
.g-note.is-muted { color: var(--text-muted, #8b949e); font-size: 0.74rem; }
.g-note.is-warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 10px;
  padding: 9px 11px;
}

/* ---- Карточки разделов ---- */
.g-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Каскад хаба — timing как classMenuCardIn (styles.css), золотая тема гильдии */
@keyframes g-card-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes g-card-bg-in {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 0.96;
    transform: scale(1);
  }
}
/* Каскад только на входе в хаб (.is-enter), не на каждом рендере */
.g-cards.is-enter .g-card {
  animation: g-card-in 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--card-i, 0) * 58ms + 48ms);
}
.g-cards.is-enter .g-card-bg {
  animation: g-card-bg-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--card-i, 0) * 58ms + 72ms);
}
.g-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 92px;
  padding: 14px 16px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: #0b1018;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 0.2s ease,
              box-shadow 0.25s ease;
  will-change: transform;
}
/* Арт растворяется маской, а не обрезается по краю */
.g-card-bg {
  position: absolute;
  top: -8%;
  right: -14px;
  width: 74%;
  height: 116%;
  background-size: cover;
  background-position: calc(100% + 10px) center;
  background-repeat: no-repeat;
  opacity: 0.96;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%,
    rgba(0, 0, 0, 0.12) 16%, rgba(0, 0, 0, 0.75) 36%, #000 52%);
  mask-image: linear-gradient(90deg, transparent 0%,
    rgba(0, 0, 0, 0.12) 16%, rgba(0, 0, 0, 0.75) 36%, #000 52%);
}
.g-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    #0b1018 0%,
    #0b1018 30%,
    rgba(11, 16, 24, 0.96) 44%,
    rgba(11, 16, 24, 0.62) 62%,
    rgba(11, 16, 24, 0.18) 82%,
    transparent 100%);
}
.g-card:hover,
.g-card:focus-visible {
  transform: translateY(-2px);
  border-color: hsl(var(--g-hue) 60% 60% / 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  outline: none;
}
.g-card:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.g-card-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: hsl(var(--g-hue) 55% 52% / 0.18);
  border: 1px solid hsl(var(--g-hue) 55% 58% / 0.34);
}
.g-card-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: hsl(var(--g-hue) 80% 72%);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-card-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.g-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.g-card-status {
  font-size: 0.74rem;
  line-height: 1.32;
  color: rgba(226, 232, 240, 0.78);
  overflow-wrap: anywhere;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.g-card-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}
.g-card-badge.is-accent {
  background: var(--g-accent-soft);
  border-color: var(--g-accent-border);
  color: var(--g-accent);
}
.g-card-badge.is-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.36);
  color: #f87171;
}
.g-card.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.g-card.is-locked:hover { transform: none; border-color: var(--g-line); }
.g-card-lock {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
}
.g-card-lock svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---- Шапка раздела ---- */
.g-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}
.g-head-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.g-head-title {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text, #e6edf3);
}
.g-head-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
}
.g-back,
.g-info-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  cursor: pointer;
  transition: border-color var(--dur-instant, 0.18s) linear,
    background var(--dur-instant, 0.18s) linear;
}
.g-back svg,
.g-info-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-back:hover,
.g-back:focus-visible,
.g-info-btn:hover,
.g-info-btn:focus-visible {
  border-color: var(--g-accent-border);
  background: var(--g-accent-soft);
  outline: none;
}

.g-hero {
  position: relative;
  height: 118px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--g-line);
  isolation: isolate;
}
.g-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 32%;
  z-index: -2;
}
.g-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 9, 14, 0.32) 0%, rgba(6, 9, 14, 0.86) 88%);
}
.g-hero-icon {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: hsl(var(--g-hue) 55% 52% / 0.2);
  border: 1px solid hsl(var(--g-hue) 55% 60% / 0.4);
  backdrop-filter: blur(3px);
}
.g-hero-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: hsl(var(--g-hue) 85% 76%);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Данные пришли на место скелета — дети стартуют с opacity:0 (без мигания скелет→контент) */
@keyframes g-content-in {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.g-body.is-content-in > * {
  /* Не ставим opacity:0 отдельно — иначе при сбое animation элемент остаётся невидимым.
     from{} + fill-mode both достаточно против мигания. */
  animation: g-content-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.g-body.is-content-in > *:nth-child(2) { animation-delay: 55ms; }
.g-body.is-content-in > *:nth-child(3) { animation-delay: 95ms; }
.g-body.is-content-in > *:nth-child(4) { animation-delay: 130ms; }
.g-body.is-content-in > *:nth-child(n + 5) { animation-delay: 155ms; }

/* ---- Кнопки ---- */
.g-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.g-actions--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.g-actions--split .g-btn,
.g-actions--stack .g-btn {
  flex: none;
  width: 100%;
}
.g-actions--stack {
  display: flex;
  flex-direction: column;
}
.g-social {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.g-social-lead {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--g-surface);
  border: 1px solid var(--g-line);
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.g-social-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--g-surface);
  border: 1px solid var(--g-line);
}
.g-social-dl {
  border-top: 0;
}
.g-social-dl .g-info-dl-row:first-child {
  padding-top: 0;
}
.g-social-dl .g-info-dl-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.g-social .g-btn {
  min-height: 48px;
}
.g-btn {
  position: relative;
  flex: 1 1 auto;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  cursor: pointer;
  transition: border-color 0.15s ease,
    background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.g-btn:hover:not(:disabled),
.g-btn:focus-visible:not(:disabled) {
  border-color: var(--g-accent-border);
  background: var(--g-accent-soft);
  outline: none;
}
.g-btn:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}
.g-btn--primary {
  background: linear-gradient(180deg, hsl(42 72% 58% / 0.22), hsl(42 72% 48% / 0.12));
  border-color: var(--g-gold-border);
  color: #f8f0dc;
}
.g-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, hsl(42 76% 62% / 0.3), hsl(42 72% 50% / 0.18));
  border-color: hsl(42 70% 62% / 0.55);
}
.g-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}
.g-btn--ghost:hover:not(:disabled) {
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
  color: #f8f0dc;
}
.g-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.g-btn.is-busy { color: transparent; }
.g-btn-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(226, 232, 240, 0.28);
  border-top-color: #e2e8f0;
  animation: g-spin 0.7s linear infinite;
}
@keyframes g-spin { to { transform: rotate(360deg); } }

.g-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--g-gold);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.g-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.g-chip {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--g-line);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease,
    background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.g-chip:hover,
.g-chip:focus-visible {
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
  color: var(--g-gold);
  outline: none;
}
.g-chip:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}
.g-chip.is-max {
  color: var(--g-gold);
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
}

/* ---- Прогресс ---- */
.g-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.g-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  position: relative;
}
.g-progress-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%);
  animation: progressShine 2.5s ease-in-out infinite;
}
@keyframes progressShine {
  0%, 100% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 1; }
}
.g-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    hsl(var(--g-hue, 42) 70% 52%),
    hsl(var(--g-hue, 42) 82% 66%),
    hsl(var(--g-hue, 42) 75% 58%));
  background-size: 200% 100%;
  transition: width 0.6s cubic-bezier(0.22, 0.68, 0, 1.01);
  position: relative;
  z-index: 1;
  animation: progressGradient 3s ease infinite;
  box-shadow: 0 0 8px hsl(var(--g-hue, 42) 70% 52% / 0.4);
}
@keyframes progressGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Стоимость ---- */
.g-cost {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(10, 14, 20, 0.5);
  border: 1px solid var(--g-line);
}
.g-cost-title {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #8b949e);
}
.g-cost-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.g-cost-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.g-cost-label { color: #cbd5e1; }
.g-cost-need { font-weight: 600; color: var(--text, #e6edf3); }
.g-cost-have { font-size: 0.7rem; color: var(--text-muted, #8b949e); }
.g-cost-row.is-lacking .g-cost-need,
.g-cost-row.is-lacking .g-cost-have { color: #f87171; }

/* ---- Поля ввода ---- */
.g-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.g-field-label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #8b949e);
}
.g-input {
  flex: 1 1 100px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text, #e6edf3);
  background: rgba(10, 14, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease;
}
.g-input:hover {
  border-color: rgba(212, 168, 84, 0.28);
}
.g-input:focus {
  outline: none;
  border-color: hsl(42 72% 58% / 0.72);
  background: rgba(14, 18, 26, 0.88);
  box-shadow: 0 0 0 3px hsl(42 70% 58% / 0.16),
    0 0 0 1px hsl(42 60% 50% / 0.2) inset;
}
.g-textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
  line-height: 1.35;
  font-variant-numeric: normal;
}
.g-btn--danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(127, 29, 29, 0.28);
}
.g-btn--danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(153, 27, 27, 0.38);
}

/* ---- Взносы ---- */
.g-deposit {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  border-radius: 12px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
}
.g-deposit + .g-deposit { margin-top: 8px; }
.g-deposit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.g-deposit-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
}
.g-deposit-cap,
.g-deposit-wallet {
  font-size: 0.71rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-deposit-controls {
  display: flex;
  gap: 7px;
}
.g-deposit-controls .g-btn { flex: 0 0 auto; }

/* ---- Слоты баффов ---- */
.g-slots {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.g-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 11px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  text-align: center;
}
.g-slot.is-free {
  border-style: dashed;
  background: rgba(148, 163, 184, 0.05);
}
.g-slot-empty {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.7);
}
.g-slot-grade {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.g-slot-bonus {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.g-slot-fx,
.g-crystal-fx {
  font-size: 0.58rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.9;
  max-width: 100%;
}
.g-slot-time {
  font-size: 0.68rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-slot.is-waiting .g-slot-time { color: #fbbf24; }

/* Грейды кристаллов: серый → фиолетовый → жёлтый → красный */
.g-slot.is-common, .g-crystal.is-common { --c-hue: 220; --c-sat: 6%; }
.g-slot.is-rare, .g-crystal.is-rare { --c-hue: 280; --c-sat: 70%; }
.g-slot.is-leg, .g-crystal.is-leg { --c-hue: 48; --c-sat: 88%; }
.g-slot.is-myth, .g-crystal.is-myth { --c-hue: 4; --c-sat: 78%; }
.g-slot:not(.is-free),
.g-crystal {
  border-color: hsl(var(--c-hue) var(--c-sat) 58% / 0.42);
  background: hsl(var(--c-hue) var(--c-sat) 52% / 0.12);
}
.g-slot:not(.is-free) .g-slot-grade,
.g-slot:not(.is-free) .g-slot-bonus,
.g-slot:not(.is-free) .g-slot-fx,
.g-crystal-grade,
.g-crystal-bonus,
.g-crystal-fx {
  color: hsl(var(--c-hue) var(--c-sat) 74%);
}

/* ---- Выбор кристаллов ---- */
.g-crystals {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}
.g-crystal {
  position: relative;
  width: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 11px;
  border: 1px solid var(--g-line);
  cursor: pointer;
  transition: transform 0.15s ease,
    border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.g-crystal-grade { font-size: 0.7rem; font-weight: 600; }
.g-crystal-bonus { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-crystal:hover:not(:disabled) {
  transform: translateY(-2px);
}
.g-crystal:active:not(:disabled) {
  transform: scale(0.96);
  transition-duration: 0.08s;
}
.g-crystal.is-picked {
  border-color: hsl(var(--c-hue) var(--c-sat) 66% / 0.8);
  box-shadow: 0 0 0 2px hsl(var(--c-hue) var(--c-sat) 62% / 0.85) inset;
}
.g-crystal.is-picked::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.7rem;
  line-height: 1;
  color: hsl(var(--c-hue) var(--c-sat) 82%);
}
.g-crystal:disabled { opacity: 0.38; cursor: not-allowed; }
.g-crystal:focus-visible {
  outline: 2px solid hsl(var(--c-hue) var(--c-sat) 66%);
  outline-offset: 2px;
}

/* ---- Ветки голема ---- */
.g-track {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  border-radius: 12px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
}
.g-track + .g-track { margin-top: 8px; }
.g-track-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.g-track-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
}
.g-track-level {
  font-size: 0.74rem;
  color: var(--g-accent);
  font-variant-numeric: tabular-nums;
}

/* ---- Табы ---- */
.g-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.55);
  border: 1px solid var(--g-line);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.g-tabs::-webkit-scrollbar {
  display: none;
}
.g-tab {
  flex: 1 1 0;
  min-width: max-content;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #8b949e);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
}
.g-tab:hover { color: #cbd5e1; }
.g-tab.is-active {
  background: var(--g-accent-soft);
  color: var(--g-accent);
  box-shadow: inset 0 0 0 1px var(--g-accent-border);
}

/* ---- Списки: общая основа ---- */
.g-holds, .g-owned-list, .g-prog-list, .g-ranks, .g-members, .g-tax-list,
.g-log, .g-items, .g-res-list, .g-temp-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.g-hold, .g-owned, .g-prog, .g-rank, .g-member, .g-tax-row, .g-log-row,
.g-item, .g-res-row, .g-temp {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  font-size: 0.8rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* Subtle hover effect for interactive items */
.g-rank,
.g-member,
.g-tax-row {
  -webkit-tap-highlight-color: transparent;
}

.g-rank.is-mine,
.g-member.is-mine,
.g-tax-row.is-mine {
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
  animation: highlightPulse 1.2s ease-out;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 16px rgba(212, 168, 84, 0.3); }
}

/* Жилы и владения */
.g-hold, .g-owned {
  flex-wrap: wrap;
}
.g-hold-res, .g-owned-name {
  font-weight: 600;
  color: var(--text, #e6edf3);
}
.g-hold-meta, .g-owned-meta {
  flex: 1 1 auto;
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
}
.g-hold-times, .g-owned-times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 0.7rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-hold-left, .g-owned-left { color: var(--g-accent); font-weight: 600; }

.g-prog { flex-direction: column; align-items: stretch; gap: 6px; }
.g-prog-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  color: var(--text, #e6edf3);
}
.g-prog-floor { font-weight: 500; color: var(--text-muted, #8b949e); font-size: 0.72rem; }

/* Ресурсы жил */
.g-res-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; }
.g-res-name { font-weight: 600; color: var(--text, #e6edf3); }
.g-res-chance, .g-res-limit, .g-res-tick {
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-temp { justify-content: space-between; font-size: 0.76rem; color: #cbd5e1; }

/* Рейтинги */
.g-rank { gap: 10px; }
.g-rank-place {
  flex: 0 0 26px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.g-rank-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text, #e6edf3);
}
.g-rank-value {
  font-weight: 600;
  color: var(--g-accent);
  font-variant-numeric: tabular-nums;
}
.g-rank:nth-child(1) .g-rank-place { color: #fbbf24; }
.g-rank:nth-child(2) .g-rank-place { color: #cbd5e1; }
.g-rank:nth-child(3) .g-rank-place { color: #d97706; }
.g-rank.is-mine,
.g-member.is-mine,
.g-tax-row.is-mine {
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
}

/* Состав */
.g-member-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.4);
}
.g-member-dot.is-online {
  background: var(--green, #22c55e);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.g-member-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.g-member-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text, #e6edf3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-member-crown { color: #fbbf24; font-size: 0.72rem; }
.g-member-meta,
.g-member-online {
  font-size: 0.7rem;
  color: var(--text-muted, #8b949e);
}
.g-member-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.g-member-cores {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--g-gold);
  font-variant-numeric: tabular-nums;
}
button.g-member {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.08s ease;
}
button.g-member:hover,
button.g-member:focus-visible {
  border-color: var(--g-gold-border);
  background: var(--g-gold-soft);
  outline: none;
}
button.g-member:active {
  transform: scale(0.99);
}
.g-app-row {
  flex-wrap: wrap;
}
.g-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.g-member-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--g-surface-2);
  border: 1px solid var(--g-line);
  margin-bottom: 10px;
}
.g-member-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #e6edf3);
}
.g-member-card-meta {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-muted, #8b949e);
}
.g-member-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted, #8b949e);
}
.g-member-actions {
  margin-top: 4px;
}

/* Налог */
.g-tax-row { justify-content: space-between; }
.g-tax-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-weight: 600;
  color: var(--text, #e6edf3);
}
.g-tax-role {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted, #8b949e);
}
.g-tax-nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}
.g-tax-total { color: var(--g-gold); font-weight: 600; }

/* Журнал */
.g-log-row { justify-content: space-between; align-items: flex-start; }
.g-log-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.g-log-who {
  font-weight: 600;
  color: var(--text, #e6edf3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-log-what,
.g-log-when {
  font-size: 0.7rem;
  color: var(--text-muted, #8b949e);
}
.g-log-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
}
.g-log-amount {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.g-log-row.is-gain .g-log-amount { color: var(--green, #22c55e); }
.g-log-row.is-spend .g-log-amount { color: #f87171; }

/* Предметы склада */
.g-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.g-item { align-items: center; }
.g-item-img {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(10, 14, 20, 0.6);
  border: 1px solid var(--g-line);
}
.g-item-img.is-empty { display: block; }
.g-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.g-item-label {
  font-size: 0.78rem;
  color: var(--text, #e6edf3);
  overflow-wrap: anywhere;
}
.g-item-meta {
  font-size: 0.68rem;
  color: var(--text-muted, #8b949e);
}
/* Рамка по редкости — та же шкала, что в инвентаре */
.g-item.is-r1 { border-color: rgba(148, 163, 184, 0.3); }
.g-item.is-r2 { border-color: rgba(74, 222, 128, 0.34); }
.g-item.is-r3 { border-color: rgba(56, 189, 248, 0.34); }
.g-item.is-r4 { border-color: rgba(192, 132, 252, 0.34); }
.g-item.is-r5 { border-color: rgba(251, 191, 36, 0.36); }
.g-item.is-r6 { border-color: rgba(248, 113, 113, 0.36); }

/* ---- Пустые состояния, скелет, инфо ---- */
.g-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 22px 14px;
  text-align: center;
}
.g-empty-glyph svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.g-empty-text {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #cbd5e1;
}
.g-empty-hint {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-muted, #8b949e);
  max-width: 34ch;
}

.g-bot-hint {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-muted, #8b949e);
  text-align: center;
}

.g-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.g-skeleton span {
  display: block;
  height: 62px;
  border-radius: 12px;
  background: linear-gradient(100deg,
    rgba(148, 163, 184, 0.06) 0%,
    rgba(148, 163, 184, 0.06) 30%,
    rgba(148, 163, 184, 0.14) 50%,
    rgba(148, 163, 184, 0.06) 70%,
    rgba(148, 163, 184, 0.06) 100%);
  background-size: 300% 100%;
  animation: g-shimmer 1.6s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.g-skeleton span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%);
  animation: g-shimmer-shine 2s ease-in-out infinite;
}
.g-skeleton span:nth-child(1) { height: 68px; }
.g-skeleton span:nth-child(2) { height: 108px; animation-delay: 0.2s; }
.g-skeleton span:nth-child(3) { height: 84px; animation-delay: 0.4s; }
@keyframes g-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes g-shimmer-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.g-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--g-surface);
  border: 1px solid var(--g-line);
}
.g-info p {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.g-timer {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.g-timer.is-done { color: var(--text-muted, #8b949e); }

.g-confirm-text {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.g-confirm-rnd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.26);
  font-size: 0.78rem;
  color: #cbd5e1;
}
.g-confirm-rnd strong {
  font-size: 0.95rem;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

/* ---- Улучшения для touch-устройств ---- */
@media (pointer: coarse) {
  /* Увеличенные области нажатия для пальцев */
  .g-card {
    min-height: 96px;
  }

  .g-btn,
  .g-chip,
  .g-crystal {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Убираем hover эффекты на touch - только :active */
  .g-card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  }

  .g-card:active {
    transform: scale(0.97);
  }

  .g-btn:hover:not(:disabled),
  .g-chip:hover:not(:disabled),
  .g-crystal:hover:not(:disabled) {
    border-color: var(--g-line);
    background: var(--g-surface-2);
    transform: none;
    box-shadow: none;
  }

  .g-btn:active:not(:disabled) {
    transform: scale(0.96);
  }

  .g-chip:active:not(:disabled) {
    transform: scale(0.94);
  }

  .g-tab:hover {
    color: var(--text-muted, #8b949e);
  }
  .g-tab.is-active:hover {
    color: var(--g-accent);
  }

  .g-crystal:active:not(:disabled) {
    transform: scale(0.95);
  }
}

/* ---- Модалка сведений гильдии ---- */
.inspector-guild-info-dialog {
  width: min(480px, calc(100vw - 32px));
  max-width: min(480px, calc(100vw - 32px));
  height: auto;
  max-height: min(92vh, calc(100dvh - 32px));
  border: 1px solid var(--g-gold-border);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 168, 84, 0.08) inset;
  overflow: hidden;
}
.inspector-guild-info-dialog .inspector-modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: 12px 12px 0;
  border: none;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.55) 0%, transparent 100%);
  justify-content: flex-end;
}
.inspector-guild-info-dialog .inspector-modal-header > div {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.inspector-guild-info-dialog .inspector-modal-close {
  background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
}
.inspector-guild-info-dialog .inspector-modal-close:hover,
.inspector-guild-info-dialog .inspector-modal-close:focus-visible {
  background: rgba(239, 68, 68, 0.15);
}
.inspector-guild-info-dialog .inspector-modal-body {
  flex: 0 0 auto;
  min-height: auto;
  overflow: hidden;
  max-height: none;
  scrollbar-gutter: auto;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.inspector-guild-info-dialog .inspector-modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.g-info-sheet {
  display: flex;
  flex-direction: column;
}
.g-info-cover,
.g-info-mini {
  position: relative;
  height: 196px;
  overflow: hidden;
  isolation: isolate;
}
.g-info-mini-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  background-size: cover;
  background-position: center 42%;
  border: 0;
  z-index: 0;
}
.g-info-mini-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 14, 0.28) 0%,
    rgba(8, 10, 14, 0.36) 38%,
    rgba(8, 10, 14, 0.5) 62%,
    rgba(6, 8, 12, 0.92) 100%
  );
}
.g-info-cover .g-banner-frame { z-index: 3; }
.g-info-cover .g-orn { width: 56px; opacity: 1; }
.g-info-mini-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 20px 16px 16px;
  text-align: center;
}
.g-info-mini-content .g-banner-name {
  font-size: clamp(1.4rem, 5.4vw, 1.85rem);
}
.g-info-body {
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.g-info-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #d9d2c4;
}
.g-info-dl {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.g-info-dl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.g-info-dl-row dt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted, #8b949e);
}
.g-info-dl-row dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f3eee3;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

@keyframes g-info-rise {
  from { opacity: 0; }
  to { opacity: 1; }
}
#guild-info-modal.is-visible:not(.is-closing) .g-info-cover {
  animation: g-info-rise 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#guild-info-modal.is-visible:not(.is-closing) .g-info-body {
  animation: g-info-rise 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

/* ---- Адаптив ---- */
@media (min-width: 769px) {
  .g-banner-content { min-height: 216px; padding: 26px 22px 18px; }
  .g-orn { width: 68px; }
  .g-hero { height: 138px; }
  .g-info-cover { height: 248px; }
  .g-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .g-banner-content { min-height: 232px; }
  .g-banner-name { font-size: 2rem; }
}

@media (max-width: 768px) {
  .inspector-guild-info-dialog {
    width: 100%;
    max-width: 100%;
    max-height: min(94vh, calc(100dvh - 12px));
    border-radius: 22px 22px 0 0;
  }
  .inspector-guild-info-dialog .inspector-sheet-grabber {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    padding: 10px 0 22px;
    background: linear-gradient(180deg, rgba(6, 8, 12, 0.5) 0%, transparent 100%);
  }
  .inspector-guild-info-dialog .inspector-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .g-info-cover {
    height: 168px;
  }
  .g-info-mini-content {
    padding-top: 28px;
  }
  .g-info-body {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  .g-info-dl-row {
    padding: 8px 0;
  }

  #panel-guild {
    --g-mobile-safe-top: env(safe-area-inset-top, 0px);
    --g-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  .g-wrap {
    padding: 10px;
    padding-bottom: max(10px, var(--g-mobile-safe-bottom));
    gap: 8px;
    transform: none;
  }

  #panel-guild .g-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .g-metrics .g-stat {
    padding: 8px 3px 7px;
    gap: 3px;
    border-radius: 10px;
    min-width: 0;
  }
  .g-metrics .g-stat-full { display: none; }
  .g-metrics .g-stat-short { display: inline; }
  .g-metrics .g-stat-label {
    font-size: 0.58rem;
    letter-spacing: 0.03em;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .g-metrics .g-stat-value {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .g-metrics .g-res-emoji {
    margin-right: 2px;
  }

  .g-banner-content {
    min-height: 148px;
    padding: 16px 12px 12px;
    gap: 6px;
  }

  .g-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .g-card {
    min-height: 70px;
    padding: 10px 10px 10px 10px;
    border-radius: 13px;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
    will-change: auto;
  }

  .g-card-bg {
    width: 62%;
    top: -8%;
    right: -10px;
  }

  .g-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .g-card-icon svg {
    width: 16px;
    height: 16px;
  }

  .g-card-title {
    font-size: 0.82rem;
  }

  .g-card-status {
    font-size: 0.66rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .g-card-badge {
    top: 6px;
    right: 6px;
    padding: 1px 6px;
    font-size: 0.58rem;
  }

  /* Оптимизация для touch - увеличенные области нажатия */
  .g-back,
  .g-info-btn {
    width: 44px;
    height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .g-btn {
    min-height: 48px;
    padding: 13px 18px;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
  }

  .g-grid--3,
  .g-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-grid--res {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
  }
  .g-grid--res > .g-stat:nth-child(-n+4) {
    grid-column: span 3;
  }
  .g-grid--res > .g-stat:nth-child(n+5) {
    grid-column: span 4;
  }
  .g-grid--res .g-stat {
    padding: 8px 6px;
    gap: 3px;
    border-radius: 10px;
  }
  .g-grid--res .g-stat-label {
    font-size: 0.58rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
  }
  .g-grid--res .g-stat-value {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .g-res-row {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }

  .g-deposit-controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .g-deposit-controls .g-btn {
    flex: 0 0 auto;
    min-width: 96px;
  }

  .g-deposit-controls .g-input {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 8px 10px;
  }

  .g-chip {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.8rem;
  }

  .g-app-actions {
    flex-direction: column;
    width: 100%;
  }
  .g-app-actions .g-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .g-banner-name {
    font-size: clamp(1.2rem, 6.4vw, 1.5rem);
  }

  .g-banner-content {
    min-height: 140px;
    padding: 14px 12px 10px;
  }

  .g-card {
    min-height: 66px;
    padding: 8px 9px;
  }

  .g-card-title {
    font-size: 0.78rem;
  }

  .g-card-status {
    font-size: 0.62rem;
  }
}

@media (max-width: 380px) {
  .g-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #panel-guild .g-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .g-wrap {
    padding: 8px;
    gap: 7px;
  }

  .g-card-icon {
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-wrap.is-nav-forward,
  .g-wrap.is-nav-back,
  .g-wrap.is-hub-enter .g-banner,
  .g-wrap.is-hub-enter .g-metrics,
  .g-wrap.is-hub-enter .g-social,
  .g-cards.is-enter .g-card,
  .g-cards.is-enter .g-card-bg,
  .g-body.is-content-in > *,
  .g-skeleton span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .g-cards.is-enter .g-card-bg {
    opacity: 0.96 !important;
  }
  .g-card:hover, .g-card:active,
  .g-btn:active, .g-crystal:hover,
  .g-banner--live:hover, .g-banner--live:active,
  .g-banner--live:hover .g-banner-art { transform: none !important; }
  .g-progress-fill { transition: none !important; }
  #guild-info-modal.is-visible .g-info-cover,
  #guild-info-modal.is-visible .g-info-body {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
