/* =========================================================================
   SECCIONES DEL SITIO CON EL ESTILO DE LA PORTADA
   Toda tarjeta de página (.card con .card-header) se ve como la portada:
   el título va afuera, en blanco sobre el fondo oscuro con la barrita
   celeste, y el contenido (.card-body) en una superficie clara sin la
   franja azul. Se hace aquí, en un solo lugar, sin tocar cada plantilla.

   No se tocan las cabeceras que son un diseño propio: el banner del perfil
   (.profile-header), el encabezado de la ficha de grupo (.group-hero) y las
   tarjetas de cada vestíbulo (.lobby-header).
   ========================================================================= */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

/* ---- título afuera ---- */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header {
  position: relative;
  margin: 0 0 0.6rem;
  padding: 0 0.2rem 0 0.95rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  border-radius: 4px;
  background: #38bdf8;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .bi {
  color: #38bdf8;
  font-size: 1.1rem;
}

/* textos secundarios y enlaces dentro del título, legibles sobre oscuro */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .text-muted {
  color: #94a3b8 !important;
  font-family: var(--font-sans, system-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header a:not(.btn) {
  color: #93c5fd;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header a:not(.btn):hover {
  color: #fff;
}

/* botones y etiquetas del título: tamaño y fuente normales */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .btn,
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .ranking-tag {
  font-family: var(--font-sans, system-ui);
  letter-spacing: 0.02em;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .btn {
  font-size: 0.78rem;
  text-transform: none;
}

/* ---- contenido en superficie clara ---- */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-body,
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .list-group,
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .table-responsive {
  overflow: hidden;
  border: 1px solid rgba(148, 197, 255, 0.14);
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 575.98px) {
  .card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header {
    font-size: 1.25rem;
  }
}

/* Descargas traía su propio marco y franja de color con !important */
.downloads-page .downloads-shell {
  overflow: visible;
  border: 0;
  background: transparent !important;
  box-shadow: none;
}

.downloads-page .downloads-shell > .card-header {
  padding: 0 0.2rem 0 0.95rem;
  border-bottom: 0;
  background: none !important;
  color: #fff !important;
  font-weight: 800;
}

/* ---- títulos de página: grandes, en minúscula normal, sin barrita ---- */
.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header,
.downloads-page .downloads-shell > .card-header {
  padding: 0 0.1rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  text-transform: none;
}

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header::before { content: none; }

.card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header .bi {
  font-size: 1.4rem;
}

@media (max-width: 575.98px) {
  .card:has(> .card-header:not(.profile-header):not(.group-hero):not(.lobby-header)) > .card-header,
  .downloads-page .downloads-shell > .card-header { font-size: 1.6rem; }
}

/* secciones dentro de una ficha: un escalón más chicas que el título de página */
.group-page .card:has(> .card-header) > .card-header { font-size: 1.5rem !important; }

/* =========================================================================
   NOTICIAS (/noticias, /noticias/{slug}) Y AVISOS (/avisos)
   Paneles claros sobre el fondo noche, como el resto de secciones.
   ========================================================================= */
.news-strip__all {
  align-self: center;
  flex: 0 0 auto;
  color: var(--azul, #2563eb);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.news-strip__all:hover { text-decoration: underline; }
@media (max-width: 767.98px) {
  .news-strip { flex-wrap: wrap; }
  .news-strip__all { width: 100%; text-align: right; }
}

.page-sub a { color: #93c5fd; }
.page-sub a:hover { color: #fff; }

/* ---- lista de noticias ---- */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  background: var(--hielo, #f8fafc);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.news-card__img { display: block; aspect-ratio: 1200 / 630; background: var(--noche, #0b1530); }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.news-card__body { padding: 1rem 1.1rem 1.15rem; }

.news-card__date {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gris, #5b6b82);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-card__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
}
.news-card__title a { color: var(--tinta, #0f172a); text-decoration: none; }
.news-card__title a:hover { color: var(--azul, #2563eb); text-decoration: underline; }

.news-card__sum { margin: 0; color: #334155; font-size: 0.95rem; line-height: 1.5; }

/* la más reciente ocupa todo el ancho */
@media (min-width: 768px) {
  .news-card--lead { grid-column: 1 / -1; flex-direction: row; }
  .news-card--lead .news-card__img { flex: 0 0 52%; aspect-ratio: auto; min-height: 260px; }
  .news-card--lead .news-card__body { align-self: center; padding: 1.5rem 1.75rem; }
  .news-card--lead .news-card__title { font-size: 2rem; }
  .news-card--lead .news-card__sum { font-size: 1.05rem; }
}

.news-list--compact .news-card__title { font-size: 1.15rem; margin: 0; }

/* ---- noticia ---- */
.article {
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  background: var(--hielo, #f8fafc);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.article__head { padding: 1.75rem 1.75rem 1rem; }

.article__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.02;
  color: var(--tinta, #0f172a);
}

.article__lead { margin: 0 0 0.75rem; color: #334155; font-size: 1.15rem; line-height: 1.5; }
.article__meta { margin: 0; color: var(--gris, #5b6b82); font-size: 0.85rem; }

.article__img { display: block; width: 100%; max-height: 420px; object-fit: cover; }

.article__body {
  padding: 1.25rem 1.75rem 0.5rem;
  color: #1e293b;
  font-size: 1.05rem;
  line-height: 1.7;
}
.article__body p { margin: 0 0 1.1rem; }
.article__body ul { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.article__body li { margin-bottom: 0.3rem; }
.article__body h2 {
  margin: 1.6rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--tinta, #0f172a);
}

.article__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.75rem 1.5rem;
  border-top: 1px solid var(--linea, #e2e8f0);
  font-weight: 600;
}
.article__foot a { color: var(--azul, #2563eb); text-decoration: none; }
.article__foot a:hover { text-decoration: underline; }

.home .hsec.mt-4 { max-width: 760px; margin-left: auto; margin-right: auto; }

@media (max-width: 575.98px) {
  .article__head, .article__body, .article__foot { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ---- avisos ---- */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 820px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice {
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  border-left: 4px solid #38bdf8;
  background: var(--hielo, #f8fafc);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.notice--past { border-left-color: #94a3b8; background: #e8eef6; }

.notice__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: var(--gris, #5b6b82);
  font-size: 0.8rem;
  font-weight: 600;
}

.notice__badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notice--past .notice__badge { background: #e2e8f0; color: #475569; }

.notice__title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tinta, #0f172a);
}

/* el juego guarda los saltos de línea como \r\n: se respetan */
.notice__body { margin: 0; color: #334155; white-space: pre-line; }

/* ===================== CAMPEONES POR COMUNIDAD ===================== */
.comunidad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.comunidad-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  background: var(--hielo, #f8fafc);
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.comunidad-card:hover,
.comunidad-card:focus-visible { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45); color: #0f172a; }
.comunidad-card__head { display: flex; align-items: center; gap: .6rem; }
.comunidad-card__head .bi { font-size: 1.5rem; color: #d97706; }
.comunidad-card__name {
  margin: 0;
  font-family: var(--font-display, var(--font-sans));
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
}
.comunidad-card__desc { margin: 0; font-size: .9rem; color: #475569; }
.comunidad-card__stats { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.comunidad-card__stats li { display: flex; flex-direction: column; line-height: 1.1; }
.comunidad-card__stats b { font-size: 1.35rem; color: #1d4ed8; }
.comunidad-card__stats span { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.comunidad-card__torneos { margin: 0; font-size: .8rem; color: #475569; }
.comunidad-card__cta { margin-top: auto; font-weight: 600; color: #1d4ed8; }
.comunidad-back { font-size: .85rem; font-weight: 600; text-decoration: none; }
.comunidad-card__logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: #fff; }
.comunidad-card__mono {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff;
  font-family: var(--font-display, var(--font-sans)); font-size: 1.8rem; font-weight: 800;
}
.comunidad-logo-sm { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #fff; }

/* admin de campeones */
.camp-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.camp-tabs a { padding: .35rem .8rem; border-radius: 999px; background: #e2e8f0; color: #0f172a; font-weight: 600; font-size: .85rem; text-decoration: none; }
.camp-tabs a.active { background: #1d4ed8; color: #fff; }
.camp-nuevo { display: none; }
.camp-nuevo.show { display: block; }
.admin-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #fff; }
