:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: #f3f7f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.58)),
    url('../images/backgrounds/stats_bg.PNG') center / cover fixed no-repeat;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: url('../images/effects/snowfall.gif') center / cover no-repeat;
  opacity: 0.28;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 24px, 1040px);
  margin: 0 auto;
  padding: 42px 0 70px;
}

.leaderboard-card {
  border: 1px solid rgba(0, 255, 255, 0.62);
  border-radius: 22px;
  background: rgba(5, 14, 17, 0.92);
  box-shadow: 0 0 32px rgba(0, 255, 255, 0.12);
  padding: clamp(18px, 4vw, 38px);
  backdrop-filter: blur(6px);
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #83ffff;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}

.subtitle,
.section-note,
.updated-text,
.privacy-hint {
  color: #bdc9cb;
}

.subtitle {
  margin-bottom: 0;
}

.status-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 auto 30px;
  padding: 10px 14px;
  border: 1px solid #607174;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
  text-align: center;
}

.status-panel[data-state='ok'] {
  border-color: #00e890;
}

.status-panel[data-state='mock'] {
  border-color: #ffd44a;
}

.status-panel[data-state='error'] {
  border-color: #ff5d73;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #a7b0b2;
  box-shadow: 0 0 10px currentColor;
}

[data-state='ok'] .status-dot {
  background: #00e890;
}

[data-state='mock'] .status-dot {
  background: #ffd44a;
}

[data-state='error'] .status-dot {
  background: #ff5d73;
}

.section {
  margin: 0 0 32px;
}

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

h2 {
  margin-bottom: 5px;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.section-note {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #344549;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
}

.leaderboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

#coinTable {
  min-width: 430px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #2d3b3e;
  text-align: center;
  white-space: nowrap;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
}

.leaderboard-table thead {
  background: #172326;
}

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

.leaderboard-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.message-row td {
  padding: 24px 12px;
  color: #bdc9cb;
  text-align: center !important;
}

.updated-text {
  margin: -12px 0 22px;
  text-align: center;
  font-size: 0.86rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.action-button,
.small-button {
  border: 1px solid #00ffff;
  border-radius: 8px;
  background: #006f72;
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.action-button {
  min-width: 190px;
  padding: 12px 20px;
  text-align: center;
}

.small-button {
  padding: 6px 12px;
}

.action-button:hover,
.action-button:focus-visible,
.small-button:hover,
.small-button:focus-visible {
  outline: none;
  background: #004d50;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.48);
  transform: translateY(-1px);
}

.privacy-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.audio-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 1px solid #00ffff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.76);
  color: white;
  cursor: pointer;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 12px #00ffff;
}

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: min(100% - 12px, 1040px);
    padding-top: 10px;
    padding-bottom: 64px;
  }

  .leaderboard-card {
    padding: 16px 10px 22px;
    border-radius: 16px;
  }

  .status-panel {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  .action-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .snow {
    display: none;
  }
}
