:root {
  --bg-1: #ff005d;
  --bg-2: #ff9f00;
  --bg-3: #ffe600;
  --bg-4: #00df7e;
  --bg-5: #00c2ff;
  --bg-6: #5e3dff;
  --bg-7: #ff47c1;
  --ink: #0a0a0a;
  --paper: #ffffff;
  --acid: #e5ff00;
  --danger: #ff2a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Chalkboard SE", cursive;
  background: linear-gradient(
    300deg,
    var(--bg-1),
    var(--bg-2),
    var(--bg-3),
    var(--bg-4),
    var(--bg-5),
    var(--bg-6),
    var(--bg-7)
  );
  background-size: 2000% 2000%;
  animation: rainbow 7s linear infinite;
  color: var(--ink);
  text-align: center;
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -30vmax;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35) 0 8%, transparent 9%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.25) 0 6%, transparent 7%),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.2) 0 7%, transparent 8%);
  animation: wobble 6s ease-in-out infinite alternate;
}

body::after {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.1) 0,
    rgba(0, 0, 0, 0.1) 4px,
    transparent 4px,
    transparent 14px
  );
  mix-blend-mode: multiply;
  animation: grain 1.5s steps(4) infinite;
}

.container {
  width: min(95%, 1000px);
  margin: 28px auto 36px;
  padding: 20px 14px 24px;
  border: 5px dashed var(--ink);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  transform-origin: center;
  animation: jitter 0.8s infinite;
}

.title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow:
    2px 2px 0 var(--paper),
    5px 5px 0 var(--ink),
    -2px -2px 0 #ffef9a;
  animation: spin-tilt 4.5s linear infinite, stretch 1.6s ease-in-out infinite alternate;
}

.subtitle {
  margin: 10px 0 18px;
  font-size: clamp(0.8rem, 3.5vw, 1.15rem);
  font-weight: 800;
  text-transform: uppercase;
  animation: blink 0.35s infinite alternate;
}

input,
textarea {
  width: min(92%, 780px);
  display: block;
  margin: 8px auto;
  padding: 12px;
  border: 4px dashed var(--ink);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  animation: shake 0.24s infinite;
}

input:focus,
textarea:focus {
  outline: 4px solid var(--acid);
  outline-offset: 2px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}

button {
  padding: 12px 18px;
  border: 4px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transform-origin: center;
  animation: pulse 0.9s infinite;
}

button:hover {
  background: var(--danger);
  color: var(--paper);
}

button:active {
  transform: scale(0.92) rotate(-3deg);
}

.counter {
  margin-top: 10px;
  font-size: clamp(1rem, 4vw, 1.7rem);
  font-weight: 900;
  text-transform: uppercase;
  animation: bounce 0.8s infinite alternate;
}

.message {
  min-height: 24px;
  margin-top: 6px;
  font-size: clamp(0.8rem, 3.2vw, 1rem);
  font-weight: 900;
  text-transform: uppercase;
  animation: spin 9s linear infinite;
}

.ticker {
  overflow: hidden;
  width: 100%;
  margin-top: 16px;
  border-top: 3px dashed var(--ink);
  border-bottom: 3px dashed var(--ink);
  background: var(--acid);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: scroll 18s linear infinite;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-track span {
  margin-right: 36px;
}

.floating {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  font-size: clamp(0.8rem, 3vw, 1rem);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 1px 1px 0 var(--paper);
  animation: float 6.2s linear forwards;
}

@keyframes rainbow {
  0% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
  100% {
    background-position: 0% 40%;
  }
}

@keyframes wobble {
  from {
    transform: translate(-1%, -2%) rotate(-3deg);
  }
  to {
    transform: translate(1%, 2%) rotate(3deg);
  }
}

@keyframes grain {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(8px, -6px);
  }
}

@keyframes jitter {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(1px, -2px) rotate(-0.4deg);
  }
  50% {
    transform: translate(-2px, 1px) rotate(0.35deg);
  }
  75% {
    transform: translate(2px, 2px) rotate(-0.2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes spin-tilt {
  from {
    transform: rotate(-1deg);
  }
  to {
    transform: rotate(1deg);
  }
}

@keyframes stretch {
  from {
    letter-spacing: 1px;
    transform: scale(1);
  }
  to {
    letter-spacing: 4px;
    transform: scale(1.09);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.12;
  }
}

@keyframes shake {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(2px, -2px);
  }
  50% {
    transform: translate(-2px, 2px);
  }
  75% {
    transform: translate(2px, 2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.15) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes bounce {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.18) rotate(-1deg);
  }
}

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

@keyframes float {
  from {
    transform: translate(var(--x-start), 110vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  to {
    transform: translate(var(--x-end), -18vh) rotate(760deg) scale(1.25);
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .container {
    margin-top: 14px;
    padding: 14px 10px 18px;
  }

  .actions {
    gap: 8px;
  }

  button {
    width: min(100%, 320px);
  }
}
