/* ═══════════════════════════════════════════
   Visual Engine – Canvas & Overlay
   ═══════════════════════════════════════════ */

#visualCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

#visualCanvas.active {
  opacity: 1;
}

.visual-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: opacity 1s ease;
}

.visual-overlay.active {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 10, 15, 0.6) 100%);
}

/* Transition effects */
.visual-overlay.flash {
  animation: visualFlash 0.3s ease-out;
}

.visual-overlay.ripple {
  animation: visualRipple 1s ease-out;
}

.visual-overlay.glitch {
  animation: visualGlitch 0.5s ease-out;
}

@keyframes visualFlash {
  0% { background: rgba(244, 63, 94, 0.3); }
  100% { background: transparent; }
}

@keyframes visualRipple {
  0% { box-shadow: inset 0 0 100px 50px rgba(168, 85, 247, 0.2); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

@keyframes visualGlitch {
  0%, 100% { transform: translate(0); filter: none; }
  20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
  60% { transform: translate(-1px, -2px); filter: hue-rotate(45deg); }
  80% { transform: translate(1px, 2px); }
}

/* Fullscreen mode */
body.fullscreen-visual .main-ui {
  opacity: 0.3;
  transform: scale(0.95);
}

body.fullscreen-visual:hover .main-ui {
  opacity: 1;
  transform: scale(1);
}

/* Low quality mode */
body.visual-low #visualCanvas {
  image-rendering: pixelated;
}
