/* ==========================================================================
   Base resets, global element styles, animated gradient backdrop.
   ========================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
  margin: 0;
}

.font-mono, .num, time, .score {
  font-family: 'JetBrains Mono', monospace;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(var(--accent-violet-rgb), 0.35);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}

/* ---------------------------------------------------------------------
   Animated moving gradient backdrop, fixed behind everything
   --------------------------------------------------------------------- */
.bg-gradient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.gradient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}

[data-theme="light"] .gradient-blob {
  opacity: 0.25;
}

.blob-1 {
  width: 55vmax;
  height: 55vmax;
  top: -20%;
  left: -10%;
  background: radial-gradient(circle at 30% 30%, var(--accent-violet), transparent 70%);
  animation: drift-1 26s ease-in-out infinite alternate;
}

.blob-2 {
  width: 45vmax;
  height: 45vmax;
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle at 60% 60%, var(--accent-mint), transparent 70%);
  animation: drift-2 32s ease-in-out infinite alternate;
}

.blob-3 {
  width: 38vmax;
  height: 38vmax;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle at 50% 50%, var(--accent-amber), transparent 70%);
  animation: drift-3 22s ease-in-out infinite alternate;
  opacity: 0.18;
}

@keyframes drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8vw, 10vh) scale(1.08); }
}
@keyframes drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10vw, -6vh) scale(1.05); }
}
@keyframes drift-3 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-6vw, 8vh) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .gradient-blob {
    animation: none !important;
  }
}

.hidden {
  display: none !important;
}
