@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Black+Ops+One&display=swap');

:root {
  --c1: #ff006e;
  --c2: #fb5607;
  --c3: #ffbe0b;
  --c4: #8338ec;
  --c5: #3a86ff;
  --c6: #06ffa5;
  --c7: #ff0000;
  --c8: #00ff00;
  --c9: #0000ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  overflow-x: hidden;
  font-family: 'Bangers', 'Impact', 'Arial Black', cursive;
  cursor: crosshair;
}

body {
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6), var(--c7), var(--c8), var(--c9));
  background-size: 1000% 1000%;
  animation: gradientShift 3s ease infinite, pageShake 0.3s infinite alternate;
  color: white;
  min-height: 100vh;
  position: relative;
  image-rendering: pixelated;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 50% 100%; }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

@keyframes pageShake {
  from { transform: translateX(-1px) rotate(-0.1deg); }
  to   { transform: translateX(1px) rotate(0.1deg); }
}

/* CRT scanlines overlay */
.crt-scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 98;
  animation: scanlinesFlicker 0.5s infinite alternate;
}

@keyframes scanlinesFlicker {
  0%   { opacity: 0.3; }
  50%  { opacity: 0.6; }
  100% { opacity: 0.4; }
}

/* RGB split overlay for glitch effect */
.rgb-split-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 97;
  background:
    linear-gradient(90deg, rgba(255,0,0,0.03) 0%, transparent 33%, rgba(0,255,0,0.03) 66%, transparent 100%);
  animation: rgbSplit 2s infinite;
}

@keyframes rgbSplit {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(3px); filter: hue-rotate(90deg); }
  40%      { transform: translateX(-2px); filter: hue-rotate(-90deg); }
  60%      { transform: translateX(4px); filter: hue-rotate(180deg); }
  80%      { transform: translateX(-1px); }
}

/* Disco floor with more intensity */
.disco-floor {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,   rgba(255,255,255,0.08) 0 2px, transparent 2px 30px),
    repeating-linear-gradient(90deg,  rgba(255,255,255,0.08) 0 2px, transparent 2px 30px);
  pointer-events: none;
  animation: discoFloor 2s linear infinite;
  z-index: 0;
}

@keyframes discoFloor {
  to { background-position: 30px 30px; }
}

/* Noise texture overlay */
.disco-floor::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
}

.emoji-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.emoji-rain span {
  position: absolute;
  top: -50px;
  font-size: 2rem;
  animation: fall linear forwards;
  user-select: none;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg) scale(1.5);
    opacity: 0;
  }
}

/* Marquee chaos - multiple directions */
.marquee {
  position: relative;
  z-index: 5;
  background: black;
  color: var(--c3);
  border-top: 4px dashed var(--c1);
  border-bottom: 4px dashed var(--c1);
  overflow: hidden;
  white-space: nowrap;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  padding: 0.6rem 0;
  text-shadow: 0 0 10px var(--c3);
}

.marquee-backwards {
  background: var(--c1);
  color: black;
  border-color: var(--c3);
  font-size: 1.2rem;
  transform: rotate(-0.5deg);
}

.marquee-backwards .marquee-track {
  animation: marqueeReverse 10s linear infinite;
}

.marquee-track {
  display: inline-flex;
  animation: marquee 18s linear infinite;
}

.marquee-track span {
  padding-right: 3rem;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marqueeReverse {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Floating chaotic images */
.chaos-img {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: screen;
  filter: contrast(1.5) saturate(2) hue-rotate(0deg);
  transition: all 0.2s;
}

.chaos-img-1 {
  width: 220px;
  top: 15%;
  left: -5%;
  transform: rotate(-15deg);
  animation: imgFloat1 6s ease-in-out infinite, imgGlitch 4s infinite;
}

.chaos-img-2 {
  width: 180px;
  top: 60%;
  right: -3%;
  transform: rotate(20deg);
  animation: imgFloat2 7s ease-in-out infinite, imgGlitch 3s infinite 1s;
}

.chaos-img-3 {
  width: 150px;
  bottom: 20%;
  left: 8%;
  transform: rotate(10deg);
  animation: imgFloat3 5s ease-in-out infinite, imgGlitch 5s infinite 0.5s;
}

.chaos-img-4 {
  width: 200px;
  top: 5%;
  right: 10%;
  transform: rotate(-25deg);
  animation: imgFloat4 8s ease-in-out infinite, imgGlitch 3.5s infinite 2s;
}

.chaos-img-5 {
  width: 120px;
  bottom: 5%;
  right: 25%;
  transform: rotate(35deg);
  animation: imgFloat5 4s ease-in-out infinite, imgGlitch 6s infinite 1.5s;
}

@keyframes imgFloat1 {
  0%, 100% { transform: rotate(-15deg) translateY(0); }
  50%      { transform: rotate(-10deg) translateY(-20px); }
}

@keyframes imgFloat2 {
  0%, 100% { transform: rotate(20deg) translateY(0); }
  50%      { transform: rotate(25deg) translateY(15px); }
}

@keyframes imgFloat3 {
  0%, 100% { transform: rotate(10deg) translateX(0); }
  50%      { transform: rotate(5deg) translateX(20px); }
}

@keyframes imgFloat4 {
  0%, 100% { transform: rotate(-25deg) scale(1); }
  50%      { transform: rotate(-20deg) scale(1.1); }
}

@keyframes imgFloat5 {
  0%, 100% { transform: rotate(35deg) translateY(0) translateX(0); }
  50%      { transform: rotate(40deg) translateY(-10px) translateX(10px); }
}

@keyframes imgGlitch {
  0%, 90%, 100% { filter: contrast(1.5) saturate(2) hue-rotate(0deg); opacity: 0.6; }
  92% { filter: contrast(3) saturate(4) hue-rotate(180deg); opacity: 0.8; transform: translateX(5px); }
  94% { filter: contrast(2) saturate(0.5) hue-rotate(-90deg); opacity: 0.4; transform: translateX(-5px); }
  96% { filter: contrast(4) saturate(3) hue-rotate(90deg); opacity: 0.7; }
  98% { filter: contrast(1) saturate(1) hue-rotate(0deg); opacity: 0.6; }
}

.stage {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 3rem 1rem 8rem;
  overflow: visible;
}

.title {
  font-family: 'Black Ops One', 'Impact', 'Arial Black', cursive;
  font-size: clamp(3rem, 12vw, 9rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  animation: titleShake 0.2s ease-in-out infinite alternate, titleColorShift 1s infinite;
  text-shadow:
    4px 4px 0 var(--c1),
    8px 8px 0 var(--c4),
    12px 12px 0 var(--c5),
    16px 16px 0 var(--c2),
    20px 20px 30px rgba(0,0,0,0.6);
  transform: rotate(-2deg);
}

@keyframes titleColorShift {
  0%   { color: white; }
  20%  { color: var(--c3); }
  40%  { color: var(--c6); }
  60%  { color: var(--c1); }
  80%  { color: var(--c5); }
  100% { color: white; }
}

.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.title::before {
  color: var(--c6);
  transform: translate(-4px, 0);
  mix-blend-mode: screen;
  animation: glitch 1.2s infinite;
}

.title::after {
  color: var(--c1);
  transform: translate(4px, 0);
  mix-blend-mode: screen;
  animation: glitch 0.8s infinite reverse;
}

@keyframes glitch {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0,0); }
  10%      { clip-path: inset(20% 0 60% 0); transform: translate(-6px, 3px); }
  20%      { clip-path: inset(50% 0 20% 0); transform: translate(6px, -3px); }
  30%      { clip-path: inset(10% 0 70% 0); transform: translate(-3px, 2px); }
  40%      { clip-path: inset(70% 0 10% 0); transform: translate(4px, -2px); }
  50%      { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 1px); }
  60%      { clip-path: inset(80% 0 5% 0); transform: translate(3px, -1px); }
  70%      { clip-path: inset(5% 0 80% 0); transform: translate(-5px, 3px); }
  80%      { clip-path: inset(60% 0 20% 0); transform: translate(2px, -3px); }
  90%      { clip-path: inset(15% 0 65% 0); transform: translate(-3px, 1px); }
}

@keyframes titleShake {
  from { transform: rotate(-2deg) scale(1) skewX(-2deg); }
  to   { transform: rotate(2deg) scale(1.03) skewX(2deg); }
}

.subtitle {
  margin-top: 1rem;
  font-size: clamp(1rem, 3vw, 2rem);
  letter-spacing: 0.3em;
  color: white;
  text-shadow: 2px 2px 0 black, 0 0 20px var(--c1);
  animation: hueShift 2s linear infinite, textFlicker 0.5s infinite alternate;
  transform: rotate(1deg);
}

@keyframes textFlicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.8; }
  75%      { opacity: 0.95; }
}

@keyframes hueShift {
  to { filter: hue-rotate(360deg); }
}

/* Glitch date display */
.glitch-date {
  font-family: 'Black Ops One', cursive;
  font-size: clamp(1.2rem, 4vw, 2.5rem);
  color: var(--c3);
  text-shadow: 0 0 10px var(--c3), 2px 2px 0 black;
  margin: 0.5rem 0;
  animation: dateGlitch 3s infinite;
  letter-spacing: 0.2em;
}

@keyframes dateGlitch {
  0%, 100% { transform: translateX(1px); opacity: 1; }
  10%      { transform: translateX(-2px); opacity: 0.8; }
  20%      { transform: translateX(3px); opacity: 1; }
  30%      { transform: translateX(-1px); opacity: 0.7; }
  40%      { transform: translateX(0); opacity: 1; }
}

.countdown {
  margin: 3rem auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  perspective: 800px;
  transform: rotate(-1deg);
}

.unit {
  background: rgba(0,0,0,0.8);
  border: 4px solid white;
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  min-width: 140px;
  box-shadow:
    0 0 30px var(--c1),
    inset 0 0 20px rgba(255,255,255,0.1),
    5px 5px 0 var(--c4);
  transform-style: preserve-3d;
  animation: unitFloat 3s ease-in-out infinite,
             unitBorderColor 2s infinite;
}

.unit:nth-child(1) { animation-delay: 0s, 0s;   border-color: var(--c1); box-shadow: 0 0 30px var(--c1); }
.unit:nth-child(2) { animation-delay: 0.3s, 0.5s; border-color: var(--c3); box-shadow: 0 0 30px var(--c3); }
.unit:nth-child(3) { animation-delay: 0.6s, 1s; border-color: var(--c6); box-shadow: 0 0 30px var(--c6); }
.unit:nth-child(4) { animation-delay: 0.9s, 1.5s; border-color: var(--c4); box-shadow: 0 0 30px var(--c4); }

@keyframes unitFloat {
  0%, 100% { transform: translateY(0) rotateX(0) rotateZ(0); }
  50%      { transform: translateY(-15px) rotateX(8deg) rotateZ(2deg); }
}

@keyframes unitBorderColor {
  0%, 100% { border-color: currentColor; }
  50%      { border-color: white; }
}

.num {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  font-family: 'Black Ops One', 'Courier New', monospace;
  text-shadow: 0 0 20px currentColor;
  animation: numFlash 1s infinite alternate;
}

@keyframes numFlash {
  from { text-shadow: 0 0 20px currentColor; }
  to   { text-shadow: 0 0 40px currentColor, 0 0 60px currentColor; }
}

.unit:nth-child(1) .num { color: var(--c1); }
.unit:nth-child(2) .num { color: var(--c3); }
.unit:nth-child(3) .num { color: var(--c6); }
.unit:nth-child(4) .num { color: var(--c4); }

.label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  opacity: 0.85;
  text-shadow: 0 0 5px white;
}

.party-info {
  margin: 2rem auto;
  font-size: 1.2rem;
  transform: rotate(0.5deg);
}

.party-info p { margin: 0.5rem 0; text-shadow: 2px 2px 0 black, 0 0 10px var(--c1); }

.hint {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
  animation: hintBounce 1s infinite;
  display: inline-block;
}

@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Rotating rings */
.rotating-ring {
  position: relative;
  margin: 3rem auto;
  width: 320px;
  height: 320px;
  animation: ringSpin 12s linear infinite;
}

.ring-reverse {
  animation: ringSpin 8s linear infinite reverse;
  margin-top: -160px;
  opacity: 0.7;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.rotating-ring span {
  position: absolute;
  top: 50%; left: 50%;
  font-size: 2.5rem;
  display: inline-block;
  transform-origin: 0 0;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.hype-btn {
  margin-top: 3rem;
  padding: 1rem 2.5rem;
  font-size: 1.5rem;
  font-family: 'Bangers', inherit;
  letter-spacing: 0.2em;
  background: var(--c1);
  color: white;
  border: 4px solid white;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 30px var(--c1), 6px 6px 0 black;
  animation: btnPulse 0.5s ease-in-out infinite alternate,
             btnShake 2s ease-in-out infinite;
  transition: transform 0.1s;
  position: relative;
  z-index: 20;
}

.hype-btn:hover { transform: scale(1.15) rotate(-5deg) skewX(3deg); }
.hype-btn:active { transform: scale(0.95); }

@keyframes btnPulse {
  from { box-shadow: 0 0 30px var(--c1), 6px 6px 0 black; }
  to   { box-shadow: 0 0 60px var(--c3), 6px 6px 0 black; }
}

@keyframes btnShake {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-1deg); }
  75%      { transform: rotate(1deg); }
}

/* Nonsense blocks */
.nonsense-block {
  position: absolute;
  font-family: 'Black Ops One', cursive;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: var(--c1);
  border: 3px solid white;
  transform: rotate(-5deg);
  box-shadow: 4px 4px 0 black;
  animation: nonsenseFloat 4s ease-in-out infinite;
  z-index: 15;
  pointer-events: none;
}

.nonsense-1 {
  top: 20%;
  right: 5%;
  background: var(--c7);
  transform: rotate(8deg);
  animation-delay: 0s;
}

.nonsense-2 {
  bottom: 30%;
  left: 3%;
  background: var(--c5);
  transform: rotate(-10deg);
  animation-delay: 1s;
}

.nonsense-3 {
  top: 50%;
  right: 2%;
  background: var(--c6);
  color: black;
  transform: rotate(5deg);
  animation-delay: 2s;
}

@keyframes nonsenseFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-15px) rotate(calc(var(--r, 0deg) + 5deg)); }
}

/* Bouncy emojis */
.bouncy-emoji {
  position: fixed;
  bottom: 0;
  font-size: 3rem;
  z-index: 4;
  animation: bounce 2.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  animation-delay: var(--d, 0s);
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); }
  50%      { transform: translateY(-60vh) rotate(360deg) scale(1.2); }
}

/* Dancing text */
.dancing-text {
  position: fixed;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bangers', cursive;
  font-size: clamp(1.5rem, 5vw, 3rem);
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 20px var(--c1), 2px 2px 0 black;
}

.dancing-text span {
  display: inline-block;
  animation: letterDance 1.5s ease-in-out infinite;
}

.dancing-text span:nth-child(1) { animation-delay: 0s; }
.dancing-text span:nth-child(2) { animation-delay: 0.1s; }
.dancing-text span:nth-child(3) { animation-delay: 0.2s; }
.dancing-text span:nth-child(4) { animation-delay: 0.3s; }
.dancing-text span:nth-child(5) { animation-delay: 0.4s; }
.dancing-text span:nth-child(6) { animation-delay: 0.5s; }
.dancing-text span:nth-child(7) { animation-delay: 0.6s; }
.dancing-text span:nth-child(8) { animation-delay: 0.7s; }
.dancing-text span:nth-child(9) { animation-delay: 0.8s; }
.dancing-text span:nth-child(10) { animation-delay: 0.9s; }
.dancing-text span:nth-child(11) { animation-delay: 1.0s; }
.dancing-text span:nth-child(12) { animation-delay: 1.1s; }
.dancing-text span:nth-child(13) { animation-delay: 1.2s; }
.dancing-text span:nth-child(14) { animation-delay: 1.3s; }
.dancing-text span:nth-child(15) { animation-delay: 1.4s; }

@keyframes letterDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-15px) rotate(5deg); }
  50%      { transform: translateY(0) rotate(-5deg); }
  75%      { transform: translateY(-8px) rotate(3deg); }
}

.confetti {
  position: fixed;
  width: 10px; height: 16px;
  pointer-events: none;
  z-index: 999;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

.party-mode[hidden] { display: none !important; }

.party-mode {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: black;
  text-align: center;
  animation: partyStrobe 0.1s steps(2) infinite;
}

.party-mode h1 {
  font-size: clamp(3rem, 12vw, 10rem);
  text-shadow: 0 0 40px white, 0 0 80px var(--c1);
  animation: partyTextShake 0.2s infinite;
}

.party-mode p { font-size: 2rem; margin-top: 1rem; text-shadow: 0 0 20px white; }

@keyframes partyStrobe {
  0%   { background: var(--c1); }
  20%  { background: var(--c3); }
  40%  { background: var(--c5); }
  60%  { background: var(--c4); }
  80%  { background: var(--c6); }
  100% { background: var(--c2); }
}

@keyframes partyTextShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%      { transform: translateX(-5px) rotate(-2deg); }
  40%      { transform: translateX(5px) rotate(2deg); }
  60%      { transform: translateX(-3px) rotate(-1deg); }
  80%      { transform: translateX(3px) rotate(1deg); }
}

/* Cursor trail */
.cursor-trail {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: trailFade 0.5s forwards;
}

@keyframes trailFade {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}

/* Text distortion on hover */
.distort-on-hover:hover {
  animation: textDistort 0.2s infinite;
}

@keyframes textDistort {
  0%   { transform: scaleX(1) scaleY(1); }
  25%  { transform: scaleX(1.1) scaleY(0.9); }
  50%  { transform: scaleX(0.9) scaleY(1.1); }
  75%  { transform: scaleX(1.05) scaleY(0.95); }
  100% { transform: scaleX(1) scaleY(1); }
}

/* Dancing picture frame with Lorem Picsum */
.dancing-frame {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  z-index: 20;
  animation: frameDance 2s ease-in-out infinite,
             frameColorShift 3s linear infinite;
  width: 220px;
}

.frame-border {
  position: relative;
  padding: 12px;
  background: linear-gradient(
    45deg,
    var(--c1), var(--c3), var(--c6), var(--c4), var(--c5), var(--c2), var(--c7), var(--c8)
  );
  background-size: 400% 400%;
  animation: frameBorderGradient 2s linear infinite,
             frameBorderDance 1.5s ease-in-out infinite;
  box-shadow:
    0 0 30px var(--c1),
    10px 10px 0 black,
    inset 0 0 20px rgba(0,0,0,0.3);
  display: inline-block;
}

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

@keyframes frameBorderDance {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  25%      { transform: rotate(2deg) scale(1.02) skewX(2deg); }
  50%      { transform: rotate(-1deg) scale(0.98) skewX(-1deg); }
  75%      { transform: rotate(3deg) scale(1.01) skewX(1deg); }
}

.frame-border img {
  display: block;
  width: 196px;
  height: 196px;
  object-fit: cover;
  filter: contrast(1.2) saturate(1.5);
  animation: imgFlicker 0.5s infinite alternate;
}

@keyframes imgFlicker {
  from { filter: contrast(1.2) saturate(1.5) brightness(1); }
  to   { filter: contrast(1.5) saturate(2) brightness(1.1); }
}

.frame-caption {
  margin-top: 1rem;
  font-family: 'Black Ops One', cursive;
  font-size: 1.2rem;
  text-shadow: 0 0 15px var(--c3), 2px 2px 0 black;
  animation: captionBounce 1s ease-in-out infinite,
             captionColorShift 1.5s linear infinite;
  letter-spacing: 0.3em;
}

@keyframes frameDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-10px) rotate(-3deg); }
  66%      { transform: translateY(5px) rotate(2deg); }
}

@keyframes frameColorShift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes captionBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.1); }
}

@keyframes captionColorShift {
  0%   { color: var(--c3); text-shadow: 0 0 15px var(--c3); }
  20%  { color: var(--c1); text-shadow: 0 0 15px var(--c1); }
  40%  { color: var(--c6); text-shadow: 0 0 15px var(--c6); }
  60%  { color: var(--c4); text-shadow: 0 0 15px var(--c4); }
  80%  { color: var(--c5); text-shadow: 0 0 15px var(--c5); }
  100% { color: var(--c3); text-shadow: 0 0 15px var(--c3); }
}

/* Extra dancing frames */
.dancing-frame-2 {
  top: 15%;
  right: 15px;
  left: auto;
  transform: none;
  width: 160px;
  animation: frameDance2 2.5s ease-in-out infinite,
             frameColorShift 4s linear infinite reverse;
}

.dancing-frame-2 .frame-border {
  padding: 8px;
  animation: frameBorderGradient 2.5s linear infinite,
             frameBorderDance2 2s ease-in-out infinite;
}

.dancing-frame-2 .frame-border img {
  width: 144px;
  height: 144px;
}

.dancing-frame-2 .frame-caption {
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}

.dancing-frame-3 {
  bottom: 15%;
  right: 25px;
  left: auto;
  top: auto;
  transform: none;
  width: 260px;
  animation: frameDance3 3s ease-in-out infinite,
             frameColorShift 2s linear infinite;
}

.dancing-frame-3 .frame-border {
  padding: 10px;
  animation: frameBorderGradient 1.5s linear infinite,
             frameBorderDance3 2.5s ease-in-out infinite;
}

.dancing-frame-3 .frame-border img {
  width: 240px;
  height: 130px;
}

.dancing-frame-3 .frame-caption {
  font-size: 1rem;
  letter-spacing: 0.2em;
}

@keyframes frameDance2 {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  33%      { transform: translateY(-12px) rotate(4deg) scale(1.03); }
  66%      { transform: translateY(8px) rotate(-3deg) scale(0.97); }
}

@keyframes frameDance3 {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25%      { transform: translateY(-8px) rotate(-2deg) scale(1.02); }
  50%      { transform: translateY(6px) rotate(3deg) scale(0.98); }
  75%      { transform: translateY(-4px) rotate(-1deg) scale(1.01); }
}

@keyframes frameBorderDance2 {
  0%, 100% { transform: rotate(4deg) scale(1); }
  25%      { transform: rotate(-2deg) scale(1.02) skewX(-2deg); }
  50%      { transform: rotate(1deg) scale(0.98) skewX(2deg); }
  75%      { transform: rotate(-4deg) scale(1.01) skewX(-1deg); }
}

@keyframes frameBorderDance3 {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  33%      { transform: rotate(3deg) scale(1.03) skewX(1deg); }
  66%      { transform: rotate(-1deg) scale(0.97) skewX(-2deg); }
}

@media (max-width: 600px) {
  .rotating-ring { width: 220px; height: 220px; }
  .ring-reverse { margin-top: -110px; }
  .unit { min-width: 80px; padding: 0.75rem; }
  .chaos-img { max-width: 100px; }
  .nonsense-block { font-size: 0.8rem; }
  .dancing-text { font-size: 1.2rem; }
  .dancing-frame { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  body { animation: none !important; }
  .crt-scanlines, .rgb-split-overlay, .disco-floor { display: none; }
  .chaos-img { opacity: 0.3; }
}
