:root {
  --hero-a: #0d6efd;
  --hero-b: #198754;
  --bg-base: #f4f8ff;
  --bg-glow-a: rgba(13, 110, 253, 0.24);
  --bg-glow-b: rgba(25, 135, 84, 0.2);
  --bg-grid: rgba(13, 110, 253, 0.08);
}

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 12% 20%, var(--bg-glow-a), transparent 42%),
    radial-gradient(circle at 86% 8%, var(--bg-glow-b), transparent 38%),
    linear-gradient(145deg, #f8fbff 0%, #eef5ff 40%, #e8f1ff 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 40%, black 35%, transparent 85%);
}

body::after {
  background:
    radial-gradient(280px 280px at 22% 78%, rgba(13, 110, 253, 0.16), transparent 72%),
    radial-gradient(260px 260px at 78% 68%, rgba(25, 135, 84, 0.14), transparent 70%);
}

.hero-gradient {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(255, 193, 7, 0.22), transparent 28%),
    linear-gradient(125deg, #0b5ed7 0%, #0d6efd 38%, #198754 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -28px 60px rgba(0, 0, 0, 0.12);
}

.hero-gradient::before,
.hero-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-gradient::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 45%, black 45%, transparent 90%);
}

.hero-gradient::after {
  background:
    radial-gradient(280px 280px at 14% 86%, rgba(13, 110, 253, 0.42), transparent 72%),
    radial-gradient(260px 260px at 86% 78%, rgba(25, 135, 84, 0.4), transparent 70%);
  opacity: 0.75;
}

.hero-gradient > .container {
  position: relative;
  z-index: 1;
}

.stat-badge {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 0.8rem;
  padding: 0.85rem;
  backdrop-filter: blur(3px);
}

.stat-badge span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-badge small {
  display: block;
}

.stat-card {
  border-left: 4px solid #0d6efd;
}

#recordsChart {
  min-height: 320px;
}

/* Landing-only snazzy background */
.landing-body {
  background-color: #f2f7ff;
  background-image:
    radial-gradient(circle at 8% 18%, rgba(13, 110, 253, 0.28), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(25, 135, 84, 0.24), transparent 30%),
    radial-gradient(circle at 50% 120%, rgba(255, 193, 7, 0.16), transparent 38%),
    linear-gradient(135deg, #f8fbff 0%, #e9f2ff 45%, #deecff 100%);
}

.landing-body::before {
  background-image:
    linear-gradient(rgba(13, 110, 253, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 110, 253, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 20% 70%, rgba(13, 110, 253, 0.14), transparent 28%),
    radial-gradient(circle at 76% 62%, rgba(25, 135, 84, 0.14), transparent 26%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  mask-image: radial-gradient(circle at 50% 40%, black 40%, transparent 88%);
}

.landing-body::after {
  background:
    radial-gradient(360px 360px at 14% 86%, rgba(13, 110, 253, 0.18), transparent 74%),
    radial-gradient(320px 320px at 82% 78%, rgba(25, 135, 84, 0.18), transparent 72%);
}

/* Mobile/Desktop view mode controls */
[data-view-mode][aria-pressed="true"] {
  font-weight: 600;
}

[data-view-mode].active {
  box-shadow: inset 0 0 0 999px rgba(13, 110, 253, 0.15);
}

html[data-view="mobile"] body {
  font-size: 0.95rem;
}

html[data-view="mobile"] .container,
html[data-view="mobile"] .container-fluid {
  max-width: 540px !important;
}

html[data-view="mobile"] .display-4 {
  font-size: 2rem;
}

html[data-view="mobile"] .navbar-brand {
  max-width: 100%;
}

html[data-view="mobile"] .hero-gradient .btn-lg {
  padding: 0.5rem 0.95rem;
  font-size: 1rem;
}

html[data-view="desktop"] body {
  font-size: 1rem;
}
