@font-face {
  font-family: Gotham;
  src: url('../fonts/GothamPro.woff') format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Gotham;
  src: url('../fonts/GothamPro-Medium.woff') format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Gotham;
  src: url('../fonts/GothamPro-Bold.woff') format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --accent: #f0ccfb;
  --accent-soft: rgba(240, 204, 251, 0.12);
  --border: rgba(255, 255, 255, 0.13);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.62);
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: #050914;
}
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background:
    radial-gradient(ellipse 52% 42% at 20% 28%, rgba(111, 49, 143, 0.28), transparent 68%),
    radial-gradient(ellipse 48% 38% at 77% 18%, rgba(30, 71, 145, 0.28), transparent 70%),
    radial-gradient(ellipse 55% 46% at 54% 76%, rgba(67, 35, 122, 0.22), transparent 72%),
    radial-gradient(ellipse 34% 30% at 92% 86%, rgba(31, 87, 153, 0.18), transparent 70%),
    linear-gradient(135deg, #070b20 0%, #10102d 43%, #08152e 100%);
  font-family: Gotham, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.78) 0 1px, transparent 1.6px),
    radial-gradient(circle at 17% 34%, rgba(210,226,255,.62) 0 1px, transparent 1.7px),
    radial-gradient(circle at 29% 9%, rgba(255,255,255,.68) 0 1px, transparent 1.5px),
    radial-gradient(circle at 39% 24%, rgba(211,220,255,.5) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 51% 8%, rgba(255,255,255,.72) 0 1px, transparent 1.6px),
    radial-gradient(circle at 63% 29%, rgba(205,220,255,.52) 0 .9px, transparent 1.6px),
    radial-gradient(circle at 76% 10%, rgba(255,255,255,.76) 0 1px, transparent 1.6px),
    radial-gradient(circle at 88% 26%, rgba(224,226,255,.58) 0 .9px, transparent 1.5px),
    radial-gradient(circle at 95% 48%, rgba(255,255,255,.7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 7% 62%, rgba(210,225,255,.5) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 22% 78%, rgba(255,255,255,.62) 0 1px, transparent 1.6px),
    radial-gradient(circle at 36% 57%, rgba(220,226,255,.45) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 48% 91%, rgba(255,255,255,.68) 0 1px, transparent 1.6px),
    radial-gradient(circle at 61% 68%, rgba(214,225,255,.5) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 73% 88%, rgba(255,255,255,.62) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 63%, rgba(210,224,255,.48) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 93% 91%, rgba(255,255,255,.66) 0 1px, transparent 1.6px);
  opacity: .82;
}

body::after {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 28% 18% at 17% 38%, rgba(182, 54, 133, .17), transparent 72%),
    radial-gradient(ellipse 31% 20% at 50% 63%, rgba(111, 53, 154, .16), transparent 72%),
    radial-gradient(ellipse 26% 17% at 82% 27%, rgba(56, 103, 184, .16), transparent 72%),
    radial-gradient(ellipse 18% 13% at 70% 88%, rgba(113, 55, 167, .14), transparent 72%);
  filter: blur(34px);
  opacity: .95;
}

.statistics-page::before,
.statistics-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

.statistics-page::before {
  width: 340px;
  height: 340px;
  left: -150px;
  top: 12vh;
  background:
    radial-gradient(circle at 36% 34%, rgba(255,255,255,.22), transparent 8%),
    radial-gradient(circle at 45% 42%, #273d91 0%, #17275f 42%, #090e2b 74%, transparent 75%);
  box-shadow: inset -28px -18px 45px rgba(0,0,0,.42), 0 0 70px rgba(52,75,170,.16);
  opacity: .82;
}

.statistics-page::after {
  width: 270px;
  height: 270px;
  right: -135px;
  bottom: 9vh;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.18), transparent 7%),
    radial-gradient(circle at 45% 44%, #35458f 0%, #1b2b64 43%, #090f2c 73%, transparent 74%);
  box-shadow: inset -24px -18px 42px rgba(0,0,0,.44), 0 0 64px rgba(56,78,163,.14);
  opacity: .72;
}
.statistics-page {
  position: relative;
  z-index: 3;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 42px;
}
.statistics-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.statistics-logo {
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.statistics-logo span {
  color: var(--accent);
}
.statistics-heading {
  text-align: center;
}
.statistics-kicker,
.card-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.statistics-heading h1,
.card-heading h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.statistics-heading h1 {
  font-size: clamp(30px, 4vw, 46px);
}
.statistics-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.back-link {
  justify-self: end;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: #fff;
  background: rgba(20, 23, 28, 0.38);
  text-decoration: none;
  font-size: 13px;
  transition: 0.2s;
}
.back-link:hover {
  border-color: rgba(240, 204, 251, 0.45);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.statistics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}
.stats-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 85% 12%,
      rgba(240, 204, 251, 0.1),
      transparent 34%
    ),
    linear-gradient(145deg, rgba(25, 22, 38, 0.88), rgba(12, 14, 25, 0.82));
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.attempts-card {
  display: flex;
  min-height: 620px;
  flex-direction: column;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.card-heading h2 {
  font-size: 22px;
}
.card-count {
  min-width: 38px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  font-size: 11px;
}
.refresh-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font:
    500 20px/1 Arial,
    sans-serif;
  transition: 0.25s;
}
.refresh-button:hover {
  border-color: rgba(240, 204, 251, 0.5);
  background: var(--accent-soft);
  transform: rotate(45deg);
}
.table-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
}
.table-scroller {
  position: relative;
  flex: 1;
  min-height: 0;
  max-height: 700px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 204, 251, 0.42) transparent;
}
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.stats-table th,
.stats-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  text-align: left;
  white-space: nowrap;
}
.stats-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: rgba(255, 255, 255, 0.68);
  background: #171827;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats-table tbody tr:hover {
  background: rgba(240, 204, 251, 0.055);
}
.stats-table td:first-child,
.stats-table th:first-child {
  text-align: center;
  color: rgba(255, 255, 255, 0.52);
}
.attempts-table td:nth-child(3) {
  color: #fff;
  font-weight: 500;
}
.attempts-table td:nth-child(5),
.leaderboard-table td:nth-child(3) {
  color: var(--accent);
  font-weight: 700;
}
.table-loader {
  padding: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}
.leaderboard-card {
  align-self: start;
}
.leaderboard-table-wrap {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
}
.leaderboard-table th,
.leaderboard-table td {
  padding: 12px 10px;
}
.leaderboard-table tbody tr:first-child td {
  color: #fff;
  background: rgba(240, 204, 251, 0.07);
}
.leaderboard-table tbody tr:first-child td:first-child {
  color: var(--accent);
  font-weight: 700;
}
.empty-row td {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center !important;
}
.error-text {
  color: #ffb4b4;
}
@media (max-width: 900px) {
  .statistics-header {
    grid-template-columns: 1fr auto;
  }
  .statistics-heading {
    grid-column: 1/-1;
    grid-row: 1;
    padding: 0 90px;
  }
  .statistics-logo {
    grid-column: 1;
    grid-row: 1;
  }
  .back-link {
    grid-column: 2;
    grid-row: 1;
  }
  .statistics-grid {
    grid-template-columns: 1fr;
  }
  .attempts-card {
    min-height: 540px;
  }
}
@media (max-width: 600px) {
  .statistics-page {
    width: min(100% - 20px, 1500px);
    padding: 18px 0 28px;
  }
  .statistics-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
  }
  .statistics-heading {
    order: 3;
    width: 100%;
    padding: 4px 0 0;
  }
  .statistics-heading h1 {
    font-size: 30px;
  }
  .statistics-heading > p:last-child {
    font-size: 12px;
  }
  .statistics-logo {
    flex: 1;
  }
  .stats-card {
    padding: 13px;
    border-radius: 13px;
  }
  .attempts-card {
    min-height: 520px;
  }
  .table-scroller {
    max-height: 62vh;
  }
  .stats-table {
    min-width: 620px;
  }
  .leaderboard-table {
    min-width: 0;
  }
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 7px;
  }
}

.statistics-link {
  display: block;
  width: max-content;
  margin: 10px auto 0;
  color: rgba(255, 255, 255, 0.65);
  font:
    500 12px/1.2 Gotham,
    Arial,
    sans-serif;
  text-decoration: none;
  transition: 0.2s;
}
.statistics-link:hover {
  color: #f0ccfb;
}
