:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --fg: #f3f3f1;
  --muted: #7a7a74;
  --line: #1d1d1f;
  --focus: #f3f3f1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.5rem 1.25rem 1rem;
  max-width: 36rem;
  margin: 0 auto;
}

h1 {
  margin: 0 0 0.85rem;
  font: 560 1.25rem/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

.yr {
  display: grid;
  grid-template-columns: 4.75rem 1fr;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1rem;
}

#yl {
  font: 500 0.92rem/1 ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  letter-spacing: 0.01em;
}

#year {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
}

#year::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
  border: 0;
}

#year::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

#year::-moz-range-track {
  height: 2px;
  background: var(--line);
  border: 0;
}

#year::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

#year:focus-visible::-webkit-slider-thumb,
#year:focus-visible::-moz-range-thumb {
  outline: 1px solid var(--focus);
  outline-offset: 3px;
}

#q {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  padding: 0.55rem 0;
  outline: none;
}

#q::placeholder { color: var(--muted); }
#q:focus { border-bottom-color: var(--focus); }

main {
  max-width: 36rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  display: grid;
  grid-template-columns: 3.25rem 1.75rem 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

li:last-child { border-bottom: 1px solid var(--line); }

.rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.92rem;
}

.flag {
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
}

.flag img {
  display: block;
  width: 1.25rem;
  height: 0.94rem;
  object-fit: cover;
  border-radius: 2px;
}

.name { overflow-wrap: anywhere; }

#empty {
  color: var(--muted);
  margin: 2rem 0 0;
}

@media (min-width: 40rem) {
  header, main { padding-left: 0; padding-right: 0; }
}
