:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --subtle: #80868b;
  --border: #dadce0;
  --border-light: #eceff1;
  --header: #f8f9fa;
  --link: #1a73e8;
  --success: #137333;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

a { color: var(--link); }

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 16px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

nav a:hover { color: var(--text); }

.main-content { padding: 26px 0 34px; }

.intro { margin-bottom: 26px; }

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 650;
}

.intro > p:not(.summary) {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.section-block { margin-top: 28px; }
.recent-section { margin-top: 0; }
.leaderboard-section { margin-top: 34px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

input[type="search"] {
  width: 240px;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

input[type="search"]:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 1px #8ab4f8;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--surface);
}

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
}

th {
  background: var(--header);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }

.rank,
.score,
.duration {
  font-variant-numeric: tabular-nums;
}

.rank { font-weight: 600; }
.team { font-weight: 500; color: var(--text); }
.score { font-weight: 600; }
.duration { color: var(--success); font-weight: 600; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 24px; }

.team-link {
  appearance: none;
  border: 0;
  border-bottom: 1px dotted #9aa0a6;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  cursor: pointer;
}

.team-link:hover,
.team-link:focus-visible {
  color: var(--link);
  border-bottom-color: var(--link);
  outline: none;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pagination[hidden] { display: none; }

.pagination button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.pagination button:hover:not(:disabled) { background: var(--header); }
.pagination button:disabled { color: #bdc1c6; cursor: default; }

.method-note {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.method-note strong { color: var(--text); font-weight: 600; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  color: var(--subtle);
  font-size: 11px;
}

.team-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(82vh, 720px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(60, 64, 67, .22);
}

.team-dialog::backdrop {
  background: rgba(32, 33, 36, .38);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.dialog-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { color: var(--text); }

.dialog-content {
  padding: 14px 20px 20px;
  overflow: auto;
}

.dialog-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.team-history-table {
  min-width: 620px;
}

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1180px); }
  .main-content { padding-top: 20px; }
  .header-inner { min-height: 48px; }
  h1 { font-size: 25px; }
  .leaderboard-head { align-items: stretch; flex-direction: column; }
  input[type="search"] { width: 100%; }
  .pagination { justify-content: space-between; }
  footer { flex-direction: column; }

  .team-dialog {
    width: calc(100% - 16px);
    max-height: 88vh;
  }

  .dialog-head {
    padding: 15px 14px 12px;
  }

  .dialog-content {
    padding: 12px 14px 16px;
  }
}
