/* Front page intro (js/intro.js). Full-screen, under 2 seconds, tap to skip. */
.intro { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: opacity 0.45s, transform 0.45s; }
.intro.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
body.intro-on { overflow: hidden; }
.intro .in-logo, .intro .in-sign { position: relative; z-index: 3; font-size: clamp(56px, 16vw, 128px); margin: 0; }

/* ---------- A. Logo drop: sunburst, the logo bounces in, the face sobs, the tagline slides up ---------- */
.intro-drop { background: radial-gradient(circle at 50% 45%, #DDF1FF 0%, #8FCBFF 45%, #3D8FE0 100%); }
.intro-drop .in-rays { position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.45) 0 9deg, transparent 9deg 18deg); animation: inSpin 7s linear infinite; }
.intro-drop .in-logo { animation: inDrop 0.95s cubic-bezier(0.3, 1.45, 0.5, 1) both; }
.intro-drop .in-logo .lface { animation: inSob 0.35s 0.95s ease-in-out 3; }
.intro-drop .in-tag { position: absolute; z-index: 3; top: calc(50% + clamp(70px, 20vw, 150px)); animation: inRise 0.5s 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-drop .in-tag span { display: inline-block; padding: 10px 24px 12px; border-radius: 16px; color: #fff; font: 400 clamp(18px, 4.6vw, 30px)/1.1 var(--title);
  background: linear-gradient(#FFD45E, #F59A0C); text-shadow: 0 2px 0 #B86A00; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 5px 0 #B86A00, 0 10px 18px rgba(20, 50, 120, 0.25); }
@keyframes inDrop { 0% { transform: translateY(-110vh) rotate(-10deg); } 70% { transform: translateY(0) rotate(3deg); } 100% { transform: none; } }
@keyframes inSob { 50% { transform: translateY(0.04em) scale(1.08, 0.92); } }
@keyframes inRise { from { opacity: 0; transform: translateY(40px) scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes inSpin { to { transform: rotate(360deg); } }

/* ---------- B. Avatar burst: a ring of avatars flies in, the logo pops in the middle ---------- */
.intro-burst { background: radial-gradient(circle at 50% 50%, #6A3FD8 0%, #3A1690 50%, #1C0652 100%); }
.intro-burst .in-ring { position: absolute; inset: 0; }
.intro-burst .in-av { --a: calc(360deg / var(--n) * var(--i)); --rx: min(42vw, 330px); --ry: min(30vh, 260px); position: absolute; left: 50%; top: 50%; width: clamp(54px, 15vw, 96px);
  animation: inFly 0.7s calc(var(--i) * 45ms) cubic-bezier(0.25, 1.3, 0.5, 1) both; }
.intro-burst .in-av .av { width: 100%; height: auto; aspect-ratio: 1; }
.intro-burst .in-logo { font-size: clamp(44px, 12vw, 110px); animation: inPop 0.55s 0.65s cubic-bezier(0.3, 1.8, 0.5, 1) both; }
.intro-burst.out .in-av { animation: inFlyOut 0.45s ease-in forwards; }
@keyframes inFly {
  from { transform: translate(-50%, -50%) translate(calc(cos(var(--a)) * 110vmax), calc(sin(var(--a)) * 110vmax)); }
  to { transform: translate(-50%, -50%) translate(calc(cos(var(--a)) * var(--rx)), calc(sin(var(--a)) * var(--ry))); } }
@keyframes inFlyOut {
  from { transform: translate(-50%, -50%) translate(calc(cos(var(--a)) * var(--rx)), calc(sin(var(--a)) * var(--ry))); }
  to { transform: translate(-50%, -50%) translate(calc(cos(var(--a)) * 110vmax), calc(sin(var(--a)) * 110vmax)); } }
@keyframes inPop { from { opacity: 0; transform: scale(0.2) rotate(-12deg); } to { opacity: 1; transform: none; } }

/* ---------- C. Curtain reveal: a marquee sign, then red curtains swish open with confetti ---------- */
.intro-curtain { background: transparent; }
.intro-curtain .in-cur { position: absolute; top: 0; bottom: 0; width: 51%; z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(90deg, #C8193A 0 26px, #8E0D26 26px 52px); box-shadow: inset 0 -30px 40px rgba(0, 0, 0, 0.35); }
.intro-curtain .in-cur.l { left: 0; animation: inOpenL 0.9s 0.85s cubic-bezier(0.6, 0, 0.3, 1) forwards; border-right: 4px solid #E0A215; }
.intro-curtain .in-cur.r { right: 0; animation: inOpenR 0.9s 0.85s cubic-bezier(0.6, 0, 0.3, 1) forwards; border-left: 4px solid #E0A215; }
.intro-curtain .in-val { position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 64px; background: radial-gradient(circle at 26px 0, #C8193A 30px, transparent 31px) 0 0 / 52px 64px repeat-x, linear-gradient(#E0A215 0 8px, transparent 8px);
  animation: inUp 0.6s 1.2s ease-in forwards; }
.intro-curtain .in-sign { z-index: 5; padding: 0.22em 0.4em; border-radius: 0.2em;
  background: radial-gradient(circle, #FFFBE0 0 5px, #FFB800 6px 7px, transparent 8px) 8px 4px / 28px 18px repeat-x,
    radial-gradient(circle, #FFFBE0 0 5px, #FFB800 6px 7px, transparent 8px) 8px calc(100% - 4px) / 28px 18px repeat-x, linear-gradient(#5A0F3C, #2A0628);
  box-shadow: 0 0 0 5px #E0A215, 0 0 40px rgba(255, 200, 80, 0.6); animation: inPop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) both, inSignUp 0.6s 0.8s ease-in forwards; }
.intro-curtain .in-confetti { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.intro-curtain .in-confetti i { position: absolute; left: 50%; top: 45%; width: 10px; height: 16px; border-radius: 2px; opacity: 0;
  background: hsl(calc(var(--i) * 47deg) 90% 60%); animation: inConfetti 1.1s calc(0.9s + var(--i) * 8ms) cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes inOpenL { to { transform: translateX(-102%); } }
@keyframes inOpenR { to { transform: translateX(102%); } }
@keyframes inUp { to { transform: translateY(-110%); } }
@keyframes inSignUp { to { opacity: 0; transform: translateY(-40vh) scale(0.7); } }
@keyframes inConfetti {
  0% { opacity: 1; transform: rotate(calc(var(--i) * 12.9deg)) translateY(0) rotate(0); }
  100% { opacity: 0; transform: rotate(calc(var(--i) * 12.9deg)) translateY(-48vmin) rotate(540deg); } }

/* ---------- D. Rivals: two avatars square up and trade taunts, one shoves, the other bursts into tears, the crowd jostles,
   then the logo crashes down between them and knocks them flying. About 3 seconds. ---------- */
.intro-rivals { --av: clamp(112px, 33vw, 200px); --cr: clamp(64px, 18vw, 118px); background: radial-gradient(circle at 50% 45%, #DDF1FF 0%, #8FCBFF 45%, #3D8FE0 100%); }
.intro-rivals .in-rays { position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.45) 0 9deg, transparent 9deg 18deg); animation: inSpin 7s linear infinite; }
.intro-rivals img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 3px #FFD45E, 0 0 0 5px #B8860B, 0 8px 14px rgba(16, 53, 126, 0.35); }
.intro-rivals .in-face, .intro-rivals .in-jost { position: relative; display: block; }
.intro-rivals .sad { position: absolute; inset: 0; opacity: 0; }
/* the two rivals: wrapper flies off when the logo lands, .in-enter slides in, .in-face does the shove */
.intro-rivals .in-duel { position: absolute; z-index: 2; top: 50%; width: var(--av); margin-top: calc(var(--av) / -2); }
.intro-rivals .in-duel.l { left: calc(50% - var(--av) - 2vw); animation: rvFlyL 0.55s 1.95s ease-in forwards; }
.intro-rivals .in-duel.r { left: calc(50% + 2vw); animation: rvFlyR 0.55s 1.95s ease-in forwards; }
.intro-rivals .l .in-enter { animation: rvInL 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-rivals .r .in-enter { animation: rvInR 0.5s 0.08s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-rivals .l .in-face { animation: rvLunge 0.4s 1s ease-out; }
.intro-rivals .r .in-face { animation: rvKnock 0.45s 1.1s cubic-bezier(0.2, 1.4, 0.5, 1) forwards; }
.intro-rivals .r .sad { animation: rvSad 0.15s 1.15s forwards; }
.intro-rivals .in-tear { position: absolute; z-index: 2; top: 52%; left: var(--x); width: 9%; aspect-ratio: 0.7; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #5AB8FF; box-shadow: inset 0 -2px 0 rgba(0, 60, 140, 0.35); opacity: 0; animation: rvTear 0.45s calc(1.25s + var(--d)) ease-in 3; }
.intro-rivals .in-bub { position: absolute; bottom: calc(100% + 12px); left: 50%; max-width: 40vw; width: max-content; padding: 7px 12px 8px; border-radius: 14px; text-align: center;
  font: 400 clamp(15px, 4.3vw, 24px)/1.1 var(--title); color: #10357E; background: #fff; box-shadow: 0 4px 0 rgba(16, 53, 126, 0.35);
  transform-origin: 50% 120%; animation: rvBub 0.3s var(--bd) cubic-bezier(0.3, 1.6, 0.5, 1) both, rvBubOut 0.2s 1.35s forwards; }
.intro-rivals .in-bub::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; }
.intro-rivals .l .in-bub { --bd: 0.45s; }
.intro-rivals .r .in-bub { --bd: 0.75s; }
/* the crowd at the bottom, shoving each other; two of them end up crying */
.intro-rivals .in-crowd { position: absolute; z-index: 2; left: 50%; bottom: 6%; display: flex; transform: translateX(-50%); }
.intro-rivals .in-cr { width: var(--cr); margin-inline: calc(var(--cr) * -0.08); animation: rvRise 0.45s calc(0.15s + var(--i) * 70ms) cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-rivals .in-jost { animation: rvJostle 0.3s calc(0.65s + var(--i) * 60ms) ease-in-out infinite alternate; }
.intro-rivals .in-cr:nth-child(even) .in-jost { animation-direction: alternate-reverse; }
.intro-rivals .in-cr .sad { animation: rvSad 0.15s calc(1.3s + var(--i) * 0.1s) forwards; }
.intro-rivals .in-logo { z-index: 4; font-size: clamp(52px, 15vw, 128px); animation: inDrop 0.6s 1.55s cubic-bezier(0.3, 1.45, 0.5, 1) both; }
.intro-rivals .in-tag { position: absolute; z-index: 4; top: calc(50% + clamp(62px, 17vw, 140px)); padding-inline: 16px; text-align: center; animation: inRise 0.5s 2.25s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-rivals .in-tag span { display: inline-block; padding: 10px 24px 12px; border-radius: 16px; color: #fff; font: 400 clamp(18px, 4.6vw, 30px)/1.1 var(--title);
  background: linear-gradient(#FFD45E, #F59A0C); text-shadow: 0 2px 0 #B86A00; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 5px 0 #B86A00, 0 10px 18px rgba(20, 50, 120, 0.25); }
/* VS badge while they square up, then a comic SHOVE! burst */
.intro-rivals .in-vs { position: absolute; z-index: 3; left: 50%; top: 50%; width: clamp(48px, 13vw, 76px); aspect-ratio: 1; margin: calc(clamp(48px, 13vw, 76px) / -2) 0 0 calc(clamp(48px, 13vw, 76px) / -2);
  display: grid; place-items: center; border-radius: 50%; font: 400 clamp(22px, 6vw, 34px)/1 var(--title); color: #fff; text-shadow: 0 2px 0 #8E0D26;
  background: radial-gradient(circle at 40% 35%, #FF6B81, #D11F3F); box-shadow: 0 0 0 4px #fff, 0 0 0 7px #F5B82E, 0 8px 14px rgba(16, 53, 126, 0.35);
  animation: rvPop 0.35s 0.35s cubic-bezier(0.3, 1.8, 0.5, 1) both, rvBubOut 0.15s 0.95s forwards; }
.intro-rivals .in-pow { position: absolute; z-index: 5; left: 50%; top: calc(50% - var(--av) * 0.15); width: clamp(120px, 34vw, 200px); aspect-ratio: 1.3; margin-left: calc(clamp(120px, 34vw, 200px) / -2);
  display: grid; place-items: center; background: #FFE14D; filter: drop-shadow(0 4px 0 #E07B00);
  clip-path: polygon(50% 0, 61% 26%, 90% 8%, 78% 38%, 100% 50%, 78% 62%, 92% 92%, 61% 74%, 50% 100%, 39% 74%, 8% 92%, 22% 62%, 0 50%, 22% 38%, 10% 8%, 39% 26%);
  opacity: 0; animation: rvPow 0.55s 1.05s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.intro-rivals .in-pow span { font: 400 clamp(18px, 5vw, 30px)/1 var(--title); color: #D11F3F; transform: rotate(-8deg); }
@keyframes rvPop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
@keyframes rvPow { 0% { opacity: 1; transform: scale(0.2) rotate(-15deg); } 45% { opacity: 1; transform: scale(1.1) rotate(4deg); } 80% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes rvInL { from { transform: translateX(-80vw) rotate(-20deg); } to { transform: none; } }
@keyframes rvInR { from { transform: translateX(80vw) rotate(20deg); } to { transform: none; } }
@keyframes rvLunge { 40% { transform: translateX(22%) rotate(8deg); } }
@keyframes rvKnock { to { transform: translateX(18%) rotate(16deg); } }
@keyframes rvSad { to { opacity: 1; } }
@keyframes rvTear { 0% { opacity: 1; transform: translateY(0) scale(0.6); } 100% { opacity: 0; transform: translateY(160%) scale(1); } }
@keyframes rvBub { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }
@keyframes rvBubOut { to { opacity: 0; } }
@keyframes rvRise { from { transform: translateY(160%); } to { transform: none; } }
@keyframes rvJostle { from { transform: translateX(-7%) rotate(-8deg); } to { transform: translateX(7%) rotate(8deg); } }
@keyframes rvFlyL { to { transform: translate(-70vw, -40vh) rotate(-540deg); } }
@keyframes rvFlyR { to { transform: translate(70vw, -40vh) rotate(540deg); } }
