/* Leagues M2 — dark default, day theme overrides, RTL-safe, mobile-first */

/* ---------- Trophy button (nested in the daily-goal pill) ---------- */
.daily-goal-cluster {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}
.daily-goal-cluster .daily-goal-chip {
  border: 0;
  background: transparent;
  border-start-start-radius: 999px;
  border-end-start-radius: 999px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  padding-inline-end: 0.3rem;
}
.daily-goal-cluster .league-trophy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 0.42rem 0 0.18rem;
  border: 0;
  border-inline-start: 1px solid rgba(148, 163, 184, 0.22);
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  flex: 0 0 auto;
}
.daily-goal-cluster .league-trophy-btn:hover,
.daily-goal-cluster .league-trophy-btn:focus-visible {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  outline: none;
}
.daily-goal-cluster .league-trophy-btn svg { width: 15px; height: 15px; display: block; margin: 0; vertical-align: middle; }
.daily-goal-cluster .league-trophy-btn.is-top-league { color: #e3b341; }
.daily-goal-cluster .league-trophy-btn.is-top-league:hover,
.daily-goal-cluster .league-trophy-btn.is-top-league:focus-visible { color: #ffd76a; }




.league-trophy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg, #e8eaf0);
}
.league-trophy-btn svg { display: block; }
.league-trophy-dot {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 2px var(--bg, #12141a);
  pointer-events: none;
}
.league-trophy-dot[hidden] { display: none; }

/* ---------- Overlay / sheet ---------- */
.league-overlay {
  position: fixed;
  inset: 0;
  /* Above soft update banner (~9000); keep sheets above chrome. */
  z-index: 100100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  overscroll-behavior: contain;
}
.league-overlay.hidden { display: none; }

.league-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--sheet-bg, #1a1d24);
  color: var(--fg, #e8eaf0);
  border-start-start-radius: 18px;
  border-start-end-radius: 18px;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  animation: league-sheet-in 0.22s ease-out;
}
@keyframes league-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.league-handle {
  width: 40px;
  height: 4px;
  margin: 4px auto 8px;
  border-radius: 2px;
  background: var(--muted, #4a4f5c);
  opacity: 0.6;
}

.league-close {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #9aa0ad);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.league-close:hover,
.league-close:focus-visible { background: var(--hover, rgba(255, 255, 255, 0.08)); color: var(--fg, #e8eaf0); }

.league-title {
  margin: 2px 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
}

/* ---------- Header ---------- */
.league-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-bg, #232733);
  margin-block-end: 10px;
}
.league-header-emblem { flex: 0 0 auto; }
.league-header-info { flex: 1 1 auto; min-width: 0; }
.league-tier-name { font-size: 16px; font-weight: 700; }
.league-countdown { font-size: 13px; color: var(--muted, #9aa0ad); margin-block-start: 2px; }

.league-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 2px;
}
.league-live-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #9aa0ad);
}

/* Monthly status chip: one quiet line with the race, stronger when top 3. */
.league-month-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 10px 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-inline-start: 3px solid rgba(148, 163, 184, 0.5);
  color: var(--fg, #eef1f6);
  font-size: 12px;
  line-height: 1.3;
}
.league-month-chip[hidden] { display: none !important; }
.league-month-chip-icon {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.league-month-chip-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 650;
  letter-spacing: 0.005em;
}
.league-month-chip.is-top3 {
  background: linear-gradient(135deg, rgba(255, 224, 138, 0.2), rgba(212, 160, 23, 0.12));
  border-color: rgba(255, 210, 90, 0.5);
  border-inline-start-color: #e3b341;
}
.league-month-chip.is-top3 .league-month-chip-icon { background: #ffd76a; opacity: 1; }
.league-month-chip.is-top3 .league-month-chip-text { color: #ffe6a3; font-weight: 700; }



.league-refresh {
  display: inline-flex;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border, #333a48);
  border-radius: 999px;
  background: transparent;
  color: var(--fg, #e8eaf0);
  font-size: 12px;
  cursor: pointer;
}
.league-refresh:hover,
.league-refresh:focus-visible { background: var(--hover, rgba(255, 255, 255, 0.08)); }

/* ---------- Emblem ---------- */
.league-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 18px;
  color: #1a1d24;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.league-emblem--sm { width: 22px; height: 22px; font-size: 11px; }
.league-emblem--t0 { background: linear-gradient(145deg, #d9a066, #a86b32); }
.league-emblem--t1 { background: linear-gradient(145deg, #e6e9ef, #a9b0bd); }
.league-emblem--t2 { background: linear-gradient(145deg, #ffe08a, #d4a017); }

/* ---------- Result card ---------- */
.league-result {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 200, 80, 0.16), rgba(255, 140, 60, 0.1));
  border: 1px solid rgba(255, 200, 80, 0.35);
  margin-block-end: 12px;
  text-align: center;
}
.league-result.hidden { display: none; }
.league-result-msg { font-size: 15px; font-weight: 700; }
.league-result-rank { font-size: 13px; color: var(--muted, #9aa0ad); margin-block: 4px 10px; }
.league-result-ok {
  padding: 8px 22px;
  border: 0;
  border-radius: 999px;
  background: #ffc850;
  color: #1a1d24;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Body / list ---------- */
.league-body { display: flex; flex-direction: column; gap: 16px; }

.league-list-wrap {
  position: relative;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  background: var(--card-bg, #232733);
}
.league-list { display: flex; flex-direction: column; }

/* ---------- Last-week podium (2nd | 1st | 3rd). direction stays LTR so places don't swap in RTL. ---------- */
.league-podium-wrap[hidden] { display: none !important; }
.league-podium-caption {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--muted, #9aa0ad);
}
.league-podium-caption[hidden] { display: none !important; }
.league-podium-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--fg, #e8eaf0);
}
.league-podium {
  direction: ltr;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 8px;
}
.league-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 6px 0;
  border-radius: 14px 14px 10px 10px;
  background: var(--card-bg, #232733);
  border: 1px solid var(--border, #333a48);
  box-sizing: border-box;
}
.league-podium-slot--1 { order: 2; grid-column: 2; padding-top: 14px; }
.league-podium-slot--2 { order: 1; grid-column: 1; }
.league-podium-slot--3 { order: 3; grid-column: 3; }
.league-podium-slot.is-empty { opacity: 0.72; }
.league-podium-slot.is-me {
  background: var(--me-bg, #2f3646);
  border-color: #6fa8ff;
  box-shadow: inset 0 0 0 1px #6fa8ff;
}
.league-podium-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 32px;
  height: 20px;
  padding: 0 7px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #1a1d24;
}
.league-podium-medal--1 { background: linear-gradient(145deg, #ffe08a, #d4a017); }
.league-podium-medal--2 { background: linear-gradient(145deg, #e8ebf2, #a9b0bd); }
.league-podium-medal--3 { background: linear-gradient(145deg, #e0b07a, #a86b32); }
.league-podium-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--avatar-bg, #3a4152);
  color: var(--fg, #e8eaf0);
  font-size: 15px;
  font-weight: 700;
}
.league-podium-slot--1 .league-podium-avatar {
  width: 46px;
  height: 46px;
  font-size: 18px;
}
.league-podium-avatar--empty {
  background: transparent;
  border: 1px dashed var(--border, #4a5160);
}
.league-podium-name {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  direction: auto;
  unicode-bidi: isolate;
}
.league-podium-slot--1 .league-podium-name { font-size: 14px; font-weight: 700; }
.league-podium-xp {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #9aa0ad);
  line-height: 1.2;
}
.league-podium-you {
  font-size: 11px;
  font-weight: 700;
  color: #9ec0ff;
  line-height: 1;
}
.league-podium-prize {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 224, 138, 0.28), rgba(212, 160, 23, 0.22));
  border: 1px solid rgba(255, 210, 90, 0.55);
  color: #ffe6a3;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.league-podium-badge-award {
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border, #3a4152);
  color: var(--muted, #b6bdc9);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.league-podium-base {
  width: 100%;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: #1a1d24;
}
.league-podium-base--1 { height: 52px; background: linear-gradient(180deg, #ffe08a, #c49212); }
.league-podium-base--2 { height: 28px; background: linear-gradient(180deg, #e6e9ef, #9aa3b2); }
.league-podium-base--3 { height: 22px; background: linear-gradient(180deg, #e0b07a, #a86b32); }

.league-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted, #9aa0ad);
  font-size: 14px;
}
.league-skel-list { display: flex; flex-direction: column; }
.league-skel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}
.league-skel-av {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--avatar-bg, #3a4152);
}
.league-skel-bar {
  flex: 1 1 auto;
  height: 10px;
  border-radius: 6px;
  background: var(--border, #333a48);
}
@media (prefers-reduced-motion: no-preference) {
  .league-skel-av,
  .league-skel-bar {
    animation: league-skel 1.1s ease-in-out infinite;
  }
}
@keyframes league-skel {
  50% { opacity: 0.45; }
}
.league-state--error { color: #ff8a8a; }
.league-retry {
  margin-block-start: 10px;
  padding: 6px 16px;
  border: 1px solid var(--border, #333a48);
  border-radius: 999px;
  background: transparent;
  color: var(--fg, #e8eaf0);
  cursor: pointer;
}

.league-card {
  padding: 20px 16px;
  text-align: center;
}
.league-card-title { font-size: 14px; color: var(--muted, #9aa0ad); line-height: 1.4; }

/* ---------- Rows ---------- */
.league-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  border-block-end: 1px solid var(--border, #2c313d);
  background: var(--card-bg, #232733);
}
.league-row:last-child { border-block-end: 0; }
.league-row.zone-up { background: rgba(80, 200, 120, 0.08); }
.league-row.zone-down { background: rgba(255, 90, 90, 0.08); }
.league-row.is-me {
  position: sticky;
  inset-block-end: 0;
  z-index: 2;
  background: var(--me-bg, #2f3646);
  box-shadow: 0 -1px 0 var(--border, #2c313d), 0 1px 0 var(--border, #2c313d);
  font-weight: 700;
}

.league-rank {
  flex: 0 0 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #9aa0ad);
  font-size: 13px;
}
.league-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--avatar-bg, #3a4152);
  color: var(--fg, #e8eaf0);
  font-size: 13px;
  font-weight: 700;
}
.league-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-xp {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #9aa0ad);
  font-size: 13px;
}

/* ---------- Zone separators ---------- */
.league-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #9aa0ad);
}
.league-sep::before,
.league-sep::after {
  content: "";
  flex: 1 1 auto;
  border-block-start: 1px dashed var(--border, #3a4152);
}
.league-sep--up { color: #6fd08c; }
.league-sep--down { color: #ff8a8a; }
.league-sep-label { flex: 0 0 auto; }

/* ---------- Profile ---------- */
.league-profile {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card-bg, #232733);
}
.league-profile.hidden { display: none; }
.league-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 8px;
}
.league-profile-tier { font-size: 15px; font-weight: 700; }
.league-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--muted, #9aa0ad);
  margin-block-end: 12px;
}
.league-stat { white-space: nowrap; }

/* ---------- Toggle ---------- */
.league-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.league-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.league-switch {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--switch-off, #3a4152);
  transition: background 0.15s ease;
}
.league-switch::after {
  content: "";
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.league-toggle input:checked + .league-switch { background: #4caf7d; }
.league-toggle input:checked + .league-switch::after { transform: translateX(18px); }
html[dir="rtl"] .league-toggle input:checked + .league-switch::after { transform: translateX(-18px); }
.league-toggle input:focus-visible + .league-switch { outline: 2px solid #6fa8ff; outline-offset: 2px; }
.league-toggle-label { flex: 1 1 auto; }

.league-hint {
  margin-block-start: 8px;
  font-size: 12px;
  color: var(--muted, #9aa0ad);
  line-height: 1.4;
}

/* ---------- Badges ---------- */
.league-badges { padding-block-start: 2px; }
.league-badges-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9aa0ad);
  margin-block-end: 8px;
}
.league-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.league-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  background: var(--card-bg, #232733);
  text-align: center;
}
.league-badge-icon { font-size: 22px; line-height: 1; }
.league-badge-title { font-size: 10px; line-height: 1.2; color: var(--muted, #9aa0ad); }
.league-badge.is-locked { opacity: 0.4; filter: grayscale(1); }
.league-badge.is-unlocked { background: var(--badge-on, #2c3444); }
.league-badge.is-unlocked .league-badge-title { color: var(--fg, #e8eaf0); }

/* ---------- Narrow phones ---------- */
@media (max-width: 380px) {
  .league-podium { gap: 6px; }
  .league-podium-slot { padding-inline: 4px; }
  .league-podium-name { font-size: 12px; }
  .league-podium-slot--1 .league-podium-avatar { width: 40px; height: 40px; }
  .league-podium-base--1 { height: 34px; }
  .league-podium-base--3 { height: 20px; font-size: 12px; }
}

/* ---------- Desktop: centered card ---------- */
@media (min-width: 640px) {
  .league-overlay { align-items: center; padding: 24px; }
  .league-sheet {
    border-radius: 18px;
    max-height: 86vh;
    padding-block-end: 20px;
    animation: league-card-in 0.18s ease-out;
  }
  @keyframes league-card-in {
    from { transform: scale(0.97); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
  .league-handle { display: none; }
  .league-list-wrap { max-height: 40vh; }
}/* ---------- Day theme ---------- */













/* ---------- RTL ---------- */
html[dir="rtl"] .league-close { inset-inline-end: 10px; }
html[dir="rtl"] .league-live-head { justify-content: space-between; }
html[dir="rtl"] .league-sep::before,
html[dir="rtl"] .league-sep::after { border-block-start-style: dashed; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .league-sheet { animation: none; }
  .league-switch,
  .league-switch::after { transition: none; }
  .league-skel-av,
  .league-skel-bar { animation: none; }
}
.league-trophy-btn[hidden] { display: none !important; }

/* ---------- Prize note (monthly rule lives with prize history) ---------- */
.league-prize-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-block-start: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted, #a3aab8);
}
.league-prize-note.hidden { display: none; }
.league-prize-note-text { font-weight: 600; color: var(--fg, #e8eaf0); }
.league-prize-rules { font-size: 11.5px; color: var(--muted, #a3aab8); }
.league-month-rank[hidden] { display: none !important; }
.league-month-rank { display: none; }

/* Early "almost won" offer: a quiet card between the race and the profile. */
.league-offer {
  padding: 12px 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(122, 162, 255, 0.12), rgba(122, 162, 255, 0.05));
  border: 1px solid rgba(122, 162, 255, 0.3);
}
.league-offer.hidden { display: none; }
.league-offer-text {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg, #e8eaf0);
}
.league-offer-benefit {
  margin: 0 0 9px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted, #a3aab8);
}
.league-offer-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: #7aa2ff;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.league-offer-btn:hover,
.league-offer-btn:focus-visible { background: #9ab8ff; outline: none; }
.league-offer-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
/* Inherit document direction; keep copy start-aligned for AR. */
html[dir="rtl"] .league-offer-text,
html[dir="rtl"] .league-offer-benefit {
  text-align: start;
}

/* Invite friends — quiet CTA under the race (referrals.enabled). */
.league-invite {
  margin-top: 10px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.league-invite.hidden { display: none; }
.league-invite-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fg, #e8eaf0);
  text-align: start;
}
.league-invite-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(122, 162, 255, 0.22);
  color: var(--fg, #e8eaf0);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.league-invite-btn:hover,
.league-invite-btn:focus-visible {
  background: rgba(122, 162, 255, 0.35);
  outline: none;
}
html[dir="rtl"] .league-invite-text {
  text-align: start;
}
body.theme-day .league-invite {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}
body.theme-day .league-invite-btn {
  background: rgba(59, 130, 246, 0.14);
  color: #0f172a;
}


.league-prize-unlock {
  margin-block-start: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted, #9aa0ad);
}
.league-prize-unlock[hidden] { display: none !important; }
.league-prize-month {
  margin-block-start: 10px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.league-prize-month.hidden { display: none; }
.league-prize-month-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #9aa0ad);
  margin-block-end: 7px;
}
.league-prize-month-list { display: flex; flex-direction: column; gap: 6px; }
.league-prize-row--winner { display: flex; align-items: center; gap: 8px; }
.league-prize-row-text { flex: 1 1 auto; min-width: 0; }
.league-prize-you {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #9ec0ff;
}
.league-avatar--sm { width: 22px; height: 22px; font-size: 11px; }
.league-terms-link {
  color: var(--accent, #7aa2ff);
  text-decoration: underline;
  font-size: 12px;
  white-space: nowrap;
}
.league-terms-link.hidden { display: none; }
@media (max-width: 420px) {
  .league-prize-note { align-items: flex-start; }
}
.league-terms-link:hover { opacity: 0.85; }
.league-prize-history {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.league-prize-history.hidden { display: none; }
.league-prize-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.league-prize-row {
  font-size: 13px;
  line-height: 1.35;
  color: var(--fg, #e8eaf0);
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface, rgba(255, 255, 255, 0.04));
}
.league-prize-row--empty {
  color: var(--muted, #9aa3b2);
  background: transparent;
  padding-inline-start: 0;
}

/* round 21: unambiguous month rank + own-row You tag */
.league-month-chip-text{display:flex;flex-direction:column;gap:2px;}
.league-month-chip-line{display:block;}
/* Week line is primary — must match the live list place. Month is quieter. */
.league-month-chip-line--week{font-weight:700;}
.league-month-chip-line--month{font-weight:500;opacity:.9;}
.league-month-chip-hint{display:block;font-size:.78em;font-weight:500;opacity:.75;}
/* qa42: when week ≠ month, keep both lines unmistakably separate. */
.league-month-chip[data-rank-scopes-differ="1"] .league-month-chip-line--week{font-weight:800;}
.league-month-chip[data-rank-scopes-differ="1"] .league-month-chip-line--month{opacity:1;}
.league-row-you{margin-left:6px;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:700;color:#7fb0ff;background:rgba(127,176,255,.14);flex-shrink:0;}
