/* GONZOWIRE OS - LSD trip modes
   Каждый body.trip-* класс задаёт свой набор фильтров и анимаций.
   Базовый класс body.lsd ставится для любого активного трипа,
   плюс конкретный режим. body.sober снимает всё. */

/* SVG-фильтры будут жить внутри #fxlayer (см. apps.js или index) */
#fxlayer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 7500;
  overflow: hidden;
}
#fxlayer svg.full { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Тостер режима */
.trip-banner {
  position: fixed; top: 40px; left: 50%;
  transform: translateX(-50%);
  background: #000;
  border: 2px solid var(--neon-pink);
  color: var(--neon-yellow);
  font-family: var(--display);
  font-size: 22px;
  padding: 8px 22px;
  z-index: 1500;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 0 32px rgba(255,43,143,.6);
  animation: bannerIn .6s ease-out;
}
@keyframes bannerIn {
  0% { transform: translate(-50%, -40px) scale(.8); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* === MESCALINE: мягкий хью-сдвиг + лёгкое дыхание === */
body.trip-mescaline #desktop {
  animation: mescalineHue 14s linear infinite;
}
body.trip-mescaline .window {
  animation: mescalineBreath 6s ease-in-out infinite;
}
@keyframes mescalineHue {
  0%   { filter: hue-rotate(0deg)   saturate(1.4); }
  50%  { filter: hue-rotate(60deg)  saturate(1.8); }
  100% { filter: hue-rotate(0deg)   saturate(1.4); }
}
@keyframes mescalineBreath {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.012); }
}

/* === LSD / BAT COUNTRY: полный радужный циркулятор + дрожь === */
body.trip-lsd #desktop, body.lsd:not([class*="trip-"]) #desktop {
  filter: hue-rotate(0deg) saturate(1.6) contrast(1.05);
  animation: lsdTrip 8s linear infinite;
}
body.trip-lsd .window, body.lsd:not([class*="trip-"]) .window { animation: lsdDrool 6s ease-in-out infinite; }
body.trip-lsd .icon .glyph, body.lsd:not([class*="trip-"]) .icon .glyph { animation: lsdWobble 2s ease-in-out infinite; }
@keyframes lsdTrip {
  0%   { filter: hue-rotate(0deg)   saturate(1.6); }
  50%  { filter: hue-rotate(180deg) saturate(2.2); }
  100% { filter: hue-rotate(360deg) saturate(1.6); }
}
@keyframes lsdDrool {
  0%,100% { transform: skewX(0deg) translateY(0); }
  50%     { transform: skewX(-2deg) translateY(2px); }
}
@keyframes lsdWobble {
  0%,100% { transform: rotate(0deg); }
  25%     { transform: rotate(-3deg) scale(1.05); }
  75%     { transform: rotate(3deg)  scale(.97); }
}

/* === ADRENOCHROME: красный пульс, тряска, ускорение === */
body.trip-adrenochrome #desktop {
  filter: contrast(1.3) saturate(1.4);
  animation: adrPulse 1.4s ease-in-out infinite;
}
body.trip-adrenochrome .window {
  animation: adrShake .12s steps(2) infinite;
}
body.trip-adrenochrome .menubar { background: linear-gradient(180deg, #ff2a1f 0%, #8b0000 100%); color: #ffe21a; }
@keyframes adrPulse {
  0%,100% { box-shadow: inset 0 0 0px rgba(255,42,31,0); }
  50%     { box-shadow: inset 0 0 200px rgba(255,42,31,.4); }
}
@keyframes adrShake {
  0%,100% { transform: translate(0,0); }
  25%     { transform: translate(-1px,1px); }
  75%     { transform: translate(1px,-1px); }
}

/* === ETHER: тяжёлый блюр + замедление === */
body.trip-ether #desktop {
  filter: blur(2.2px) saturate(.7) brightness(1.1);
  animation: etherSwim 18s ease-in-out infinite;
}
body.trip-ether .window { animation: etherFloat 9s ease-in-out infinite; }
body.trip-ether .icon { animation: etherFloat 12s ease-in-out infinite; }
body.trip-ether * { transition-duration: 1.6s !important; }
@keyframes etherSwim {
  0%,100% { filter: blur(2.2px) saturate(.7) brightness(1.1) hue-rotate(0deg); }
  50%     { filter: blur(3.5px) saturate(.6) brightness(1.2) hue-rotate(40deg); }
}
@keyframes etherFloat {
  0%,100% { transform: translate(0,0); }
  25%     { transform: translate(2px,-3px); }
  50%     { transform: translate(-3px,2px); }
  75%     { transform: translate(1px,3px); }
}

/* === AMYL: стробоскоп (короткими вспышками) === */
body.trip-amyl #desktop {
  animation: amylStrobe .18s steps(2) infinite;
}
body.trip-amyl::after {
  content: "";
  position: fixed; inset: 0;
  background: #ffe21a;
  pointer-events: none;
  z-index: 9500;
  animation: amylFlash .9s steps(2) infinite;
  mix-blend-mode: difference;
}
@keyframes amylStrobe {
  0%   { filter: brightness(1.0) hue-rotate(0deg); }
  50%  { filter: brightness(1.4) hue-rotate(120deg); }
  100% { filter: brightness(1.0) hue-rotate(0deg); }
}
@keyframes amylFlash {
  0%,90%,100% { opacity: 0; }
  93%         { opacity: .25; }
}

/* === COCAINE: резкий контраст, сверхбыстрые анимации === */
body.trip-cocaine #desktop {
  filter: contrast(1.5) saturate(1.7) brightness(1.1);
}
body.trip-cocaine * { animation-duration: 0.3s !important; }
body.trip-cocaine .menubar { animation: cokeJitter .08s steps(2) infinite; }
body.trip-cocaine .clock { color: var(--neon-acid); }
@keyframes cokeJitter {
  0%,100% { transform: translateX(0); }
  50%     { transform: translateX(1px); }
}

/* === DMT: kaleidoscope (через SVG-фильтр), бешеные цвета === */
body.trip-dmt #desktop {
  filter: url(#dmt-kaleido) hue-rotate(0deg) saturate(2);
  animation: dmtSpin 22s linear infinite;
}
body.trip-dmt .window { filter: hue-rotate(0deg); animation: dmtHue 6s linear infinite; }
@keyframes dmtSpin {
  0%   { filter: url(#dmt-kaleido) hue-rotate(0deg)   saturate(2); }
  100% { filter: url(#dmt-kaleido) hue-rotate(360deg) saturate(2); }
}
@keyframes dmtHue {
  0%,100% { filter: hue-rotate(0deg); }
  50%     { filter: hue-rotate(180deg); }
}

/* === SOBER: чистый сброс === */
body.sober #desktop, body.sober .window, body.sober .icon .glyph {
  filter: none !important;
  animation: none !important;
}

/* Глобальные ambient объекты */
.ghost-letter {
  position: fixed;
  font-family: var(--psy);
  color: var(--neon-pink);
  font-size: 80px;
  pointer-events: none;
  opacity: 0;
  z-index: 1200;
  text-shadow: 0 0 20px rgba(255,43,143,.8);
  animation: ghostFloat 6s linear forwards;
}
@keyframes ghostFloat {
  0%   { opacity: 0; transform: translate(0,0) scale(.5); }
  20%  { opacity: .8; }
  100% { opacity: 0; transform: translate(0,-200px) scale(2); }
}

.lizard-walker {
  position: fixed; bottom: 0; left: -80px;
  font-size: 48px;
  z-index: 1200;
  pointer-events: none;
  animation: lizardWalk 22s linear forwards;
}
@keyframes lizardWalk {
  0%   { left: -80px; }
  100% { left: 110vw; }
}

.cursor-trail {
  position: fixed;
  width: 12px; height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9100;
  background: var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink);
  opacity: .7;
  animation: trailFade .8s linear forwards;
}
@keyframes trailFade {
  0%   { opacity: .7; transform: scale(1); }
  100% { opacity: 0; transform: scale(.2); }
}
