/* The circus stage of the game's login screen: sky, clouds, curtains that open, a marquee with chasing bulbs. */
.stage { min-height: 100vh; min-height: 100dvh; position: relative; isolation: isolate; }

.sky { position: fixed; inset: 0; z-index: -3; background: url("../img/sky.png") center bottom / cover no-repeat #3fb0f0; }
.rays {
  position: fixed; z-index: -2; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .10) 0deg 7deg, rgba(255, 255, 255, 0) 7deg 15deg);
  animation: spin 160s linear infinite; mask-image: radial-gradient(circle, #000 10%, transparent 60%);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 60%);
}
.hills { position: fixed; z-index: -1; left: 0; right: 0; bottom: 0; height: 18vh; background: url("../img/sky.png") center bottom / cover no-repeat; mask-image: linear-gradient(transparent, #000 30%); -webkit-mask-image: linear-gradient(transparent, #000 30%); pointer-events: none; }

.cloud { position: fixed; z-index: -1; opacity: .95; pointer-events: none; animation: drift linear infinite; filter: drop-shadow(0 6px 8px rgba(18, 90, 150, .25)); }
.cloud.c1 { top: 16vh; width: 190px; animation-duration: 70s; animation-delay: -12s; }
.cloud.c2 { top: 36vh; width: 120px; animation-duration: 95s; animation-delay: -60s; opacity: .8; }
.cloud.c3 { top: 8vh; width: 150px; animation-duration: 82s; animation-delay: -40s; }
.cloud.c4 { top: 55vh; width: 230px; animation-duration: 110s; animation-delay: -5s; opacity: .7; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }

/* valance across the top and the side curtains */
.valance {
  position: fixed; z-index: 55; top: 0; left: 0; right: 0; height: 120px; pointer-events: none;
  background: url("../img/swag.png") center top / auto 120px repeat-x;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .3));
  animation: valance-in 1s .2s var(--ease-pop) both;
}
@keyframes valance-in { from { transform: translateY(-110%); } to { transform: none; } }
.curtain { position: fixed; z-index: 54; top: 0; height: 100vh; height: 100dvh; width: auto; max-width: none; pointer-events: none; transform-origin: top center; }
.curtain.left { left: -30px; animation: curtain-sway 7s ease-in-out infinite; }
.curtain.right { right: -30px; animation: curtain-sway-r 7s ease-in-out infinite; }
@keyframes curtain-sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(.7deg); } }
@keyframes curtain-sway-r { 0%, 100% { transform: scaleX(-1) rotate(0); } 50% { transform: scaleX(-1) rotate(.7deg); } }

/* the closed curtains that open when the page loads */
.velvet {
  position: fixed; z-index: 70; top: 0; bottom: 0; width: 51vw; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 12%, transparent 88%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(90deg, #6e0a10 0, #a8121a 26px, #d8302c 40px, #b3161d 56px, #6e0a10 80px);
  box-shadow: inset 0 -26px 0 -10px #e8b23c;
}
.velvet::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: repeating-linear-gradient(90deg, #f4ca67 0 3px, #c88f22 3px 6px); }
.velvet.left { left: 0; animation: open-left 1.5s .45s var(--ease-out) forwards; }
.velvet.right { right: 0; animation: open-right 1.5s .45s var(--ease-out) forwards; }
@keyframes open-left { 30% { transform: translateX(-6%) skewX(2deg); } to { transform: translateX(-104%) skewX(-4deg); visibility: hidden; } }
@keyframes open-right { 30% { transform: translateX(6%) skewX(-2deg); } to { transform: translateX(104%) skewX(4deg); visibility: hidden; } }

/* content */
.stage-main { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; padding: 96px 16px 40px; min-height: 100vh; min-height: 100dvh; }
.logo-wrap { animation: logo-drop 1.1s 1.1s var(--ease-pop) both; }
.logo { width: min(330px, 66vw); filter: drop-shadow(0 8px 0 rgba(20, 60, 110, .35)); animation: float 5s 2.4s ease-in-out infinite; }
@keyframes logo-drop { 0% { transform: translateY(-120vh) rotate(-8deg); } 70% { transform: translateY(14px) rotate(2deg); } 100% { transform: none; } }

.marquee {
  position: relative; width: min(520px, 100%); margin-top: 18px; padding: 24px; border-radius: 48px;
  background: linear-gradient(#ec4a34, #b3251a 55%, #9a1d14);
  box-shadow: 0 0 0 4px #4d1408, inset 0 3px 0 rgba(255, 255, 255, .35), inset 0 -4px 0 rgba(0, 0, 0, .25),
              0 18px 36px rgba(16, 50, 90, .45), 0 0 46px rgba(255, 170, 60, .45);
  animation: marquee-in .8s 1.6s var(--ease-pop) both;
}
@keyframes marquee-in { from { transform: scale(.4) translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.marquee-inner {
  position: relative; z-index: 2; border-radius: 30px; padding: 46px 30px 26px;
  border: 4px solid #ff8a1c; box-shadow: 0 0 0 3px #6b2108, inset 0 0 26px rgba(160, 100, 40, .35);
  background:
    repeating-linear-gradient(97deg, rgba(160, 110, 50, .06) 0 2px, transparent 2px 7px),
    radial-gradient(ellipse at 50% 30%, #fbefcf, #f2dba8);
  display: grid; gap: 16px;
}
.bulbs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bulb {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe0, #ffd84d 45%, #e59b14);
  box-shadow: 0 0 8px 2px rgba(255, 214, 80, .9);
  animation: chase 1.2s linear infinite;
}
@keyframes chase {
  0%, 100% { filter: brightness(1.15); box-shadow: 0 0 10px 3px rgba(255, 220, 90, .95); }
  50% { filter: brightness(.45) saturate(.6); box-shadow: 0 0 0 0 rgba(255, 214, 80, 0); }
}
.marquee.is-party .bulb { animation-duration: .35s; }

.balloons { position: absolute; z-index: 0; width: 190px; top: -150px; pointer-events: none; animation: bob 4.5s ease-in-out infinite; transform-origin: bottom center; }
.balloons.l { left: -140px; }
.balloons.r { right: -140px; animation-delay: -2s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(3deg); } }

/* wooden plaque that hangs over the top edge of the marquee */
.plaque {
  position: absolute; z-index: 3; left: 50%; top: -30px; transform: translateX(-50%);
  min-width: 250px; padding: 4px 28px; text-align: center; white-space: nowrap;
  border: 18px solid transparent; border-image: url("../img/title.png") 26 fill / 18px stretch;
  color: #fff3cf; font: 700 22px var(--display); letter-spacing: .5px; text-shadow: 0 2px 0 var(--shadow);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .35));
  animation: plaque-swing 1.2s 2.1s var(--ease-pop) both;
  transform-origin: top center;
}
@keyframes plaque-swing { 0% { transform: translateX(-50%) rotate(-14deg) translateY(-30px); opacity: 0; } 60% { transform: translateX(-50%) rotate(5deg); opacity: 1; } 100% { transform: translateX(-50%); } }

.stage form { display: grid; gap: 14px; }
.stage .actions { display: grid; justify-items: center; gap: 10px; margin-top: 4px; }
.stage .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.stage .lead { margin: 0; text-align: center; color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 13px; margin: 2px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, rgba(122, 90, 56, .35) 0 6px, transparent 6px 10px); }

.register { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ribbon {
  position: absolute; top: -12px; right: calc(50% - 120px); transform: rotate(8deg);
  padding: 3px 12px; font: 700 12px var(--display); color: #fff; letter-spacing: .5px;
  background: linear-gradient(#ff7b1c, #e14d0f); border-radius: 4px; box-shadow: 0 2px 0 #7a2a06;
  animation: wiggle 2.6s ease-in-out infinite;
}
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(8deg); } 85% { transform: rotate(-4deg) scale(1.1); } 90% { transform: rotate(12deg) scale(1.1); } 95% { transform: rotate(4deg); } }

.stage-foot { margin-top: auto; padding-top: 26px; color: rgba(255, 255, 255, .9); font-size: 13px; text-shadow: 0 1px 2px rgba(10, 50, 90, .6); text-align: center; }
.stage-foot a { color: #fff; }

/* sparkle around the gold button */
.btn-gold { position: relative; }
.btn-gold::before {
  content: ""; position: absolute; inset: -6px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .75) 45%, transparent 60%) -200% 0 / 200% 100% no-repeat;
  animation: shine 3.4s 3s ease-in-out infinite; mix-blend-mode: soft-light;
}
@keyframes shine { 0%, 60% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

@media (max-width: 760px) {
  .curtain { height: 100vh; }
  .curtain.left { left: -170px; }
  .curtain.right { right: -170px; }
  .valance { height: 80px; background-size: auto 80px; }
  .stage-main { padding-top: 70px; }
  .balloons { width: 120px; top: -95px; }
  .balloons.l { left: -36px; }
  .balloons.r { right: -36px; }
  .marquee { padding: 16px; border-radius: 34px; }
  .marquee-inner { padding: 42px 18px 20px; border-radius: 22px; }
  .plaque { min-width: 200px; font-size: 19px; }
}
@media (max-width: 420px) {
  .curtain { display: none; }
  .balloons { display: none; }
}
@media (prefers-reduced-motion: reduce) { .velvet { display: none; } .rays { animation: none; } }
