:root {
  color-scheme: light;
  --paper: #fbfbfd;
  --ink: #191e2d;
  --muted: #52596a;
  --line: #d7dbe5;
  --accent: #2444ad;
  --surface: #eff1f6;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
main { max-width: 73rem; margin: auto; padding: clamp(1.5rem, 6vw, 4rem) clamp(.75rem, 4vw, 2rem); }
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .75rem 2rem;
  padding-bottom: 1.5rem;
}
h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.25rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.065em;
}
.subtitle { margin: .85rem 0 0; }
.updated, footer, .filter-status { color: var(--muted); font-size: .875rem; }
.updated { margin: 0; font-variant-numeric: tabular-nums; }
.updated time { white-space: nowrap; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .85rem 2rem;
  border-block-start: 1px solid var(--line);
  padding: 1rem 0;
}
.periods, #filters, .fallback { display: flex; flex-wrap: wrap; gap: .4rem .75rem; }
#filters[hidden] { display: none; }
.fallback { gap: .5rem 1rem; }
.periods a, .fallback a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .5rem;
  border-bottom: 2px solid transparent;
  color: inherit;
  font-size: .9375rem;
  text-decoration: none;
}
.periods a:first-child { padding-left: 0; }
.periods a[aria-current], .fallback a[aria-current] {
  color: var(--accent);
  border-bottom-color: currentColor;
  font-weight: 650;
}
label { display: grid; gap: .25rem; min-width: 0; color: var(--muted); font-size: .875rem; }
select {
  appearance: none;
  max-width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .5rem 2rem .5rem .7rem;
  color: var(--ink);
  font: inherit;
  font-size: .9375rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right .95rem center / .285rem .285rem no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right .665rem center / .285rem .285rem no-repeat,
    var(--paper);
}
a[href], select { cursor: pointer; }
a[href]:hover, a[href]:active { text-decoration: underline; text-underline-offset: .19em; }
select:hover, select:active { border-color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filter-status { margin: 0 0 .5rem; }
.filter-status:empty { margin: 0; }

table {
  width: 100%;
  border-top: 2px solid var(--ink);
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
th, td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .875rem; font-weight: 550; }
tbody tr:hover, tbody tr:focus-within { background: var(--surface); }
.rank { width: 4.25rem; padding-left: 0; text-align: right; }
.rank, td.platform, td.release { color: var(--muted); }
.platform, .release { white-space: nowrap; }
td.platform, td.release { font-size: .9375rem; }
.growth { width: 6.5rem; padding-right: 0; text-align: right; white-space: nowrap; }
td.growth { color: var(--accent); font-weight: 675; }
.game {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 2.75rem;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.game strong { font-weight: 625; }
.game small { display: none; color: var(--muted); font-size: .8125rem; }
.art {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
}
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.message {
  margin: 0;
  padding: 1.5rem 0;
  border-block-start: 2px solid var(--ink);
  border-block-end: 1px solid var(--line);
}
footer { max-width: 55ch; margin: 1.2rem 0 0; line-height: 1.5; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 42rem) {
  #filters { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform, .release { display: none; }
  .growth, .rank { width: auto; }
  th, td { padding-inline: .4rem; }
  .game { gap: .5rem; }
  .game small { display: block; margin-top: .15rem; }
}
@media (max-width: 25rem) {
  #filters { grid-template-columns: 1fr; }
}
