/* "Our servers": the Debug Den and Debug Breakout (Discord) and the Debug Lair (TeamSpeak), live from
   Dark's /api/community feed, drawn by the script in index.html. */
.section__community {
  padding: 2rem 0 6rem;
}

.community__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.8rem;
}

.community__description {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 620px;
  margin: 0 auto;
}

.community__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

/* Each card is five rows (head, blurb, stats, right now, actions). With subgrid the cards share those
   rows, so every row starts at the same height in all three cards whatever the text length. */
.server-card {
  --sc: #5865f2; /* Discord blurple; the Lair uses purple */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.4rem 1.4rem;
  border-top: 3px solid var(--sc) !important;
}
@supports (grid-template-rows: subgrid) {
  .server-card {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 1rem;
  }
  .server-card__actions {
    align-self: end;
  }
}
.server-card__now {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}
.server-card--lair {
  --sc: #8b5cf6;
}

.server-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.server-card__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--sc);
  font-size: 1.4rem;
}
.server-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.server-card__type {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sc);
}
.server-card__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.server-card__blurb {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.server-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.server-card__stat strong {
  color: var(--text-primary);
  font-weight: 600;
}
.server-card__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: #3ecf8e;
  vertical-align: 1px;
}
.server-card__dot--off {
  background: var(--text-muted);
}
.server-card__dot--down {
  background: #ef4444;
}

/* The Lair: who's on, and the radio. */
.server-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.server-card__row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr;
  gap: 0.6rem;
}
.server-card__channel {
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.server-card__people {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.server-card__away {
  color: var(--text-tertiary);
}
.server-card__empty,
.server-card__song {
  color: var(--text-tertiary);
  font-size: 0.88rem;
  margin: 0;
}
.server-card__song i {
  color: var(--sc);
  margin-right: 0.35rem;
}

.server-card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding-top: 0.25rem;
}
.server-card__actions .btn {
  flex: 1 1 auto;
}
.server-card__small {
  flex: 1 1 100%;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}
.server-card__small code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.server-card__small a {
  color: var(--accent-strong);
}

@media (max-width: 520px) {
  .server-card__row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
