:root {
  --paper: #f6f8f7;
  --surface: #ffffff;
  --ink: #17221f;
  --muted: #6a7772;
  --line: #dfe6e2;
  --gem: #138a68;
  --gem-soft: #e8f4ef;
  --loss: #b24b43;
  --draw: #7a6b42;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(19, 138, 104, 0.035) 1px, transparent 1px)
      0 0 / 80px 80px,
    var(--paper);
}

button,
a {
  font: inherit;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 44px;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gem);
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 650;
  letter-spacing: -0.045em;
}

.summary {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 12px;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 650;
}

.total-count {
  color: var(--muted);
  font-size: 13px;
}

.match-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.match-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(150px, 1fr) 110px 86px;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid var(--line);
}

.match-row:last-child {
  border-bottom: 0;
}

.match-row::before {
  position: absolute;
  inset: 16px auto 16px 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--gem);
  content: "";
}

.time {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.meta,
.fingerprint {
  color: var(--muted);
  font-size: 12px;
}

.player {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.avatar-frame {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 21px;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-copy {
  min-width: 0;
}

.player-label {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 600;
}

.fingerprint {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  font: 650 18px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.result {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--gem-soft);
  color: var(--gem);
  font-size: 11px;
  font-weight: 700;
}

.result.loss {
  background: #f8ebe9;
  color: var(--loss);
}

.result.draw {
  background: #f4f0e4;
  color: var(--draw);
}

.replay-link {
  justify-self: end;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.replay-link:hover {
  border-color: var(--gem);
  background: var(--gem-soft);
  color: var(--gem);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.pagination button:disabled {
  color: #a4afaa;
  cursor: default;
  opacity: 0.65;
}

.empty-state,
.error-state {
  padding: 42px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.error-state {
  color: var(--loss);
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 22px, 960px);
    padding-top: 30px;
  }

  .masthead {
    display: block;
  }

  .summary {
    margin: 14px 0 0;
    white-space: normal;
  }

  .match-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .player {
    grid-column: 1;
  }

  .score-block {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .replay-link {
    grid-column: 2;
    grid-row: 2;
  }
}
