@font-face {
  font-family: "Linux Libertine";
  src: url("/fonts/LinLibertine_R.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pixel Operator";
  src: url("/fonts/PixelOperator.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Linux Libertine", Georgia, "Times New Roman", Times, serif;
  --font-pixel: "Pixel Operator", "SFMono-Regular", Consolas, monospace;
  --page: #eef2f7;
  --page-ink: #202122;
  --page-muted: #57606a;
  --page-line: #c9d3df;
  --page-panel: rgba(255, 255, 255, 0.92);
  --page-panel-strong: rgba(255, 255, 255, 0.97);
  --page-accent-strong: #1f437d;
  --page-shadow: rgba(29, 43, 67, 0.12);
  --stats-map-height: clamp(42rem, 42vw, 52rem);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 10px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 42%),
    linear-gradient(180deg, #f7fafc 0%, #e7edf4 100%);
  color: var(--page-ink);
  font-family: var(--font-ui);
}

a {
  color: inherit;
}

.stats-shell {
  width: min(132rem, calc(100vw - 2.4rem));
  margin: 0 auto;
  padding: 3.2rem 0 4.8rem;
}

.stats-hero {
  display: grid;
  gap: 0.8rem;
  padding: 2.6rem 2.8rem 0;
}

.stats-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stats-title-icon {
  width: clamp(3.8rem, 5vw, 4.8rem);
  height: clamp(3.8rem, 5vw, 4.8rem);
  object-fit: contain;
  flex: 0 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.stats-home-link {
  justify-self: start;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 2.1rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.stats-home-link:hover,
.stats-home-link:focus-visible {
  color: var(--page-accent-strong);
  outline: none;
}

.stats-kicker,
.stats-panel-kicker {
  margin: 0;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-title {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  font-weight: 400;
  line-height: 1;
}

.stats-title-wordmark {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(4rem, 5.6vw, 5.4rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stats-title-suffix {
  display: inline-block;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 2.8vw, 2.7rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.stats-summary {
  max-width: 72rem;
  margin: 0;
  color: var(--page-muted);
  font-family: var(--font-serif);
  font-size: 2.8rem;
  line-height: 1.25;
}

.stats-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  margin-top: 2.4rem;
  padding: 0 2.8rem;
}

.stats-card,
.stats-panel {
  border: 1px solid var(--page-line);
  border-radius: 2rem;
  background: var(--page-panel);
  box-shadow: 0 1.8rem 4rem var(--page-shadow);
  backdrop-filter: blur(10px) saturate(1.1);
}

.stats-card {
  padding: 2rem 2.2rem;
}

.stats-card-label {
  margin: 0;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-card-value {
  margin: 0.6rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(4.4rem, 5vw, 6.2rem);
  line-height: 0.95;
}

.stats-card-meta,
.stats-panel-note {
  margin: 0.8rem 0 0;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.6rem;
  margin-top: 1.6rem;
  padding: 0 2.8rem;
  align-items: start;
}

.stats-chart-row {
  margin-top: 1.6rem;
  padding: 0 2.8rem;
}

.stats-panel {
  padding: 2rem 2rem 2.2rem;
}

.stats-map-panel,
.stats-country-panel,
.stats-chart-panel {
  width: 100%;
}

.stats-country-panel {
  padding: 2rem 2rem 2.2rem;
}

.stats-country-panel .stats-error {
  margin: 0 0 1.4rem;
}

.stats-country-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

.stats-country-sort-label {
  margin: 0;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-country-sort-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.stats-country-sort-button {
  appearance: none;
  border: 1px solid rgba(201, 211, 223, 0.96);
  border-radius: 999px;
  background: rgba(247, 249, 252, 0.92);
  color: var(--page-muted);
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.95rem 1.2rem 1rem;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.stats-country-sort-button:hover,
.stats-country-sort-button:focus-visible {
  border-color: rgba(95, 110, 132, 0.5);
  color: var(--page-ink);
  outline: none;
}

.stats-country-sort-button.is-active {
  border-color: rgba(54, 69, 91, 0.92);
  background: #111111;
  color: #ffffff;
}

.stats-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 1.4rem;
}

.stats-chart-label,
.stats-chart-range {
  margin: 0;
  color: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-chart-wrap {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 5.8rem minmax(0, 1fr);
  background: #ffffff;
  overflow: hidden;
}

.stats-chart-y-axis-wrap {
  position: relative;
  width: 5.8rem;
  background: #ffffff;
  z-index: 1;
  pointer-events: none;
}

.stats-chart-scroll {
  overflow: hidden;
}

.stats-chart-y-axis,
.stats-chart {
  display: block;
  height: 28rem;
}

.stats-chart-axis-line {
  stroke: rgba(120, 120, 120, 0.24);
  stroke-width: 1;
}

.stats-chart-grid {
  stroke: rgba(120, 120, 120, 0.16);
  stroke-width: 1;
}

.stats-chart-bar {
  fill: #111111;
}

.stats-chart-axis-label {
  fill: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 1.8rem;
}

.stats-chart-y-label {
  fill: var(--page-muted);
  font-family: var(--font-pixel);
  font-size: 1.7rem;
}

.stats-chart-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  display: none;
  pointer-events: none;
  border: 1px solid var(--page-line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--page-ink);
  font-family: var(--font-pixel);
  font-size: 1.7rem;
  line-height: 1.15;
  padding: 0.8rem 1rem;
  white-space: nowrap;
  box-shadow: 0 1.2rem 2.4rem rgba(29, 43, 67, 0.12);
}

.stats-chart-tooltip.is-visible {
  display: block;
}

.stats-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.8rem;
}

.stats-panel-title {
  margin: 0.2rem 0 0;
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 400;
  line-height: 1;
}

.stats-map {
  position: relative;
  width: 100%;
  height: var(--stats-map-height);
  border: 1px solid var(--page-line);
  border-radius: 1.6rem;
  overflow: hidden;
  background: #ffffff;
}

.stats-map .jvm-container {
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.stats-map .jvm-container svg {
  background: #ffffff;
}

.stats-map .jvm-region {
  stroke: rgba(70, 70, 70, 0.4);
  stroke-width: 1;
  transition: fill 140ms ease;
}

.stats-map .jvm-region:hover {
  stroke: rgba(20, 20, 20, 0.75);
  stroke-width: 1.15;
}

.stats-map-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
  border: 1px solid var(--page-line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--page-ink);
  font-family: var(--font-pixel);
  font-size: 1.8rem;
  line-height: 1.15;
  padding: 0.9rem 1.1rem;
  max-width: min(32rem, calc(100vw - 1.6rem));
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 1.2rem 2.4rem rgba(29, 43, 67, 0.12);
}

.stats-map-tooltip.is-visible {
  display: block;
}

.stats-country-table-wrap {
  width: 100%;
  border: 1px solid var(--page-line);
  border-radius: 1.6rem;
  background: #ffffff;
  overflow: hidden;
}

.stats-country-table-scroll {
  max-height: calc(var(--stats-map-height) - 5.1rem);
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stats-country-table-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.stats-country-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.stats-country-table th:first-child,
.stats-country-table td:first-child {
  width: 41%;
}

.stats-country-table th:nth-child(2),
.stats-country-table td:nth-child(2),
.stats-country-table th:nth-child(3),
.stats-country-table td:nth-child(3),
.stats-country-table th:nth-child(4),
.stats-country-table td:nth-child(4) {
  width: 19.66%;
}

.stats-country-table-head {
  border-bottom: 1px solid rgba(201, 211, 223, 0.86);
}

.stats-country-table th,
.stats-country-table td {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(201, 211, 223, 0.86);
  text-align: left;
  font-size: 2.1rem;
  font-family: var(--font-serif);
}

.stats-country-table th {
  background: #f7f9fc;
  color: var(--page-muted);
  font-size: 2rem;
  font-weight: 400;
}

.stats-country-table-head th:first-child {
  border-top-left-radius: 1.6rem;
}

.stats-country-table-head th:last-child {
  border-top-right-radius: 1.6rem;
}

.stats-country-table td:last-child,
.stats-country-table th:last-child {
  text-align: right;
}

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

.stats-table-empty {
  color: var(--page-muted);
  font-family: var(--font-serif);
  font-size: 2.4rem;
  text-align: center !important;
}

.stats-error {
  margin: 0 0 1.4rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(166, 47, 47, 0.25);
  border-radius: 1.2rem;
  background: rgba(166, 47, 47, 0.08);
  color: #8d2a2a;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1.25;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .stats-shell {
    width: min(100vw, calc(100vw - 2rem));
    padding-top: 2rem;
  }

  .stats-hero,
  .stats-metrics,
  .stats-layout,
  .stats-chart-row {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stats-metrics,
  .stats-layout {
    grid-template-columns: 1fr;
  }

  .stats-title-wordmark {
    font-size: clamp(3.4rem, 8.5vw, 4.4rem);
  }

  .stats-title-suffix {
    font-size: clamp(1.8rem, 4.2vw, 2.2rem);
  }

  .stats-card {
    padding: 1.6rem 1.7rem;
  }

  .stats-card-label,
  .stats-chart-label,
  .stats-chart-range {
    font-size: 1.7rem;
  }

  .stats-card-value {
    font-size: clamp(3.6rem, 9vw, 4.8rem);
  }

  .stats-card-meta,
  .stats-panel-note {
    font-size: 1.5rem;
  }

  .stats-map-panel,
  .stats-country-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .stats-map-panel {
    padding: 0;
  }

  .stats-country-panel {
    padding: 0;
  }

  .stats-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-map {
    height: auto;
    min-height: 0;
    aspect-ratio: 1.62 / 1;
    background: #ffffff;
  }

  .stats-map-panel {
    background: #ffffff;
  }

  .stats-map .jvm-container,
  .stats-map .jvm-container svg {
    width: 100%;
    height: 100%;
  }

  .stats-chart-panel {
    padding: 1.5rem 1.5rem 1.7rem;
  }

  .stats-chart-header {
    gap: 0.8rem;
    margin-bottom: 1rem;
  }

  .stats-chart-wrap {
    display: block;
  }

  .stats-chart-y-axis-wrap {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5.4rem;
    background: rgba(255, 255, 255, 0.96);
  }

  .stats-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .stats-chart,
  .stats-chart-y-axis {
    max-width: none;
  }

  .stats-chart-axis-label {
    font-size: 1.55rem;
  }

  .stats-chart-y-label {
    font-size: 1.45rem;
  }

  .stats-country-table th,
  .stats-country-table td {
    padding: 1rem 1.1rem;
    font-size: 1.85rem;
  }

  .stats-country-table th {
    font-size: 1.75rem;
  }

  .stats-country-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1rem;
  }

  .stats-country-sort-label {
    font-size: 1.65rem;
  }

  .stats-country-sort-controls {
    gap: 0.6rem;
  }

  .stats-country-sort-button {
    font-size: 1.55rem;
    padding: 0.85rem 1.05rem 0.9rem;
  }

  .stats-table-empty {
    font-size: 2rem;
  }

  .stats-country-table-wrap {
    overflow: hidden;
  }

  .stats-country-table-scroll {
    max-height: none;
    overflow: visible;
  }
}
