.season-pill {
  display: inline-block;
  margin-inline-start: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink, #1a1410);
}

.stats-main {
  padding: 0 0 3rem;
  min-height: auto;
  border-bottom: none;
}

.page-inner.stats-main {
  max-width: 56rem;
  width: calc(100% - 0px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

#page-board .stats-title,
#page-board .support,
#page-board .status,
#page-weapons .stats-title,
#page-weapons .support,
#page-weapons .status,
#page-stats .stats-title {
  text-align: center;
  width: 100%;
}

#page-board .toolbar,
#page-weapons .toolbar {
  justify-content: center;
  width: 100%;
  max-width: 40rem;
}

#page-board .page-inner.stats-main,
#page-weapons .page-inner.stats-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-board .table-scroll,
#page-board .board,
#page-weapons .table-scroll,
#page-weapons .board {
  width: min(52rem, 100%);
  align-self: center;
}

.stats-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.5vw, 2.6rem);
  letter-spacing: 0.03em;
  line-height: 1.05;
}

.table-scroll {
  width: 100%;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.th-sort {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  cursor: pointer;
}

.th-sort:hover,
.th-sort.is-active {
  color: var(--accent-2);
}

.th-sort.is-active::after {
  content: " ▾";
  font-size: 0.75em;
}

.stats-main > .support {
  margin: 0 0 0.25rem;
  color: var(--muted);
  max-width: 36rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin: 1.25rem 0 1.15rem;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.toolbar select,
.toolbar input {
  min-width: 8rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(12, 16, 20, 0.55);
  color: var(--ink);
  font: inherit;
}

.toolbar select:focus,
.toolbar input:focus {
  outline: 1px solid var(--accent-2);
  outline-offset: 1px;
}

.toolbar .grow {
  flex: 1 1 14rem;
}

.toolbar .grow input {
  width: 100%;
  min-width: 0;
}

.toolbar button {
  cursor: pointer;
  font: inherit;
  border: none;
}

.status {
  color: var(--accent-2);
  margin: 0 0 1rem;
}

.board {
  width: 100%;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-scroll .board {
  margin-left: 0;
  margin-right: 0;
  min-width: 28rem;
}

.board th,
.board td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.board th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.board a {
  color: var(--ink);
  text-decoration: none;
}

.board a:hover {
  color: var(--accent-2);
}

.board td:nth-child(n + 3) {
  font-variant-numeric: tabular-nums;
}

.player-card {
  width: min(48rem, 100%);
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1.35rem 0 1.75rem;
  border-top: 1px solid var(--line);
  align-self: center;
}

.player-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  text-align: center;
}

.player-card .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.stat-grid div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.stat-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.stat-grid strong .delta {
  font-size: 0.85em;
  margin-inline-start: 0.3rem;
}

.stat-grid strong .delta.is-up {
  color: #5ecf8e;
}

.stat-grid strong .delta.is-down {
  color: #e07a4a;
}

.stat-grid strong.is-na {
  color: var(--muted);
  font-weight: 700;
}

.stat-grid strong.is-up {
  color: #5ecf8e;
}

.stat-grid strong.is-down {
  color: #e07a4a;
}

#weapons-signature.is-na {
  color: var(--muted);
}

#player-weapons-table tr.is-signature td {
  color: var(--accent-2);
}

.weapon-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.65rem 0 0.25rem;
}

.weapon-pager button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  text-transform: uppercase;
}

.weapon-pager button:hover:not(:disabled) {
  border-color: var(--accent-2);
  color: var(--ink);
}

.weapon-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.weapon-pager span {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.h2h-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2.5rem;
  margin: 0 0 2rem;
  width: 100%;
}

.h2h-grid > div {
  min-width: 0;
}

.h2h-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  text-align: center;
}

.h2h-list {
  width: 100%;
}

.h2h-rank {
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
}

.h2h-list a {
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.h2h-list a:hover {
  color: var(--accent-2);
}

.h2h-list li span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex: 0 0 auto;
}

.h2h-list .empty-h2h {
  color: var(--muted);
  justify-content: flex-start;
}

.player-card > .support {
  margin-top: 0.25rem;
  text-align: center;
}

.player-card > .season-list {
  width: 100%;
}

@media (max-width: 640px) {
  .h2h-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .stat-grid strong {
    font-size: 1rem;
  }

  .toolbar.rank-filters {
    gap: 0.55rem;
  }

  .toolbar.rank-filters .grow {
    flex: 1 1 100%;
  }

  .toolbar select,
  .toolbar input {
    min-width: 0;
    width: 100%;
  }

  .board {
    font-size: 0.82rem;
  }

  .board th,
  .board td {
    padding: 0.55rem 0.4rem;
  }

  .table-scroll .board {
    min-width: 26rem;
  }
}

.season-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.season-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.season-list.h2h-list li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  justify-content: stretch;
  gap: 0.65rem;
}

.panel-block {
  margin: 1.75rem 0 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.panel-block h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  letter-spacing: 0.03em;
}

.support.narrow {
  max-width: 36rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.subhead {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.curve-panel {
  max-width: 44rem;
  margin: 0.35rem 0 1.25rem;
}

.curve-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.85rem;
  margin: 0 0 0.55rem;
}

.curve-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.curve-ranges button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  text-transform: uppercase;
}

.curve-ranges button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8f1;
}

.curve-ranges button:hover {
  border-color: var(--accent-2);
  color: var(--ink);
}

.curve-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.chart-wrap.is-dragging {
  cursor: grabbing;
}

.chart-wrap.is-dragging svg {
  cursor: grabbing;
}

.curve-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid var(--line);
}

.curve-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 3.5rem;
}

.curve-stat span {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.curve-stat strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink);
}

.curve-stat--delta.is-up strong {
  color: #5ecf8e;
}

.curve-stat--delta.is-down strong {
  color: #e07a4a;
}

.chart-wrap {
  position: relative;
  margin: 0;
  padding: 0.35rem 0 0.5rem;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  overflow: visible;
  touch-action: none;
}

.chart-wrap .axis {
  fill: none;
  stroke: rgba(242, 235, 224, 0.22);
  stroke-width: 1;
}

.chart-wrap .grid {
  fill: none;
  stroke: rgba(242, 235, 224, 0.08);
  stroke-width: 1;
}

.chart-wrap .baseline {
  fill: none;
  stroke: rgba(242, 235, 224, 0.28);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-wrap .baseline-lab {
  fill: rgba(242, 235, 224, 0.4);
  font-size: 10px;
  font-family: var(--font-body);
}

.chart-wrap .area {
  stroke: none;
}

.chart-wrap .line {
  fill: none;
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-wrap .line--up {
  stroke: #5ecf8e;
}

.chart-wrap .line--down {
  stroke: #c45c26;
}

.chart-wrap .dot {
  fill: #e8a05c;
  stroke: var(--bg-1, #151c24);
  stroke-width: 1.5;
}

.chart-wrap .dot--end {
  fill: #f2ebe0;
  stroke: #5ecf8e;
  stroke-width: 2;
}

.chart-wrap .dot--peak {
  fill: #5ecf8e;
}

.chart-wrap .dot--low {
  fill: #c45c26;
}

.chart-wrap .dot--hover {
  fill: #f2ebe0;
  stroke: #e8a05c;
  stroke-width: 2;
  pointer-events: none;
}

.chart-wrap .crosshair {
  stroke: rgba(242, 235, 224, 0.35);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  pointer-events: none;
}

.chart-wrap .label,
.chart-wrap .xlabel,
.chart-wrap .ylabel,
.chart-wrap .point-lab {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
}

.chart-wrap .ylabel {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-wrap .point-lab {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.curve-tip {
  position: absolute;
  top: 0.35rem;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(12, 16, 20, 0.94);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: 2px;
}

.curve-tip strong {
  display: block;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.curve-tip span {
  color: var(--muted);
  font-size: 0.72rem;
}

html[dir="rtl"] .chart-wrap .ylabel {
  /* keep numeric axis readable LTR */
  direction: ltr;
  unicode-bidi: isolate;
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
