:root {
  --hayate-maroon: #6f1024;
  --hayate-maroon-dark: #4f0a19;
  --hayate-gold: #d9a62e;
  --surface: #ffffff;
  --surface-soft: #f6f3f4;
  --border: #e5dadd;
  --text: #22191c;
  --muted: #74686c;
  --danger: #a82032;
  --shadow: 0 12px 30px rgba(77, 18, 35, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface-soft);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
select {
  font: inherit;
}

.stats-header {
  background:
    linear-gradient(
      135deg,
      var(--hayate-maroon-dark),
      var(--hayate-maroon)
    );
  color: #fff;
}

.stats-header__inner {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto;
  max-width: 1100px;
  min-height: 76px;
  padding: 12px 16px;
}

.stats-header__back {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 30px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
}

.stats-header__eyebrow,
.stats-panel__eyebrow,
.stats-hero__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 4px;
}

.stats-header h1 {
  font-size: 20px;
  margin: 0;
}

.stats-main {
  margin: 0 auto;
  max-width: 1100px;
  padding: 18px 12px 36px;
}

.stats-hero {
  align-items: end;
  background:
    linear-gradient(
      145deg,
      #fff,
      #f9f4f5
    );
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.stats-hero__label,
.stats-panel__eyebrow {
  color: var(--hayate-maroon);
}

.stats-hero h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.stats-hero p:not(.stats-hero__label) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

.season-select {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
}

.season-select span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.season-select select {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 800;
  min-height: 42px;
  padding: 0 34px 0 12px;
}

.stats-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-top: 14px;
  overflow: hidden;
}

.stats-panel__top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.stats-panel__top h2 {
  font-size: 19px;
  margin: 0;
}

.stats-panel__count {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 7px 10px;
}

.stats-tabs {
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 12px;
}

.stats-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  min-height: 46px;
}

.stats-tab.is-active {
  border-bottom-color: var(--hayate-maroon);
  color: var(--hayate-maroon);
}

.stats-message {
  color: var(--muted);
  padding: 34px 18px;
  text-align: center;
}

.stats-message.is-error {
  color: var(--danger);
}

.stats-message button {
  background: var(--hayate-maroon);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  margin-top: 10px;
  min-height: 42px;
  padding: 0 18px;
}

.stats-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.stats-table {
  border-collapse: collapse;
  min-width: 900px;
  width: 100%;
}

.stats-table th,
.stats-table td {
  border-bottom: 1px solid #eee6e8;
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
}

.stats-table th {
  background: #fbf8f9;
  color: var(--muted);
  font-size: 11px;
  position: sticky;
  top: 0;
}

.stats-table th:first-child,
.stats-table td:first-child {
  left: 0;
  min-width: 138px;
  position: sticky;
  text-align: left;
  z-index: 1;
}

.stats-table th:first-child {
  background: #fbf8f9;
  z-index: 2;
}

.stats-table td:first-child {
  background: #fff;
  color: var(--hayate-maroon-dark);
  font-weight: 800;
}

.stats-table tbody tr:last-child td {
  border-bottom: 0;
}

.stats-table .is-key {
  color: var(--hayate-maroon);
  font-weight: 900;
}

.stats-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 12px 4px 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .stats-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .season-select {
    width: 100%;
  }

  .season-select select {
    width: 100%;
  }

  .stats-panel__top {
    align-items: flex-start;
  }
}

@media (min-width: 760px) {
  .stats-main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .stats-hero,
  .stats-panel {
    border-radius: 24px;
  }
}
