/* Clan Hub and Clan Detail composition.

   The `cln-` prefix covers what the two Clan screens need beyond the shared
   `sov-` vocabulary: the landscape strip, the four highlight categories, the
   standing meters and the activity pulse. The supplied references carried
   these as inline `style` attributes; they are named classes here so the
   templates stay legible and the two screens share one definition.

   Requires ds_tokens.css, ds_patterns.css, ds_stats_shared.css. */

/* ---------- Clan Landscape ---------- */

.cln-landscape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  padding: 0.9rem 1.3rem;
}

.cln-landscape-label {
  color: var(--gold-300);
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cln-landscape-stat {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding-left: 1.2rem;
  border-left: 1px solid rgba(213, 177, 101, 0.2);
}

.cln-landscape-value {
  color: #fff6dd;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.cln-landscape-note {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

/* ---------- Clan Highlights ---------- */

.cln-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.cln-highlight-helper {
  margin: 0;
  padding: 0.7rem 1rem 0;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.76rem;
  line-height: 1.4;
}

.cln-highlight-list {
  display: grid;
  padding: 0.4rem 0 0.6rem;
}

.cln-highlight-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(213, 177, 101, 0.1);
  color: inherit;
  text-decoration: none;
}

.cln-highlight-row:last-child {
  border-bottom: 0;
}

.cln-highlight-row:hover,
.cln-highlight-row:focus-visible {
  background: rgba(255, 231, 158, 0.05);
}

.cln-highlight-empty {
  margin: 0;
  padding: 0.9rem 1rem 1.1rem;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

/* The monogram square doubles as the Clan's icon slot on both screens. */
.cln-crest {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  border: 1px solid rgba(213, 177, 101, 0.4);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(85, 48, 14, 0.85), rgba(9, 19, 33, 0.92));
  color: var(--gold-200);
  font-family: var(--font-title);
  font-size: 0.66rem;
  font-weight: 800;
}

.cln-highlight-ident {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.cln-highlight-name {
  display: block;
  overflow: hidden;
  color: #fff6dd;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cln-highlight-sub {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.cln-highlight-metric {
  display: grid;
  gap: 0;
  text-align: right;
}

.cln-metric-value {
  color: var(--gold-200);
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cln-metric-value--first {
  color: var(--gold-100);
  font-size: 1.25rem;
  text-shadow: 0 0 12px rgba(255, 224, 160, 0.5);
}

.cln-metric-label {
  color: var(--text-soft);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- meters ---------- */

.cln-meter {
  display: block;
  overflow: hidden;
  max-width: 14rem;
  height: 0.3rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}

.cln-meter > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
}

/* A dot rather than a fill: Elo has no meaningful zero, so the reference
   places each Clan across the spread of the values on screen instead of
   implying a proportion of some maximum. */
.cln-scale {
  position: relative;
  display: block;
  max-width: 14rem;
  height: 0.3rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}

.cln-scale > span {
  position: absolute;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gold-200);
  box-shadow: 0 0 6px rgba(255, 224, 160, 0.7);
  transform: translate(-50%, -50%);
}

/* ---------- Where This Clan Stands ---------- */

.cln-standing-intro {
  margin: 0;
  padding: 0.7rem 1.1rem 0;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.78rem;
}

.cln-standing {
  display: grid;
  padding: 0.5rem 0 0.9rem;
}

.cln-standing-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 1.2rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid rgba(213, 177, 101, 0.1);
}

.cln-standing-row:last-child {
  border-bottom: 0;
}

.cln-standing-label {
  color: #fff6dd;
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.cln-standing-note {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.cln-standing-meter {
  overflow: hidden;
  height: 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}

.cln-standing-meter > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
}

/* An unmeasured dimension reads as unmeasured: a dashed empty track, never a
   full-width bar and never a bar pinned to last place. */
.cln-standing-meter--unavailable {
  border: 1px dashed rgba(213, 177, 101, 0.3);
  background: transparent;
}

/* ---------- secondary rails ---------- */

.cln-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cln-mini-list {
  display: grid;
  padding: 0.4rem 0 0.6rem;
}

.cln-mini-row {
  display: grid;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(213, 177, 101, 0.1);
  color: inherit;
  text-decoration: none;
}

.cln-mini-row:last-child {
  border-bottom: 0;
}

.cln-mini-row--rated {
  grid-template-columns: 1.4rem auto minmax(0, 1fr) auto;
}

.cln-mini-row--activity {
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
}

.cln-mini-place {
  color: var(--gold-400);
  font-family: var(--font-title);
  font-size: 0.78rem;
}

.cln-avatar {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(230, 195, 123, 0.28);
  border-radius: 50%;
  background: rgba(9, 20, 35, 0.9);
  color: #f4d28a;
  font-family: var(--font-title);
  font-size: 0.6rem;
  font-weight: 800;
}

.cln-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cln-mini-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff6dd;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cln-mini-ident {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.cln-mini-detail {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.cln-mini-when {
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.cln-mini-elo {
  color: var(--gold-200);
  font-family: var(--font-title);
  font-variant-numeric: tabular-nums;
}

.cln-caveat {
  margin: 0;
  padding: 0.6rem 1.1rem 0.9rem;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.72rem;
}

/* ---------- Activity Pulse ---------- */

.cln-pulse {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
}

.cln-pulse-row {
  display: grid;
  gap: 0.3rem;
}

.cln-pulse-head {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.cln-pulse-head strong {
  color: #fff6dd;
  font-variant-numeric: tabular-nums;
}

.cln-pulse-meter {
  overflow: hidden;
  height: 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}

.cln-pulse-meter > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gold-300);
}

.cln-pulse-meter--online > span {
  background: var(--status-win);
}

.cln-pulse-meter--recent > span {
  background: var(--gold-400);
}
