/* ══ Stats hub (stats.php) ════════════════════════════════════════════════════
   Builds on includes/team.css (.tpd-* cards, lists, tables, tabs) and the .tp-*
   hero in _styles.css. Versioned by filemtime like the other page stylesheets. */

.sh-page .sh-mark { width: 132px; flex: none; }
.sh-page .sh-mark img { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.th-first { margin-top: 0; }
.th-section { margin-top: 38px; }

/* ── Season bar ───────────────────────────────────────────────────────────── */
.sh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 13px 26px;
          background: rgba(255,255,255,.6); border-bottom: 1px solid #dfe3e7; font-family: helvetica, arial, sans-serif; }
.sh-bar-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6a7178; }
.sh-bar select { padding: 8px 28px 8px 11px; border: 1px solid #d3d9de; border-radius: 9px; background: #fff; cursor: pointer;
                 font: 700 13px helvetica, arial, sans-serif; color: #22262b; }
.sh-bar select:focus { outline: none; border-color: #252f52; box-shadow: 0 0 0 3px rgba(37,47,82,.15); }
.sh-bar-note { flex: 1 1 auto; font-size: 12px; color: #6a7178; }
.sh-bar .tpd-link { font-size: 11px; }

/* ── Leaderboards ─────────────────────────────────────────────────────────── */
.sh-boards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; align-items: start; }
.sh-board { overflow: hidden; border-top: 4px solid var(--c,#252f52); }
.sh-board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 13px 16px 0; }
.sh-board-head h2 { margin: 0; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 23px; line-height: 1;
                    font-weight: 600; text-transform: uppercase; color: #22262b; }
.sh-board .tpd-tabs { margin: 10px 16px 0; }
.sh-board .tpd-tab[aria-selected="true"] { background: var(--c,#252f52); color: #fff; }

/* Leader panel + chasing pack. The leader photo swaps to preview whichever
   chaser you point at, so the whole board reads from one place. */
.sh-panel { display: grid; grid-template-columns: 178px minmax(0,1fr); gap: 0; align-items: stretch; margin-top: 12px; border-top: 1px solid #eef0f2; }
.sh-panel[hidden] { display: none; }
.sh-leader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 16px 12px 18px;
             text-align: center; color: inherit; text-decoration: none; border-right: 1px solid #eef0f2; background: #fafbfc; }
.sh-face { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
           background: var(--pc,#3d4852); color: #fff; font: 700 27px 'Josefin Sans', helvetica, arial, sans-serif; letter-spacing: .04em;
           box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e0e4e8; transition: box-shadow .18s ease; }
.sh-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-leader:hover .sh-face { box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--pc,#3d4852); }
.sh-leader-name { margin-top: 11px; font-size: 16px; font-weight: 700; line-height: 1.15; color: #22262b; text-transform: uppercase;
                  font-family: 'Josefin Sans', helvetica, arial, sans-serif; letter-spacing: .02em; }
.sh-leader:hover .sh-leader-name { text-decoration: underline; }
.sh-leader-team { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; font-size: 11px; color: #8a929c; }
.sh-leader-team img { width: 20px; height: 20px; object-fit: contain; }
.sh-leader-val { margin-top: 10px; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 44px; line-height: .95;
                 font-weight: 600; color: #22262b; font-variant-numeric: tabular-nums; }
.sh-leader-unit { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #9aa1a9; }
.sh-leader.is-preview .sh-leader-name, .sh-leader.is-preview .sh-leader-val { color: #252f52; }

.sh-chase { list-style: none; margin: 0; padding: 4px 0; }
.sh-chase li a { display: grid; grid-template-columns: 20px minmax(0,1fr) auto 20px max-content; align-items: center; gap: 9px;
                 padding: 5px 14px 5px 10px; color: #3a4048; text-decoration: none; font-size: 13px; }
.sh-chase li a:hover, .sh-chase li a:focus-visible { background: #f3f6fa; color: #22262b; outline: none; }
.sh-chase .sh-rank { text-align: right; font-size: 11px; font-weight: 700; color: #a6adb5; font-variant-numeric: tabular-nums; }
.sh-chase .sh-who { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sh-chase .sh-gp { font-size: 10.5px; color: #a6adb5; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sh-chase .sh-crest { width: 20px; height: 20px; object-fit: contain; }
.sh-chase .sh-val { justify-self: end; min-width: 3.5ch; text-align: right; font-weight: 700; color: #22262b; font-variant-numeric: tabular-nums; }
.sh-note { grid-column: 1 / -1; padding: 8px 14px 10px; border-top: 1px solid #f0f2f4; font-size: 11px; color: #9aa1a9; }
.sh-empty { grid-column: 1 / -1; padding: 30px 16px; text-align: center; color: #8a929c; }

/* ── Season leaderboard table ─────────────────────────────────────────────── */
.sh-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; border-bottom: 1px solid #eef0f2; }
.sh-filter { flex: 1 1 180px; min-width: 0; padding: 8px 11px; border: 1px solid #d6dbe0; border-radius: 8px; font: 13px helvetica, arial, sans-serif; color: #22262b; }
.sh-filter:focus, .sh-select:focus { outline: none; border-color: #252f52; box-shadow: 0 0 0 3px rgba(37,47,82,.13); }
.sh-select { padding: 7px 26px 7px 9px; border: 1px solid #d6dbe0; border-radius: 8px; background: #fff; cursor: pointer;
             font: 700 12px helvetica, arial, sans-serif; color: #22262b; }
.sh-count { padding: 9px 16px 0; font-size: 11.5px; color: #8a929c; }
.sh-table td { vertical-align: middle; }
.sh-table th button { -webkit-appearance: none; appearance: none; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
                      font: inherit; color: inherit; text-align: inherit; text-transform: inherit; letter-spacing: inherit; }
.sh-table th button:hover { color: #22262b; }
.sh-table th button:focus-visible { outline: 2px solid #252f52; outline-offset: 2px; }
.sh-table th button:after { content: '\2195'; margin-left: 4px; font-size: 9px; opacity: .35; }
.sh-table th button[aria-sort="desc"]:after { content: '\25BC'; opacity: 1; }
.sh-table th button[aria-sort="asc"]:after { content: '\25B2'; opacity: 1; }
.sh-table th.is-sorted { color: #22262b; background: #eef1f5; }
.sh-who-cell { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.sh-who-cell .sh-face { width: 32px; height: 32px; font-size: 11px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e0e4e8; }
.sh-who-cell b { display: block; font-size: 13px; color: #22262b; }
.sh-who-cell em { display: block; font-size: 10.5px; font-style: normal; font-weight: 400; color: #9aa1a9; }
.sh-who-cell:hover b { color: #252f52; text-decoration: underline; }
.sh-team-cell { display: inline-flex; align-items: center; gap: 7px; color: #3a4048 !important; font-weight: 600 !important; text-decoration: none; }
.sh-team-cell img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.sh-more-wrap { padding: 4px 16px 16px; text-align: center; }
.sh-rookie { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px; background: #fbf1dc; color: #7a560f;
             font-size: 9px; font-weight: 700; line-height: 15px; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }

/* ── Team scoring ─────────────────────────────────────────────────────────── */
.sh-scoring li { gap: 10px; }
.sh-scoring .tpd-list-main b { display: flex; align-items: center; gap: 4px; }
.sh-bars { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.sh-bar-track { flex: 1 1 auto; height: 6px; border-radius: 3px; background: #eef1f4; overflow: hidden; }
.sh-bar-track i { display: block; height: 100%; border-radius: 3px; background: var(--c,#3d4852); }
.sh-bar-track.is-ga i { background: #b3261e; opacity: .55; }
.sh-bars em { flex: none; width: 5.5ch; font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: .06em;
              text-transform: uppercase; color: #9aa1a9; }

/* ── All-time ─────────────────────────────────────────────────────────────── */
.sh-alltime { border-top: 4px solid #750207; }
.sh-alltime .tpd-tab[aria-selected="true"] { background: #750207; color: #fff; }
.sh-alltime .sh-panel { grid-template-columns: 200px minmax(0,1fr) minmax(0,1fr); }
.sh-alltime .sh-chase { columns: 1; }
.sh-alltime .sh-chase.is-second { border-left: 1px solid #eef0f2; }
.sh-alltime .sh-leader-val { font-size: 50px; }
.sh-yrs { font-size: 10px; color: #a6adb5; }

/* ── CTA ──────────────────────────────────────────────────────────────────── */
.sh-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 34px; padding: 20px 24px;
          border-radius: 12px; color: #fff; background: linear-gradient(135deg,#1a2036 0%,#252f52 60%,#1a2036 100%); border-top: 4px solid #3cd918;
          box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.sh-cta b { display: block; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 24px; line-height: 1.1; font-weight: 600; }
.sh-cta span { display: block; margin-top: 4px; font-size: 13px; color: rgba(255,255,255,.75); }
.sh-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.sh-cta .tpd-btn { width: auto; margin-top: 0; padding: 11px 18px; background: #3cd918; color: #fff; }
.sh-cta .tpd-btn:hover { background: #32bd14; }
.sh-cta .tpd-btn.is-ghost { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; }
.sh-cta .tpd-btn.is-ghost:hover { background: rgba(255,255,255,.1); }

@media (max-width: 1100px) {
  .sh-alltime .sh-panel { grid-template-columns: 178px minmax(0,1fr); }
  .sh-alltime .sh-chase.is-second { border-left: 0; border-top: 1px solid #eef0f2; grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sh-boards { grid-template-columns: minmax(0,1fr); }
  .sh-page .sh-mark { width: 96px; }
}
@media (max-width: 620px) {
  .sh-bar { padding: 11px 12px; }
  .sh-page .sh-mark { width: 76px; }
  .sh-panel, .sh-alltime .sh-panel { grid-template-columns: minmax(0,1fr); }
  .sh-leader { border-right: 0; border-bottom: 1px solid #eef0f2; }
  .sh-alltime .sh-chase.is-second { border-top: 1px solid #eef0f2; }
  .sh-chase li a { grid-template-columns: 20px minmax(0,1fr) 20px max-content; }
  .sh-chase .sh-gp { display: none; }
  .sh-tools .sh-select { flex: 1 1 30%; }
  .sh-cta { padding: 18px; }
  .sh-cta-btns, .sh-cta .tpd-btn { width: 100%; }
}
