:root {
  --lane: #d6ff4a;
  --teal: #d6ff4a;
  --navy: #5d0c6e;
  --cream: #f6ffe6;
  --red: #5d0c6e;
  --ink: #2a0634;
  --sky: #16081e;
  --shadow: 0 12px 40px rgba(93, 12, 110, 0.32);
  font-family: ui-rounded, "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Opening screen: the club's double doors with a neon sign, closed while the
   lane loads, swinging open once it is ready. Only the first page load shows
   it; trips to the club and back never bring it back. */
#boot {
  position: fixed;
  inset: 0;
  z-index: 8;
  margin: 0;
  overflow: hidden;
  background: #0c0312;
  perspective: 1800px;
  font-family: inherit;
}

#boot[hidden] { display: none; }

#boot.is-open {
  background: transparent;
  pointer-events: none;
  transition: background 0.2s ease;
}

.door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 44px),
    radial-gradient(120% 70% at 50% 50%, #34103f, #1a0624 70%, #12041a);
  backface-visibility: hidden;
  transition: transform 1.5s cubic-bezier(0.62, 0.02, 0.24, 1), filter 1.5s ease;
  will-change: transform;
}

.door-left {
  left: 0;
  transform-origin: left center;
  box-shadow: inset -2px 0 0 rgba(255, 74, 216, 0.9), inset -18px 0 30px -14px rgba(255, 74, 216, 0.6);
}

.door-right {
  right: 0;
  transform-origin: right center;
  box-shadow: inset 2px 0 0 rgba(214, 255, 74, 0.9), inset 18px 0 30px -14px rgba(214, 255, 74, 0.55);
}

/* Raised panel on each leaf. */
.door::before {
  content: "";
  position: absolute;
  inset: 7% 9%;
  border-radius: 22px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 74, 216, 0.35),
    inset 0 0 40px rgba(255, 74, 216, 0.12),
    0 0 22px rgba(255, 74, 216, 0.12);
}

.door-right::before {
  box-shadow:
    inset 0 0 0 2px rgba(214, 255, 74, 0.3),
    inset 0 0 40px rgba(214, 255, 74, 0.1),
    0 0 22px rgba(214, 255, 74, 0.1);
}

/* The sign is laid across both leaves: each shows its own half, so it splits
   down the seam as the doors open. */
.door-art {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200%;
  display: grid;
  place-items: center;
}

.door-left .door-art { left: 0; }
.door-right .door-art { right: 0; }

.door-sign {
  display: grid;
  gap: 0.25em;
  margin: 0;
  padding: 0 4vw;
  text-align: center;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 1;
  animation: sign-hum 3.2s ease-in-out infinite;
}

.ds-main {
  color: #fff0fc;
  font-size: clamp(2.6rem, 12vw, 7.5rem);
  letter-spacing: 0.06em;
  text-shadow:
    0 0 2px #fff,
    0 0 12px rgba(255, 74, 216, 0.95),
    0 0 34px rgba(255, 74, 216, 0.7),
    0 0 70px rgba(255, 74, 216, 0.35);
}

.ds-sub {
  color: #ffd9f7;
  font-size: clamp(1.05rem, 4.6vw, 2.7rem);
  letter-spacing: 0.3em;
  text-shadow:
    0 0 2px #fff,
    0 0 10px rgba(255, 74, 216, 0.9),
    0 0 26px rgba(255, 74, 216, 0.55);
}

.door-sign b {
  color: #d6ff4a;
  text-shadow:
    0 0 2px #fff,
    0 0 12px rgba(214, 255, 74, 0.95),
    0 0 32px rgba(214, 255, 74, 0.6);
}

.door-handle {
  position: absolute;
  top: calc(50% + clamp(70px, 14vw, 150px));
  width: 9px;
  height: clamp(70px, 12vh, 120px);
  border-radius: 6px;
  background: linear-gradient(180deg, #f2ffc0, #d6ff4a);
  box-shadow: 0 0 14px rgba(214, 255, 74, 0.7);
}

.door-left .door-handle { right: 18px; }
.door-right .door-handle { left: 18px; }

.boot-status {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: max(9%, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: #c9b8d4;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.boot-status::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: boot-dots 1.2s steps(4, end) infinite;
}

/* A burst of light through the seam as the doors part. */
#boot::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 40px 18px rgba(214, 255, 74, 0.55), 0 0 90px 40px rgba(255, 74, 216, 0.3);
  opacity: 0;
  pointer-events: none;
}

#boot.is-open::after { animation: door-light 0.9s ease-out forwards; }
#boot.is-open .boot-status { opacity: 0; }
#boot.is-open .door-left { transform: rotateY(-104deg); filter: brightness(0.6); }
#boot.is-open .door-right { transform: rotateY(104deg); filter: brightness(0.6); }

#boot.is-error .door-sign { animation: none; }
#boot.is-error .boot-status { color: #ff8be6; }
#boot.is-error .boot-status::after { display: none; }

@keyframes door-light {
  0% { opacity: 0; width: 4px; }
  20% { opacity: 1; }
  100% { opacity: 0; width: 70vw; }
}

@keyframes boot-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

@keyframes sign-hum {
  0%, 46%, 50%, 55%, 100% { opacity: 1; }
  48% { opacity: 0.72; }
  53% { opacity: 0.86; }
}

@media (prefers-reduced-motion: reduce) {
  .door-sign { animation: none; }
  #boot.is-open .door-left,
  #boot.is-open .door-right {
    transform: none;
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  #boot.is-open::after { animation: none; }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  margin: 0;
  background: #0c0312;
  color: #eaff9a;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

body.is-joining #hud,
body.is-joining #victory,
body.is-joining #leave {
  display: none;
}

body.is-club #view,
body.is-club #hud,
body.is-club #victory,
body.is-club #leave,
body.is-club #hello,
body.is-club #boot {
  display: none;
}

body.is-club {
  overflow: hidden;
  touch-action: manipulation;
  background: #120418;
  user-select: text;
  -webkit-user-select: text;
}

body.is-club #portal {
  display: block;
  min-height: 100dvh;
}

button, input { font: inherit; }
