@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ==========================================
   HAZZARDSMP DASHBOARD
   Leaderboard Header Design
========================================== */

:root {
    --bg: #100819;
    --bg-deep: #10050b;
    --surface: rgba(29, 15, 43, 0.86);
    --surface-solid: #1d0f2b;
    --surface-hover: #2b1640;
    --border: rgba(216, 160, 255, 0.16);

    --text: #fdf4ff;
    --muted: #c0a6cc;

    --blue: #a855f7;
    --blue-light: #e0aaff;
    --cyan: #ff8acb;
    --green: #f472b6;

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(
      ellipse at 15% 0%,
      rgba(217, 22, 255, .13),
      transparent 36%
    ),
    radial-gradient(
      ellipse at 90% 35%,
      rgba(192, 132, 252, .06),
      transparent 30%
    );
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color .3s ease, color .3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

/* ==========================================
   HEADER — SAVED HAZZARDSMP LEADERBOARD STYLE
========================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  width: 100%;
  min-height: 76px;
  padding: 14px max(20px, calc((100% - 1160px) / 2));

  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(12, 5, 23, .88);

  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* Brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;

  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;

  border: 1px solid rgba(216, 180, 254, .35);
  border-radius: 12px;

  transition:
    transform .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-4deg) scale(1.05);
  border-color: rgba(216, 180, 254, .8);
  box-shadow: 0 0 22px rgba(168, 85, 247, .35);
}

.brand-name {
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.6px;
}

.brand-name span {
  color: var(--blue);
}

/* Navigation */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;

  margin-left: auto;
}

.main-nav a {
  position: relative;
  display: inline-block;
  padding: 10px 0;

  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;

  font-size: 13px;
  font-weight: 650;

  transition: color .2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;

  width: 100%;
  height: 2px;

  border-radius: 2px;
  background: var(--blue);

  transform: scaleX(0);
  transform-origin: left;

  transition: transform .22s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

/* Header actions */

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Theme toggle */

.theme-btn,
.login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 42px;
  padding: 0 15px;

  border: 1px solid var(--border);
  border-radius: 10px;

  cursor: pointer;
  white-space: nowrap;

  font-size: 13px;
  font-weight: 750;

  transition:
    transform .2s ease,
    border-color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

.theme-btn {
  color: var(--text);
  background: rgba(255, 255, 255, .035);
}

.theme-btn:hover {
  border-color: rgba(216, 180, 254, .6);
  background: rgba(168, 85, 247, .1);
  transform: translateY(-2px);
}

.theme-icon {
  color: var(--blue-light);
  font-size: 1.05rem;
}

/* Login button */

.login-link {
  border-color: rgba(216, 180, 254, .35);
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  box-shadow: 0 5px 18px rgba(168, 85, 247, .18);
}

.login-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 24px rgba(168, 85, 247, .3);
}

/* Hamburger */

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  padding: 0;

  border: 1px solid rgba(196, 181, 212, .2);
  border-radius: 10px;

  color: var(--text);
  background: #200d36;

  font-family: Arial, sans-serif;
  font-size: 23px;
  line-height: 1;

  cursor: pointer;

  transition:
    background .2s ease,
    border-color .2s ease;
}

.menu-toggle:hover {
  background: #3f1745;
  border-color: rgba(216, 180, 254, .45);
}

/* ==========================================
   PAGE LAYOUT
========================================== */

.dashboard {
  width: min(1200px, 88%);
  margin: 0 auto;
  padding: 46px 0 72px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 29px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-light);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.eyebrow span {
  padding: 0 5px;
  color: var(--muted);
}

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

h1 {
  margin-bottom: 9px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -1.5px;
}

h1 > span {
  color: var(--blue-light);
}

.subtitle,
.panel-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.7;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  padding: 10px 13px;

  border: 1px solid var(--border);
  border-radius: 999px;

  color: var(--muted);
  background: var(--surface);

  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;

  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(54, 223, 154, .75);

  animation: pulse 1.8s infinite;
}

/* ==========================================
   STAT CARDS
========================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 19px;
}

.stat-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 20px;

  transition:
    transform .25s ease,
    border-color .25s ease,
    background .25s ease,
    box-shadow .25s ease;
}

.stat-card::before {
  position: absolute;
  top: 0;
  left: 18px;

  width: 42px;
  height: 2px;

  background: linear-gradient(90deg, var(--blue), var(--cyan));
  content: "";

  transition: width .25s ease;
}

.stat-card:hover {
  border-color: rgba(216, 180, 254, .42);
  background: var(--surface-hover);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, .25),
    0 0 25px rgba(217, 22, 255, .06);
  transform: translateY(-5px);
}

.stat-card:hover::before {
  width: calc(100% - 36px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.stat-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  place-items: center;

  border: 1px solid rgba(216, 180, 254, .2);
  border-radius: 9px;

  color: var(--blue-light);
  background: rgba(168, 85, 247, .08);

  font-size: 1rem;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 11px;
}

.stat-value > span:first-child {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 850;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  color: var(--muted);
  font-size: .73rem;
}

.stat-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}

.stat-note .status-dot {
  width: 6px;
  height: 6px;
}

/* ==========================================
   GRAPH PANEL
========================================== */

.panel {
  padding: 25px;
}

.graph-panel {
  margin-bottom: 19px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel h2 {
  margin-bottom: 7px;
  font-size: 1.2rem;
  letter-spacing: -.4px;
}

.panel-subtitle {
  font-size: .8rem;
}

.graph-controls {
  display: flex;
  flex-shrink: 0;
  gap: 5px;
  padding: 4px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: rgba(0, 0, 0, .12);
}

.range-btn {
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;

  color: var(--muted);
  background: transparent;

  cursor: pointer;
  font-size: .68rem;
  font-weight: 800;

  transition:
    color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

.range-btn:hover {
  color: var(--text);
}

.range-btn.active {
  color: white;
  background: linear-gradient(110deg, #a855f7, #7e22ce);
  box-shadow: 0 4px 14px rgba(168, 85, 247, .2);
}

.graph-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 26px;
  color: var(--muted);
  font-size: .73rem;
}

.graph-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(201, 112, 255, .5);
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .7px;
}

/* Blinking "Live" dot next to the graph */

.live-label .live-dot {
  display: block;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #50dfa0;
  box-shadow: 0 0 10px #50dfa0aa;

  animation: live-blink 1.4s ease-in-out infinite;
}

/* Turns amber when a check did not come through. */

.live-label.is-stale {
  color: #f4c46a;
}

.live-label.is-stale .live-dot {
  background: #f4c46a;
  box-shadow: none;
  animation: none;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

body.light-theme .live-label .live-dot {
  background: #0f8f5f;
}

.chart-wrap {
  position: relative;
  height: 310px;
  margin-top: 14px;
}

.graph-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;

  margin-top: 13px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .72rem;
}

.graph-footer strong {
  color: var(--text);
  font-weight: 700;
}

/* ==========================================
   LOWER PANELS
========================================== */

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 19px;
}

.info-panel h2,
.note-panel h2,
.summary-panel h2 {
  margin-bottom: 20px;
}

/* ---------- Summary panel: peak player + Discord members ---------- */

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;

  margin-bottom: 20px;
}

.summary-tile {
  padding: 18px 20px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(20, 4, 20, .35);
}

body.light-theme .summary-tile {
  background: rgba(255, 255, 255, .72);
}

.summary-tile.discord {
  border-color: rgba(88, 101, 242, .3);
  background: rgba(88, 101, 242, .08);
}

body.light-theme .summary-tile.discord {
  background: rgba(88, 101, 242, .06);
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.summary-label .ic {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.summary-discord-icon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

.summary-value {
  display: block;
  margin-top: 10px;

  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.summary-note {
  display: block;
  margin-top: 7px;

  color: var(--muted);
  font-size: 11.5px;
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;

  border-bottom: 1px solid var(--border);
  color: var(--muted);

  font-size: .81rem;
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-row strong {
  color: var(--text);
  font-weight: 650;
  text-align: right;
}

.info-row .demo-text {
  color: #f4c46a;
}

.note-panel {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.note-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;

  border: 1px solid rgba(216, 180, 254, .3);
  border-radius: 11px;

  color: var(--blue-light);
  background: rgba(168, 85, 247, .09);

  font-weight: 800;
}

.note-panel h2 {
  margin-bottom: 10px;
}

.note-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.8;
}

/* ==========================================
   FOOTER
========================================== */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px 25px;

  padding: 27px max(20px, calc((100% - 1160px) / 2));

  border-top: 1px solid var(--border);
  background: rgba(20, 4, 20, .65);
}

.footer-brand {
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: .8px;
  border-radius: 12px;
}

.footer-brand span {
  color: var(--cyan);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  font-size: .75rem;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: var(--blue-light);
}

.copyright {
  width: 100%;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* ==========================================
   ANIMATIONS
========================================== */

.reveal {
  animation: rise-in .65s both;
}

.stats-grid .reveal:nth-child(2) {
  animation-delay: .06s;
}

.stats-grid .reveal:nth-child(3) {
  animation-delay: .12s;
}

.stats-grid .reveal:nth-child(4) {
  animation-delay: .18s;
}

/* ==========================================
   LIGHT THEME
========================================== */

body.light-theme {
  --bg: #faf5ff;
  --bg-deep: #f3e8ff;
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #fff;
  --surface-hover: #fdf4ff;
  --border: rgba(102, 45, 112, .16);
  --text: #2e1065;
  --muted: #85618a;
  --shadow: 0 18px 45px rgba(90, 40, 98, .08);

  background-image:
    radial-gradient(
      ellipse at 15% 0%,
      rgba(217, 22, 255, .1),
      transparent 36%
    ),
    radial-gradient(
      ellipse at 90% 35%,
      rgba(192, 132, 252, .08),
      transparent 30%
    );
}

body.light-theme .navbar {
  background: rgba(254, 247, 255, .9);
  border-bottom-color: var(--border);
}

body.light-theme .brand {
  color: var(--text);
}

body.light-theme .site-footer {
  background: rgba(255, 255, 255, .55);
}

body.light-theme .graph-controls {
  background: rgba(89, 40, 100, .04);
}

body.light-theme .range-btn.active {
  color: #fff;
}

body.light-theme .menu-toggle {
  color: var(--text);
  background: #fdf4ff;
}

body.light-theme .main-nav a {
  color: var(--muted);
}

body.light-theme .main-nav a:hover,
body.light-theme .main-nav a.active {
  color: var(--text);
}

/* ==========================================
   KEYFRAMES
========================================== */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .45;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(13px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   TABLET RESPONSIVE
========================================== */

@media (max-width: 1000px) {
  .navbar {
    padding-right: 4%;
    padding-left: 4%;
    gap: 16px;
  }

  .main-nav {
    gap: 17px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard {
    width: 92%;
  }
}

/* ==========================================
   MOBILE NAVIGATION
========================================== */

@media (max-width: 850px) {
  .navbar {
    position: sticky;
    flex-wrap: wrap;
    padding: 13px 5%;
    gap: 12px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 17px;
  }

  /* Hamburger is visible before being clicked */

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 42px;
    margin-left: auto;
  }

  .nav-actions {
    margin-left: 0;
    gap: 8px;
  }

  /* Collapsible navigation */

  .main-nav {
    display: none;
    order: 4;
    flex: 0 0 100%;
    width: 100%;

    align-items: stretch;
    flex-direction: column;
    gap: 3px;

    margin: 0;
    padding: 10px 0 2px;

    border-top: 1px solid var(--border);
  }

  .main-nav.open {
    display: flex;
    animation: rise-in .22s both;
  }

  .main-nav a {
    display: block;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 13px;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: rgba(168, 85, 247, .08);
  }

  .main-nav a::after {
    bottom: 5px;
    left: 10px;
    width: 35px;
  }

  .login-link,
  .theme-btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: .75rem;
  }

  .dashboard {
    padding-top: 32px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel {
    padding: 19px;
  }

  .panel-heading {
    flex-direction: column;
  }

  .graph-controls {
    align-self: flex-start;
  }

  .chart-wrap {
    height: 270px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .copyright {
    margin-top: 3px !important;
  }
}

/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 460px) {
  .navbar {
    padding: 12px;
    gap: 8px;
  }

  .brand {
    gap: 7px;
  }

  .brand-logo {
    width: 35px;
    height: 35px;
    border-radius: 12px;
    border: 1px solid rgba(216, 180, 254, .35);
    border-radius: 12px;
    display: block;
    object-fit: contain;

  }

  .brand-name {
    font-size: 15px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 21px;
  }

  .nav-actions {
    gap: 6px;
  }

  .login-link,
  .theme-btn {
    min-height: 36px;
    padding: 0 9px;
    font-size: .7rem;
  }

  .theme-btn {
    gap: 4px;
  }

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

  .stat-card {
    min-height: 145px;
  }

  .server-status {
    font-size: .62rem;
  }

  .graph-footer {
    flex-direction: column;
  }

  .dashboard {
    width: calc(100% - 28px);
  }

  .panel {
    padding: 16px;
  }

  .site-footer {
    padding: 24px 14px;
  }
}

/* ==========================================
   ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}