:root {
  --bg: #0a0710;
  --ghoul: #b6ff3c;
  --blood: #ff2e63;
  --bone: #f4f1e8;
  --purple: #6a2fb5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 80% at 50% 0%, #24103d 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, #3a0d24 0%, transparent 60%),
    var(--bg);
  color: var(--bone);
  font-family: "Impact", "Haettenschweiler", "Arial Black", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow-x: hidden;
  text-align: center;
  padding: 4vh 1rem;
}

main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 3vh, 2rem);
}

/* ---------- title ---------- */

.title {
  margin: 0;
  line-height: 0.85;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: wobble 1.6s ease-in-out infinite;
}

.line {
  display: block;
  font-size: clamp(2.5rem, 12vw, 8rem);
  color: var(--bone);
  text-shadow:
    0 0 12px var(--purple),
    4px 4px 0 var(--blood),
    -4px -4px 0 var(--ghoul);
}

.line--big {
  font-size: clamp(3.5rem, 18vw, 12rem);
  color: var(--ghoul);
  animation: flicker 3.1s steps(2, end) infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50%      { transform: rotate(1.5deg) scale(1.03); }
}

@keyframes flicker {
  0%, 42%, 46%, 100% { opacity: 1; }
  44%, 45%           { opacity: 0.25; }
}

/* ---------- the loop ---------- */

.loop {
  width: min(92vw, 720px);
}

.loop__frame,
.fallback {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--ghoul);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 50px rgba(182, 255, 60, 0.35);
}

.loop iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.skeletons {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0.25rem, 2vw, 1rem);
  /* The horde grows past the viewport; body hides the overflow. */
  flex-shrink: 0;
}

.skelly {
  font-size: clamp(1.75rem, 6vw, 3.5rem);
  display: inline-block;
  filter: drop-shadow(0 0 14px var(--ghoul));
  animation: doot 0.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.16s);
}

@keyframes doot {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-22%) rotate(8deg); }
}

/* ---------- bits ---------- */

.tagline {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 1.15rem);
  letter-spacing: 0.08em;
  color: #cbb8e8;
  text-transform: uppercase;
}

.sound {
  --dx: 0px;
  --dy: 0px;
  font: inherit;
  font-size: clamp(0.8rem, 2vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ghoul);
  border: 0;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(182, 255, 60, 0.4);
  transform: translate(var(--dx), var(--dy));
  transition: transform 0.12s ease-out;
}

.sound:hover  { transform: translate(var(--dx), var(--dy)) scale(1.06) rotate(-2deg); }
.sound:active { transform: translate(var(--dx), var(--dy)) scale(0.96); }

.footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 3vh;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a6a92;
}

/* ---------- atmosphere ---------- */

.fog {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(106, 47, 181, 0.35), transparent) 20% 30% / 60% 60% no-repeat,
    radial-gradient(closest-side, rgba(255, 46, 99, 0.22), transparent) 80% 70% / 55% 55% no-repeat;
  filter: blur(30px);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-4%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.15); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
}


/* ---------- the gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  border: 0;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  color: var(--bone);
  background: rgba(4, 2, 8, 0.72);
  backdrop-filter: blur(3px);
  transition: opacity 0.4s ease;
}

.gate--gone {
  opacity: 0;
  pointer-events: none;
}

.gate__title {
  font-family: inherit;
  font-size: clamp(2rem, 9vw, 6rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--ghoul);
  text-shadow: 0 0 28px var(--ghoul), 4px 4px 0 var(--blood);
  animation: flicker 2.4s steps(2, end) infinite;
}

.gate__sub {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #cbb8e8;
}

/* ---------- buttons that run away ---------- */

.dodgy {
  --dx: 0px;
  --dy: 0px;
  transform: translate(var(--dx), var(--dy));
  transition: transform 0.12s ease-out;
}

/* ---------- fake system errors ---------- */

.dialog {
  position: fixed;
  z-index: 60;
  width: min(330px, 84vw);
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 7px 7px 2px 2px;
  box-shadow: 4px 4px 14px rgba(0, 0, 0, 0.55);
  font-family: Tahoma, Verdana, system-ui, sans-serif;
  color: #000;
  overflow: hidden;
}

.dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 4px 4px 4px 8px;
  background: linear-gradient(#0058ee, #3a93ff 8%, #0053ee 40%, #0043a8);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  cursor: move;
  user-select: none;
}

.dialog__x {
  width: 20px;
  height: 18px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: #d24a3d;
  color: #fff;
  font: bold 11px Tahoma, sans-serif;
  line-height: 1;
  cursor: pointer;
}

.dialog__body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 8px;
  font-size: 12px;
}

.dialog__body p { margin: 0; }
.dialog__icon { font-size: 26px; }

.dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 14px 14px;
}

.dialog__ok {
  min-width: 74px;
  padding: 4px 10px;
  border: 1px solid #003c74;
  border-radius: 3px;
  background: linear-gradient(#fff, #ecebe5 45%, #d8d0c4);
  font: 12px Tahoma, sans-serif;
  cursor: pointer;
}

/* ---------- cursor trail ---------- */

.trail {
  position: fixed;
  z-index: 40;
  font-size: 15px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: trail 0.9s ease-out forwards;
}

@keyframes trail {
  to {
    opacity: 0;
    transform: translate(-50%, 20px) rotate(140deg) scale(0.4);
  }
}

/* ---------- konami ---------- */

.fried {
  filter: saturate(6) contrast(1.9) hue-rotate(20deg);
}

.fried .loop__frame {
  animation: roll 1.6s ease-in-out;
}

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

/* ---------- footer extra ---------- */

.footer__brag {
  margin-top: 0.35rem;
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  .title, .line--big, .skelly, .fog, .gate__title { animation: none; }
  .fried .loop__frame { animation: none; }
}
