/* ═══════════════════════════════════════════
   Passenger "Welcome Aboard" cinematic modal
   Triggered after a manifest awards a passenger.
   ═══════════════════════════════════════════ */

.pw-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  transition: opacity 0.5s ease, background 0.7s ease, backdrop-filter 0.7s ease;
  pointer-events: none;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}
.pw-overlay.active {
  background: radial-gradient(ellipse at center, rgba(20, 12, 4, 0.94), rgba(0, 0, 0, 0.99));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 1;
  pointer-events: auto;
}

/* Drifting stardust layer — subtle motion behind the portrait */
.pw-overlay::before {
  content: '';
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 200, 100, 0.55), transparent 60%),
    radial-gradient(1px 1px at 78% 62%, rgba(255, 180, 80, 0.40), transparent 60%),
    radial-gradient(1.5px 1.5px at 42% 84%, rgba(255, 220, 150, 0.50), transparent 60%),
    radial-gradient(1px 1px at 88% 22%, rgba(255, 200, 100, 0.30), transparent 60%),
    radial-gradient(1px 1px at 28% 70%, rgba(255, 240, 200, 0.35), transparent 60%),
    radial-gradient(1px 1px at 60% 8%, rgba(255, 200, 120, 0.45), transparent 60%);
  opacity: 0;
  animation: pw-drift 40s linear infinite;
  transition: opacity 1.2s ease 0.4s;
  pointer-events: none;
}
.pw-overlay.active::before { opacity: 1; }

@keyframes pw-drift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-40px, -60px); }
}

/* Vignette ring — pulses the gold accent */
.pw-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    transparent 30%,
    rgba(255, 179, 0, 0.05) 60%,
    rgba(0, 0, 0, 0.4) 100%);
  opacity: 0;
  transition: opacity 1s ease 0.5s;
  pointer-events: none;
}
.pw-overlay.active::after { opacity: 1; }

.pw-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 480px);
  max-height: 100vh;
  overflow-y: auto;
  padding: 24px 24px 32px;
  text-align: center;
  transform: scale(0.94) translateY(14px);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
              opacity 0.5s ease 0.1s;
}
.pw-overlay.active .pw-stage {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.pw-queue-indicator {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--accent-dim);
  margin-bottom: 8px;
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
}
.pw-overlay.active .pw-queue-indicator { opacity: 1; }

.pw-header {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--accent);
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
  text-shadow: 0 0 12px rgba(255, 179, 0, 0.4);
}
.pw-overlay.active .pw-header {
  opacity: 1;
  transform: translateY(0);
}

.pw-portrait-frame {
  position: relative;
  width: min(70vw, 280px);
  aspect-ratio: 1;
  margin-bottom: 22px;
}

.pw-portrait-glow {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255, 179, 0, 0.45) 0%,
    rgba(255, 179, 0, 0.18) 28%,
    rgba(255, 179, 0, 0) 65%);
  filter: blur(12px);
  opacity: 0;
  transform: scale(0.85);
  animation: pw-glow-pulse 4.5s ease-in-out infinite;
  transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
  pointer-events: none;
}
.pw-overlay.active .pw-portrait-glow {
  opacity: 1;
  transform: scale(1);
}

@keyframes pw-glow-pulse {
  0%, 100% { filter: blur(12px) brightness(1); }
  50%      { filter: blur(16px) brightness(1.25); }
}

.pw-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--accent-dim);
  box-shadow:
    0 0 30px rgba(255, 179, 0, 0.30),
    0 0 90px rgba(0, 0, 0, 0.7),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
  filter: brightness(0.55) saturate(0.75);
  transform: scale(0.92);
  transition: filter 1.1s ease 0.55s,
              transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s,
              border-color 0.6s ease 0.55s;
}
.pw-overlay.active .pw-portrait {
  filter: brightness(1) saturate(1);
  transform: scale(1);
  border-color: var(--accent);
}

.pw-role {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 7px;
  color: var(--amber);
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease 0.85s, transform 0.45s ease 0.85s;
}
.pw-overlay.active .pw-role {
  opacity: 1;
  transform: translateY(0);
}

.pw-name {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--white);
  text-shadow: 0 0 24px rgba(255, 179, 0, 0.45);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease 1s, transform 0.55s ease 1s;
}
.pw-overlay.active .pw-name {
  opacity: 1;
  transform: translateY(0);
}

.pw-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--dim);
  margin-bottom: 18px;
  opacity: 0;
  transition: opacity 0.5s ease 1.2s;
}
.pw-overlay.active .pw-tagline { opacity: 1; }
.pw-tagline strong {
  color: var(--accent);
  letter-spacing: 2.5px;
  font-weight: normal;
}

.pw-beat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-style: italic;
  color: var(--accent-dim);
  margin: 0 0 22px;
  max-width: 380px;
  line-height: 1.7;
  border-left: 2px solid var(--accent);
  padding: 8px 14px;
  text-align: left;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.55s ease 1.4s, transform 0.55s ease 1.4s;
  background: rgba(255, 179, 0, 0.04);
}
.pw-overlay.active .pw-beat {
  opacity: 1;
  transform: translateX(0);
}

.pw-progress {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--dim);
  margin-bottom: 24px;
  opacity: 0;
  transition: opacity 0.5s ease 1.65s;
}
.pw-overlay.active .pw-progress { opacity: 1; }

/* The global `button {}` rule in foundation.css uses !important on
   background / border / border-radius / box-shadow, so every override here
   must also use !important to win the cascade. Without it the button paints
   in the global dark glossy gradient and the dark text becomes invisible. */
.pw-continue {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  letter-spacing: 3px;
  color: #1a0f06 !important;
  background: linear-gradient(135deg, #ffb300 0%, #ff8800 100%) !important;
  border: 1px solid #ffb300 !important;
  padding: 14px 36px;
  border-radius: 4px !important;
  cursor: pointer;
  box-shadow:
    0 0 32px rgba(255, 179, 0, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.6s ease 1.85s,
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1.85s,
              box-shadow 0.25s ease,
              filter 0.25s ease;
}
.pw-overlay.active .pw-continue {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.pw-continue:hover,
.pw-continue:active {
  box-shadow:
    0 0 56px rgba(255, 179, 0, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  filter: brightness(1.1);
}
.pw-continue:active {
  transform: translateY(1px) scale(0.99);
}

/* Light theme — soften the night-sky look but keep the gold reveal punchy */
[data-theme="light"] .pw-overlay.active {
  background: radial-gradient(ellipse at center, rgba(40, 28, 14, 0.93), rgba(10, 6, 0, 0.97));
}
[data-theme="light"] .pw-portrait {
  border-color: rgba(255, 140, 0, 0.55);
}
[data-theme="light"] .pw-overlay.active .pw-portrait {
  border-color: var(--accent);
}
