/* Ermandooo gag splash.
   WHY: Separated from core UI so it can be disabled fast via
   window.ERMANDOOO_SPLASH_ENABLED = false or by removing this file/import. */
.ermandooo-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(0,230,118,.2), transparent 34%),
    radial-gradient(circle at 70% 70%, rgba(64,196,255,.16), transparent 32%),
    #080c10;
  color: var(--t1, #f0f4f8);
  pointer-events: auto;
  animation: ermSplashOut .5s ease 9.55s forwards;
}

.ermandooo-stage {
  position: relative;
  width: min(92vw, 720px);
  height: 260px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.ermandooo-word {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd, Impact, sans-serif);
  font-size: clamp(3.5rem, 15vw, 8rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(0,230,118,.35);
}

.ermandooo-base {
  display: inline-flex;
  animation: ermBaseParty 2.2s ease-in-out 7.15s infinite;
}

.ermandooo-d {
  position: relative;
  display: inline-block;
  color: #ffd740;
  animation: ermDBoom 1.1s ease 6.55s forwards;
}

.ermandooo-o {
  display: inline-block;
  color: #40c4ff;
  transform-origin: 50% 60%;
  animation:
    ermODance 5s ease-in-out forwards,
    ermOFly 1.55s cubic-bezier(.22, .9, .2, 1) 5s forwards;
}

.ermandooo-o:nth-of-type(3) { animation-delay: 0s, 5s; }
.ermandooo-o:nth-of-type(4) { animation-delay: .28s, 5.16s; }
.ermandooo-o:nth-of-type(5) { animation-delay: .56s, 5.32s; }

.ermandooo-confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #00e676;
  opacity: 0;
  animation: ermConfetti 1.8s ease-out 7.1s forwards;
}

.ermandooo-confetti:nth-child(2) { left: 28%; top: 38%; background: #ffd740; animation-delay: 7.2s; }
.ermandooo-confetti:nth-child(3) { left: 64%; top: 34%; background: #40c4ff; animation-delay: 7.28s; }
.ermandooo-confetti:nth-child(4) { left: 44%; top: 68%; background: #ff5252; animation-delay: 7.36s; }
.ermandooo-confetti:nth-child(5) { left: 72%; top: 58%; background: #00e676; animation-delay: 7.44s; }

.ermandooo-slogan {
  position: absolute;
  top: calc(50% + 82px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  min-width: min(82vw, 520px);
  padding: 18px 20px 20px;
  font-family: var(--fd, Impact, sans-serif);
  font-size: clamp(1.25rem, 5.8vw, 2.8rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f0f4f8;
  text-align: center;
  pointer-events: none;
  border: 1px solid rgba(64,196,255,.18);
  border-radius: 22px;
  background:
    linear-gradient(100deg, rgba(255,255,255,.07), rgba(255,255,255,.015) 46%, rgba(0,230,118,.06)),
    rgba(5, 12, 18, .34);
  box-shadow:
    inset 0 0 22px rgba(64,196,255,.08),
    0 0 36px rgba(0,230,118,.14),
    0 18px 60px rgba(0,0,0,.32);
  backdrop-filter: blur(12px) saturate(1.25);
  overflow: hidden;
  animation: ermSloganExit .8s cubic-bezier(.2,.9,.25,1) 7s forwards;
}

.ermandooo-slogan::before,
.ermandooo-slogan::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ermandooo-slogan::before {
  background:
    linear-gradient(90deg, transparent, rgba(64,196,255,.34), transparent),
    repeating-linear-gradient(180deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px);
  opacity: 0;
  transform: translateX(-80%);
  animation: ermSloganScan 1.25s ease 2.05s 4;
}

.ermandooo-slogan::after {
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(0,230,118,.18),
    inset 0 1px 0 rgba(255,255,255,.24);
  opacity: .85;
}

.ermandooo-slogan-beam {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,230,118,.65), rgba(255,215,64,.55), transparent);
  opacity: 0;
  transform: scaleX(.35);
  filter: drop-shadow(0 0 10px rgba(0,230,118,.7));
  animation: ermBeamPulse 1s ease 3.85s 3;
}

.ermandooo-slogan-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 2px 4px;
}

.ermandooo-slogan-part {
  display: inline-block;
  opacity: 0;
  transform: translate3d(-42px, 18px, 0) scale(.92) skewX(-7deg);
  text-shadow: 0 0 18px rgba(0,230,118,.28);
  filter: blur(7px);
  animation: ermSloganIn .55s cubic-bezier(.16,1,.25,1) forwards;
}

.ermandooo-slogan-part:nth-child(2) {
  color: #00e676;
  text-align: left;
  min-width: 2.1em;
  padding: .04em .18em;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,230,118,.22), rgba(64,196,255,.08));
  box-shadow:
    inset 0 0 0 1px rgba(0,230,118,.22),
    0 0 18px rgba(0,230,118,.28);
  transform: translate3d(42px, 18px, 0) scale(.92) skewX(7deg);
  animation-name: ermSloganIn, ermYouPulse;
  animation-duration: .55s, 1.1s;
  animation-timing-function: cubic-bezier(.16,1,.25,1), ease-in-out;
  animation-fill-mode: forwards, both;
  animation-iteration-count: 1, 3;
}

.ermandooo-slogan-part.is-tip { animation-delay: 2s; color: #e9fbff; }
.ermandooo-slogan-part.is-you-a { animation-delay: 3s, 3.5s; }
.ermandooo-slogan-part.is-win { animation-delay: 5s; color: #ffd740; }
.ermandooo-slogan-part.is-you-b { animation-delay: 6s, 6.5s; }

.ermandooo-slogan-part.is-tip,
.ermandooo-slogan-part.is-win {
  justify-self: end;
}

.ermandooo-slogan-part.is-win {
  text-shadow: 0 0 14px rgba(255,215,64,.42), 0 0 34px rgba(255,215,64,.18);
}

.ermandooo-splash.is-removing {
  animation: ermSplashOut .25s ease forwards;
}

@keyframes ermODance {
  0% { transform: translateY(0) rotate(0) scale(1); }
  18% { transform: translateY(-28px) rotate(-10deg) scale(1.08); }
  36% { transform: translateY(18px) rotate(12deg) scale(.96); }
  54% { transform: translateY(-34px) rotate(16deg) scale(1.12); }
  72% { transform: translateY(12px) rotate(-16deg) scale(.98); }
  100% { transform: translateY(-8px) rotate(0) scale(1.04); }
}

@keyframes ermOFly {
  0% { opacity: 1; filter: blur(0); }
  70% { opacity: 1; transform: translateX(-1.15em) translateY(-20px) scale(.45) rotate(540deg); }
  100% { opacity: 0; transform: translateX(-1.5em) translateY(0) scale(.08) rotate(720deg); filter: blur(3px); }
}

@keyframes ermDBoom {
  0% { transform: scale(1); opacity: 1; filter: none; }
  40% { transform: scale(1.45) rotate(-8deg); opacity: 1; filter: drop-shadow(0 0 28px #ffd740); }
  100% { transform: scale(2.6) rotate(28deg); opacity: 0; filter: blur(10px); }
}

@keyframes ermBaseParty {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); color: #f0f4f8; }
  25% { transform: translateY(-12px) rotate(-3deg) scale(1.06); color: #00e676; }
  50% { transform: translateY(6px) rotate(3deg) scale(.98); color: #ffd740; }
  75% { transform: translateY(-8px) rotate(2deg) scale(1.04); color: #40c4ff; }
}

@keyframes ermConfetti {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x, 80px), var(--y, -120px)) scale(1) rotate(520deg); }
}

@keyframes ermSloganIn {
  72% { opacity: 1; filter: blur(0); transform: translate3d(0, -3px, 0) scale(1.04) skewX(0); }
  to { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0) scale(1) skewX(0); }
}

@keyframes ermYouPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(0,230,118,0)); }
  50% { filter: drop-shadow(0 0 18px rgba(0,230,118,.85)); }
}

@keyframes ermSloganScan {
  0% { opacity: 0; transform: translateX(-85%); }
  18%, 58% { opacity: .55; }
  100% { opacity: 0; transform: translateX(85%); }
}

@keyframes ermBeamPulse {
  0%, 100% { opacity: 0; transform: scaleX(.35); }
  45% { opacity: 1; transform: scaleX(1); }
}

@keyframes ermSloganExit {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); filter: blur(0); }
  45% { opacity: 1; transform: translateX(-50%) translateY(-18px) scale(1.06); filter: blur(0) brightness(1.35); }
  100% { opacity: 0; transform: translateX(-50%) translateY(190px) scale(1.38) rotate(-7deg); filter: blur(10px); }
}

@keyframes ermSplashOut {
  to { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .ermandooo-splash { animation: ermSplashOut .25s ease 2s forwards; }
  .ermandooo-splash * { animation-duration: .01ms !important; animation-delay: 0s !important; }
}
