/* Страница клана (public/clan.html) — дополнения поверх общей светлой темы
   hero.css (см. комментарий в clan.html: та же тема, что у страницы героя,
   переиспользуется как тема сайта в целом). Здесь — то, чего в hero.css нет:
   баннер клана, таблица состава, карточка "Следующий бой". */

/* ---------- Карточка клана (лево-верх) ---------- */

.cp-identity-top { display: flex; gap: 14px; align-items: flex-start; }
.cp-crest {
  width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(160deg, #1a2036, var(--hh-navy));
  display: flex; align-items: center; justify-content: center; font-size: 2rem; overflow: hidden;
}
.cp-crest img { width: 100%; height: 100%; object-fit: cover; }
.cp-name-row { display: flex; align-items: center; gap: 6px; }
.cp-name-row h2 { margin: 0; font-size: 1.25rem; }
.cp-edit-btn {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--hh-border); background: #fff;
  font-size: 0.7rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.cp-tagline { font-size: 0.82rem; color: var(--hh-muted); margin: 2px 0 8px; font-style: italic; }

.cp-fact-row { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--hh-text); margin: 5px 0; }
.cp-fact-row .icon { width: 18px; text-align: center; }

.cp-code-block { margin: 12px 0; }
.cp-code-label { font-size: 0.72rem; color: var(--hh-muted); margin-bottom: 4px; }
.cp-code-row { display: flex; gap: 6px; }
.cp-code-value {
  flex: 1; background: #fafbfc; border: 1px dashed var(--hh-border); border-radius: 8px;
  padding: 7px 10px; font-size: 0.85rem; color: var(--hh-muted); font-family: monospace;
}
.cp-code-copy {
  width: 34px; border-radius: 8px; border: 1px solid var(--hh-border); background: #fff; cursor: pointer;
}

.cp-join-btn {
  margin-top: 12px; width: 100%; padding: 11px; border-radius: 10px; border: none;
  background: var(--hh-red); color: #fff; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cp-join-btn:hover { background: var(--hh-red-dark); }

.cp-own-badge {
  margin-top: 12px; padding: 10px; border-radius: 10px; background: #f4f5f8; border: 1px solid var(--hh-border);
  text-align: center; font-size: 0.85rem; color: var(--hh-muted);
}

/* Кнопки "Управлять" / "Выйти из клана" / "Распустить клан" — сразу под
   плашкой "Ты в этом клане" (item 4/6/7, автор, 23.09.2026: обе кнопки
   "неяркого цвета"). .hh-btn-ghost уже даёт нужный неброский вид (см.
   hero.css), здесь только раскладка в столбик на всю ширину карточки. */
.cp-manage-btn, .cp-danger-btn {
  display: block; width: 100%; margin-top: 8px; text-align: center;
}
.cp-manage-btn { background: var(--hh-navy); border-color: var(--hh-navy); color: #fff; }

/* ---------- Меню действий над участником (item 5, три точки) ---------- */
.cp-kick-wrap { position: relative; display: inline-block; }
.cp-kick-dots {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--hh-border); background: #fff;
  cursor: pointer; font-weight: 700; color: var(--hh-muted); line-height: 1;
}
.cp-kick-dots:hover { background: #f4f5f8; }
.cp-kick-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  background: #fff; border: 1px solid var(--hh-border); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12); padding: 4px; min-width: 150px;
}
.cp-kick-confirm {
  display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 6px;
  border: none; background: none; color: var(--hh-red-dark); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.cp-kick-confirm:hover { background: #fde8e8; }

.cp-join-form { margin-top: 10px; }
.cp-join-form input, .cp-join-form select {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--hh-border); display: block;
}

/* ---------- Баннер клана (заглушка вместо рисованной арт-заставки) ---------- */

.cp-banner {
  position: relative;
  border-radius: 14px;
  min-height: 220px;
  background: radial-gradient(circle at 30% 20%, #2a3050, var(--hh-navy) 65%);
  border: 1px solid var(--hh-border);
  box-shadow: var(--hh-shadow);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  overflow: hidden;
}
.cp-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 14px);
}

/* ---------- Блок "герой клана" (п.8) — портрет + суммарные характеристики,
   заменяет прежние карточки Босса/Капо (см. renderBanner в clan.js). ---------- */

.cp-hero-banner { align-items: center; min-height: 240px; }
.cp-hero-wrap {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
}
.cp-hero-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(18, 23, 42, 0.8); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
  padding: 8px 12px; color: #fff; min-width: 78px;
}
.cp-hero-stat-icon { font-size: 1.1rem; }
.cp-hero-stat-label { font-size: 0.62rem; color: #ffd166; }
.cp-hero-stat-value { font-size: 1rem; font-weight: 700; }
.cp-hero-portrait { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cp-hero-portrait-img {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #1a2036, var(--hh-navy));
  border: 3px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.cp-hero-portrait-img img { width: 100%; height: 100%; object-fit: cover; }
.cp-hero-portrait-fallback { line-height: 1; }
.cp-hero-name { color: #fff; font-weight: 700; font-size: 0.95rem; text-align: center; }
.cp-hero-edit-link {
  font-size: 0.72rem; color: #ffd166; text-decoration: none; background: rgba(18, 23, 42, 0.8);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 3px 8px;
}
.cp-hero-edit-link:hover { text-decoration: underline; }

/* ---------- Таблица состава ---------- */

.cp-members-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cp-search {
  font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--hh-border);
  font-size: 0.82rem; width: 200px;
}

.cp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cp-table th {
  text-align: left; color: var(--hh-muted); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.02em; padding: 6px 8px; border-bottom: 1px solid var(--hh-border);
}
.cp-table td { padding: 9px 8px; border-bottom: 1px solid var(--hh-border); vertical-align: middle; }
.cp-table tr:last-child td { border-bottom: none; }
.cp-player-cell { display: flex; align-items: center; gap: 8px; }
.cp-player-cell-link { cursor: pointer; border-radius: 8px; margin: -4px; padding: 4px; }
.cp-player-cell-link:hover { background: #f4f5f8; }
.cp-player-name { text-decoration: none; }
.cp-player-cell-link:hover .cp-player-name { text-decoration: underline; }
.cp-player-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #f4f5f8; border: 1px solid var(--hh-border);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0;
}
.cp-player-name { font-weight: 600; }
.cp-player-id { font-size: 0.68rem; color: var(--hh-muted); }
.cp-role-pill {
  display: inline-flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; background: #fde8e8; color: var(--hh-red-dark);
}
.cp-role-select { font: inherit; font-size: 0.78rem; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--hh-border); }
.cp-online-cell { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--hh-muted); }
.cp-online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hh-green); }
.cp-online-dot.off { background: #c7cbd4; }

.cp-show-all-btn {
  display: block; width: 100%; margin-top: 10px; padding: 8px; border-radius: 8px;
  border: 1px solid var(--hh-border); background: #fafbfc; color: var(--hh-text); cursor: pointer; font: inherit; font-size: 0.82rem;
}

/* ---------- Следующий бой клана ---------- */

.cp-nextbattle-empty { text-align: center; padding: 10px 0; }
.cp-nextbattle-empty .hh-muted { display: block; margin-bottom: 10px; }

.cp-matchup { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cp-matchup-side { text-align: center; flex: 1; }
.cp-matchup-side .crest-mini {
  width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 4px; background: var(--hh-navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.cp-matchup-side .name { font-size: 0.78rem; font-weight: 700; }
.cp-matchup-vs { font-weight: 800; color: var(--hh-red); }
.cp-countdown { text-align: center; font-size: 0.8rem; color: var(--hh-muted); margin-bottom: 10px; }
.cp-nextbattle-link {
  display: block; text-align: center; padding: 9px; border-radius: 8px; background: var(--hh-red);
  color: #fff; font-weight: 700; font-size: 0.85rem; text-decoration: none;
}
.cp-nextbattle-link:hover { background: var(--hh-red-dark); }

/* ТЗ «Классик», п.4: список участников — со скроллом, шапка таблицы остаётся на месте. */
.cp-members-scroll { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 140, 60, 0.45) transparent; }
.cp-members-scroll::-webkit-scrollbar { width: 6px; }
.cp-members-scroll::-webkit-scrollbar-thumb { background: rgba(255, 140, 60, 0.45); border-radius: 3px; }
.cp-members-scroll .cp-table th { position: sticky; top: 0; z-index: 1; background: var(--hh-card-solid, #1a120d); }
.cp-player-cell-link { cursor: pointer; }
.cp-player-cell-link:hover .cp-player-name { text-decoration: underline; }

/* ТЗ «Классик» №2: список бойцов — 10 строк видно, остальные в прокрутке (п.27); блок «Рейтинг» — ссылка (п.11) */
.cp-members-scroll { max-height: 600px; }
.cp-player-avatar { cursor: pointer; overflow: hidden; }
.cp-player-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
a.cp-rating-link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
a.cp-rating-link:hover { border-color: rgba(255, 190, 90, 0.8); transform: translateY(-1px); }

/* ---------- ТЗ 09.10.2026, п.6: список участников — всегда справа вверху, без CSS-колонок ----------
   Раньше карточки текли в две CSS-колонки и положение/отрисовка списка зависели от высоты соседей.
   Теперь явная сетка (как в магазине): слева клан, баннер, статистика; справа — участники, бой, активность. */
html.embedded main.cl-main { column-count: auto; column-gap: 0; padding-bottom: 60px; }
html.embedded main.cl-main > section#clanApp { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) var(--hero-gap) minmax(0, 1fr); }
html.embedded main.cl-main #clanApp > .hh-grid { display: contents; }
html.embedded main.cl-main #clanApp .hh-col { display: block; min-width: 0; }
html.embedded main.cl-main #clanApp .hh-col-left { grid-column: 1; grid-row: 1 / span 2; }
html.embedded main.cl-main #clanApp .hh-col-center { grid-column: 3; grid-row: 1; }
html.embedded main.cl-main #clanApp .hh-col-right { grid-column: 3; grid-row: 2; }
html.embedded main.cl-main #clanApp .hh-card, html.embedded main.cl-main #clanApp .cp-banner { margin-bottom: 14px; }
@media (max-width: 900px) {
  html.embedded main.cl-main > section#clanApp { grid-template-columns: 1fr; }
  html.embedded main.cl-main #clanApp .hh-col-left, html.embedded main.cl-main #clanApp .hh-col-center, html.embedded main.cl-main #clanApp .hh-col-right { grid-column: 1; grid-row: auto; }
}
/* Таблица состава должна помещаться в карточку: компактнее и с горизонтальной прокруткой на узких окнах */
.cp-members-scroll { overflow-x: auto; max-height: min(600px, calc(100vh - 230px)); }
.cp-table { min-width: 440px; }
.cp-table th, .cp-table td { padding-left: 6px; padding-right: 6px; }
.cp-table td:last-child, .cp-table th:last-child { width: 34px; padding-right: 2px; }
.cp-role-select { max-width: 86px; }
@media (max-width: 1500px) { .cp-player-id { display: none; } }
@media (max-width: 1500px) { .cp-online-cell { font-size: 0; gap: 0; } .cp-online-dot { width: 11px; height: 11px; } .cp-table { min-width: 0; } }
@media (max-width: 1500px) {
  .cp-table { font-size: 0.8rem; } .cp-table th { font-size: 0.6rem; letter-spacing: 0; }
  .cp-table th, .cp-table td { padding-left: 4px; padding-right: 4px; }
  .cp-role-select { max-width: 70px; font-size: 0.72rem; padding: 3px 2px; } .cp-player-avatar { width: 26px; height: 26px; }
  .cp-role-pill { padding: 2px 5px; }
}


/* ---------- Блоки «Статистика боёв» и «Рейтинг клана» — как на главной странице героя (hub.css, hm-battle / hm-rating) ---------- */
.cl-hm { --u: 1px; margin-bottom: 14px; }
.cl-hm .ui-card-head { height: 45px; padding: 0 12px; font-size: 19px; gap: 14px; }
.cl-hm .ui-card-head .ic { width: 31px; height: 31px; }
.cl-hm .ui-card-body { margin: 0 1px 1px; border-radius: 8px; }
.cl-hm .hm-battle-row, .hm-battle-row.ui-card-body { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 0 10px !important; min-height: 140px; }
.hm-battle-row > div { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hm-battle-row > div + div::before { content: ""; position: absolute; left: 0; top: 4%; bottom: 4%; width: 1px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent); }
.hm-battle-row .ic { width: 34px; height: 34px; filter: drop-shadow(0 0 7px rgba(255, 170, 60, 0.45)); }
.hm-battle-row span { margin-top: 7px; font-size: 16px; font-weight: 500; color: #e9dccb; }
.hm-battle-row b { margin-top: 2px; font-family: var(--f-num, inherit); font-size: 42px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hm-battle-row b.t { color: #ffc24a; text-shadow: 0 0 14px rgba(255, 170, 40, 0.5); }
.hm-battle-row b.win { color: #52e07a; text-shadow: 0 0 14px rgba(60, 220, 110, 0.5); }
.hm-battle-row b.loss { color: #ff5a6e; text-shadow: 0 0 14px rgba(255, 70, 90, 0.5); }
.hm-rating-row.ui-card-body { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 0 22px !important; text-align: center; cursor: pointer; }
.hm-rating-row > div { position: relative; }
.hm-rating-row > div + div::before { content: ""; position: absolute; left: 0; top: 4%; bottom: 4%; width: 1px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent); }
.hm-rating-row span { display: block; font-size: 16px; color: #e9dccb; }
.hm-rating-row b { display: block; margin-top: 8px; font-size: 24px; font-weight: 400; color: #fff; line-height: 1; }
.cl-hm .hm-rating-foot {
  display: flex; align-items: center; justify-content: space-between; margin: 0 1px; padding: 14px 16px 14px 17px; color: #bfb2a2; text-decoration: none; font-size: 14.5px;
  border-top: 1px solid rgba(255, 130, 50, 0.3); box-shadow: 0 -1px 10px rgba(255, 110, 40, 0.18); transition: color 0.2s, background 0.2s;
}
.cl-hm .hm-rating-foot .ic { width: 18px; height: 18px; color: #fff; transition: transform 0.2s; }
.cl-hm .hm-rating-foot:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.cl-hm .hm-rating-foot:hover .ic { transform: translateX(4px); }


/* ---------- 5 героев клана в ряд (ТЗ 12.10.2026, п.10) ---------- */
.cp-hero-banner { min-height: 0; padding: 14px 8px 10px; overflow: hidden; }
.cp-fig-row { display: flex; align-items: flex-end; justify-content: center; width: 100%; padding-top: 6px; }
.cp-fig { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 0; max-width: 118px; margin: 0 -6px; text-decoration: none; color: #fff; transition: transform 0.2s; }
.cp-fig:hover { transform: translateY(-4px); }
.cp-fig-img { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 170px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.cp-fig-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cp-fig-emoji { font-size: 2.4rem; line-height: 1; padding-bottom: 20px; }
.cp-fig-name { margin-top: 4px; font-size: 0.76rem; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px #000; }
.cp-fig-power { font-size: 0.66rem; color: #ffd166; }
.cp-fig.boss { z-index: 2; max-width: 138px; }
.cp-fig.boss .cp-fig-img { height: 205px; filter: drop-shadow(0 0 14px rgba(255, 176, 46, 0.55)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.cp-fig.boss .cp-fig-name { color: #ffd166; font-size: 0.84rem; }
