/* One-time Vault door intro — open2077.net Cyberpunk 2077 edition.
   Visual overlay only — never touches playback.
   Animations run only after #vaultIntro.vault-intro-play is set, so the
   closed-door first frame (already in the HTML) can paint with no jump. */
#vaultIntroBootCover { display: none !important; }
html.vault-intro-pending {
  background: #050c16 !important;
  overflow: hidden !important;
}
html.tv-mode #vaultIntro,
html.apk-mode #vaultIntro,
html.tv-mode #vaultIntroBootCover,
html.apk-mode #vaultIntroBootCover {
  display: none !important;
}

#vaultIntro {
  position: fixed;
  inset: 0;
  z-index: 2000001;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050c16;
  color: #00f0ff;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  isolation: isolate;
}
html.vault-intro-pending #vaultIntro {
  display: flex !important;
}
html.vault-intro-pending body.gate-pending > .gate-loader,
html.vault-intro-pending .gate-loader,
html.vault-intro-pending #vaultPending {
  display: none !important;
  visibility: hidden !important;
}
#vaultIntro.vault-intro--reduced { animation: none; }
#vaultIntro.vault-intro-play { animation: vintro-root-out 5.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
#vaultIntro.vault-intro--reduced.vault-intro-play { animation: vintro-reduced 0.55s ease-out forwards; }
#vaultIntro.vault-intro--skipping {
  animation: vintro-skip 0.28s ease-in forwards;
  pointer-events: none;
}
#vaultIntro.vault-intro--done { display: none !important; }

#vaultIntro .vault-intro-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 52% at 50% 46%, rgba(8, 223, 236, 0.16), transparent 58%),
    radial-gradient(ellipse 46% 36% at 18% 22%, rgba(252, 238, 10, 0.14), transparent 64%),
    radial-gradient(ellipse 52% 42% at 84% 82%, rgba(255, 0, 95, 0.16), transparent 68%),
    #050c16;
  pointer-events: none;
}
.vault-intro-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.24;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.6) 2px,
    rgba(0, 0, 0, 0.6) 3px
  );
  mix-blend-mode: multiply;
}
.vault-intro-scanbeam {
  position: absolute;
  left: 0;
  right: 0;
  height: 16%;
  top: -20%;
  pointer-events: none;
  z-index: 6;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(252, 238, 10, 0.12),
    rgba(0, 240, 255, 0.18),
    rgba(255, 0, 95, 0.12),
    transparent
  );
  mix-blend-mode: screen;
  opacity: 0;
}
#vaultIntro.vault-intro-play .vault-intro-scanbeam {
  animation: vintro-scanbeam 5.5s cubic-bezier(0.22, 0.1, 0.25, 1) forwards;
}
.vault-intro-glitch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  mix-blend-mode: screen;
  background: linear-gradient(90deg, rgba(252, 238, 10, 0.22), rgba(0, 240, 255, 0.22) 38%, transparent 55%, rgba(255, 0, 95, 0.24));
}
#vaultIntro.vault-intro-play .vault-intro-glitch {
  animation: vintro-glitch 5.5s steps(2, end) forwards;
}
.vault-intro-chroma {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(252, 238, 10, 0.24) 0, rgba(0, 240, 255, 0.18) 9%, transparent 18%, transparent 82%, rgba(255, 0, 95, 0.26) 100%);
  mix-blend-mode: screen;
}
#vaultIntro.vault-intro-play .vault-intro-chroma {
  animation: vintro-chroma 5.5s ease-out forwards;
}

.vault-intro-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  overflow: hidden;
}
.vintro-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  transform: translateX(0);
}
.vintro-leaf-l { left: 0; }
.vintro-leaf-r { right: 0; }
#vaultIntro.vault-intro-play .vintro-leaf-l {
  animation: vintro-open-l 5.5s cubic-bezier(0.8, 0, 0.15, 1) forwards;
}
#vaultIntro.vault-intro-play .vintro-leaf-r {
  animation: vintro-open-r 5.5s cubic-bezier(0.8, 0, 0.15, 1) forwards;
}

/* Brushed obsidian Blackwall titanium blast doors + yellow hazard trim */
#vaultIntro .vintro-panel {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.56), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.56)),
    linear-gradient(180deg, rgba(252, 238, 10, 0.08), transparent 28%, transparent 72%, rgba(255, 0, 95, 0.10)),
    radial-gradient(circle at 50% 50%, #15253d 0%, #091322 55%, #050c16 100%);
}
#vaultIntro .vintro-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  pointer-events: none;
  opacity: 0.65;
  background: repeating-linear-gradient(
    -45deg,
    rgba(252, 238, 10, 0.55) 0 10px,
    rgba(5, 12, 22, 0.65) 10px 20px
  );
}
#vaultIntro .vintro-leaf-l .vintro-panel::before { right: 6px; }
#vaultIntro .vintro-leaf-r .vintro-panel::before { left: 6px; }

#vaultIntro .vintro-panel-hex,
#vaultIntro .vintro-panel-circuit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#vaultIntro .vintro-panel-hex {
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath fill='none' stroke='%2308dfec' stroke-opacity='0.5' stroke-width='0.8' d='M28 0l28 16v32L28 64 0 48V16zM28 64l28 16v32L28 128 0 112V80z'/%3E%3C/svg%3E");
  background-size: 56px 97px;
}
#vaultIntro.vault-intro-play .vintro-panel-hex {
  animation: vintro-hex-drift 5.5s linear forwards;
}
#vaultIntro .vintro-panel-circuit {
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='none' stroke='%2300f0ff' stroke-opacity='0.48' stroke-width='1.2' d='M8 28h50v24h24M96 28h56M8 108h26V82h52v52M118 80h26v40M36 148h70'/%3E%3Ccircle cx='58' cy='52' r='4' fill='none' stroke='%23fcee0a' stroke-opacity='0.9' stroke-width='1.3'/%3E%3Ccircle cx='88' cy='108' r='4' fill='none' stroke='%2300f0ff' stroke-opacity='0.85' stroke-width='1.2'/%3E%3Ccircle cx='36' cy='148' r='2.4' fill='%23ff005f' fill-opacity='0.85'/%3E%3Ccircle cx='152' cy='28' r='2.4' fill='%23fcee0a' fill-opacity='0.85'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
#vaultIntro .vintro-panel-rivets {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  pointer-events: none;
  background-image: radial-gradient(circle, #fcee0a 0 2px, transparent 2.6px);
  background-size: 18px 36px;
  background-repeat: repeat-y;
  background-position: center 10px;
  opacity: 0.78;
  filter: drop-shadow(0 0 4px rgba(252, 238, 10, 0.78));
}
#vaultIntro .vintro-leaf-l .vintro-panel-rivets { left: 12px; }
#vaultIntro .vintro-leaf-r .vintro-panel-rivets { right: 12px; }
#vaultIntro .vintro-leaf-l .vintro-panel-edge,
#vaultIntro .vintro-leaf-r .vintro-panel-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #fcee0a, #00f0ff 50%, #ff005f, #fcee0a);
  box-shadow: 0 0 14px rgba(252, 238, 10, 0.78), 0 0 26px rgba(0, 240, 255, 0.58);
  opacity: 0.95;
}
#vaultIntro .vintro-leaf-l .vintro-panel-edge { right: 0; }
#vaultIntro .vintro-leaf-r .vintro-panel-edge { left: 0; }

.vintro-lock {
  position: absolute;
  top: 50%;
  width: min(100vw, 100vh);
  height: min(100vw, 100vh);
  z-index: 1;
}
.vintro-leaf-l .vintro-lock { right: 0; transform: translate(50%, -50%); }
.vintro-leaf-r .vintro-lock { left: 0; transform: translate(-50%, -50%); }
.vintro-lock svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 22px rgba(8, 223, 236, 0.34)) drop-shadow(0 0 8px rgba(252, 238, 10, 0.16));
}

.vintro-wheel { transform-box: fill-box; transform-origin: center; }
.vintro-bolt { transform-box: fill-box; transform-origin: center; }
.vintro-bar { transform-box: fill-box; transform-origin: center; }
#vaultIntro.vault-intro-play .vintro-wheel {
  animation: vintro-wheel 5.5s cubic-bezier(0.3, 0.05, 0.25, 1) forwards;
}
#vaultIntro.vault-intro-play .vintro-bolt {
  animation: vintro-bolt 5.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
#vaultIntro.vault-intro-play .vintro-bar {
  animation: vintro-bar 5.5s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}
#vaultIntro.vault-intro-play .vintro-rim-glow {
  animation: vintro-rim 5.5s ease-in-out forwards;
}

#vaultIntro .vintro-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(to bottom, #fcee0a, #00f0ff 50%, #f472b6, #fcee0a);
  box-shadow:
    0 0 12px #fcee0a,
    0 0 24px rgba(0, 240, 255, 0.88),
    0 0 46px rgba(255, 0, 95, 0.55);
  opacity: 0.94;
}
#vaultIntro .vintro-seam-pink {
  width: 1px;
  margin-left: -0.5px;
  background: repeating-linear-gradient(to bottom, #fcee0a 0 6px, #f472b6 6px 10px, transparent 10px 18px);
  box-shadow: 0 0 8px #f472b6;
  opacity: 0.92;
}
#vaultIntro.vault-intro-play .vintro-seam {
  animation: vintro-seam 5.5s ease-in forwards;
}

/* Recolour lock SVG strokes/accents into open2077 yellow / cyan / crimson */
#vaultIntro .vintro-lock .vintro-wheel circle[stroke="#00f0ff"] { stroke: #fcee0a; }
#vaultIntro .vintro-lock .vintro-wheel circle[fill="#00f0ff"] { fill: #fcee0a; }
#vaultIntro .vintro-lock .vintro-wheel rect[stroke="#00f0ff"] { stroke: #fcee0a; }
#vaultIntro .vintro-lock .vintro-bolt rect[fill="#f472b6"] { fill: #fcee0a; }
#vaultIntro .vintro-lock .vintro-bar[stroke="#f472b6"] { stroke: #fcee0a; }

.vault-intro-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  background: #fff;
  box-shadow:
    0 0 22px 10px #fff,
    0 0 55px 24px rgba(252, 238, 10, 0.92),
    0 0 110px 44px rgba(0, 240, 255, 0.82),
    0 0 170px 64px rgba(255, 0, 95, 0.45);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
}
#vaultIntro.vault-intro-play .vault-intro-burst {
  animation: vintro-burst 5.5s ease-out forwards;
}

/* open2077.net Cyberpunk 2077 HUD Console */
#vaultIntro .vault-intro-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #08dfec;
  text-shadow: 0 0 12px rgba(8, 223, 236, 0.55);
  padding: 40px 20px max(30px, calc(env(safe-area-inset-bottom, 0px) + 22px));
  background: linear-gradient(to top, rgba(5, 12, 22, 0.94) 0%, rgba(5, 12, 22, 0.58) 58%, transparent 100%);
}
#vaultIntro .vault-intro-hud::before,
#vaultIntro .vault-intro-hud::after {
  content: "";
  position: fixed;
  width: 34px;
  height: 34px;
  pointer-events: none;
}
#vaultIntro .vault-intro-hud::before {
  top: 22px;
  left: 22px;
  border-top: 2px solid #fcee0a;
  border-left: 2px solid #fcee0a;
}
#vaultIntro .vault-intro-hud::after {
  top: 22px;
  right: 22px;
  border-top: 2px solid #ff005f;
  border-right: 2px solid #ff005f;
}
#vaultIntro .vault-intro-hud-meta {
  display: inline-flex;
  align-items: center;
  padding: 5px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: #fcee0a;
  background: rgba(5, 12, 22, 0.85);
  border: 1px solid rgba(252, 238, 10, 0.52);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
#vaultIntro.vault-intro-play .vault-intro-hud-meta {
  animation: vintro-hud-flicker 5.5s step-end forwards;
}
#vaultIntro .vault-intro-hud-status {
  font-family: "Archivo", "JetBrains Mono", ui-monospace, sans-serif;
  font-style: italic;
  font-size: clamp(18px, 4.2vw, 26px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 2px 0 0 rgba(255, 0, 95, 0.78), 0 0 18px rgba(8, 223, 236, 0.45);
  min-height: 1.4em;
}
#vaultIntro .vault-intro-hud-status[data-phase="granted"] {
  color: #fcee0a;
  letter-spacing: 0.14em;
  font-size: clamp(22px, 5vw, 32px);
  text-shadow:
    3px 0 0 rgba(255, 0, 95, 0.88),
    0 0 16px rgba(252, 238, 10, 0.88),
    0 0 38px rgba(8, 223, 236, 0.65);
}
#vaultIntro.vault-intro-play .vault-intro-hud-status[data-phase="granted"] {
  animation: vintro-granted 0.8s steps(3, end) both;
}
#vaultIntro .vault-intro-skip-hint {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(154, 179, 214, 0.82);
  text-shadow: 0 0 8px rgba(8, 223, 236, 0.35);
}
#vaultIntro .vault-intro-hud-bar {
  width: min(60vw, 320px);
  height: 5px;
  margin-top: 4px;
  background: rgba(8, 223, 236, 0.18);
  border: 1px solid rgba(75, 99, 133, 0.48);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  overflow: hidden;
  position: relative;
}
#vaultIntro .vault-intro-hud-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #fcee0a, #08dfec 56%, #ff005f);
  box-shadow: 0 0 12px rgba(252, 238, 10, 0.85);
}
#vaultIntro.vault-intro-play .vault-intro-hud-bar > i {
  animation: vintro-barfill 3.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes vintro-wheel {
  0%, 18% { transform: rotate(0deg); }
  68% { transform: rotate(155deg); }
  100% { transform: rotate(168deg); }
}
@keyframes vintro-bolt {
  0%, 22% { transform: translate(0, 0) scale(1); opacity: 1; }
  50% { transform: translate(var(--bx, 0), var(--by, 0)) scale(0.7); opacity: 0.25; }
  62%, 100% { transform: translate(var(--bx, 0), var(--by, 0)) scale(0.4); opacity: 0; }
}
@keyframes vintro-bar {
  0%, 24% { transform: scaleX(1); opacity: 1; }
  52% { transform: scaleX(0.12); opacity: 0.35; }
  62%, 100% { transform: scaleX(0); opacity: 0; }
}
@keyframes vintro-seam {
  0%, 45% { opacity: 0.75; width: 3px; margin-left: -1.5px; filter: none; }
  55% { opacity: 1; width: 6px; margin-left: -3px; }
  66% { opacity: 1; width: 12px; margin-left: -6px; }
  80% { opacity: 0.35; width: 22px; margin-left: -11px; }
  100% { opacity: 0; width: 28px; margin-left: -14px; }
}
@keyframes vintro-rim {
  0%, 20% { stroke-opacity: 0.45; }
  50%, 70% { stroke-opacity: 1; }
  100% { stroke-opacity: 0.35; }
}
@keyframes vintro-open-l {
  0%, 72% { transform: translateX(0); }
  96% { transform: translateX(-100%); }
  100% { transform: translateX(-100%); }
}
@keyframes vintro-open-r {
  0%, 72% { transform: translateX(0); }
  96% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
@keyframes vintro-burst {
  0%, 72% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
  76% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  88% { opacity: 0.45; transform: translate(-50%, -50%) scale(22); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(36); }
}
@keyframes vintro-root-out {
  0%, 88% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes vintro-skip { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes vintro-reduced { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes vintro-scanbeam {
  0% { top: -20%; opacity: 0; }
  10% { opacity: 1; }
  75% { top: 90%; opacity: 0.72; }
  100% { top: 110%; opacity: 0; }
}
@keyframes vintro-hex-drift {
  0% { background-position: 0 0; }
  100% { background-position: 0 -48px; }
}
@keyframes vintro-glitch {
  0%, 52%, 58%, 64%, 100% { opacity: 0; transform: none; }
  53% { opacity: 0.85; transform: translate(-6px, 2px) skewX(-4deg); }
  55% { opacity: 0.45; transform: translate(8px, -3px) skewX(6deg); }
  60% { opacity: 0.92; transform: translate(4px, 1px); }
  63% { opacity: 0.38; transform: translate(-10px, 0) skewX(-3deg); }
}
@keyframes vintro-chroma {
  0%, 50% { opacity: 0; }
  54% { opacity: 0.72; }
  62% { opacity: 0.18; }
  68% { opacity: 0.6; }
  78%, 100% { opacity: 0; }
}
@keyframes vintro-hud-flicker {
  0%, 8%, 10%, 100% { opacity: 1; }
  9% { opacity: 0.18; }
  52% { opacity: 0.22; }
  53%, 62% { opacity: 1; }
  63% { opacity: 0.28; }
  64% { opacity: 1; }
}
@keyframes vintro-granted {
  0% { opacity: 0; filter: none; transform: translate(0, 0); }
  12% { opacity: 1; filter: none; }
  20% { opacity: 1; filter: drop-shadow(-3px 0 #00f0ff) drop-shadow(3px 0 #ff005f); transform: translate(-2px, 0); }
  28% { opacity: 0.72; filter: none; transform: translate(2px, 0); }
  36%, 100% { opacity: 1; filter: none; transform: none; }
}
@keyframes vintro-barfill { 0% { width: 0; } 100% { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .vintro-panel-hex,
  .vault-intro-scanbeam,
  .vault-intro-glitch,
  .vault-intro-chroma,
  .vintro-leaf-l,
  .vintro-leaf-r,
  .vintro-wheel,
  .vintro-bolt,
  .vintro-bar,
  .vintro-seam,
  .vintro-rim-glow,
  .vault-intro-burst,
  .vault-intro-hud-bar > i,
  .vault-intro-hud-meta {
    animation: none !important;
  }
  #vaultIntro.vault-intro-play:not(.vault-intro--skipping) {
    animation: vintro-reduced 0.55s ease-out forwards;
  }
}

@media (max-width: 420px) {
  .vault-intro-hud-meta { letter-spacing: 0.16em; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .vault-intro-hud {
    padding: 16px 16px max(12px, env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }
  .vault-intro-hud-status { font-size: 14px; }
  .vault-intro-hud-status[data-phase="granted"] { font-size: 17px; }
}
