@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Barlow:wght@400;500;600;700;800&display=swap");
:root {
  --navy: #1f3b63;
  --gold: #b8932e;
  --dg: #8f6f14;
  --ivory: #faf8f3;
  --line: #e6e2d9;
  --gray: #5b6578;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--navy);
  font-family: Barlow, Arial;
}
.statshub {
  width: min(1240px, calc(100% - 32px));
  margin: 12px auto 44px;
}
.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  background: #fff;
}
.hub-head span,
.table-head span {
  color: var(--dg);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.hub-head h1 {
  margin: 3px 0;
  font: 900 clamp(2rem, 4vw, 3.2rem)/0.95 "Barlow Condensed";
}
.hub-head p {
  margin: 5px 0;
  color: var(--gray);
  font-size: 0.88rem;
}
.data-status {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--ivory);
}
.data-status i {
  grid-row: 1/3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f9d61;
}
.data-status b {
  font-size: 0.68rem;
}
.data-status small {
  color: var(--gray);
  font-size: 0.68rem;
}
.league-strip {
  display: flex;
  gap: 0;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.league-strip button {
  min-width: 90px;
  padding: 11px 15px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 3px solid transparent;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}
.league-strip button.active {
  border-bottom-color: var(--gold);
  color: var(--dg);
}
.control-deck {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.control-deck label {
  padding: 9px;
  border-right: 1px solid var(--line);
}
label span {
  display: block;
  margin-bottom: 5px;
  color: var(--gray);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
select,
input {
  width: 100%;
  padding: 9px;
  border: 1px solid #d8d3c7;
  background: #fff;
  color: var(--navy);
  font: 700 0.82rem Barlow;
}
.view-tabs {
  display: flex;
  gap: 22px;
  overflow: auto;
  margin-top: 8px;
  padding: 0 12px;
  border-block: 1px solid var(--line);
  background: #fff;
}
.view-tabs button,
.view-tabs a {
  flex: none;
  padding: 11px 1px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}
.view-tabs button.active {
  border-color: var(--gold);
  color: var(--dg);
}
.view-tabs a {
  margin-left: auto;
}
.category-row {
  display: grid;
  grid-template-columns: 260px 260px 1fr;
  gap: 10px;
  align-items: end;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.result-count {
  text-align: right;
  color: var(--gray);
  font-size: 0.75rem;
}
.leader-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.leader-card {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  background: #fff;
}
.leader-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  object-position: center bottom;
}
.leader-card span,
.leader-card small,
.leader-card strong {
  display: block;
}
.leader-card span {
  color: var(--dg);
  font-size: 0.62rem;
  font-weight: 800;
}
.leader-card strong {
  font-size: 0.9rem;
}
.leader-card small {
  color: var(--gray);
  font-size: 0.68rem;
}
.leader-card b {
  font: 900 1.35rem "Barlow Condensed";
}
.table-card {
  border: 1px solid var(--line);
  background: #fff;
}
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-left: 4px solid var(--gold);
}
.table-head h2 {
  margin: 2px 0 0;
  font: 800 1.35rem "Barlow Condensed";
}
.table-head button {
  padding: 8px 11px;
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 800;
}
.table-wrap {
  overflow: auto;
}
.table-wrap table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.table-wrap th,
.table-wrap td {
  height: 68px;
  padding: 8px 10px;
  border-top: 1px solid #ece9e1;
  text-align: center;
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table-wrap th {
  height: 40px;
  background: var(--navy);
  color: #d9bc62;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  width: 44px;
  padding-right: 2px;
  padding-left: 7px;
  text-align: center;
}
.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
  width: 256px;
  padding-right: 10px;
  padding-left: 2px;
  text-align: left;
}
.table-wrap th:nth-child(n + 3),
.table-wrap td:nth-child(n + 3) {
  width: 78px;
  min-width: 78px;
}
.table-wrap tbody tr:hover {
  background: #fbf8ef;
}

.table-actions{display:flex;align-items:center;gap:9px}.stat-key{position:relative}.stat-key summary{list-style:none;cursor:pointer;border:1px solid #b8b2a5;background:#fff;padding:9px 12px;color:#1f3b63;font-size:.7rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.stat-key summary::-webkit-details-marker{display:none}.stat-key[open] summary{border-color:#b8932e;background:#f7f1df}.stat-key>div{position:absolute;z-index:20;right:0;top:calc(100% + 7px);display:grid;grid-template-columns:repeat(2,minmax(210px,1fr));gap:0;width:min(540px,80vw);max-height:370px;overflow:auto;border:1px solid #d7d0c2;background:#fff;box-shadow:0 18px 42px #14243a2b}.stat-key>div div{display:grid;grid-template-columns:48px 1fr;gap:8px;padding:10px 12px;border-bottom:1px solid #ece7dc}.stat-key>div b{color:#8f6f14;font-size:.72rem}.stat-key>div span{color:#5b6578;font-size:.72rem;line-height:1.35}.table-wrap th small{display:none}.table-wrap th[title]{cursor:help}.table-wrap th[title]:hover small{display:block;position:absolute;z-index:12;top:100%;right:0;width:170px;padding:7px 9px;background:#fff;color:#1f3b63;border:1px solid #b8932e;box-shadow:0 8px 22px #14243a24;font-size:.65rem;letter-spacing:0;text-align:left;text-transform:none;white-space:normal}
@media(max-width:620px){.table-head{align-items:flex-start}.table-actions{align-items:stretch;flex-direction:column}.stat-key>div{grid-template-columns:1fr;width:min(320px,88vw)}}
.entity {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 238px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.entity-visual {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
}
.entity-visual .player-portrait,
.entity-visual .team-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  object-position: center bottom;
}
.entity-visual .team-mark {
  position: absolute;
  right: -3px;
  bottom: 0;
  width: 25px;
  height: 25px;
  padding: 2px;
  border: 1px solid #e6e2d9;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(31, 59, 99, 0.14);
}
.entity b,
.entity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity b {
  font-size: 0.88rem;
  line-height: 1.15;
}
.entity small {
  margin-top: 3px;
  color: var(--gray);
  font-size: 0.7rem;
}
.loading {
  padding: 80px;
  text-align: center;
  color: var(--gray);
}
.source-note {
  padding: 13px 16px;
  border-left: 4px solid var(--gold);
  background: #fff;
  color: var(--gray);
  font-size: 0.72rem;
  line-height: 1.45;
}
.source-note b {
  color: var(--dg);
  margin-right: 10px;
}
@media (max-width: 850px) {
  .control-deck {
    grid-template-columns: 1fr 1fr;
  }
  .control-deck label {
    border-bottom: 1px solid var(--line);
  }
  .category-row {
    grid-template-columns: 1fr 1fr;
  }
  .result-count {
    grid-column: 1/-1;
    text-align: left;
  }
  .leader-deck {
    grid-template-columns: 1fr;
  }
  .view-tabs a {
    margin-left: 0;
  }
}
@media (max-width: 560px) {
  .statshub {
    width: calc(100% - 20px);
  }
  .hub-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .control-deck {
    grid-template-columns: 1fr;
  }
  .category-row {
    grid-template-columns: 1fr;
  }
  .hub-head h1 {
    font-size: 2.2rem;
  }
  .table-wrap th:nth-child(2),
  .table-wrap td:nth-child(2) {
    width: 230px;
  }
  .entity {
    grid-template-columns: 56px minmax(0, 1fr);
    width: 212px;
  }
  .entity-visual,
  .entity-visual .player-portrait,
  .entity-visual .team-logo {
    width: 54px;
    height: 54px;
  }
  .entity-visual .team-mark {
    width: 23px;
    height: 23px;
  }
}
