/* Executive harbor gate — IMAX cinematic entry (Waypoint navy + gold) */

body.waypoint-gate-active {
  overflow: hidden;
}

body.waypoint-gate-active .desk-header,
body.waypoint-gate-active #commandDeck {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.waypoint-gate-active #bloombergDock {
  display: none !important;
}

body:has(#launchOverlay:not([hidden]):not([aria-hidden="true"])) .crew-messenger,
body:has(#launchOverlay:not([hidden]):not([aria-hidden="true"])) .pete-chat-messenger {
  visibility: hidden !important;
  pointer-events: none !important;
}

#launchOverlay {
  --gate-gold: #c5a059;
  --gate-gold-bright: #e8d092;
  --gate-navy: #020810;
  --gate-navy-mid: #0c1824;
}

#launchOverlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: block;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  background: #020810;
}

/* Bottom harbor scrim — lifts login from water, keeps ship visible above */
#launchOverlay.gate-auth-visible::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: min(460px, 50vh);
  z-index: 14;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 120% at 50% 100%, rgba(2, 10, 18, 0.82) 0%, rgba(2, 10, 18, 0.35) 55%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(4, 14, 24, 0.45) 45%, rgba(2, 8, 14, 0.9) 100%);
  opacity: 1;
}

#launchOverlay.gate-auth-visible.gate-auth-wide::before {
  height: min(520px, 62vh);
  background:
    radial-gradient(ellipse 95% 120% at 50% 100%, rgba(2, 10, 18, 0.92) 0%, rgba(2, 10, 18, 0.55) 55%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(4, 14, 24, 0.65) 40%, rgba(2, 8, 14, 0.96) 100%);
}

#launchOverlay.gate-auth-visible .gate-harbor-art {
  object-position: 50% 42%;
}

/* Screensaver idle — full ship + harbor town visible; lanterns ride the same rock as the art */
.gate-cinematic.gate-harbor-idle .gate-harbor-stage {
  inset: 0;
  animation: none;
}

.gate-cinematic.gate-harbor-idle .gate-harbor-art {
  animation: none;
  transform: none;
  object-position: 50% 42%;
  filter: brightness(1.02) saturate(1.08);
}

.gate-cinematic.gate-harbor-idle .gate-cinematic-progress,
.gate-cinematic.gate-harbor-idle .gate-intro-flash,
.gate-cinematic.gate-harbor-idle .gate-light-sweep {
  display: none;
  animation: none;
  opacity: 0;
}

/* ── Cinematic harbor (0–2.5s) ── */
.gate-cinematic {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  animation: gateCinematicHold 2.5s ease-out forwards;
}

.gate-cinematic.gate-cinematic-dim {
  animation: gateCinematicDim 1s ease forwards;
}

.gate-harbor-stage {
  position: absolute;
  inset: 0;
}

.gate-ship-rock {
  position: absolute;
  inset: 0;
  transform-origin: 50% 68%;
  animation: gateDockRock 9.5s ease-in-out infinite;
  will-change: transform;
}

.gate-ship-rock .gate-harbor-picture,
.gate-ship-rock .gate-lanterns,
.gate-ship-rock .gate-flag-wind,
.gate-ship-rock .gate-ripples {
  position: absolute;
  inset: 0;
}

.gate-harbor-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.gate-harbor-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

/* ── Sky clouds — slow drift ── */
.gate-clouds {
  position: absolute;
  inset: 0;
  height: 48%;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}

.gate-cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(28, 48, 68, 0.45);
  filter: blur(32px);
}

.gate-cloud-1 {
  width: min(340px, 42vw);
  height: min(72px, 10vh);
  top: 6%;
  left: -8%;
  animation: gateCloudDrift1 52s linear infinite;
}

.gate-cloud-2 {
  width: min(420px, 50vw);
  height: min(88px, 12vh);
  top: 14%;
  left: 35%;
  animation: gateCloudDrift2 68s linear infinite;
  opacity: 0.85;
}

.gate-cloud-3 {
  width: min(280px, 36vw);
  height: min(64px, 9vh);
  top: 4%;
  left: 62%;
  animation: gateCloudDrift3 58s linear infinite reverse;
}

.gate-cloud-4 {
  width: min(360px, 44vw);
  height: min(76px, 11vh);
  top: 20%;
  left: 78%;
  animation: gateCloudDrift1 74s linear infinite reverse;
  opacity: 0.7;
}

/* ── Lantern hotspots ── */
.gate-lanterns {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.gate-lantern {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 208, 0.82) 0%, rgba(232, 200, 120, 0.55) 50%, rgba(197, 128, 64, 0.28) 100%);
  box-shadow:
    0 0 3px 1px rgba(255, 220, 140, 0.38),
    0 0 8px 2px rgba(232, 168, 80, 0.18),
    0 0 16px 5px rgba(197, 120, 50, 0.08);
  animation: gateLanternFlicker var(--lf, 3.4s) ease-in-out infinite;
  animation-delay: var(--ld, 0s);
  opacity: 0.7;
}

.gate-lantern-md {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
}

.gate-lantern-sm {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  opacity: 0.78;
}

.gate-lantern-xs {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  opacity: 0.52;
  box-shadow:
    0 0 2px 1px rgba(255, 220, 140, 0.28),
    0 0 6px 2px rgba(232, 168, 80, 0.12);
}

/* ── Flag in the wind ── */
.gate-flag-wind {
  position: absolute;
  top: 11%;
  left: 49.5%;
  z-index: 6;
  pointer-events: none;
  transform-origin: 8px 0;
  animation: gateFlagWind 3.2s ease-in-out infinite;
}

.gate-flag-svg {
  width: clamp(40px, 5vw, 62px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.55));
}

.gate-flag-wind .gate-flag-glow {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, rgba(232, 208, 146, 0.35) 0%, transparent 70%);
  animation: gateFlagPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* ── Dock ripples + water lines ── */
.gate-ripples {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.gate-ripple {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: 20px;
  height: 8px;
  margin: -4px 0 0 -10px;
  border: 1px solid rgba(160, 200, 220, 0.22);
  border-radius: 50%;
  animation: gateRippleExpand 4.5s ease-out infinite;
  animation-delay: var(--rs, 0s);
  opacity: 0;
}

.gate-ripple-sm {
  width: 14px;
  height: 6px;
  animation-duration: 3.8s;
}

.gate-wave-lines {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 14px,
    rgba(140, 180, 210, 0.07) 14px,
    rgba(140, 180, 210, 0.07) 15px
  );
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%);
  animation: gateWaveLinesDrift 8s linear infinite;
}

/* Teal + gold Pirates color grade */
.gate-cinematic-grade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(8, 28, 42, 0.22) 0%, transparent 45%, rgba(40, 22, 8, 0.08) 100%),
    linear-gradient(180deg, rgba(4, 10, 18, 0.15) 0%, transparent 38%, rgba(2, 6, 12, 0.4) 100%);
  mix-blend-mode: soft-light;
}

/* Soft moonlight through clouds — upper right, no disc */
.gate-sky-glow-wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 42% 32% at 84% 14%,
    rgba(160, 195, 230, 0.14) 0%,
    rgba(80, 120, 170, 0.05) 42%,
    transparent 72%
  );
  animation: gateMoonlightBreath 6s ease-in-out infinite alternate;
}

.gate-lantern-pulse {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 55% 40% at 48% 52%,
    rgba(232, 168, 80, 0.028) 0%,
    rgba(197, 120, 50, 0.01) 50%,
    transparent 75%
  );
  animation: gateLanternPulse 4.8s ease-in-out infinite alternate;
}

#launchOverlay.gate-auth-visible .gate-flag-wind {
  left: 53%;
  transition: left 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

#launchOverlay.gate-auth-visible .gate-lanterns,
#launchOverlay.gate-auth-visible .gate-clouds,
#launchOverlay.gate-auth-visible .gate-ripples {
  opacity: 0.92;
}

/* Lighthouse / moonlight sweep across frame */
.gate-light-sweep {
  position: absolute;
  inset: -20%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(180, 210, 240, 0.07) 48%,
    rgba(232, 208, 146, 0.05) 50%,
    rgba(180, 210, 240, 0.07) 52%,
    transparent 58%
  );
  animation: gateLightSweep 4.2s ease-in-out 0.4s forwards;
  opacity: 0;
}

.gate-intro-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(200, 220, 240, 0.12), transparent 60%);
  animation: gateIntroFlash 1.2s ease-out forwards;
}

.gate-cinematic-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 72% at 50% 44%, transparent 22%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, transparent 22%, transparent 68%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 3;
}

.gate-cinematic-grain {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
}

.gate-fog {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 40%;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(180deg, transparent, rgba(12, 28, 42, 0.35), rgba(6, 14, 22, 0.65));
  filter: blur(14px);
}

.gate-fog-a {
  bottom: 8%;
  animation: gateFogDriftA 8s ease-in-out infinite alternate;
}

.gate-fog-b {
  bottom: 0;
  opacity: 0.6;
  animation: gateFogDriftB 11s ease-in-out infinite alternate;
}

.gate-fog-c {
  bottom: 22%;
  height: 28%;
  opacity: 0.45;
  animation: gateFogRollIn 2.5s ease-out forwards;
}

.gate-wave-shimmer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14%;
  height: 140px;
  z-index: 4;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 168, 80, 0.05) 20%,
    rgba(180, 210, 230, 0.07) 50%,
    rgba(232, 168, 80, 0.05) 80%,
    transparent 100%);
  animation: gateWaterGlimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

.gate-wave-shimmer-b {
  bottom: 10%;
  height: 100px;
  opacity: 0.7;
  animation: gateWaterGlimmer 2.8s ease-in-out infinite reverse;
  animation-delay: 0.6s;
}

.gate-cinematic-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  z-index: 8;
  background: linear-gradient(90deg, transparent, var(--gate-gold), var(--gate-gold-bright), transparent);
  animation: gateProgressBar 2.5s linear forwards;
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.5);
}

/* ── Brand reveal — anchored top, clear of ship ── */
.gate-phase-brand {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(28px, 7vh, 88px);
  pointer-events: none;
}

.gate-phase-brand[hidden] {
  display: none !important;
}

.gate-phase-brand.gate-phase-visible .gate-brand-emblem {
  opacity: 1;
  transform: none;
  filter: drop-shadow(0 0 24px rgba(197, 160, 89, 0.5));
}

.gate-phase-brand.gate-phase-visible .gate-brand-rule {
  width: min(320px, 70vw);
  opacity: 1;
}

.gate-phase-brand.gate-phase-visible .gate-brand-word {
  opacity: 1;
  transform: none;
  filter: none;
}

.gate-phase-brand.gate-phase-visible .gate-brand-word-2 {
  animation: none;
}

.gate-brand-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 22px);
  text-align: center;
  max-width: min(960px, 94vw);
}

.gate-brand-emblem {
  width: min(140px, 16vw);
  height: auto;
  opacity: 1;
  transform: none;
  filter: drop-shadow(0 0 24px rgba(197, 160, 89, 0.5));
}

.gate-brand-rule {
  width: min(320px, 70vw);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gate-gold-bright), var(--gate-gold), transparent);
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.45);
  opacity: 1;
}

.gate-brand-text {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 12px);
  overflow: hidden;
}

.gate-brand-word {
  opacity: 1;
  transform: none;
  filter: none;
}

.gate-brand-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.12em;
  color: var(--gate-gold-bright);
  text-transform: uppercase;
  text-shadow:
    0 0 40px rgba(197, 160, 89, 0.55),
    0 0 80px rgba(197, 160, 89, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.85);
  background: linear-gradient(180deg, #fff0c8 0%, var(--gate-gold-bright) 35%, var(--gate-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gate-phase-brand.gate-phase-visible .gate-brand-name {
  animation: gateNameShimmer 4s ease-in-out infinite;
}

.gate-brand-sub {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.58em;
  color: var(--gate-gold);
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(197, 160, 89, 0.35), 0 2px 8px rgba(0, 0, 0, 0.8);
  padding-left: 0.58em;
}

/* ── Auth panel — centered on dock, no scroll on entry buttons ── */
.gate-phase-auth {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: clamp(18px, 3.5vh, 44px);
  top: auto;
  transform: translateX(-50%);
  z-index: 20;
  width: min(400px, calc(100vw - 36px));
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate-phase-auth.gate-auth-wide {
  width: min(780px, calc(100vw - 28px));
}

.gate-phase-auth.gate-auth-login {
  width: min(400px, calc(100vw - 36px));
}

.gate-phase-auth.gate-phase-visible {
  opacity: 1;
}

.gate-phase-auth[hidden] {
  display: none !important;
}

/* Welcome — separate themed buttons, no box */
.gate-auth-choices {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  text-align: center;
}

.gate-auth-choices[hidden] {
  display: none !important;
}

.gate-choices-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gate-gold-bright);
  margin: 0 0 2px;
  text-shadow: 0 0 20px rgba(197, 160, 89, 0.35);
}

.gate-choices-sub {
  font-size: 0.68rem;
  color: rgba(180, 200, 220, 0.8);
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.gate-choice-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.gate-choice-btn:hover {
  transform: translateY(-2px);
}

.gate-choice-primary {
  background: linear-gradient(180deg, #e8d092 0%, #c5a059 55%, #a88648 100%);
  color: #0a1520;
  border: 1px solid rgba(255, 240, 200, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 28px rgba(197, 160, 89, 0.3);
}

.gate-choice-primary:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 36px rgba(197, 160, 89, 0.45);
}

.gate-choice-secondary {
  background: rgba(4, 14, 26, 0.55);
  border: 1px solid rgba(197, 160, 89, 0.32);
  color: var(--gate-gold-bright);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(197, 160, 89, 0.08);
}

.gate-choice-secondary:hover {
  background: rgba(197, 160, 89, 0.1);
  border-color: rgba(197, 160, 89, 0.48);
}

.gate-choice-ghost {
  background: transparent;
  border: none;
  color: rgba(180, 200, 220, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 10px;
  box-shadow: none;
}

.gate-choice-ghost:hover {
  color: var(--gate-gold);
  transform: none;
}

.gate-discover {
  margin-top: 14px;
  padding: 16px 14px 14px;
  border-radius: 10px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.gate-discover-kicker {
  margin: 0 0 4px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(180, 200, 220, 0.75);
}

.gate-discover-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gate-gold-bright);
}

.gate-discover-copy {
  margin: 0 0 12px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(220, 230, 240, 0.82);
}

.gate-choice-discover {
  text-decoration: none;
  box-sizing: border-box;
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.55);
  color: var(--gate-gold-bright);
}

.gate-explore-lantern {
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #e8d092 0%, #c5a059 55%, #a88648 100%);
  color: #0a1520;
  border: 1px solid rgba(255, 240, 200, 0.28);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(232, 168, 80, 0.16);
}

.gate-explore-lantern::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 244, 208, 0.22) 0%, transparent 70%);
  animation: gateLanternFlicker 3.8s ease-in-out infinite;
  animation-delay: 0.9s;
}

.gate-choice-discover:hover,
.gate-choice-discover:focus-visible,
.gate-explore-lantern:hover,
.gate-explore-lantern:focus-visible {
  background: linear-gradient(180deg, #f0dca8 0%, #d4b06a 55%, #c5a059 100%);
  border-color: rgba(255, 240, 200, 0.45);
  color: #0a1520;
  text-decoration: none;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(232, 168, 80, 0.24);
}

.gate-legal {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-align: center;
  color: rgba(170, 190, 210, 0.46);
}

.gate-legal a {
  color: rgba(180, 200, 220, 0.55);
  text-decoration: none;
}

.gate-legal a:hover,
.gate-legal a:focus-visible {
  color: var(--gate-gold);
  text-decoration: underline;
}

.gate-phase-auth.gate-auth-wide .gate-explore-lantern {
  display: none;
}

#launchOverlay.gate-boarding-active .gate-explore-lantern,
#launchOverlay.gate-boarding-active .gate-legal,
#launchOverlay.gate-boarding-active .gate-phase-brand {
  visibility: hidden;
  pointer-events: none;
}

.gate-auth-dock {
  position: relative;
  padding-top: 10px;
}

.gate-auth-dock::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.35), transparent);
  opacity: 0.8;
}

.gate-auth-lantern {
  position: absolute;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 208, 0.9) 0%, rgba(232, 200, 120, 0.65) 100%);
  box-shadow: 0 0 8px 2px rgba(232, 168, 80, 0.35);
  animation: gateLanternFlicker 3.6s ease-in-out infinite;
  z-index: 2;
  opacity: 0.75;
}

.gate-auth-lantern-l { left: 14%; }
.gate-auth-lantern-r { right: 14%; animation-delay: 1.4s; }

.gate-auth-card {
  position: relative;
  padding: 18px 22px 16px;
  border-radius: 6px 6px 14px 14px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  border-top: 2px solid rgba(197, 160, 89, 0.5);
  background:
    linear-gradient(180deg, rgba(12, 28, 44, 0.94) 0%, rgba(6, 14, 26, 0.97) 100%);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(197, 160, 89, 0.14);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
}

.gate-phase-auth.gate-auth-wide .gate-auth-card {
  background:
    linear-gradient(180deg, rgba(10, 26, 42, 0.97) 0%, rgba(4, 12, 22, 0.99) 100%);
  border-color: rgba(197, 160, 89, 0.38);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(197, 160, 89, 0.16);
}

.gate-auth-card[hidden] {
  display: none !important;
}

.gate-auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(160deg, rgba(232, 168, 80, 0.06) 0%, transparent 42%),
    linear-gradient(0deg, rgba(80, 140, 180, 0.04) 0%, transparent 30%);
  pointer-events: none;
}

.gate-auth-card::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(140, 180, 210, 0.25), transparent);
  opacity: 0.6;
}

.gate-auth-card h2 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  color: var(--gate-gold-bright);
  margin: 0 0 2px;
  text-align: center;
  text-shadow: 0 0 20px rgba(197, 160, 89, 0.25);
}

.gate-auth-card .gate-auth-sub {
  text-align: center;
  font-size: 0.68rem;
  color: rgba(180, 200, 220, 0.75);
  margin-bottom: 14px;
  letter-spacing: 0.08em;
}

.gate-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.gate-auth-actions .btn {
  width: 100%;
  justify-content: center;
}

.gate-auth-actions .btn-gold {
  box-shadow: 0 0 22px rgba(197, 160, 89, 0.28), inset 0 1px 0 rgba(255, 240, 200, 0.2);
}

.btn-gate-outline {
  border-color: rgba(197, 160, 89, 0.28);
  color: var(--gate-gold-bright);
  background: rgba(4, 12, 22, 0.35);
  backdrop-filter: blur(4px);
}

.btn-gate-outline:hover {
  background: rgba(197, 160, 89, 0.08);
  border-color: rgba(197, 160, 89, 0.45);
}

.btn-gate-admin {
  font-size: 0.68rem;
  opacity: 0.65;
  margin-top: 2px;
  background: transparent;
  border: none;
  color: rgba(180, 200, 220, 0.7);
  letter-spacing: 0.04em;
}

.btn-gate-admin:hover {
  opacity: 0.9;
  color: var(--gate-gold);
}

.gate-form-panel input,
.gate-form-panel select {
  background: rgba(4, 10, 18, 0.95);
  border-color: rgba(197, 160, 89, 0.28);
  color: #eef4fa;
}

.gate-form-panel input:focus {
  border-color: rgba(197, 160, 89, 0.4);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.12);
}

.gate-form-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.gate-form-panel.active {
  display: flex;
}

#gateSignupPanel.active {
  gap: 8px;
}

.gate-signup-plans-label {
  margin: 6px 0 4px !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.14em;
}

.gate-phase-auth.gate-auth-wide .gate-plans-grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 8px;
}

.gate-phase-auth.gate-auth-wide .gate-plan-card {
  padding: 12px 11px;
}

.gate-phase-auth.gate-auth-wide .gate-plan-name {
  font-size: 0.78rem;
  margin: 4px 0 2px;
}

.gate-phase-auth.gate-auth-wide .gate-plan-price {
  font-size: 1.1rem;
  margin: 2px 0;
}

.gate-phase-auth.gate-auth-wide .gate-plan-intro {
  font-size: 0.6rem;
  margin-bottom: 4px;
}

.gate-phase-auth.gate-auth-wide .gate-plan-features {
  font-size: 0.58rem;
  line-height: 1.35;
}

.gate-phase-auth.gate-auth-wide .gate-form-panel label {
  font-size: 0.7rem;
}

.gate-phase-auth.gate-auth-wide .gate-form-panel input {
  padding: 8px 10px;
  margin-top: 2px;
}

.gate-phase-auth.gate-auth-wide #gateSignupPanel form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 12px;
  align-items: end;
}

.gate-phase-auth.gate-auth-wide #gateSignupPanel form > label:nth-child(1) { grid-column: 1; }
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > label:nth-child(2) { grid-column: 2; }
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > label:nth-child(3) { grid-column: 3; }
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > .gate-signup-plans-label,
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > .gate-plans-grid,
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > .btn,
.gate-phase-auth.gate-auth-wide #gateSignupPanel form > .gate-message {
  grid-column: 1 / -1;
}

.gate-phase-auth.gate-auth-wide #gateSignupPanel .gate-form-back {
  margin-bottom: 0;
}

.gate-form-panel label {
  font-size: 0.75rem;
  color: rgba(210, 225, 240, 0.92);
  letter-spacing: 0.04em;
}

.gate-form-panel input,
.gate-form-panel select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: rgba(4, 10, 18, 0.95);
  color: #eef4fa;
  font: inherit;
}

.gate-form-panel .btn,
.gate-form-panel .btn-gold {
  width: 100%;
  justify-content: center;
}

.gate-form-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  align-self: flex-start;
  padding: 0;
  margin-bottom: 4px;
}

.gate-form-back:hover { color: var(--gate-gold); }

.gate-auth-switch {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(210, 225, 240, 0.78);
}

.gate-text-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--gate-gold, #d4b15f);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gate-text-link:hover {
  color: #f0e6c8;
}

.gate-message {
  font-size: 0.78rem;
  text-align: center;
  min-height: 1.2em;
}

.gate-message.error { color: #e88; }
.gate-message.ok { color: var(--green); }

.gate-promo-hint {
  margin: -4px 0 12px;
  font-size: 0.82rem;
}

.gate-sms-consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0 16px;
  font-size: 0.82rem;
  color: var(--text-muted, #9aa3b2);
  line-height: 1.45;
  text-align: left;
}

.gate-sms-consent-row input {
  margin-top: 3px;
}

.gate-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

@media (max-width: 560px) {
  .gate-plans-grid { grid-template-columns: 1fr; }
}

.gate-plan-card {
  position: relative;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.24);
  background: rgba(8, 18, 30, 0.94);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-align: left;
}

.gate-plan-card:hover {
  border-color: rgba(197, 160, 89, 0.4);
  transform: translateY(-2px);
}

.gate-plan-card.selected {
  border-color: var(--gate-gold);
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.15);
}

.gate-plan-card.featured {
  border-color: rgba(197, 160, 89, 0.35);
}

.gate-plan-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gate-gold);
  color: var(--gate-navy);
  white-space: nowrap;
}

.gate-plan-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gate-gold-bright);
  letter-spacing: 0.08em;
  margin: 8px 0 4px;
}

.gate-plan-price {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0;
}

.gate-plan-price small {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

.gate-plan-intro {
  font-size: 0.68rem;
  color: var(--green);
  margin-bottom: 8px;
}

.gate-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.45;
  color: rgba(190, 210, 230, 0.9);
}

.gate-plan-features li {
  padding: 2px 0 2px 12px;
  position: relative;
}

.gate-plan-features li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--gate-gold);
  font-size: 0.5rem;
  top: 4px;
}

.gate-payment-summary {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 16, 24, 0.5);
  margin-bottom: 12px;
}

.gate-payment-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin: 4px 0;
}

.gate-payment-total {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gate-gold-bright);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 8px;
}

/* ── Keyframes ── */
@keyframes gateHarborEstablish {
  0% {
    transform: scale(0.78);
    filter: brightness(0.75) saturate(0.95);
    opacity: 0.85;
  }
  100% {
    transform: scale(0.82);
    filter: brightness(1.02) saturate(1.08);
    opacity: 1;
  }
}

@keyframes gateHarborScreensaver {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.015) translate(-0.4%, -0.3%);
  }
  100% {
    transform: scale(1.03) translate(0.5%, 0.2%);
  }
}

@keyframes gateStageDrift {
  0% {
    transform: scale(1.06) rotate(-0.35deg) translate(2.5%, 1.5%);
  }
  35% {
    transform: scale(1.04) rotate(0.15deg) translate(-1.5%, 0.5%);
  }
  70% {
    transform: scale(1.02) rotate(-0.1deg) translate(0.5%, -0.5%);
  }
  100% {
    transform: scale(1) rotate(0deg) translate(0, 0);
  }
}

@keyframes gateCameraEpic {
  0% {
    transform: scale(1.22) translate(4%, 2%);
    filter: brightness(0.72) saturate(0.95) contrast(1.08);
  }
  18% {
    transform: scale(1.16) translate(2%, 1%);
    filter: brightness(0.85) saturate(1.02) contrast(1.06);
  }
  40% {
    transform: scale(1.1) translate(-2.5%, 0%);
    filter: brightness(0.94) saturate(1.06) contrast(1.05);
  }
  62% {
    transform: scale(1.05) translate(-1%, -0.8%);
    filter: brightness(1) saturate(1.08) contrast(1.04);
  }
  82% {
    transform: scale(1.02) translate(0.8%, -0.3%);
    filter: brightness(1.02) saturate(1.1) contrast(1.05);
  }
  100% {
    transform: scale(1) translate(0, 0);
    filter: brightness(1.04) saturate(1.1) contrast(1.05);
  }
}

@keyframes gateDockRock {
  0%, 100% {
    transform: rotate(-0.1deg) translateY(0);
  }
  25% {
    transform: rotate(0.06deg) translateY(-0.6px);
  }
  50% {
    transform: rotate(0.12deg) translateY(-1px);
  }
  75% {
    transform: rotate(-0.04deg) translateY(-0.4px);
  }
}

@keyframes gateCloudDrift1 {
  from { transform: translateX(0); }
  to { transform: translateX(18%); }
}

@keyframes gateCloudDrift2 {
  from { transform: translateX(0) translateY(0); }
  to { transform: translateX(-14%) translateY(6px); }
}

@keyframes gateCloudDrift3 {
  from { transform: translateX(0); }
  to { transform: translateX(-20%); }
}

@keyframes gateLanternFlicker {
  0%, 100% {
    opacity: 0.58;
    transform: scale(0.97);
    filter: brightness(0.9);
  }
  35% {
    opacity: 0.76;
    transform: scale(1.02);
    filter: brightness(1.04);
  }
  62% {
    opacity: 0.64;
    transform: scale(0.98);
    filter: brightness(0.94);
  }
  82% {
    opacity: 0.72;
    transform: scale(1);
    filter: brightness(1.02);
  }
}

@keyframes gateFlagWind {
  0%, 100% {
    transform: rotate(-5deg) skewX(0deg) scaleX(1);
  }
  20% {
    transform: rotate(4deg) skewX(-4deg) scaleX(1.06);
  }
  45% {
    transform: rotate(7deg) skewX(3deg) scaleX(0.97);
  }
  70% {
    transform: rotate(-2deg) skewX(-2deg) scaleX(1.04);
  }
  88% {
    transform: rotate(6deg) skewX(2deg) scaleX(1.02);
  }
}

@keyframes gateRippleExpand {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  12% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

@keyframes gateWaveLinesDrift {
  from { background-position: 0 0; }
  to { background-position: 0 28px; }
}

@keyframes gateIntroFlash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes gateLightSweep {
  0% { opacity: 0; transform: translateX(-30%) skewX(-8deg); }
  15% { opacity: 1; }
  45% { opacity: 0.85; transform: translateX(15%) skewX(-8deg); }
  100% { opacity: 0; transform: translateX(55%) skewX(-8deg); }
}

@keyframes gateFlagPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes gateFogRollIn {
  0% { opacity: 0; transform: translateY(12%); }
  100% { opacity: 0.45; transform: translateY(0); }
}

@keyframes gateScrimFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gateCinematicHold {
  0%, 85% { opacity: 1; }
  100% { opacity: 1; }
}

@keyframes gateCinematicDim {
  to {
    filter: brightness(0.78) saturate(1.05) contrast(1.02);
  }
}

@keyframes gateMoonlightBreath {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

@keyframes gateLanternPulse {
  from { opacity: 0.55; }
  to { opacity: 0.72; }
}

@keyframes gateFogDriftA {
  from { transform: translateX(-3%) translateY(0); }
  to { transform: translateX(3%) translateY(-8px); }
}

@keyframes gateFogDriftB {
  from { transform: translateX(2%); opacity: 0.5; }
  to { transform: translateX(-4%); opacity: 0.75; }
}

@keyframes gateWaterGlimmer {
  0%, 100% { opacity: 0.4; transform: translateX(-2%); }
  50% { opacity: 0.85; transform: translateX(2%); }
}

@keyframes gateProgressBar {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes gateEmblemDrop {
  0% {
    opacity: 0;
    transform: translateY(-48px) scale(0.6);
    filter: drop-shadow(0 0 0 transparent);
  }
  55% {
    opacity: 1;
    transform: translateY(6px) scale(1.08);
    filter: drop-shadow(0 0 32px rgba(232, 208, 146, 0.8));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 24px rgba(197, 160, 89, 0.65)) drop-shadow(0 0 56px rgba(197, 160, 89, 0.25));
  }
}

@keyframes gateRuleExpand {
  0% { width: 0; opacity: 0; }
  100% { width: min(320px, 70vw); opacity: 1; }
}

@keyframes gateWordReveal {
  0% {
    opacity: 0;
    transform: translateY(110%) scale(0.92);
    filter: blur(8px);
    letter-spacing: 0.35em;
  }
  60% {
    opacity: 1;
    transform: translateY(-6%) scale(1.03);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    letter-spacing: inherit;
  }
}

@keyframes gateNameShimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes gateAuthRise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(40px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    filter: blur(0);
  }
}

/* Laptop login — cinematic intact, card/brand restrained (does not apply >=1920) */
@media (max-width: 1919px) and (min-width: 1280px) {
  .gate-phase-brand {
    padding-top: clamp(16px, 3.5vh, 40px);
  }

  .gate-brand-emblem {
    width: min(72px, 8vw);
  }

  .gate-brand-name {
    font-size: clamp(1.7rem, 3.2vw, 2.45rem);
    letter-spacing: 0.1em;
  }

  .gate-brand-sub {
    font-size: clamp(0.72rem, 1.1vw, 0.88rem);
    letter-spacing: 0.36em;
    padding-left: 0.36em;
  }

  .gate-brand-reveal {
    gap: 8px;
    max-width: min(520px, 86vw);
  }

  .gate-phase-auth {
    width: min(340px, calc(100vw - 48px));
    bottom: clamp(12px, 2.5vh, 28px);
  }

  .gate-phase-auth.gate-auth-login {
    width: min(340px, calc(100vw - 48px));
  }

  .gate-phase-auth.gate-auth-wide {
    width: min(640px, calc(100vw - 40px));
  }

  .gate-auth-card {
    padding: 12px 16px 12px;
  }

  .gate-choice-btn {
    padding: 9px 14px;
    font-size: 0.72rem;
  }

  .gate-choices-eyebrow {
    font-size: 0.7rem;
  }

  .gate-discover {
    margin-top: 8px;
    padding: 10px 12px;
  }

  .gate-discover-title {
    font-size: 0.82rem;
  }

  .gate-explore-lantern {
    margin-top: 8px;
  }

  .gate-legal {
    margin-top: 8px;
    font-size: 0.54rem;
  }
}

/* Tablet login — constrained card, readable, may scroll */
@media (max-width: 1279px) and (min-width: 721px) {
  .gate-phase-brand {
    padding-top: clamp(16px, 3.8vh, 36px);
  }

  .gate-brand-emblem {
    width: min(64px, 12vw);
  }

  .gate-brand-name {
    font-size: clamp(1.55rem, 4.6vw, 2.15rem);
    letter-spacing: 0.09em;
  }

  .gate-brand-sub {
    font-size: clamp(0.7rem, 1.6vw, 0.84rem);
    letter-spacing: 0.32em;
    padding-left: 0.32em;
  }

  .gate-phase-auth {
    width: min(360px, calc(100vw - 32px));
    bottom: clamp(10px, 2.2vh, 24px);
    max-height: min(68vh, 560px);
    overflow-y: auto;
  }

  .gate-phase-auth.gate-auth-login {
    width: min(360px, calc(100vw - 32px));
  }

  .gate-phase-auth.gate-auth-wide {
    width: min(620px, calc(100vw - 28px));
  }

  .gate-auth-card {
    padding: 12px 14px 12px;
  }

  .gate-choice-btn {
    padding: 10px 14px;
    font-size: 0.74rem;
    min-height: 44px;
  }
}

@media (max-width: 720px) {
  .gate-phase-auth.gate-auth-wide {
    width: min(400px, calc(100vw - 20px));
  }

  .gate-phase-auth.gate-auth-wide #gateSignupPanel form {
    grid-template-columns: 1fr;
  }

  .gate-phase-auth.gate-auth-wide #gateSignupPanel form > label {
    grid-column: 1 / -1;
  }

  .gate-phase-auth.gate-auth-wide .gate-plans-grid {
    grid-template-columns: 1fr;
  }

  .gate-phase-brand {
    padding-top: clamp(20px, 5vh, 48px);
  }

  .gate-brand-name {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
    letter-spacing: 0.08em;
  }

  .gate-brand-sub {
    letter-spacing: 0.38em;
    padding-left: 0.38em;
  }

  .gate-phase-auth {
    bottom: clamp(10px, 2.5vh, 24px);
    width: min(380px, calc(100vw - 20px));
  }

  #launchOverlay.gate-auth-visible::before {
    height: min(420px, 58vh);
  }

  #launchOverlay.gate-auth-visible .gate-harbor-art {
    object-position: 50% 32%;
  }

  .gate-flag-wind {
    top: 14%;
    left: 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-harbor-stage,
  .gate-ship-rock,
  .gate-harbor-art,
  .gate-fog,
  .gate-wave-shimmer,
  .gate-wave-lines,
  .gate-cinematic-progress,
  .gate-light-sweep,
  .gate-cloud,
  .gate-lantern,
  .gate-ripple,
  .gate-flag-wind,
  .gate-intro-flash,
  .gate-brand-word,
  .gate-brand-emblem,
  .gate-brand-rule,
  .gate-explore-lantern::after,
  .gate-auth-lantern {
    animation: none !important;
  }
  .gate-harbor-stage,
  .gate-ship-rock,
  .gate-harbor-art {
    transform: none;
    filter: none;
  }
  .gate-ripple {
    opacity: 0.3;
  }
  .gate-brand-word,
  .gate-brand-emblem {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .gate-brand-rule {
    width: min(320px, 70vw);
    opacity: 1;
  }
}
