/* Prioridad 4 · Fase 4.6 · Comunidad, personajes y clanes · v2.50.86 */

/* Los hijos de flex/grid con contenido dinámico deben poder encogerse. */
.community-layout > *,
.community-grid > *,
.community-games-grid > *,
.community-rankings > *,
.public-character-grid > *,
.public-character-card > *,
.public-character-card__head > *,
.public-character-profile__layout > *,
.character-community-stats > *,
.character-public-facts > *,
.clan-grid > *,
.clan-card > *,
.clan-profile > *,
.clan-directory-layout > *,
.clan-ranking-grid > *,
.clan-context-choice-grid > *,
.clan-member-grid > *,
.clan-poll-grid > *,
.clan-board-grid > *,
.clan-alliance-grid > *,
.clan-diplomacy-columns > *,
.clan-thread-layout > *,
.clan-form-two > *,
.clan-request-card > *,
.clan-event-card > * { min-width: 0; }

/* Textos variables: alias, nombres de personaje/clan, servidor e idioma. */
.public-character-card h2,
.public-character-card h3,
.public-character-profile__hero h1,
.clan-card h2,
.clan-card h3,
.clan-profile h1,
.clan-profile h2,
.clan-page-hero h1,
.clan-page-hero h2,
.clan-member-card h3,
.clan-request-card h3,
.clan-event-card h3,
.clan-board-card h3,
.clan-context-choice__body,
.clan-context-choice__clan,
.clan-member-card__body,
.clan-request-card__identity,
.event-meta,
.clan-history-row,
.character-meta,
.clan-meta { overflow-wrap: anywhere; }

/* Medios y emblemas nunca amplían su contenedor. */
.public-character-card img,
.public-character-profile__avatar img,
.clan-card img,
.clan-profile img,
.clan-member-card img,
.clan-context-choice img,
.clan-alliance-card img,
.community-game-card img { max-width: 100%; height: auto; }

/* Carriles internos para subnavegaciones densas. */
.clan-nav,
.clan-subnav,
.subnav,
.profile-tabs {
  max-width: 100%;
  scrollbar-width: thin;
}

/* Formularios y acciones no pueden imponer anchuras superiores al viewport. */
.clan-form-modern input,
.clan-form-modern select,
.clan-form-modern textarea,
.public-character-filters input,
.public-character-filters select,
.filter-panel input,
.filter-panel select { max-width: 100%; min-width: 0; }

@media (max-width: 1024px) {
  .community-grid,
  .community-games-grid,
  .community-rankings,
  .clan-ranking-grid,
  .clan-alliance-grid,
  .clan-context-choice-grid,
  .clan-member-grid,
  .clan-poll-grid,
  .clan-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .clan-diplomacy-columns,
  .clan-thread-layout,
  .public-character-profile__layout,
  .clan-directory-layout { grid-template-columns: minmax(0, 1fr); }

  .clan-profile,
  .clan-profile.compact { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); }

  .clan-page-hero,
  .public-characters-hero,
  .community-hero { min-width: 0; }
}

@media (max-width: 760px) {
  .community-grid,
  .community-games-grid,
  .community-rankings,
  .public-character-grid,
  .character-community-stats,
  .clan-grid,
  .clan-ranking-grid,
  .clan-alliance-grid,
  .clan-context-choice-grid,
  .clan-member-grid,
  .clan-poll-grid,
  .clan-board-grid,
  .dashboard-cards { grid-template-columns: minmax(0, 1fr); }

  .public-character-filters,
  .filter-panel,
  .clan-form-two,
  .form-row { grid-template-columns: minmax(0, 1fr); }

  .clan-nav,
  .clan-subnav,
  .subnav,
  .profile-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .4rem;
  }

  .clan-nav a,
  .clan-subnav a,
  .subnav a,
  .profile-tabs a { flex: 0 0 auto; white-space: nowrap; min-height: 42px; }

  .clan-request-card,
  .clan-member-card,
  .clan-event-card,
  .clan-board-card { width: 100%; }

  .clan-request-card__actions,
  .clan-member-card__actions,
  .clan-form-actions,
  .character-main-actions,
  .card-actions,
  .filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .55rem;
  }

  .clan-request-card__actions > *,
  .clan-member-card__actions > *,
  .clan-form-actions > *,
  .character-main-actions > *,
  .filter-actions > * { min-width: 0; }

  .clan-profile,
  .clan-profile.compact,
  .public-character-profile__hero { grid-template-columns: minmax(0, 1fr); text-align: center; }

  .clan-profile > img,
  .public-character-profile__avatar { width: min(140px, 45vw); margin-inline: auto; }

  .clan-meta,
  .character-public-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .clan-card { grid-template-columns: 64px minmax(0, 1fr); gap: .75rem; padding: .85rem; }
  .clan-card > img { width: 64px; }

  .public-character-card__head,
  .clan-member-card,
  .clan-request-card { min-width: 0; }

  .clan-meta,
  .character-public-facts { grid-template-columns: minmax(0, 1fr); }

  .clan-request-card__actions,
  .clan-member-card__actions,
  .clan-form-actions,
  .character-main-actions,
  .card-actions,
  .filter-actions { flex-direction: column; }

  .clan-request-card__actions .button,
  .clan-member-card__actions .button,
  .clan-form-actions .button,
  .character-main-actions .button,
  .card-actions .button,
  .filter-actions .button,
  .filter-actions button { width: 100%; }

  .clan-page-hero,
  .public-characters-hero,
  .community-hero { padding-inline: 1rem; }
}
