/* 2000s chaos theme: neon gradients, Comic Sans, marquees, spins, sparkles */
:root {
  --neon1: #ff00ff;
  --neon2: #00ffff;
  --neon3: #ffff00;
  --bg1: #ff6ec7;
  --bg2: #00d4ff;
  --bg3: #fffb00;
  --text: #000;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", cursive, system-ui;
  color: var(--text);
  background: linear-gradient(130deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 300% 300%;
  animation: bgShift 12s ease-in-out infinite;
  overflow-x: hidden;
  cursor: none; /* hide real cursor */
}

/* Dark theme variables */
body[data-theme="dark"] {
  --neon1: #00e5ff;
  --neon2: #ff33ff;
  --neon3: #aaff00;
  --bg1: #0b0b1a;
  --bg2: #10102a;
  --bg3: #1b0033;
  --text: #e8f6ff;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pattern overlays (animated stripes + checkerboard) */
body::before, body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
/* Diagonal stripes */
body::before {
  opacity: 0.10;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,0,0.7) 0 16px, rgba(0,0,0,0.6) 16px 32px);
  mix-blend-mode: multiply;
  animation: patternScrollOne 12s linear infinite;
}
/* Retro checkerboard */
body::after {
  opacity: 0.08;
  background-image:
    conic-gradient(from 45deg, rgba(255,0,255,0.5) 0 25%, rgba(0,255,255,0.5) 0 50%, rgba(255,0,255,0.5) 0 75%, rgba(0,255,255,0.5) 0 100%);
  background-size: 40px 40px;
  mix-blend-mode: screen;
  animation: patternScrollTwo 18s linear infinite;
}

/* Dark: slightly stronger overlays and slower patterns for readability */
body[data-theme="dark"]::before { opacity: 0.12; }
body[data-theme="dark"]::after { opacity: 0.10; }
@keyframes patternScrollOne { to { background-position: 200% 0; } }
@keyframes patternScrollTwo { to { background-position: -200% 0; } }

/* Intensify patterns */
body.patterns-intense::before { opacity: 0.22; animation-duration: 6s; }
body.patterns-intense::after  { opacity: 0.18; animation-duration: 10s; }

/* Strobe overlay (intense mode) */
/* Strobe overlay (disabled) */
/* Previously used body.strobe to apply heavy hue/brightness flashes. Removed to reduce photosensitivity risk. */
/* body.strobe { animation: none; } */
@keyframes strobeFlash { }

/* Custom oversized cursor */
#cursor, #cursor-shadow {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  border-radius: 50%;
  will-change: transform;
}
#cursor {
  width: 48px; height: 48px;
  background: radial-gradient(circle at 30% 30%, #fff, #ff00aa 60%, transparent 61%);
  border: 3px solid #000;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.5), 0 0 30px #fff;
}
#cursor-shadow {
  width: 90px; height: 90px;
  background: rgba(255,255,255,0.15);
  filter: blur(8px);
}

header {
  padding: 16px 10px 10px;
  text-align: center;
}
.title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 3px 3px 0 #000, -3px -3px 0 #00f, 3px -3px 0 #f0f, -3px 3px 0 #0ff;
}
.subtitle {
  font-size: 20px;
  margin-top: 6px;
  color: #000;
  text-shadow: 0 0 6px #fff;
  background: rgba(255,255,255,0.4);
  display: inline-block;
  padding: 6px 10px;
  border: 3px dashed #000;
  transform: rotate(-2deg);
}
body[data-theme="dark"] .subtitle {
  color: #fff;
  background: rgba(0,0,0,0.35);
  border-color: #0ff;
  text-shadow: 0 0 10px var(--neon2);
}

/* Neon flashing text effect */
.neon {
  animation: neonPulse 1.2s ease-in-out infinite;
}
@keyframes neonPulse {
  0% {
    text-shadow:
      0 0 4px #fff,
      0 0 8px var(--neon1),
      0 0 16px var(--neon2),
      0 0 24px var(--neon3);
    filter: drop-shadow(0 0 6px #fff);
  }
  50% {
    text-shadow:
      0 0 2px #fff,
      0 0 6px var(--neon2),
      0 0 12px var(--neon1);
    filter: drop-shadow(0 0 2px #fff);
    opacity: 0.85;
  }
  100% {
    text-shadow:
      0 0 4px #fff,
      0 0 8px var(--neon1),
      0 0 16px var(--neon2),
      0 0 24px var(--neon3);
    filter: drop-shadow(0 0 6px #fff);
  }
}

/* <blink> tag emulation */
blink { animation: blink 0.7s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Selected text highlight */
::selection { background: #00ffff; color: #000; }

.marquee {
  font-size: 18px;
  background: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #0ff 10px, #0ff 20px);
  color: #000;
  border: 4px ridge #000;
  padding: 6px 0;
}
.marquee.loud { font-weight: 900; letter-spacing: 1px; }
.marquee.box { background: repeating-linear-gradient(135deg, #f0f, #f0f 12px, #0f0 12px, #0f0 24px); }
body[data-theme="dark"] .marquee { border-color: #0ff; }
body[data-theme="dark"] .marquee.box { background: repeating-linear-gradient(135deg, #0ff, #0ff 12px, #f0f 12px, #f0f 24px); }

main { padding: 10px; }
.layout {
  width: 100%;
  border-spacing: 10px;
}
.sidebar {
  width: 20%;
  vertical-align: top;
  background: rgba(255,255,255,0.6);
  border: 6px groove #000;
  padding: 10px;
}
body[data-theme="dark"] .sidebar { background: rgba(0,0,0,0.6); border-color: #0ff; }
.content {
  width: 60%;
  vertical-align: top;
  background: rgba(255,255,255,0.85);
  border: 8px double #000;
  padding: 12px;
}
body[data-theme="dark"] .content { background: rgba(0,0,0,0.8); border-color: #0ff; color: #e6fffb; }
.nav-title { text-align: center; text-transform: uppercase; }
.nav {
  list-style: none; padding: 0; margin: 10px 0;
}
.nav li { margin: 8px 0; }
.nav a {
  display: block;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fff, #ffd);
  border: 3px outset #000;
  color: #000; text-decoration: none;
}
.nav a:hover { background: #fffc8a; transform: rotate(1deg) scale(1.05); }
body[data-theme="dark"] .nav a { background: linear-gradient(180deg, #141414, #1f1f1f); color: #aaffff; border-color: #0ff; }
body[data-theme="dark"] .nav a:hover { background: #1a2a2a; }

.panel {
  margin: 16px 0;
  padding: 14px;
  border: 6px ridge #000;
  background: #fff;
  transform: rotate(-0.3deg);
}
.panel.loud { background: #fffd78; border-color: #f0f; box-shadow: 0 0 20px #f0f inset; }
.panel-title {
  margin: 0 0 10px 0;
  font-size: 28px;
  text-shadow: 2px 2px #0ff;
}
.bullets { margin: 8px 0 0 18px; }
body[data-theme="dark"] .panel { background: #0b0b14; color: #e0fbff; border-color: #0ff; box-shadow: 0 0 20px rgba(0,255,255,0.15) inset; }
body[data-theme="dark"] .panel.loud { background: #1a1030; border-color: #f0f; }
body[data-theme="dark"] .panel-title { text-shadow: 2px 2px #f0f; }

.btn {
  font-family: inherit;
  padding: 10px 16px;
  margin: 6px;
  border: 4px outset #000;
  background: linear-gradient(180deg, #fff, #ffef4a);
  cursor: pointer;
}
.btn.alt { background: linear-gradient(180deg, #fff, #78ffea); }
.btn:hover { filter: hue-rotate(50deg); transform: scale(1.05) rotate(-1deg); }
body[data-theme="dark"] .btn { background: linear-gradient(180deg, #161616, #2a2a2a); color: #aaffff; border-color: #0ff; }
body[data-theme="dark"] .btn.alt { background: linear-gradient(180deg, #161616, #003b3b); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.card {
  text-align: center;
  padding: 18px;
  background: #fff4;
  border: 4px groove #000;
  font-size: 20px;
}

.gallery { display: flex; gap: 12px; flex-wrap: wrap; }
.polaroid {
  width: 80px; height: 80px; display: grid; place-items: center;
  background: #fff;
  border: 6px solid #000;
  box-shadow: 4px 6px 0 #000;
}
body[data-theme="dark"] .polaroid { background: #0f0f14; border-color: #0ff; box-shadow: 4px 6px 0 #0ff; color: #9ff; }

.guestbook { display: grid; gap: 8px; }
.entry { background: #fff; border: 3px dotted #000; padding: 6px; transform: rotate(0.5deg); }
body[data-theme="dark"] .entry { background: #12121a; color: #def; border-color: #0ff; }

footer { margin: 16px 0 30px; }

/* Under construction styling */
.construction {
  background-image:
    repeating-linear-gradient(45deg, #ff0 0 12px, #000 12px 24px);
  color: #000;
}
.construction p { background: rgba(255,255,255,0.8); padding: 8px; border: 3px dashed #000; }
body[data-theme="dark"] .construction { background-image: repeating-linear-gradient(45deg, #0ff 0 12px, #000 12px 24px); color: #0ff; }
body[data-theme="dark"] .construction p { background: rgba(0,0,0,0.7); border-color: #0ff; color: #aff; }

/* Flash pulse for random highlights */
.flash { animation: flash 0.22s steps(2, end) 1; }
@keyframes flash { 0%, 100% { filter: brightness(1.6) saturate(1.6); } 50% { filter: none; } }

/* Neon select dropdowns */
.polls { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: grid; gap: 6px; font-weight: bold; }
.neon-select {
  appearance: none;
  padding: 10px 12px;
  border: 5px ridge #000;
  background: linear-gradient(180deg, #fff, #eaffff);
  box-shadow:
    0 0 6px #fff,
    0 0 12px var(--neon1),
    inset 0 0 8px rgba(0,0,0,0.1);
  animation: neonBox 1.4s ease-in-out infinite;
  font-family: inherit;
}
@keyframes neonBox {
  0%, 100% { box-shadow: 0 0 6px #fff, 0 0 12px var(--neon2), inset 0 0 8px rgba(0,0,0,0.1); }
  50% { box-shadow: 0 0 2px #fff, 0 0 22px var(--neon3), inset 0 0 4px rgba(0,0,0,0.05); }
}

/* Hit counter */
.hit-counter { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 6px; }
.hit-counter .label { font-weight: 900; background: #000; color: #0ff; padding: 2px 6px; border: 3px inset #555; }
.hit-counter .digits {
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
  padding: 4px 8px;
  background: #000;
  color: #0f0;
  border: 4px groove #333;
  box-shadow: inset 0 0 10px #0f0, 0 0 12px #0f0;
}
.hit-counter .since { font-size: 12px; opacity: 0.9; }

/* Chaos spins */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 3s linear infinite; display: inline-block; }
.spin-slow { animation: spin 12s linear infinite; display: inline-block; }
.spin-mid { animation: spin 6s linear infinite; display: inline-block; }
.spin-fast { animation: spin 0.8s linear infinite; display: inline-block; }

/* Wobble hover */
@keyframes wobble {
  0% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.05); }
  100% { transform: rotate(-2deg) scale(1); }
}
.wobble:hover { animation: wobble 0.4s ease-in-out both; }

/* Chaos layer */
#chaos-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
}
.emoji, .sparkle {
  position: absolute; will-change: transform, opacity; user-select: none;
}

/* Big obnoxious Dark Mode switch */
.dark-mode-cta { display: grid; gap: 6px; margin-bottom: 10px; }
.dark-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 120px;
  border: 10px ridge #000;
  background: linear-gradient(180deg, #fff, #ffd54d);
  box-shadow: 10px 12px 0 #000, inset 0 0 24px rgba(255,255,0,0.4);
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  text-shadow: 0 0 6px #fff, 0 0 10px #f0f;
}
.dark-toggle::after,
.dark-toggle::before {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
}
/* Radial light burst */
.dark-toggle::after {
  background: radial-gradient(circle at center,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0.75) 20%,
    rgba(255,0,255,0.35) 45%,
    rgba(0,255,255,0.35) 65%,
    rgba(255,255,255,0.0) 75%);
  filter: blur(2px) saturate(1.4);
  transform: scale(0.1);
}
/* Shockwave ring */
.dark-toggle::before {
  border: 10px solid rgba(255,255,255,0.7);
  filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 18px #0ff) drop-shadow(0 0 18px #f0f);
  transform: scale(0.2);
}
.dark-toggle .label { font-size: 28px; }
.dark-toggle .knob {
  position: absolute;
  width: 140px; height: 84px;
  border: 8px outset #000;
  background: radial-gradient(circle at 30% 30%, #fff, #ff80ff 60%);
  top: 50%; left: 10px; transform: translateY(-50%);
  box-shadow: 0 0 20px #f0f, 0 0 12px #fff inset;
}
.dark-toggle .knob { transition: left 220ms cubic-bezier(0.3, 0.7, 0.4, 1), transform 220ms ease; }
.dark-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, #8de3ff, #00ffff);
  box-shadow: 10px 12px 0 #000, inset 0 0 24px rgba(0,255,255,0.4);
}
.dark-toggle[aria-pressed="true"] .knob {
  left: calc(100% - 150px);
  background: radial-gradient(circle at 30% 30%, #fff, #00e5ff 60%);
  box-shadow: 0 0 20px #0ff, 0 0 12px #fff inset;
}
.dark-toggle.burst-active::after { animation: burstExpand 600ms cubic-bezier(0.2, 0.7, 0.1, 1) 1; }
.dark-toggle.burst-active::before { animation: ringExpand 650ms cubic-bezier(0.2, 0.7, 0.1, 1) 1; }
.dark-toggle.burst-active .knob { animation: clack 320ms ease 1; }
.dark-mode-cta .hint.small { text-align: center; font-style: italic; }

@keyframes burstExpand {
  0% { opacity: 0.0; transform: scale(0.1); filter: blur(12px) saturate(1.8); }
  20% { opacity: 0.9; transform: scale(0.9); filter: blur(6px) saturate(1.8); }
  60% { opacity: 0.5; transform: scale(1.6); filter: blur(12px) saturate(1.4); }
  100% { opacity: 0.0; transform: scale(2.2); filter: blur(20px) saturate(1.1); }
}
@keyframes ringExpand {
  0% { opacity: 0.0; transform: scale(0.2); border-width: 16px; }
  30% { opacity: 0.9; transform: scale(1.0); border-width: 10px; }
  100% { opacity: 0.0; transform: scale(2.6); border-width: 2px; }
}
@keyframes clack {
  0% { transform: translateY(-50%) rotate(0deg) scale(1); }
  30% { transform: translateY(-55%) rotate(-8deg) scale(0.96); }
  60% { transform: translateY(-48%) rotate(6deg) scale(1.04); }
  100% { transform: translateY(-50%) rotate(0deg) scale(1); }
}
.dark-mode-cta .hint.small { text-align: center; font-style: italic; }

/* Entry overlay for enabling audio */
#enter-overlay {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 12000;
  background: radial-gradient(circle at center, rgba(255,255,255,0.9), rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#enter-overlay.visible { opacity: 1; pointer-events: auto; }
.overlay, #enter-overlay, #warning-overlay { cursor: auto; }
.fade-out#enter-overlay, #enter-overlay.fade-out { opacity: 0; pointer-events: none; }
.enter-box {
  background: linear-gradient(135deg, #fff, #ffe);
  border: 10px ridge #000;
  padding: 20px 30px;
  text-align: center;
  box-shadow: 8px 10px 0 #000;
}
body[data-theme="dark"] #enter-overlay { background: radial-gradient(circle at center, rgba(0,0,0,0.85), rgba(0,0,0,0.6), rgba(0,0,0,0.35)); }
body[data-theme="dark"] .enter-box { background: linear-gradient(135deg, #0e0e14, #12121a); border-color: #0ff; color: #eaffff; }

/* Global, single-shot theme burst (gentle) */
body.theme-burst {
  transition: filter 400ms ease, transform 400ms ease;
  filter: brightness(1.08) contrast(1.05) saturate(1.1);
}
.enter-box h1 { margin: 0 0 10px 0; }
.enter-box button {
  font-family: inherit; font-size: 20px; padding: 10px 20px; border: 6px outset #000; cursor: pointer;
  background: linear-gradient(180deg, #fff, #b1ff5d);
}

/* Spin-out animation for the entry box */
@keyframes spinAway {
  0% { transform: none; opacity: 1; }
  60% { transform: rotate(420deg) scale(0.6) translateY(-40vh); opacity: 0.8; }
  100% { transform: rotate(1080deg) scale(0.2) translateY(-140vh); opacity: 0; }
}
.enter-box.spin-away {
  animation: spinAway 0.9s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}

/* Warning overlay styling */
#warning-overlay {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 13000;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,0,0.8) 0 24px, rgba(0,0,0,0.9) 24px 48px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#warning-overlay.visible { opacity: 1; pointer-events: auto; }
.warning-box {
  background: #fff;
  border: 12px ridge #000;
  box-shadow: 10px 12px 0 #000, 0 0 30px #ff0 inset;
  padding: 24px 26px;
  max-width: 760px;
  text-align: center;
}
body[data-theme="dark"] #warning-overlay { background: repeating-linear-gradient(135deg, rgba(0,255,255,0.5) 0 24px, rgba(0,0,0,0.9) 24px 48px); }
body[data-theme="dark"] .warning-box { background: #0e0e14; color: #eaffff; border-color: #0ff; box-shadow: 10px 12px 0 #0ff, 0 0 30px rgba(0,255,255,0.2) inset; }
.warning-box h1 { margin: 0 0 8px 0; }
.warning-box .agree { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 10px 0; font-weight: bold; }
.warning-actions { margin-top: 10px; }
.warning-actions button {
  font-family: inherit; font-size: 20px; padding: 10px 20px; border: 6px outset #000; cursor: pointer;
  background: linear-gradient(180deg, #fff, #ff7b7b);
}

/* Shake animation for validation */
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake 0.25s linear 1; }

/* Violent rainbow flash (used after clicking Continue) */
@keyframes rainbowFlash {
  from { filter: hue-rotate(0deg) saturate(3) brightness(1.25); }
  to   { filter: hue-rotate(360deg) saturate(3) brightness(1.25); }
}
@keyframes jolt {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-2px, 2px) rotate(-2deg); }
  50% { transform: translate(2px, -2px) rotate(2deg); }
  75% { transform: translate(-1px, 1px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.rainbow-flash {
  animation: rainbowFlash 0.09s linear infinite, jolt 0.12s steps(2, end) infinite;
  box-shadow: 0 0 18px #fff, 0 0 36px #ff0, 0 0 54px #0ff, 0 0 72px #f0f;
}

/* Small screens */
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar, .content { width: auto; margin: 8px 0; }
}

/* While overlays are visible, show native cursor and hide custom cursor */
body.overlay-mode { cursor: auto; }
body.overlay-mode #cursor,
body.overlay-mode #cursor-shadow { display: none; }

/* ===================== Drunk Mode (Aggressive) ===================== */
/* Apply to wrapper for reliable SVG filter rendering */
body.drunk #world {
  will-change: transform, filter;
  transform-origin: 50% 45%;
  animation:
    drunkWobbleAggro 6.2s cubic-bezier(0.33, 0.0, 0.22, 1) infinite,
    drunkFilterShift 4.8s ease-in-out infinite;
}

@keyframes drunkWobbleAggro {
  0%   { transform: perspective(700px) rotateZ(2.0deg) rotateX(2deg) rotateY(-1.5deg) translate(0px, 0px) scale(1.00) skewX(0.3deg) skewY(0.2deg); }
  20%  { transform: perspective(700px) rotateZ(-3.2deg) rotateX(-3deg) rotateY(2deg) translate(-28px, 16px) scale(1.06) skewX(-1.6deg) skewY(0.8deg); }
  40%  { transform: perspective(700px) rotateZ(3.6deg) rotateX(2.5deg) rotateY(-2.5deg) translate(20px, -28px) scale(1.10) skewX(1.6deg) skewY(-1.2deg); }
  60%  { transform: perspective(700px) rotateZ(-2.4deg) rotateX(-2deg) rotateY(2deg) translate(-24px, 10px) scale(1.05) skewX(-1.0deg) skewY(1.4deg); }
  80%  { transform: perspective(700px) rotateZ(2.8deg) rotateX(1.5deg) rotateY(-1.5deg) translate(14px, -18px) scale(1.07) skewX(1.2deg) skewY(-0.8deg); }
  100% { transform: perspective(700px) rotateZ(2.0deg) rotateX(2deg) rotateY(-1.5deg) translate(0px, 0px) scale(1.00) skewX(0.3deg) skewY(0.2deg); }
}

@keyframes drunkFilterShift {
  0%   { filter: url(#drunkWarp) hue-rotate(0deg) saturate(2.0) contrast(1.14) blur(0.0px); }
  50%  { filter: url(#drunkWarp) hue-rotate(35deg) saturate(2.3) contrast(1.22) blur(1.6px); }
  100% { filter: url(#drunkWarp) hue-rotate(0deg) saturate(2.0) contrast(1.14) blur(0.0px); }
}

/* Stronger background pattern overlays while drunk */
body.drunk::before { opacity: 0.20; animation-duration: 7s; }
body.drunk::after  { opacity: 0.16; animation-duration: 12s; }
body.drunk.patterns-intense::before { opacity: 0.32; }
body.drunk.patterns-intense::after  { opacity: 0.24; }

/* ===================== Flashstorm (high-intensity colors) ===================== */
/* Global hue/brightness pulses and moving rainbow bands */
body.flashstorm {
  animation: strobeHue 0.65s steps(2, end) infinite;
}

@keyframes strobeHue {
  0%   { filter: hue-rotate(0deg) saturate(2.2) brightness(1.15); }
  50%  { filter: hue-rotate(120deg) saturate(2.6) brightness(1.35); }
  100% { filter: hue-rotate(240deg) saturate(2.2) brightness(1.15); }
}

/* Two animated rainbow sheets that sweep across the page */
body.flashstorm::before,
body.flashstorm::after {
  content: ""; position: fixed; inset: -20%; pointer-events: none; z-index: 1;
  background:
    conic-gradient(from 0deg,
      rgba(255,0,0,0.18), rgba(255,153,0,0.18), rgba(255,255,0,0.18), rgba(0,255,0,0.18),
      rgba(0,255,255,0.18), rgba(0,0,255,0.18), rgba(255,0,255,0.18), rgba(255,0,0,0.18));
  mix-blend-mode: screen;
  filter: blur(8px) saturate(1.4);
}
body.flashstorm::before { animation: sweepA 3.5s linear infinite; opacity: 0.45; }
body.flashstorm::after  { animation: sweepB 4.2s linear infinite; opacity: 0.35; }

@keyframes sweepA { to { transform: rotate(360deg) translate(0,0); } }
@keyframes sweepB { to { transform: rotate(-360deg) translate(0,0); } }

/* Element-level rainbow pulses (text/box glows) */
.title, .subtitle, .panel, .btn, .card, .nav a, .polaroid, .digits, .dark-toggle {
  transition: filter 120ms linear;
}
/* Do not override element animations (like spin); glow via pseudo-elements */
body.flashstorm .title,
body.flashstorm .subtitle,
body.flashstorm .panel-title { position: relative; }
body.flashstorm .title::after,
body.flashstorm .subtitle::after,
body.flashstorm .panel-title::after {
  content: ""; position: absolute; inset: -4px; pointer-events: none; mix-blend-mode: screen;
  animation: textGlow 0.5s linear infinite;
}
body.flashstorm .panel,
body.flashstorm .btn,
body.flashstorm .card,
body.flashstorm .nav a,
body.flashstorm .polaroid { animation: boxNeon 0.7s linear infinite; }

@keyframes textGlow {
  0%   { box-shadow: 0 0 8px #fff, 0 0 18px #f0f, 0 0 24px #0ff; filter: hue-rotate(0deg); }
  50%  { box-shadow: 0 0 4px #fff, 0 0 26px #0ff, 0 0 34px #ff0; filter: hue-rotate(120deg); }
  100% { box-shadow: 0 0 8px #fff, 0 0 18px #f0f, 0 0 24px #0ff; filter: hue-rotate(240deg); }
}
@keyframes boxNeon {
  0%   { box-shadow: 0 0 8px #fff, 0 0 16px #f0f inset, 0 0 20px #0ff; }
  50%  { box-shadow: 0 0 4px #fff, 0 0 28px #0ff inset, 0 0 30px #ff0; }
  100% { box-shadow: 0 0 8px #fff, 0 0 16px #f0f inset, 0 0 20px #0ff; }
}
