/* ============================================================
   WEEKLY LEAGUE — isolated feature styles
   Backend controls visibility through [hidden].
   ============================================================ */

.league-nav-item[hidden],
.league-home-card[hidden],
.league-unjoined[hidden],
#leagueJoinedContent[hidden] {
  display: none !important;
}

.league-home-card {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 8% 30%, rgba(227,173,69,.18), transparent 180px),
    linear-gradient(135deg, rgba(255,253,248,.98), rgba(247,242,230,.96));
  border: 1px solid rgba(201,141,32,.25);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.league-home-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--gold-ink);
  background: linear-gradient(145deg, #f6df9f, var(--gold));
  border: 1px solid rgba(201,141,32,.30);
  border-radius: 15px;
  font-size: 1.53333em;
  box-shadow: 0 10px 24px rgba(201,141,32,.18);
}

.league-home-copy { min-width: 0; display: grid; gap: 3px; }
.league-home-copy strong { color: var(--ink); font-size: 1em; line-height: 1.25; }
.league-home-copy small { color: var(--muted-strong); font-size: .66667em; line-height: 1.4; }

.league-home-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.league-home-stats[hidden] { display: none !important; }
.league-home-stats div { display: grid; gap: 2px; min-width: 66px; }
.league-home-stats strong { color: var(--ink); font-size: 1.06667em; }
.league-home-stats span { color: var(--muted); font-size: .46667em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.league-home-open {
  min-height: 40px;
  padding: 0 15px;
  color: #fff;
  background: var(--surface-strong);
  border: 1px solid rgba(16,32,39,.12);
  border-radius: 12px;
  font-size: .63333em;
  font-weight: 800;
  white-space: nowrap;
}
.league-home-open:hover { background: #1a2b31; }

.league-view { max-width: 1180px; }

.league-page-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 28px;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
}
.league-page-header h1 { margin-top: 6px; font-size: clamp(2.13333em, 5vw, 3.6em); letter-spacing: -.045em; }
.league-page-header p { max-width: 680px; margin-top: 9px; color: var(--muted-strong); font-size: .8em; line-height: 1.6; }

.league-countdown-card {
  min-width: 150px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: right;
  box-shadow: var(--shadow-sm);
}
.league-countdown-card span { display: block; color: var(--muted); font-size: .46667em; font-weight: 850; letter-spacing: .12em; }
.league-countdown-card strong { display: block; margin-top: 4px; color: var(--ink); font-size: 1.2em; }

.league-unjoined {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 28px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}
.league-unjoined-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: var(--gold-ink);
  background: linear-gradient(145deg, #f8e8b8, var(--gold));
  border-radius: 22px;
  font-size: 2.26667em;
}
.league-unjoined h2 { margin-top: 5px; }
.league-unjoined p { margin-top: 6px; color: var(--muted-strong); font-size: .73333em; }

.league-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-top: 26px;
}
.league-summary-card {
  min-height: 124px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.league-summary-card > span { color: var(--muted); font-size: .46667em; font-weight: 850; letter-spacing: .12em; }
.league-summary-card > strong { color: var(--ink); font-size: 1.8em; letter-spacing: -.04em; }
.league-summary-card > small { color: var(--muted-strong); font-size: .6em; line-height: 1.4; }
.league-summary-rank {
  background:
    radial-gradient(circle at 90% 10%, rgba(227,173,69,.22), transparent 130px),
    var(--surface);
  border-color: rgba(201,141,32,.28);
}

.league-board-shell {
  margin-top: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}
.league-board-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}
.league-board-heading h2 { margin-top: 4px; }
.league-zone-key { display: flex; flex-wrap: wrap; gap: 8px; }
.league-zone-key span {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .53333em;
  font-weight: 800;
}
.league-zone-key .is-promotion { color: #226044; background: var(--success-soft); }
.league-zone-key .is-safe { color: var(--muted-strong); background: var(--surface-soft); }
.league-zone-key .is-relegation { color: #93443c; background: var(--danger-soft); }

.league-board { display: grid; }
.league-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(217,216,208,.72);
}
.league-row:last-child { border-bottom: 0; }
.league-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.league-row.is-promotion::before { background: var(--success); }
.league-row.is-relegation::before { background: var(--danger); }
.league-row.is-me {
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.10), rgba(var(--accent-rgb),.025));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb),.18);
}
.league-rank {
  color: var(--muted-strong);
  font: 800 .86667em/1 var(--font-mono);
  text-align: center;
}
.league-row:nth-child(1) .league-rank,
.league-row:nth-child(2) .league-rank,
.league-row:nth-child(3) .league-rank { color: var(--gold-strong); }
.league-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #dcebea;
  background: var(--surface-strong);
  border-radius: 50%;
  font-size: .66667em;
  font-weight: 850;
}
.league-row.is-me .league-avatar { color: #fff; background: var(--accent); }
.league-player { min-width: 0; display: grid; gap: 2px; }
.league-player strong { overflow: hidden; color: var(--ink); font-size: .73333em; text-overflow: ellipsis; white-space: nowrap; }
.league-player small { color: var(--muted); font-size: .53333em; }
.league-xp { color: var(--ink); font: 800 .8em/1 var(--font-mono); white-space: nowrap; }

@media (max-width: 900px) {
  /* Mantém o menu inferior aprovado com exatamente 6 itens. */
  .league-nav-item { display: none !important; }

  .league-home-card {
    grid-template-columns: auto minmax(0,1fr);
    gap: 12px;
    padding: 15px;
  }
  .league-home-stats { grid-column: 1 / -1; justify-content: space-between; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
  .league-home-open { grid-column: 1 / -1; width: 100%; }

  .league-page-header { grid-template-columns: 1fr; align-items: start; }
  .league-countdown-card { width: 100%; text-align: left; }
  .league-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .league-board-heading { align-items: start; flex-direction: column; }
  .league-row { grid-template-columns: 34px 36px minmax(0,1fr) auto; gap: 9px; padding: 7px 12px; }
}

@media (max-width: 700px) {
  .league-view { width: min(100% - 28px, 1180px); }
  .league-page-header h1 { font-size: 2.26667em; }
  .league-summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .league-summary-card { min-height: 108px; padding: 15px; }
  .league-summary-card > strong { font-size: 1.46667em; }
  .league-unjoined { grid-template-columns: 1fr; padding: 22px; }
  .league-unjoined-icon { width: 58px; height: 58px; border-radius: 18px; font-size: 1.86667em; }
  .league-board-heading { padding: 18px 14px 14px; }
  .league-zone-key { gap: 5px; }
  .league-zone-key span { padding: 5px 7px; font-size: .46667em; }
  .league-row { min-height: 58px; grid-template-columns: 30px 34px minmax(0,1fr) auto; gap: 7px; padding: 7px 10px; }
  .league-avatar { width: 32px; height: 32px; }
  .league-player strong { font-size: .66667em; }
  .league-xp { font-size: .66667em; }
}

/* Responsive rules are colocated with their owning component (V9). */
@media (max-width: 900px) {
  .sidebar .league-nav-item:not([hidden]) { display: grid !important; }
}
