:root {
  --c1: #ff006e;
  --c2: #fb5607;
  --c3: #ffbe0b;
  --c4: #8338ec;
  --c5: #3a86ff;
  --c6: #06ffa5;
}

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

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

body {
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6));
  background-size: 600% 600%;
  animation: gradientShift 8s ease infinite;
  color: white;
  min-height: 100vh;
  position: relative;
}

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

.disco-floor {
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,   rgba(255,255,255,0.05) 0 2px, transparent 2px 40px),
    repeating-linear-gradient(90deg,  rgba(255,255,255,0.05) 0 2px, transparent 2px 40px);
  pointer-events: none;
  animation: discoFloor 4s linear infinite;
  z-index: 0;
}

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

.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);
    opacity: 0;
  }
}

.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;
}

.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%); }
}

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

.title {
  font-size: clamp(3rem, 12vw, 9rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  animation: titleShake 0.4s ease-in-out infinite alternate;
  text-shadow:
    4px 4px 0 var(--c1),
    8px 8px 0 var(--c4),
    12px 12px 0 var(--c5),
    16px 16px 30px rgba(0,0,0,0.6);
}

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

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

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

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

@keyframes titleShake {
  from { transform: rotate(-1.5deg) scale(1); }
  to   { transform: rotate(1.5deg)  scale(1.02); }
}

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

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

.countdown {
  margin: 3rem auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  perspective: 800px;
}

.unit {
  background: rgba(0,0,0,0.7);
  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);
  transform-style: preserve-3d;
  animation: unitFloat 3s ease-in-out infinite;
}

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

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

.num {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 20px 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;
}

.party-info {
  margin: 2rem auto;
  font-size: 1.2rem;
}

.party-info p { margin: 0.5rem 0; text-shadow: 2px 2px 0 black; }

.hint {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
}

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

.rotating-ring span {
  position: absolute;
  top: 50%; left: 50%;
  font-size: 2.5rem;
  display: inline-block;
  transform-origin: 0 0;
}

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

.hype-btn {
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  font-size: 1.5rem;
  font-family: 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.8s ease-in-out infinite alternate;
  transition: transform 0.1s;
}

.hype-btn:hover { transform: scale(1.1) rotate(-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; }
}

.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;
}

.bouncy-emoji:nth-of-type(1) { left: 5%; }
.bouncy-emoji:nth-of-type(2) { left: 22%; }
.bouncy-emoji:nth-of-type(3) { left: 40%; }
.bouncy-emoji:nth-of-type(4) { left: 60%; }
.bouncy-emoji:nth-of-type(5) { left: 78%; }
.bouncy-emoji:nth-of-type(6) { left: 92%; }

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

.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.15s steps(2) infinite;
}

.party-mode h1 {
  font-size: clamp(3rem, 12vw, 10rem);
  text-shadow: 0 0 40px white;
}

.party-mode p { font-size: 2rem; margin-top: 1rem; }

@keyframes partyStrobe {
  0%   { background: var(--c1); }
  25%  { background: var(--c3); }
  50%  { background: var(--c5); }
  75%  { background: var(--c4); }
  100% { background: var(--c6); }
}

@media (max-width: 600px) {
  .rotating-ring { width: 220px; height: 220px; }
  .unit { min-width: 80px; padding: 0.75rem; }
}
