/* ============================================================
   Клан HG — светлая современная тема
   ============================================================ */

:root {
  --bg: #f2f5fb;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.92);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --text: #0f172a;
  --text-muted: #64748b;

  --violet: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #0891b2;
  --amber: #d97706;
  --green: #059669;
  --red: #dc2626;

  --grad: linear-gradient(120deg, #8b5cf6 0%, #3b82f6 50%, #0ea5e9 100%);
  --grad-warm: linear-gradient(120deg, #f59e0b, #f97316);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --font-display: 'Unbounded', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 620px at 85% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(900px 560px at -10% 110%, rgba(14, 165, 233, 0.10), transparent 60%),
    radial-gradient(700px 520px at 50% 55%, rgba(59, 130, 246, 0.05), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--cyan); }
a:hover { color: #0369a1; }

::selection { background: rgba(139, 92, 246, 0.25); color: #1e1b4b; }

/* ---------- Декоративный фон ---------- */

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.38;
  animation: drift 20s ease-in-out infinite alternate;
}

.blob-1 { width: 480px; height: 480px; background: #c4b5fd; top: -140px; right: -110px; }
.blob-2 { width: 430px; height: 430px; background: #7dd3fc; bottom: -150px; left: -90px; animation-delay: -7s; }
.blob-3 { width: 340px; height: 340px; background: #a5f3fc; top: 42%; left: 55%; opacity: 0.25; animation-delay: -13s; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(44px, 34px) scale(1.14); }
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  padding: 2px;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 8px 24px rgba(139, 92, 246, 0.3);
  transition: transform 0.3s ease;
}

.brand:hover .brand-logo { transform: rotate(8deg) scale(1.06); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-name b {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 6px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.nav-link-custom {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.25s ease;
}

.nav-link-custom:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* ---------- Выпадающее меню в шапке ---------- */

.nav-links .dropdown-toggle::after {
  margin-left: 7px;
  vertical-align: 1px;
  border-top-color: var(--text-muted);
}

.nav-links .dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.14);
  padding: 8px;
  min-width: 200px;
  animation: fadeUp 0.22s ease both;
}

.nav-links .dropdown-item {
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 9px 14px;
  transition: all 0.2s ease;
}

.nav-links .dropdown-item:hover {
  background: rgba(139, 92, 246, 0.09);
  color: var(--text);
}


.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-actions .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.nav-actions .user-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--grad);
  padding: 1px;
}

/* Переключатель языка EN/RU */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
}
.lang-btn.active {
  color: #fff;
  background: var(--grad);
}

/* ---------- Контент ---------- */

.main-content {
  padding: 10px 12px 60px;
  min-height: calc(100vh - 180px);
}

.page-head { margin: 34px 0 24px; }
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  margin: 0;
}
.page-sub { color: var(--text-muted); margin-top: 8px; }

.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Кнопки ---------- */

.btn {
  font-weight: 700;
  border-radius: 12px;
  padding: 0.6rem 1.3rem;
  border: none;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background-image: var(--grad);
  background-size: 160% 160%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover,
.btn-primary:focus {
  background-position: 100% 50%;
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

.btn-warning {
  background-image: var(--grad-warm);
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover,
.btn-warning:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.4);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline-light:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.25);
  color: var(--text);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.07);
  color: var(--text);
}
.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.13);
  color: var(--text);
}

.btn-sm { padding: 0.42rem 0.95rem; font-size: 0.85rem; }

/* ---------- Discord OAuth ---------- */

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.6rem 1.3rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
  text-decoration: none;
  transition: all 0.25s ease;
}
.btn-discord:hover,
.btn-discord:focus {
  color: #fff;
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(88, 101, 242, 0.45);
  text-decoration: none;
}
.btn-discord .discord-ico {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}
.btn-discord.btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }

/* ---------- Bungie OAuth ---------- */

.btn-bungie {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.6rem 1.3rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: #26272b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
  text-decoration: none;
  transition: all 0.25s ease;
}
.btn-bungie:hover,
.btn-bungie:focus {
  color: #fff;
  background: #101114;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.36);
  text-decoration: none;
}
.btn-bungie .bungie-ico {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  font-size: 0.86em;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background-image: var(--grad);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.btn-bungie.btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }


.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ---------- Карточки ---------- */

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ---------- Hero (гость) ---------- */

.hero { text-align: center; padding: 96px 0 50px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #6d28d9;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5.5vw, 3.5rem);
  line-height: 1.14;
  margin: 0;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 540px;
  margin: 20px auto 0;
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-features {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 56px;
  flex-wrap: wrap;
}

.feature-tile {
  flex: 1;
  min-width: 210px;
  max-width: 280px;
  padding: 22px 20px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: all 0.3s ease;
}
.feature-tile:hover {
  background: #fff;
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.35);
}
.feature-tile .feature-ico {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.2rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  margin-bottom: 14px;
}
.feature-tile b { display: block; font-size: 0.98rem; margin-bottom: 6px; }
.feature-tile span { color: var(--text-muted); font-size: 0.87rem; line-height: 1.55; }

/* ---------- Профиль (авторизованный) ---------- */

.profile-card { max-width: 780px; margin: 42px auto; overflow: hidden; }

.profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 30px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(14, 165, 233, 0.06));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
  background: var(--grad);
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.15), 0 14px 32px rgba(15, 23, 42, 0.18);
}

.profile-head-info h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.profile-rows { padding: 8px 30px; }

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--border-strong);
  flex-wrap: wrap;
}
.profile-row:last-child { border-bottom: none; }

.profile-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.profile-value { font-weight: 700; font-size: 1.02rem; word-break: break-word; }

.badge-soft {
  display: inline-block;
  padding: 0.35em 0.75em;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.1);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.28);
}
.badge-soft.cyan { background: rgba(8, 145, 178, 0.08); color: #0e7490; border-color: rgba(8, 145, 178, 0.25); }
.badge-soft.amber { background: rgba(217, 119, 6, 0.08); color: #b45309; border-color: rgba(217, 119, 6, 0.28); }

/* ---------- Таблицы ---------- */

.table {
  --bs-table-bg: transparent;
  color: var(--text);
  border-color: var(--border);
  vertical-align: middle;
}

.table-dark {
  --bs-table-bg: rgba(255, 255, 255, 0.55);
  --bs-table-color: var(--text);
  --bs-table-striped-bg: rgba(15, 23, 42, 0.025);
  --bs-table-striped-color: var(--text);
  --bs-table-active-bg: rgba(139, 92, 246, 0.08);
  --bs-table-active-color: var(--text);
  --bs-table-hover-bg: rgba(139, 92, 246, 0.05);
  --bs-table-hover-color: var(--text);
  --bs-table-border-color: var(--border);
  color: var(--text);
}

.table thead th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
  padding-top: 16px;
  padding-bottom: 16px;
}

.table tbody tr { transition: background 0.2s ease; }
.table tbody tr:hover { background: rgba(139, 92, 246, 0.05); }

.table-card { padding: 8px 12px 20px; }

/* ---------- Формы ---------- */

.form-control,
.form-select {
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  transition: all 0.25s ease;
}
.form-control:focus,
.form-select:focus {
  background-color: #fff;
  color: var(--text);
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}
.form-control::placeholder { color: #94a3b8; }
.form-control option,
.form-select option { background: #fff; color: var(--text); }

.form-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-check-input { background-color: #fff; border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--violet); border-color: var(--violet); }

/* ---------- Алерты ---------- */

.alert {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}
.alert-info {
  background: rgba(8, 145, 178, 0.08);
  border-color: rgba(8, 145, 178, 0.25);
  color: #155e75;
}
.alert-danger {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}
.alert-success {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.25);
  color: #065f46;
}

/* ---------- Аудио ---------- */

audio {
  height: 42px;
  width: min(320px, 100%);
  border-radius: 999px;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.12));
}
audio::-webkit-media-controls-panel { background: #fff; }
audio::-webkit-media-controls-enclosure { background: #fff; border-radius: 999px; }

/* ---------- Модалки ---------- */

.modal-content {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(243, 246, 252, 0.98));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.modal-title { font-family: var(--font-display); font-size: 1.15rem; }
.btn-close { opacity: 0.55; }
.btn-close:hover { opacity: 0.9; }

/* ---------- Логи ---------- */

.log-tabs {
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.log-tab {
  border: 1px solid var(--border-strong);
  border-radius: 999px !important;
  padding: 8px 16px !important;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.25s ease;
}

.log-tab:hover {
  color: var(--text);
  background: #fff;
}

.log-tab.active {
  background-image: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
}

.log-count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  margin-left: 4px;
}

.log-tab.active .log-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.log-table-wrap { max-height: 68vh; overflow: auto; }

.log-msg-cell {
  max-width: 460px;
  word-break: break-word;
  white-space: pre-wrap;
}

.log-action-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.1);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.log-action-voice_join { background: rgba(5, 150, 105, 0.1); color: #065f46; border-color: rgba(5, 150, 105, 0.3); }
.log-action-voice_leave { background: rgba(220, 38, 38, 0.08); color: #991b1b; border-color: rgba(220, 38, 38, 0.28); }
.log-action-voice_move { background: rgba(8, 145, 178, 0.1); color: #155e75; border-color: rgba(8, 145, 178, 0.28); }
.log-action-guild_join { background: rgba(5, 150, 105, 0.1); color: #065f46; border-color: rgba(5, 150, 105, 0.3); }
.log-action-guild_leave { background: rgba(220, 38, 38, 0.08); color: #991b1b; border-color: rgba(220, 38, 38, 0.28); }
.log-action-song_play { background: rgba(245, 158, 11, 0.1); color: #b45309; border-color: rgba(245, 158, 11, 0.3); }
.log-action-message_delete { background: rgba(220, 38, 38, 0.08); color: #991b1b; border-color: rgba(220, 38, 38, 0.28); }

.log-box {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 68vh;
  overflow: auto;
}


/* ---------- Нет прав ---------- */

.denied-wrap { text-align: center; padding: 90px 0; }
.denied-ico {
  width: 92px;
  height: 92px;
  margin: 0 auto 26px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(220, 38, 38, 0.25);
  box-shadow: 0 0 60px rgba(220, 38, 38, 0.12);
}

/* ---------- Анимации ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.fade-up { animation: fadeUp 0.55s ease both; }
.fade-up-1 { animation-delay: 0.07s; }
.fade-up-2 { animation-delay: 0.14s; }
.fade-up-3 { animation-delay: 0.21s; }

/* ---------- Скроллбар ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--blue));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

/* ---------- Футер ---------- */

.site-footer {
  padding: 26px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
}
.site-footer b { color: var(--text); }

/* ============================================================
   Мини-игра: рулетка челленджей Destiny 2
   ============================================================ */

.game-create-card {
  max-width: 560px;
  margin: 0 auto;
}

.game-ico {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.28);
}

/* ---------- Список игроков ---------- */

.game-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 2px;
}

.game-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.game-player-item.current {
  background: rgba(139, 92, 246, 0.09);
  border-color: rgba(139, 92, 246, 0.42);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.game-player-item.me {
  border-style: dashed;
}

.game-player-pos {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.07);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}

.game-player-item.current .game-player-pos {
  background-image: var(--grad);
  color: #fff;
}

.game-player-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.92rem;
  word-break: break-word;
}

.game-player-turn {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

/* ---------- Колесо ---------- */

.game-wheel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.game-wheel {
  position: relative;
  width: 392px;
  height: 392px;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.4);
  background:
    radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(15, 23, 42, 0.03) 60%, transparent 62%),
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.5), transparent 45%);
  box-shadow:
    0 0 0 12px rgba(255, 255, 255, 0.45),
    0 26px 70px rgba(15, 23, 42, 0.18),
    inset 0 0 40px rgba(139, 92, 246, 0.12);
  will-change: transform;
}

.game-wheel::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(139, 92, 246, 0.35);
}

.game-wheel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-image: var(--grad);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5), 0 0 0 6px rgba(255, 255, 255, 0.85);
  z-index: 3;
}

.game-wheel-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  transform: rotate(var(--a)) translateY(-173px) rotate(calc(-1 * var(--a)));
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  font-size: 1.3rem;
  z-index: 2;
}

.game-wheel-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  user-select: none;
  pointer-events: none;
}

.game-wheel-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, calc(-50% - 178px)) translateY(-6px);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--violet);
  filter: drop-shadow(0 3px 6px rgba(139, 92, 246, 0.45));
  z-index: 4;
}

/* ---------- Результат ---------- */

.game-result-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  animation: fadeUp 0.4s ease both;
}

.game-result-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
  flex: none;
}

.game-result-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
}

.game-challenge-text {
  color: var(--text-muted);
  word-break: break-word;
}

/* ---------- История ---------- */

.game-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 40vh;
  overflow-y: auto;
  padding: 2px;
}

.game-history-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
}

.game-history-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  flex: none;
}

.game-history-info { min-width: 0; }

.game-history-title {
  font-weight: 800;
  font-size: 0.9rem;
  word-break: break-word;
}

.game-history-who {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.game-history-challenge {
  color: var(--text-muted);
  margin-top: 4px;
  word-break: break-word;
  line-height: 1.45;
}

/* ---------- Реролл ---------- */

#rerollPanel {
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: rgba(139, 92, 246, 0.05);
}


#rerollList .btn {
  min-width: 34px;
}

/* ---------- Адаптив ---------- */



@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .hero { padding: 64px 0 30px; }
  .profile-head { justify-content: center; text-align: center; }
  .profile-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .table-card { overflow-x: auto; }
  .table { min-width: 640px; }
}

/* ---------- Блокирующее окно: токен конфиг-сервиса ---------- */

.config-overlay {
  position: fixed;
  inset: 0;
  /* Ниже модалок Bootstrap (z-index ~1055), чтобы можно было войти,
     если администратор ещё не авторизован. */
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}


.config-modal {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px;
  animation: fadeUp 0.4s ease both;
}

.config-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.config-modal-header h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.config-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.config-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 18px;
}
.config-form { margin: 0; }
.config-ok-ico {
  font-size: 2.2rem;
  margin-bottom: 8px;
  animation: fadeUp 0.4s ease both;
}

/* ---------- Модалка выбора музыки ---------- */

.song-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}

.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.song-item:hover {
  background: #fff;
  border-color: rgba(139, 92, 246, 0.35);
}
.song-item.active {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.35);
}

.song-name {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
  min-width: 0;
}

/* ---------- Модалки прав/данных пользователя ---------- */

.rights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
}

.rights-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.rights-item:hover {
  background: #fff;
  border-color: rgba(139, 92, 246, 0.35);
}

.rights-info {
  min-width: 0;
  flex: 1;
}

.rights-name {
  font-weight: 700;
  font-size: 0.94rem;
  word-break: break-word;
}

.rights-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: 2px;
  word-break: break-word;
}

/* ---------- Инвентарь Destiny 2: карточки оружия ---------- */

.weapon-card {
  display: flex;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  color: var(--text);
}
.weapon-card:hover {
  background: #fff;
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.weapon-equipped {
  background: linear-gradient(120deg, rgba(245, 158, 11, 0.10), rgba(249, 115, 22, 0.06));
  border-color: rgba(245, 158, 11, 0.35);
}
.weapon-equipped:hover {
  border-color: rgba(245, 158, 11, 0.6);
}

.weapon-icon-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
}
.weapon-equipped .weapon-icon-placeholder {
  width: 64px;
  height: 64px;
}

/* ---------- Инвентарь Destiny 2: слоты оружия ---------- */

.weapon-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* Секция почтмейстера (Lost Items / Special Deliveries) — выделяем,
   т.к. предметы там могут потеряться при переполнении. */
.weapon-slot-postmaster {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(120deg, rgba(245, 158, 11, 0.06), rgba(249, 115, 22, 0.04));
}
.weapon-slot-postmaster .weapon-slot-head {
  border-bottom-color: rgba(245, 158, 11, 0.25);
}
.weapon-slot-postmaster .weapon-slot-title {
  color: #d97706;
}

/* ---------- Инвентарь: широкий контейнер и рядовая сетка секций ---------- */

/* Инвентарь: полноширинный контейнер с минимальными отступами от краёв. */
.inv-container {
  padding-left: 4px;
  padding-right: 4px;
}

.main-content:has(.inv-container) {
  padding-left: 4px;
  padding-right: 4px;
}

/* Каркас инвентаря: единый грид из 4 колонок (3 персонажа + хранилище).
   Каждый РЯД грида — одна секция (Почтмейстер/Разное, Primary, Special,
   Heavy, Шлем, Наручи, Броня, Поножи, Классовый предмет) сразу для всех
   колонок, поэтому заголовки секций всегда на одной высоте без исключений:
   высоту ряда задаёт самая высокая ячейка, предметы не скрываются. */
.inv-grid {
  display: grid;
  grid-template-columns: 300px 300px 300px minmax(0, 1fr);
  gap: 2px;
}

.inv-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Карточка-секция внутри ячейки тянется на всю высоту ряда. */
.inv-cell > .weapon-slot,
.inv-cell > .inv-card-head {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

/* Заголовки карточек (персонаж / хранилище) — верхний ряд грида. */
.inv-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.inv-emblem {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.inv-vault-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex: none;
  font-size: 1.4rem;
  background: rgba(139, 92, 246, 0.15);
}

.inv-head-text {
  min-width: 0;
}

/* На экранах уже 1400px грид кладётся в один столбик. */
@media (max-width: 1399.98px) {
  .inv-grid {
    grid-template-columns: 1fr;
  }
}

/* Базовая сетка плиток: колонки ровно 50px, авто-подбор (без лимита в
   ряд), маленький одинаковый зазор 2px, плитки не растягиваются. */
.weapon-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 50px);
  justify-content: start;
  gap: 2px;
}

/* Отдельностоящая сетка (не внутри weapon-slot-body: хранилище, Разное,
   Почтмейстер) — свой отступ; в weapon-slot-body отступ даёт сам body. */
.weapon-slot > .weapon-slot-grid {
  padding: 10px;
}





.weapon-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.weapon-slot-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.weapon-slot-body {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 4px;
  padding: 10px;
  align-items: stretch;
}

/* Экипированное оружие — левая колонка */
.weapon-slot-equipped {
  display: grid;
  grid-auto-rows: auto;
  gap: 2px;
  min-width: 0;
}

/* Неэкипированное оружие — правая колонка (по 3 в ряд) */
.weapon-slot-other {
  min-width: 0;
}

.weapon-slot-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  min-height: 63px;
}

@media (max-width: 575.98px) {
  .weapon-slot-body {
    grid-template-columns: 1fr;
  }
}

/* ---------- Инвентарь Destiny 2: сетка иконок + модалка ---------- */

/* Сетка внутри weapon-slot-body наследует базовую .weapon-slot-grid. */

.weapon-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 50 / 63;
  padding: 0;
  border: 1px solid var(--border);
  /* Подложка прозрачная — предмет виден на фоне карточки. */
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
/* Иконка — квадратная 50x50, НЕ растягивается на высоту контейнера 50x63.
   Нижние ~13px контейнера — полоса под силу/стихию/бейдж количества. */
.weapon-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  flex: none;
}

/* Нижняя полоса 13px: сила (слева) и стихия (справа). */
.weapon-tile-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  height: 13px;
  padding: 0 3px;
  flex: none;
  pointer-events: none;
}

.weapon-tile-power {
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* Цветной индикатор стихии (defaultDamageType): 2=Arc, 3=Solar, 4=Void,
   5=Raid, 6=Stasis, 7=Strand. */
.weapon-tile-element {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
.weapon-tile-element[data-el="2"] { background: #69c4ff; }  /* Arc */
.weapon-tile-element[data-el="3"] { background: #ff9a3c; }  /* Solar */
.weapon-tile-element[data-el="4"] { background: #b28aff; }  /* Void */
.weapon-tile-element[data-el="5"] { background: #ffd166; }  /* Raid */
.weapon-tile-element[data-el="6"] { background: #8be9fd; }  /* Stasis */
.weapon-tile-element[data-el="7"] { background: #a6e3a1; }  /* Strand */

/* Перетаскивание предметов (drag & drop). */
.weapon-tile[draggable="true"] {
  cursor: grab;
}
.weapon-tile[draggable="true"]:active {
  cursor: grabbing;
}
.weapon-tile-dragging {
  opacity: 0.4;
}
.inv-cell.inv-drop-over > .weapon-slot,
.inv-cell.inv-drop-over > .inv-card-head {
  box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.7);
}

/* Поиск по инвентарю. */
.inv-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin-bottom: 12px;
}
.inv-search-input {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: none;
}
.inv-search-input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.inv-search-count {
  white-space: nowrap;
}

/* Подсветка при поиске. */
.weapon-tile-match {
  border-color: rgba(139, 92, 246, 0.95);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35),
              0 4px 14px rgba(139, 92, 246, 0.25);
  z-index: 1;
}
.weapon-tile-mismatch {
  opacity: 0.2;
  filter: saturate(0.35);
}

/* Тост о перемещении предмета. */
.inv-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 2000;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.inv-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.inv-toast-success {
  background: rgba(16, 120, 60, 0.95);
}

/* Заглушки для выравнивания высоты слотов: невидимые плитки той же
   высоты, что и weapon-tile (aspect-ratio: 1). Занимают место в сетке,
   но не отображаются как контент. */
.weapon-tile-placeholder {
  width: 100%;
  aspect-ratio: 50 / 63;
  visibility: hidden;
  pointer-events: none;
}

.weapon-tile:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
  z-index: 2;
}
.weapon-tile:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.7);
  outline-offset: 2px;
}

.weapon-tile-equipped {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(120deg, rgba(245, 158, 11, 0.16), rgba(249, 115, 22, 0.08));
}
.weapon-tile-equipped:hover {
  border-color: rgba(245, 158, 11, 0.8);
}

.weapon-tile-star {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.75rem;
  line-height: 1;
  color: #f59e0b;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

/* Бейдж количества — в нижней полосе (13px) контейнера 50x63, выводится
   только когда есть доп. информация (например, количество > 1). */
.weapon-tile-count {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 12px;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: rgba(8, 8, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  pointer-events: none;
}

.weapon-tile-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.06);
}

/* ---------- Коллекции Destiny 2 ---------- */

.coll-category {
  margin-bottom: 18px;
  padding: 18px;
}

.coll-category-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.coll-category-body {
  padding-top: 12px;
}


.coll-category-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.coll-category-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.coll-subgroup {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.coll-subgroup-title,
.coll-section-title {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.coll-subgroup-title {
  color: var(--text);
}

/* Кнопка-заголовок сворачиваемой секции/подсекции */
.coll-collapse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  margin: 0 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}
.coll-collapse-btn:hover {
  background: rgba(139, 92, 246, 0.08);
}
.coll-collapse-btn .coll-caret {
  display: inline-block;
  width: 14px;
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.coll-collapse-btn .coll-section-label {
  flex: 1 1 auto;
  min-width: 0;
}
.coll-collapse-btn .coll-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.coll-section {
  margin-bottom: 10px;
}
.coll-section-body,
.coll-subgroup-body {
  padding-left: 8px;
  padding-top: 2px;
}

/* Заголовок группы-сета внутри схлопнутой секции */
.coll-set-label {
  margin: 10px 0 6px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.coll-set-label:first-child {
  margin-top: 0;
}

.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.coll-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.coll-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.coll-tile:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
  z-index: 2;
}

/* Не собранный предмет — приглушённый, с «замком» */
.coll-tile:not(.coll-tile-obtained) {
  filter: grayscale(1) brightness(0.82);
}
.coll-tile:not(.coll-tile-obtained):hover {
  filter: grayscale(0.4) brightness(0.95);
}

.coll-tile-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.55);
  border-radius: 50%;
  pointer-events: none;
}
.coll-tile-lock::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  line-height: 1;
}

/* Заголовок категории как сворачиваемая кнопка */
.coll-category-head.coll-collapse-btn {
  gap: 12px;
  padding: 8px;
  margin: 0;
}
.coll-category-head.coll-collapse-btn .coll-category-title {
  flex: 1 1 auto;
}
.coll-category-head .coll-category-count {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
}

/* Переключатель «Только не собранные» */
.coll-filter-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.coll-filter-collapse-btn:hover {
  background: #fff;
  border-color: rgba(139, 92, 246, 0.35);
}
.coll-filter-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

/* Блок ручного обновления манифестов (только админы) */
.manifest-update-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.manifest-update-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.manifest-update-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.manifest-update-info strong {
  color: var(--text);
}

@media (max-width: 575.98px) {

  .coll-grid {
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 6px;
  }
  .coll-category {
    padding: 12px;
  }
}

/* ---------- Модалка оружия ---------- */

.weapon-modal-body {
  align-items: flex-start;
}

.weapon-modal-icon-wrap {
  flex: none;
}
.weapon-modal-icon {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}
.weapon-modal-name-ru {
  color: var(--text-muted);
  margin-bottom: 10px;
}
.weapon-modal-info {
  width: 100%;
  font-size: 0.85rem;
}
.weapon-modal-info td {
  padding: 4px 0;
  vertical-align: top;
}
.weapon-modal-info td:first-child {
  color: var(--text-muted);
  padding-right: 14px;
  white-space: nowrap;
}
.weapon-modal-info td:last-child {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* ---------- Катализатор в модалке коллекций ---------- */

/* Бейдж статуса катализатора на плитке оружия (угол): ⚡ / ✓ / ✕ */
.coll-tile-catalyst {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  min-width: 16px;
  height: 16px;
  padding: 0 2px;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.4);
  pointer-events: none;
}

/* Катализатор освоен — зелёная галочка */
.coll-tile-catalyst-done {
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
}

/* Катализатор есть у оружия, но не получен игроком — красный крестик */
.coll-tile-catalyst-missing {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* Полоска прогресса катализатора внизу плитки */
.coll-tile-catalyst-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  z-index: 3;
  background: rgba(15, 23, 42, 0.22);
  pointer-events: none;
}
.coll-tile-catalyst-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #0ea5e9);
  transition: width 0.3s ease;
}
.coll-tile:not(.coll-tile-obtained) .coll-tile-catalyst-progress {
  background: rgba(15, 23, 42, 0.18);
}
.coll-tile:not(.coll-tile-obtained) .coll-tile-catalyst-bar {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.55), rgba(14, 165, 233, 0.55));
}

.catalyst-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(14, 165, 233, 0.06));
}

.catalyst-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.catalyst-icon-wrap {
  flex: none;
}
.catalyst-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

.catalyst-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.catalyst-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text);
  word-break: break-word;
}

.catalyst-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 700;
}
.catalyst-status.is-complete { color: #22c55e; }
.catalyst-status.is-progress { color: #f59e0b; }
.catalyst-status.is-missing  { color: var(--text-muted); }

.catalyst-desc {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}

.catalyst-quests {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalyst-quest {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.catalyst-quest-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.catalyst-quest-count {
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}

.catalyst-bar {
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}
.catalyst-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #0ea5e9);
  transition: width 0.3s ease;
}

.catalyst-quest-empty {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
}