/* ── Mitglieder / Struktur ── */

.page-shell--members {
  max-width: min(1680px, 96vw);
  padding-left: clamp(12px, 2vw, 28px);
  padding-right: clamp(12px, 2vw, 28px);
}

.page-header {
  margin-bottom: 28px;
}

.page-tag {
  margin-bottom: 6px;
}

.page-header h1 {
  margin-bottom: 4px;
}

.structure-root {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.structure-unit-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Unit hero */
.unit-hero {
  position: relative;
  padding: 24px 0 8px;
  text-align: center;
}

.unit-hero-inner {
  position: relative;
  z-index: 1;
}

.unit-hero-badge {
  display: inline-flex;
  margin-bottom: 10px;
}

.unit-hero-badge .logo-stack--card {
  --logo-size: 100px;
}

.unit-hero h2 {
  margin: 0 0 4px;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  text-shadow: 0 0 32px var(--accent-glow);
}

.unit-hero p {
  margin: 0;
  max-width: 560px;
  margin-inline: auto;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Command bar */
.command-bar {
  display: flex;
  justify-content: center;
}

.command-bar-inner {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: min(1200px, 100%);
}

.command-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  text-align: left;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.03) 100%);
  border: 1px solid var(--border-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 180, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.3);
}

.command-card-label {
  flex-shrink: 0;
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.command-card-name {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-bright);
}

.command-card-name.is-empty {
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
}

/* Teams grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background:
    linear-gradient(165deg, rgba(212, 175, 55, 0.1) 0%, transparent 40%),
    rgba(14, 11, 8, 0.45);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 180, 0.07),
    0 10px 36px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 180, 0.12),
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 32px var(--accent-glow);
}

.team-card-watermark {
  position: absolute;
  top: -8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  color: rgba(212, 175, 55, 0.07);
  pointer-events: none;
  user-select: none;
}

.team-card-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.team-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-bright);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.06));
  border: 1px solid var(--border-glass-strong);
  box-shadow: 0 0 20px var(--accent-glow);
}

.team-card-titles {
  min-width: 0;
}

.team-card-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 2px;
}

.team-card-header h3 {
  margin: 0;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-bright);
}

.team-roster {
  list-style: none;
  margin: 0;
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.roster-row:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.22);
}

.roster-role {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
}

.roster-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  text-align: right;
  white-space: nowrap;
}

.roster-avatar,
.command-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}

.roster-name.is-empty {
  font-weight: 400;
  color: var(--text-dim);
  font-style: italic;
}

.member-display-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.member-name-text {
  flex-shrink: 0;
}

.member-callsign {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.28);
  vertical-align: middle;
}

.roster-name.member-profile-trigger,
.command-card-name.member-profile-trigger {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.member-profile-callsign {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.member-profile-trigger {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: right;
  transition: color 0.2s ease, transform 0.2s ease;
}

.command-card .member-profile-trigger {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  width: auto;
  max-width: 100%;
}

.member-profile-trigger:hover {
  color: var(--gold-bright);
  transform: scale(1.02);
}

.member-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 24px;
}

.member-profile-modal[hidden] {
  display: none !important;
}

.member-profile-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.member-profile-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 32px 28px 28px;
  text-align: center;
  border-radius: var(--radius-lg);
}

.member-profile-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.member-profile-close:hover {
  color: var(--gold-bright);
}

.member-profile-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 20px;
}

.member-profile-avatar {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-glass-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 32px var(--accent-glow);
}

.member-profile-fallback {
  width: min(200px, 50vw);
  height: min(200px, 50vw);
  border-radius: 50%;
  border: 2px dashed var(--border-glass-strong);
  background: rgba(212, 175, 55, 0.06);
}

.member-profile-panel h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.structure-teams-empty,
.structure-empty {
  padding: 48px 28px;
  text-align: center;
  color: var(--text-dim);
  border-radius: var(--radius-lg);
}

.nav-links a.active {
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.08);
}

@media (max-width: 1100px) {
  .teams-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

@media (max-width: 640px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }

  .command-bar-inner {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .command-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: none;
  }

  .command-card-name {
    justify-content: flex-start;
    width: 100%;
  }

  .roster-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .roster-role {
    white-space: normal;
  }

  .roster-name {
    justify-self: start;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
  }

  .roster-name.member-profile-trigger {
    justify-content: flex-start;
  }

  .unit-hero {
    padding: 20px 0 4px;
  }
}
