/* ==========================================================================
   KUBUS.LOL — ULTIMATE CYBER BIOLINK THEME (GUNS.LOL GOD-TIER UPGRADE)
   BASE: Tokens, Resets, Canvas layers, HUD Telemetry, Glassmorphism
   ========================================================================== */

:root {
  --bg-dark: #040509;
  --panel-bg: rgba(10, 12, 22, 0.72);
  --panel-subbg: rgba(18, 21, 36, 0.58);
  --panel-border: rgba(255, 255, 255, 0.1);
  --panel-border-hover: rgba(0, 242, 254, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-pink: #ff2a8d;
  --accent-cyan: #00f2fe;
  --accent-purple: #9d4edd;
  --accent-green: #10b981;
  --accent-gold: #f59e0b;
  --accent-red: #ff0055;
  --accent-blue: #3b82f6;

  --rainbow-gradient: linear-gradient(
    135deg,
    #ff0055 0%,
    #ff6a00 18%,
    #ffe600 35%,
    #00ff88 52%,
    #00f0ff 70%,
    #9d4edd 85%,
    #ff00b7 100%
  );

  --conic-rainbow: conic-gradient(
    from 0deg,
    #ff0055,
    #ff7700,
    #ffff00,
    #00ff88,
    #00e5ff,
    #7000ff,
    #ff00aa,
    #ff0055
  );

  --holo-shimmer: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(0, 242, 254, 0.25) 45%,
    rgba(255, 42, 141, 0.25) 55%,
    rgba(255, 255, 255, 0.08) 75%,
    transparent 100%
  );

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-cyber: 'Orbitron', 'JetBrains Mono', monospace;

  --card-radius: 24px;
  --transition-fast: 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* Dynamic audio reactivity scale */
  --audio-bass-scale: 1;
  --audio-glow-intensity: 0.5;
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-primary);
  user-select: none;
}

body {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   BACKGROUND LAYERS & CANVASES
   ========================================================================== */
.bg-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-media {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-image 0.5s ease;
  will-change: transform, filter;
}

.canvas-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
}
.canvas-fx.active {
  display: block;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 12, 22, 0.45) 0%, rgba(4, 5, 9, 0.88) 100%);
  z-index: 2;
  transition: opacity 0.4s ease;
}

/* CYBER VIGNETTE & CRT SCANLINES */
.crt-scanlines {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(18, 16, 24, 0) 50%, rgba(0, 0, 0, 0.35) 50%),
    linear-gradient(90deg, rgba(255, 0, 85, 0.02), rgba(0, 242, 254, 0.01), rgba(0, 255, 136, 0.02));
  background-size: 100% 3px, 6px 100%;
  z-index: 3;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
body.fx-scanlines .crt-scanlines {
  opacity: 0.85;
}

/* CURSOR PARTICLES CANVAS */
.cursor-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

/* ==========================================================================
   CYBER HUD TELEMETRY (CORNER ACCENTS)
   ========================================================================== */
.cyber-hud-element {
  position: fixed;
  z-index: 15;
  font-family: var(--font-cyber);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
  transition: opacity 0.3s ease;
}

.hud-tl {
  bottom: 40px;
  left: 20px;
}
.hud-tr {
  bottom: 40px;
  right: 20px;
}
.hud-bl {
  bottom: 14px;
  left: 20px;
}
.hud-br {
  bottom: 14px;
  right: 20px;
}

.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  display: inline-block;
  animation: hudBlink 2s infinite ease-in-out;
}

.hud-dot.cyan {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.hud-dot.pink {
  background: var(--accent-pink);
  box-shadow: 0 0 8px var(--accent-pink);
}

@keyframes hudBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@media (max-width: 900px) {
  .cyber-hud-element {
    display: none;
  }
}

/* ==========================================================================
   GLASSMORPHISM BASE CLASSES
   ========================================================================== */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.2) inset;
  border-radius: 18px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-subpanel {
  background: var(--panel-subbg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
