/*
 * League home: rules for pages with <body class="p-league">. Shared rules are in sfp.css.
 */
/* Team badge pictures (img/badges/): square images, so they are drawn in a square box and never squashed.
   The shield placeholder keeps its own size. */
.p-league img.badge { width: 32px; height: 32px; object-fit: contain; }
.p-league img.badge.s { width: 22px; height: 22px; }
.p-league table.league img.badge { width: 40px; height: 40px; }
.p-league table.league .tw > svg.badge { margin: 0 9px; }

/* ------------------------------------------------------------------
   SHELL
------------------------------------------------------------------- */
.p-league .tbl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin: 0 4px; }
.p-league .tbl-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .01em; }
.p-league .tbl-upd { margin: 0; font-size: 12.5px; color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.p-league .tbl-key { margin: 0 4px; font-size: 12px; color: var(--ink-faint); }
.p-league table.league .c-rk { width: 58px; }
.p-league table.league .c-wk { width: 36px; }
.p-league table.league .c-sr { width: 42px; }
.p-league table.league .c-pts { width: 50px; }
.p-league .section > .sub { margin: -6px 4px 0; font-size: 13px; color: var(--ink-faint); }

/* ------------------------------------------------------------------
   SITE HEADER
------------------------------------------------------------------- */
.p-league a:focus-visible, .p-league button:focus-visible, .p-league summary:focus-visible, .p-league .scroller:focus-visible, .p-league .snap:focus-visible, .p-league label.btn:focus-within {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------
   THE CARD
------------------------------------------------------------------- */
.p-league .card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}
.p-league .card-title .note { font-size: 12px; font-weight: 400; color: var(--ink-faint); }

/* ------------------------------------------------------------------
   WEEKLY ROUND UP (the top panel)
------------------------------------------------------------------- */
.p-league .round-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; margin: 0 0 12px; }
.p-league .tlink,
.p-league .lb li .t,
.p-league .shame dd:not(.n),
.p-league .src-row .hd b { text-transform: uppercase; }
.p-league .round-head h2 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.05; }
.p-league .round-week { margin: 0; font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.p-league .round-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.p-league .rt { min-width: 0; padding: 12px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-fill); }
.p-league .rt-label { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--gold); }
/* Round up tiles: the badge sits above the team name, so the name gets the whole width of the tile. */
.p-league .rt-team { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; margin: 0 0 6px; }
.p-league .rt-team .badge { flex: none; }
.p-league .rt-name { margin: 0; font-family: "Sofia Sans Extra Condensed", "Saira Semi Condensed", sans-serif; font-size: 19px; font-weight: 600; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.p-league .rt-name a { color: inherit; text-decoration: none; }
.p-league .rt-val { margin: 8px 0 0; font-size: 32px; font-weight: 600; line-height: 1; color: var(--accent); }
.p-league .rt-val small { margin-left: 5px; font-size: 13px; font-weight: 400; color: var(--ink-faint); }
.p-league .rt-sub { margin: 4px 0 0; font-size: 12.5px; line-height: 1.3; color: var(--ink-faint); }
.p-league .rt-sub a { color: var(--ink-soft); }
.p-league .rt-sub-team { margin: 0 0 8px; }
.p-league .rt-empty { margin: 0; font-size: 14px; color: var(--ink-faint); }
.p-league .motm { padding: 14px; }
.p-league .motm-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.p-league .motm-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--gold); }
.p-league .motm-ico { flex: none; width: 24px; height: 32px; color: var(--gold); }
.p-league .motm-win { display: inline-block; vertical-align: -3px; width: 14px; height: 19px; margin-left: 6px; color: var(--gold); }
.p-league .motm-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.p-league .motm-col { min-width: 0; }
.p-league .motm-month { margin: 0; font-size: 15px; font-weight: 600; }
.p-league .motm-sub { margin: 2px 0 6px; font-size: 12.5px; color: var(--ink-faint); }
.p-league .motm-row { display: grid; grid-template-columns: 24px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); }
.p-league .motm-k { font-size: 14px; color: var(--ink-faint); }
.p-league .motm-who { min-width: 0; }
.p-league .motm-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.p-league .motm-team { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.p-league .motm-team a { color: inherit; text-decoration: none; }
.p-league .motm-pts { font-size: 20px; font-weight: 600; color: var(--accent); }
.p-league .round-note { margin: 12px 0 0; font-size: 12.5px; color: var(--gold); }
.p-league .mine {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.p-league .mine b { color: var(--ink); font-weight: 600; }
.p-league .mine .pos { color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------------
   LEAGUE TABLE
------------------------------------------------------------------- */
.p-league .table-card { padding: 12px 10px 8px; }
.p-league table.league { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 17px; font-family: "Sofia Sans Extra Condensed", "Saira Semi Condensed", sans-serif; }
.p-league table.league th { font-size: 13px; font-weight: 500; color: var(--ink-faint); text-align: right; padding: 4px 6px 7px; }
.p-league table.league th:first-child, .p-league table.league th:nth-child(2) { text-align: left; }
.p-league table.league th:first-child { padding-left: 6px; }
.p-league table.league td { padding: 9px 6px 8px; text-align: right; border-top: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.p-league table.league td.rk { text-align: left; font-weight: 500; color: var(--ink-soft); padding-left: 6px; }
.p-league table.league .rk-in { display: flex; align-items: center; gap: 6px; }
.p-league table.league .rk-in b { font-weight: 500; }
.p-league table.league .mv { flex: none; width: 10px; height: 10px; }
.p-league table.league .mv.none { display: inline-block; }
.p-league table.league .mv.up { fill: var(--up); }
.p-league table.league .mv.down { fill: var(--down); }
.p-league table.league .mv.same { fill: var(--accent-2); }
.p-league table.league tr.cutline td { border-top: 2px dotted var(--accent-2); }
.p-league table.league td.team { text-align: left; font-weight: 500; font-size: 17px; overflow: hidden; }
.p-league table.league td.team span { display: block; line-height: 1.1; overflow-wrap: break-word; }
.p-league table.league td.pts { font-weight: 700; font-size: 19px; color: var(--accent); }
.p-league table.league td.dim { color: var(--ink-soft); }
.p-league table.league th.dim, .p-league table.league td.dim { font-style: italic; }
/* sortable headings (js/league.js turns each heading into a button) */
.p-league table.league .sort { display: inline-flex; align-items: center; gap: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-style: inherit; cursor: pointer; }
.p-league table.league .sort:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 3px; }
.p-league table.league .sort-i { display: inline-block; width: 0; height: 0; margin-left: 4px; border: 4px solid transparent; opacity: 0; }
.p-league table.league th[aria-sort="ascending"] .sort-i { border-top-width: 0; border-bottom-color: currentColor; opacity: 1; }
.p-league table.league th[aria-sort="descending"] .sort-i { border-bottom-width: 0; border-top-color: currentColor; opacity: 1; }
.p-league table.league th[aria-sort] { color: var(--ink); }
.p-league table.league.is-sorted tr.cutline td { border-top: 1px solid rgba(255,255,255,.08); }
.p-league table.league th:first-child .sort, .p-league table.league th:nth-child(2) .sort { text-align: left; }
.p-league .tw { display: flex; align-items: center; gap: 9px; }
.p-league .tn { min-width: 0; flex: 1; }
.p-league .meter { display: block; height: 3px; border-radius: 3px; margin-top: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.p-league .meter i { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }
.p-league table.league tr.me td { background: rgba(242,44,247,.15); }
.p-league table.league tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.p-league table.league tr.me .meter i { background: var(--accent); }
.p-league table.league tr.me td.team { font-weight: 600; }

/* ------------------------------------------------------------------
   POINTS SOURCE
------------------------------------------------------------------- */
.p-league .src { display: grid; gap: 11px; }
.p-league .src-row .hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; font-size: 13.5px; margin-bottom: 4px; }
.p-league .src-row .hd b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-league .src-row .hd span { flex: none; margin-left: auto; font-size: 12px; color: var(--ink-faint); }
.p-league .src-row.me .hd b { font-weight: 700; }
.p-league .stack { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.08); }
.p-league .stack i {
  display: block;
  height: 100%;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  padding: 0 5px;
  white-space: nowrap;
  overflow: hidden;
  color: #06065e;
}
.p-league .stack .gk { background: var(--accent-2); }
.p-league .stack .df { background: var(--grp-b); }
.p-league .stack .mf { background: var(--gold); }
.p-league .stack .fw { background: var(--accent); color: #fff; }
.p-league .stack .of { background: rgba(255,255,255,.34); color: #fff; }
.p-league .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--ink-soft);
}
.p-league .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.p-league .legend .gk { background: var(--accent-2); }
.p-league .legend .df { background: var(--grp-b); }
.p-league .legend .mf { background: var(--gold); }
.p-league .legend .fw { background: var(--accent); }
.p-league .legend .of { background: rgba(255,255,255,.34); }

/* ------------------------------------------------------------------
   TILES
------------------------------------------------------------------- */
.p-league .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.p-league .tile { position: relative; padding: 14px 14px 12px; }
.p-league .tile-ic { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; color: var(--accent-2); opacity: .9; }
.p-league .tile-ic-card { color: var(--gold); opacity: 1; }
.p-league .tile b { display: block; font-size: 44px; font-weight: 500; line-height: 1; color: var(--accent-2); }
.p-league .tile span { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-soft); line-height: 1.25; }

/* ------------------------------------------------------------------
   LEADER CARDS (swipe)
------------------------------------------------------------------- */
.p-league .snap {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(var(--page-pad) * -1);
  padding: 2px var(--page-pad) 4px;
  scroll-padding: 0 var(--page-pad);
}
.p-league .snap::-webkit-scrollbar { display: none; }
.p-league .snap > * { scroll-snap-align: start; flex: none; }
.p-league .lb { width: min(78%, 300px); padding: 16px; }
.p-league .lb h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.p-league .lb ol { list-style: none; margin: 0; padding: 0; }
.p-league .lb li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 6px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 14px;
}
.p-league .lb li .n { color: var(--ink-faint); font-size: 13px; }
.p-league .lb li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-league .lb li .v { font-weight: 700; color: var(--accent); }
.p-league .lb li.first .t { font-weight: 600; }
.p-league .lb li.me { background: rgba(242,44,247,.15); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.p-league .lb li.gap { border-top: 0; padding: 0; color: var(--ink-faint); line-height: .8; text-align: center; display: block; }

/* ------------------------------------------------------------------
   HALL OF SHAME
------------------------------------------------------------------- */
.p-league .shame dl { margin: 0; }
.p-league .shame dl div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.p-league .shame dl div:first-child { border-top: 0; padding-top: 2px; }
.p-league .shame dt { font-size: 13px; color: var(--ink-faint); grid-column: 1 / -1; }
.p-league .shame dd { margin: 0; font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-league .shame dd.n { font-size: 26px; font-weight: 600; color: var(--accent); line-height: 1; }

/* ------------------------------------------------------------------
   DATA PANEL
------------------------------------------------------------------- */
.p-league .status { margin-top: 12px; font-size: 13px; min-height: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------------
   YOUR TEAM PICKER
------------------------------------------------------------------- */
.p-league .picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.p-league .picker label { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.p-league .picker select {
  flex: 1;
  max-width: 240px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,40,.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 7px 10px;
}
.p-league .picker select option { color: #000; }
.p-league .picker select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ------------------------------------------------------------------
   LAYOUT HELPERS
------------------------------------------------------------------- */
.p-league .shame h3 { margin: 0 0 8px; }
.p-league .shame dl div:first-child { padding-top: 2px; }
.p-league .shame dd { white-space: normal; line-height: 1.2; }
.p-league .shame dd.n { align-self: end; }

/* ------------------------------------------------------------------
   DESKTOP
------------------------------------------------------------------- */
@media (max-width: 379px) {            /* small phones: a little tighter so names still fit */
  .p-league table.league img.badge { width: 30px; height: 30px; }
  .p-league table.league .tw > svg.badge { margin: 0 4px; }
  .p-league table.league .c-rk { width: 46px; }
  .p-league table.league .c-wk { width: 32px; }
  .p-league table.league .c-sr { width: 38px; }
  .p-league table.league .c-pts { width: 42px; }
  .p-league table.league td, .p-league table.league th { padding-left: 3px; padding-right: 3px; }
  .p-league table.league .rk-in { gap: 3px; }
  .p-league table.league td.team { font-size: 16px; }
}

@media (min-width: 1000px) {
  .p-league .page {
    max-width: 1180px;
    padding: 28px var(--page-pad) 64px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 28px;
    align-items: start;
  }
  .p-league .picker { grid-column: 1 / -1; grid-row: 1; justify-self: end; width: 400px; }
  .p-league .picker select { max-width: none; }
  .p-league #table { grid-column: 1 / -1; grid-row: 2; }
  .p-league #hero { grid-column: 1 / -1; grid-row: 3; }
  .p-league #points { grid-column: 1 / 8; grid-row: 5; }
  .p-league #tiles-sec { grid-column: 8 / 13; grid-row: 5; }
  .p-league #leaders { grid-column: 1 / -1; grid-row: 6; }
  .p-league #podcast { grid-column: 1 / 6; grid-row: 4; }
  .p-league #podcast.full { grid-column: 1 / -1; }
  .p-league #motm { grid-column: 1 / -1; grid-row: 4; }
  .p-league #motm.half { grid-column: 6 / 13; }
  .p-league #data-sec { grid-column: 1 / -1; grid-row: 7; max-width: 720px; }
  .p-league .site-foot { grid-column: 1 / -1; grid-row: 8; margin-top: 8px; }
  .p-league table.league .c-rk { width: 90px; }
  .p-league table.league .c-wk { width: 110px; }
  .p-league table.league .c-sr { width: 110px; }
  .p-league table.league .c-pts { width: 100px; }
  .p-league .tbl-head h1 { font-size: 27px; }
  .p-league .tbl-upd { font-size: 14px; }
  .p-league table.league .mv { width: 12px; height: 12px; }
  .p-league table.league img.badge { width: 48px; height: 48px; }
  .p-league table.league .tw > svg.badge { margin: 0 13px; }
  .p-league .hero { padding: 26px 28px; }
  .p-league .round-head h2 { font-size: 32px; }
  .p-league .round-week { font-size: 15px; }
  .p-league .round-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .p-league .rt { padding: 18px 18px 16px; }
  .p-league .rt-label { font-size: 15px; margin-bottom: 14px; }
  .p-league .rt-name { font-size: 22px; }
  .p-league .rt-val { font-size: 44px; margin-top: 12px; }
  .p-league .rt-sub { font-size: 14px; }
  .p-league .motm { padding: 22px 26px; }
  .p-league .motm-head h2 { font-size: 18px; }
  .p-league .motm-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .p-league .table-card { padding: 16px 16px 10px; }
  .p-league table.league { font-size: 16px; font-family: "PT Sans", sans-serif; }
  .p-league table.league td { padding: 11px 8px 10px; }
  .p-league table.league th { font-size: 12.5px; padding: 6px 8px 9px; }
  .p-league table.league td.team { font-size: 22px; }
  .p-league table.league td.pts { font-size: 20px; }
  .p-league .meter { height: 4px; margin-top: 7px; }
  .p-league .src { gap: 13px; }
  .p-league .src-row .hd { font-size: 14px; }
  .p-league .stack { height: 20px; }
  .p-league .stack i { line-height: 20px; }
  .p-league .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-league .tile { padding: 18px 18px 16px; }
  .p-league .tile b { font-size: 52px; }
  .p-league .tile-ic { top: 16px; right: 16px; width: 34px; height: 34px; }
  .p-league .tile span { font-size: 14px; }
  .p-league .snap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; overflow: visible; }
  .p-league .lb { width: auto; padding: 18px 20px; }
  .p-league .lb h3 { font-size: 20px; }
  .p-league .lb li { font-size: 15px; padding: 9px 0; }
  .p-league .shame dd.n { font-size: 30px; }
}
@media (min-width: 1500px) {
  .p-league .page { max-width: 1320px; }
}

/* ------------------------------------------------------------------
   PHP VERSION: the footer line and footer follow the content
------------------------------------------------------------------- */
@media (min-width: 1000px) {
  .p-league .updated { grid-column: 1 / -1; }
  .p-league .updated, .p-league .site-foot { grid-row: auto; }
}
