/* =========================================================================
   PlayTennisLV — League Enhancements
   Scoped styles loaded AFTER styles.min.css on all league pages.
   Adds: tabbed hub, wrap-friendly subpage nav, sticky mobile CTA bar,
         mobile-card standings, tighter register form.
   Safe to load on any league page; rules are carefully scoped to .page-leagues*
   so nothing else is affected.
   ========================================================================= */

/* ── 1. Subpage nav: wrap on mobile instead of horizontal scroll ────────── */
@media (max-width: 720px) {
  .page-leagues .subpage-nav,
  .page-leagues-standings .subpage-nav,
  .page-leagues-submit .subpage-nav,
  .page-leagues-admin .subpage-nav,
  .page-leagues-rules .subpage-nav,
  .page-league-registration .subpage-nav {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    overflow: visible !important;
    flex-wrap: wrap;
    gap: 0.32rem;
    padding: 0.3rem;
    scroll-snap-type: none;
  }
  .page-leagues .subpage-nav a,
  .page-leagues-standings .subpage-nav a,
  .page-leagues-submit .subpage-nav a,
  .page-leagues-admin .subpage-nav a,
  .page-leagues-rules .subpage-nav a,
  .page-league-registration .subpage-nav a {
    flex: none !important;
    white-space: normal;
    min-height: 40px;
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
    line-height: 1.15;
  }
}

/* ── 2. Tabs on the merged leagues.html ─────────────────────────────────── */
.league-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.96), rgba(242, 249, 247, 0.92));
  border: 1px solid rgba(2, 117, 139, 0.2);
  border-radius: 999px;
  padding: 0.32rem;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.league-tabs [role="tab"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: #114d5a;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 0.6rem 1rem;
  min-height: 42px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.league-tabs [role="tab"]:hover,
.league-tabs [role="tab"]:focus-visible {
  background: rgba(2, 117, 139, 0.1);
  color: #0d5a69;
  outline: none;
}

.league-tabs [role="tab"][aria-selected="true"] {
  background: linear-gradient(130deg, #027f97, #249488);
  color: #ffffff;
  box-shadow: 0 10px 22px -8px rgba(2, 117, 139, 0.48);
}

.league-tabs [role="tab"][aria-selected="true"]:focus-visible {
  box-shadow: 0 10px 22px -8px rgba(2, 117, 139, 0.48), 0 0 0 3px rgba(2, 117, 139, 0.26);
}

.league-tab-count {
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.league-tabs [role="tab"]:not([aria-selected="true"]) .league-tab-count {
  background: rgba(2, 117, 139, 0.14);
  color: #0d5a69;
}

[role="tabpanel"][hidden] {
  display: none !important;
}

/* Scroll to the tablist, not the scrolled content, when a tab is clicked */
.league-tabs-anchor {
  scroll-margin-top: 96px;
}

@media (max-width: 720px) {
  .league-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    border-radius: 18px;
    padding: 0.3rem;
  }
  .league-tabs [role="tab"] {
    font-size: 0.82rem;
    padding: 0.55rem 0.5rem;
    min-height: 44px;
    border-radius: 14px;
  }
  .league-tabs [role="tab"][aria-selected="true"] {
    border-radius: 14px;
  }
}

/* ── 3. Hero pricing band ───────────────────────────────────────────────── */
.league-price-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-top: 1.1rem;
  margin-bottom: 0.2rem;
  border-radius: 16px;
  background: linear-gradient(130deg, rgba(2, 117, 139, 0.09), rgba(94, 168, 76, 0.09));
  border: 1px solid rgba(2, 117, 139, 0.18);
}

.league-price-band-prices {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.league-price-band-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.league-price-band-item-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0d5a69;
}

.league-price-band-item-value {
  font-family: "Chivo", "Outfit", sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  color: #02758b;
}

.league-price-band-item-value small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-left: 0.32rem;
}

.league-price-band-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

@media (max-width: 540px) {
  .league-price-band {
    padding: 0.9rem 1rem;
    border-radius: 14px;
  }
  .league-price-band-item-value {
    font-size: 1.4rem;
  }
  .league-price-band-actions .btn {
    flex: 1 1 100%;
  }
}

/* ── 4. Division card: show pricing pill + better touch targets ─────────── */
.league-division-card {
  position: relative;
}

.league-division-pricing-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: rgba(2, 117, 139, 0.1);
  color: #0d5a69;
  margin-top: 0.38rem;
  align-self: flex-start;
}

@media (max-width: 720px) {
  .league-division-grid {
    grid-template-columns: 1fr !important;
    gap: 0.55rem;
  }
  .league-division-card {
    padding: 0.95rem 1rem !important;
    min-height: 56px;
  }
}

/* ── 5. Mobile card standings (replaces horizontal-scroll table) ────────── */
.standings-card-list {
  display: none;
}

@media (max-width: 720px) {
  .standings-scroll,
  .table-scroll.standings-scroll {
    display: none !important;
  }
  .standings-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
}

.standings-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.standings-card.is-top {
  border-color: rgba(2, 117, 139, 0.4);
  background: linear-gradient(160deg, rgba(2, 117, 139, 0.07), rgba(255, 255, 255, 1));
}

.standings-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 117, 139, 0.2);
}

.standings-card-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(2, 117, 139, 0.11);
  color: #0d5a69;
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
}

.standings-card.is-top .standings-card-rank {
  background: linear-gradient(130deg, #f4a11d, #ef9f27);
  color: #ffffff;
  box-shadow: 0 4px 8px -2px rgba(239, 159, 39, 0.5);
}

.standings-card.is-second .standings-card-rank {
  background: linear-gradient(130deg, #94a3ae, #c9d0d4);
  color: #fff;
}

.standings-card-body {
  min-width: 0;
}

.standings-card-name {
  display: block;
  font-family: "Chivo", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem 0.62rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.22rem;
}

.standings-card-meta strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.standings-card-pts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
}

.standings-card-pts-num {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1;
}

.standings-card-pts-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.18rem;
}

.standings-card-stp {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0d5a69;
  background: rgba(2, 117, 139, 0.1);
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
}

/* ── 6. Sticky mobile CTA bar (all league pages) ────────────────────────── */
.league-mobile-bar {
  display: none;
}

@media (max-width: 720px) {
  .league-mobile-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem calc(0.6rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(2, 117, 139, 0.18);
    box-shadow: 0 -10px 28px -12px rgba(10, 30, 30, 0.18);
    backdrop-filter: saturate(1.3) blur(8px);
    -webkit-backdrop-filter: saturate(1.3) blur(8px);
  }

  .league-mobile-bar .btn {
    flex: 1 1 0;
    min-height: 46px;
    padding: 0.6rem 0.8rem;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
  }

  /* Push page content up so nothing is hidden under the bar */
  body.page-leagues,
  body.page-leagues-standings,
  body.page-leagues-submit,
  body.page-leagues-rules,
  body.page-leagues-admin,
  body.page-league-registration {
    padding-bottom: 82px;
  }

  /* Keep the footer above the bar visually — the body padding handles space */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .league-tabs [role="tab"],
  .standings-card,
  .league-division-card {
    transition: none !important;
  }
}

/* ── 7. Register form: tighter mobile spacing + progressive disclosure ─── */
.league-register-price-hero {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1.2rem;
}

.league-register-price-hero-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
}

.league-register-price-hero-card.is-featured {
  border-color: rgba(2, 117, 139, 0.45);
  background: linear-gradient(140deg, rgba(2, 117, 139, 0.08), rgba(255, 255, 255, 1));
}

.league-register-price-hero-card-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0d5a69;
}

.league-register-price-hero-card-value {
  font-family: "Chivo", sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.league-register-price-hero-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.league-register-price-hero-ribbon {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 0.18rem 0.52rem;
  background: linear-gradient(130deg, #f4a11d, #ef9f27);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 4px 10px -3px rgba(239, 159, 39, 0.5);
}

@media (max-width: 540px) {
  .league-register-price-hero {
    grid-template-columns: 1fr;
  }
  .league-register-price-hero-card-value {
    font-size: 1.55rem;
  }
}

/* Progressive disclosure — "Optional rating info" toggle */
.league-register-optional {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbf9;
  overflow: hidden;
}

.league-register-optional summary {
  list-style: none;
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.league-register-optional summary::-webkit-details-marker {
  display: none;
}

.league-register-optional summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: #0d5a69;
  transition: transform 180ms ease;
  line-height: 1;
}

.league-register-optional[open] summary::after {
  transform: rotate(45deg);
}

.league-register-optional summary small {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
  margin-right: 0.5rem;
}

.league-register-optional-body {
  padding: 0 1rem 1rem;
}

/* Form mobile polish */
@media (max-width: 540px) {
  .league-registration-form-shell label {
    font-size: 0.9rem;
  }
  .league-registration-form-shell input,
  .league-registration-form-shell select {
    font-size: 16px; /* prevents iOS zoom */
    min-height: 46px;
  }
  .league-membership-choice-grid {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
  }
  .league-membership-choice-inner {
    padding: 0.85rem 0.95rem !important;
  }
}

/* ── 8. Division register-now card inside Overview tab ──────────────────── */
.league-division-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  background: linear-gradient(130deg, #027f97, #249488);
  color: #fff !important;
  align-self: flex-start;
  margin-top: 0.45rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.league-division-card-cta:hover,
.league-division-card-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -6px rgba(2, 117, 139, 0.4);
}

/* ── 9. Inline "How it works" refinement on leagues.html ────────────────── */
@media (max-width: 720px) {
  .league-how-grid {
    grid-template-columns: 1fr !important;
    gap: 0.7rem !important;
  }
}

/* ── 10. Rules stack readable on mobile ─────────────────────────────────── */
@media (max-width: 540px) {
  .league-rules-stack {
    gap: 0.55rem !important;
  }
  .league-rule-card {
    padding: 0.75rem 0.85rem !important;
  }
  .league-rule-number {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.88rem !important;
  }
  .league-rule-body h3 {
    font-size: 1.02rem !important;
  }
}

/* ── 11. Hide the always-on desktop subpage-nav when a tabbed UI takes over ── */
.page-leagues .tabs-replace-nav .subpage-nav {
  display: none;
}

/* Print: hide mobile CTA and tabs, show all content */
@media print {
  .league-mobile-bar { display: none !important; }
  .league-tabs { display: none !important; }
  [role="tabpanel"] { display: block !important; }
  .ptlv-toast-host { display: none !important; }
}

/* ═════════════════════════════════════════════════════════════════════════
   12. Sortable standings columns
   ═════════════════════════════════════════════════════════════════════════ */
.standings-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  padding-right: 1.2rem !important;
  transition: background-color 140ms ease, color 140ms ease;
}
.standings-table th[data-sort-key]:hover,
.standings-table th[data-sort-key]:focus-visible {
  background: rgba(2, 117, 139, 0.08);
  color: #0d5a69;
  outline: none;
}
.standings-table th[data-sort-key]::after {
  content: "";
  position: absolute;
  right: 0.4rem;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(0deg);
  opacity: 0.18;
  transition: opacity 180ms ease, transform 180ms ease;
  background:
    linear-gradient(45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%) no-repeat,
    linear-gradient(-45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%) no-repeat;
  background-size: 100% 50%, 100% 50%;
  background-position: 0 0, 0 100%;
}
.standings-table th[data-sort-key][aria-sort="ascending"]::after,
.standings-table th[data-sort-key][aria-sort="descending"]::after {
  opacity: 1;
  background:
    linear-gradient(45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%) no-repeat;
  background-size: 100% 100%;
}
.standings-table th[data-sort-key][aria-sort="descending"]::after {
  transform: translateY(-50%) scaleY(-1);
}

/* ═════════════════════════════════════════════════════════════════════════
   13. Streak / form pills (last 5 results per player)
   ═════════════════════════════════════════════════════════════════════════ */
.standings-streak {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.standings-streak-pill {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  color: #fff;
  font-family: "Chivo", sans-serif;
}
.standings-streak-pill.is-win {
  background: linear-gradient(135deg, #5ea84c, #4e9240);
}
.standings-streak-pill.is-loss {
  background: linear-gradient(135deg, #c7697b, #a8556b);
}
.standings-card .standings-streak {
  margin-left: 0;
  margin-top: 0.28rem;
  gap: 3px;
}
.standings-card .standings-streak-pill {
  width: 12px;
  height: 12px;
  line-height: 12px;
  border-radius: 3px;
  font-size: 0.52rem;
}

/* ═════════════════════════════════════════════════════════════════════════
   14. Toast notification system
   ═════════════════════════════════════════════════════════════════════════ */
.ptlv-toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 1.2rem);
}
@media (max-width: 720px) {
  .ptlv-toast-host {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}
.ptlv-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 260px;
  max-width: 380px;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  background: rgba(15, 40, 45, 0.96);
  color: #ffffff;
  font-family: "Chivo", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 18px 48px -12px rgba(10, 30, 30, 0.45), 0 2px 6px rgba(10, 30, 30, 0.12);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ptlv-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.ptlv-toast-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
}
.ptlv-toast.is-success .ptlv-toast-icon {
  background: linear-gradient(135deg, #5ea84c, #4e9240);
  color: #fff;
}
.ptlv-toast.is-error .ptlv-toast-icon {
  background: linear-gradient(135deg, #e96a66, #c94e4a);
  color: #fff;
}
.ptlv-toast.is-info .ptlv-toast-icon {
  background: linear-gradient(135deg, #027f97, #249488);
  color: #fff;
}
.ptlv-toast.is-warn {
  background: rgba(60, 38, 5, 0.96);
}
.ptlv-toast.is-warn .ptlv-toast-icon {
  background: linear-gradient(135deg, #f4a11d, #ef9f27);
  color: #fff;
}
.ptlv-toast-body { flex: 1 1 auto; }
.ptlv-toast-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}
.ptlv-toast-close:hover,
.ptlv-toast-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .ptlv-toast { transition: opacity 120ms linear; transform: none; }
  .ptlv-toast.is-visible { transform: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   15. Registration progress dots
   ═════════════════════════════════════════════════════════════════════════ */
.register-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  margin: 0.3rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 246, 0.9));
}
.register-progress-steps {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.register-progress-step {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: "Chivo", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 220ms ease;
}
.register-progress-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #edf1ee;
  border: 2px solid rgba(2, 117, 139, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #0d5a69;
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease, transform 240ms ease;
}
.register-progress-step.is-done {
  color: #0d5a69;
}
.register-progress-step.is-done .register-progress-step-dot {
  background: linear-gradient(135deg, #5ea84c, #4e9240);
  border-color: rgba(78, 146, 64, 0.4);
  color: #ffffff;
  transform: scale(1.02);
}
.register-progress-step.is-done .register-progress-step-dot::before {
  content: "\2713";
  font-size: 0.76rem;
  line-height: 1;
}
.register-progress-step.is-done .register-progress-step-dot span { display: none; }
.register-progress-step-label { white-space: nowrap; }
.register-progress-divider {
  flex: 0 0 12px;
  height: 2px;
  background: rgba(2, 117, 139, 0.18);
  border-radius: 2px;
}
.register-progress-step.is-done + .register-progress-divider {
  background: linear-gradient(90deg, #5ea84c, rgba(2, 117, 139, 0.22));
}
.register-progress-percent {
  flex: none;
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 0.88rem;
  color: #0d5a69;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
@media (max-width: 540px) {
  .register-progress { padding: 0.55rem 0.65rem; gap: 0.4rem; }
  .register-progress-step-label { display: none; }
  .register-progress-step-dot { width: 20px; height: 20px; }
  .register-progress-divider { flex: 1 1 auto; }
}

/* ═════════════════════════════════════════════════════════════════════════
   16. Last-updated chip polish
   ═════════════════════════════════════════════════════════════════════════ */
.standings-meta-enhanced {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.standings-meta-enhanced::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5ea84c;
  box-shadow: 0 0 0 0 rgba(94, 168, 76, 0.6);
  animation: ptlv-pulse 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .standings-meta-enhanced::before { animation: none; }
}
@keyframes ptlv-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 168, 76, 0.55); }
  60% { box-shadow: 0 0 0 8px rgba(94, 168, 76, 0); }
}

/* ═════════════════════════════════════════════════════════════════════════
   17. Skeleton refinement (for initial tbody load)
   ═════════════════════════════════════════════════════════════════════════ */
.skeleton-bar {
  display: inline-block;
  height: 0.82rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f1 0%, #f7faf9 50%, #eef2f1 100%);
  background-size: 200% 100%;
  animation: ptlv-shimmer 1.4s ease-in-out infinite;
}
@keyframes ptlv-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═════════════════════════════════════════════════════════════════════════
   18. League thanks page — richer post-registration experience
   ═════════════════════════════════════════════════════════════════════════ */
.thanks-league-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.1rem;
  margin-top: 0.4rem;
}
@media (max-width: 860px) {
  .thanks-league-grid { grid-template-columns: 1fr; }
}
.thanks-league-card {
  padding: 1.4rem 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(2, 117, 139, 0.16);
  background: #ffffff;
  position: relative;
  overflow: hidden;
}
.thanks-league-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(2, 117, 139, 0.06), rgba(94, 168, 76, 0.05));
  z-index: 0;
  pointer-events: none;
}
.thanks-league-card > * { position: relative; z-index: 1; }
.thanks-league-card h2 {
  margin: 0.2rem 0 0.9rem;
  font-size: 1.3rem;
  line-height: 1.2;
}
.thanks-league-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.thanks-league-steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.8rem;
  align-items: start;
}
.thanks-league-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #027f97, #249488);
  color: #ffffff;
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 0.92rem;
  box-shadow: 0 6px 12px -4px rgba(2, 117, 139, 0.45);
}
.thanks-league-steps strong {
  display: block;
  font-family: "Chivo", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.18rem;
}
.thanks-league-steps p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.thanks-league-payment-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.thanks-league-fee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.thanks-league-fee {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(2, 117, 139, 0.07);
  border: 1px solid rgba(2, 117, 139, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.thanks-league-fee-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0d5a69;
}
.thanks-league-fee-value {
  font-family: "Chivo", sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.thanks-league-pay-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.thanks-league-pay-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  text-decoration: none;
  color: var(--text);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
a.thanks-league-pay-option:hover,
a.thanks-league-pay-option:focus-visible {
  border-color: rgba(2, 117, 139, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -12px rgba(2, 117, 139, 0.35);
  outline: none;
}
.thanks-league-pay-option-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0d5a69;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 0.18rem 0.56rem;
  border-radius: 999px;
  background: rgba(2, 117, 139, 0.12);
}
.thanks-league-pay-option-handle {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.thanks-league-pay-option-arrow {
  font-size: 1.2rem;
  color: #0d5a69;
  font-weight: 600;
  grid-row: 1 / span 2;
  align-self: center;
  transition: transform 200ms ease;
}
a.thanks-league-pay-option:hover .thanks-league-pay-option-arrow,
a.thanks-league-pay-option:focus-visible .thanks-league-pay-option-arrow {
  transform: translateX(3px);
}
.thanks-league-pay-option-sub {
  grid-column: 2;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
}
.thanks-league-pay-option-check {
  background: #fbfdfb;
}
.thanks-league-email-note {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

/* ═════════════════════════════════════════════════════════════════════════
   19. Row entrance stagger + count-up animation
   ═════════════════════════════════════════════════════════════════════════ */
.standings-table tbody tr.is-entering {
  animation: ptlv-row-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.standings-card.is-entering {
  animation: ptlv-row-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ptlv-row-in {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .standings-table tbody tr.is-entering,
  .standings-card.is-entering { animation: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   20. Division leader spotlight
   ═════════════════════════════════════════════════════════════════════════ */
.league-division-leader {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.7rem 0.32rem 0.45rem;
  margin-top: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(244, 161, 29, 0.16), rgba(239, 159, 39, 0.08));
  border: 1px solid rgba(244, 161, 29, 0.28);
  color: #8a5806;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  align-self: flex-start;
  max-width: 100%;
  opacity: 0;
  transform: translateY(4px);
  animation: ptlv-leader-in 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ptlv-leader-in {
  to { opacity: 1; transform: translateY(0); }
}
.league-division-leader-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, #f4a11d, #ef9f27);
  flex: none;
  letter-spacing: 0;
}
.league-division-leader-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .league-division-leader { animation: none; opacity: 1; transform: none; }
}

/* Subtle count-up — a brief highlight when numbers finish animating */
.standings-count-up.is-finished {
  animation: ptlv-count-flash 380ms ease-out both;
}
@keyframes ptlv-count-flash {
  0%   { color: #02758b; }
  100% { color: inherit; }
}

/* ═════════════════════════════════════════════════════════════════════════
   21. Hub hero refinements
   ═════════════════════════════════════════════════════════════════════════ */
.league-season-bar {
  align-items: baseline;
}
.league-season-bar h1 {
  background: linear-gradient(130deg, #0d5a69 0%, #02758b 40%, #249488 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.015em;
}

/* "Live" tiny dot on the active season pill */
.league-season-pill.is-active {
  position: relative;
  padding-left: 1.55rem;
}
.league-season-pill.is-active::before {
  content: "";
  position: absolute;
  left: 0.68rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5ea84c;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(94, 168, 76, 0.55);
  animation: ptlv-pulse 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .league-season-pill.is-active::before { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; background: #eef2f1; }
}
