/* ==========================================================================
   TIGER TIME SPORTS LOUNGE // THE VAULT (entrance styles)
   Obsidian #0b0d10 · gold leaf #d4af37 · intaglio guilloche
   Desktop: 50 / 50 split (Kinetic Zoetrope console | Leona companion stage)
   Phone:   the zoetrope owns the screen (92vw, max 440px, 1:1, centered)
   ========================================================================== */
.vault-entrance {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 50% 50%;
  background:
    radial-gradient(ellipse 60% 70% at 25% 45%, #16181d 0%, #0b0d10 70%),
    #0b0d10;
  color: #efe6cf;
  overflow: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

.vault-entrance[hidden] {
  display: none;
}

.vault-entrance.vault-exit {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(4px);
  pointer-events: none;
}

body.vault-open #app-root {
  visibility: hidden;
}

.vault-guilloche {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
}

/* ---------------- LEFT: THE CONSOLE ---------------- */
.vault-console {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 16px);
  padding: 3vh 3vw;
  box-sizing: border-box;
  border-right: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 1px 0 0 rgba(212, 175, 55, 0.12), 18px 0 60px rgba(0, 0, 0, 0.6);
}

.vault-head {
  text-align: center;
}

.vault-mark {
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #efe6cf;
}

.vault-sub {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #d4af37;
}

.zoetrope-mount {
  width: min(42vw, 60vh);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 24px rgba(212, 175, 55, 0.16));
}

.vault-gauge {
  width: min(42vw, 60vh);
  display: flex;
  align-items: center;
  gap: 10px;
}

.vault-gauge-track {
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  background: #15171c;
  border: 0.5px solid rgba(212, 175, 55, 0.5);
}

.vault-gauge-track > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #6b5418, #d4af37, #ffe5a0);
}

.vault-gauge-mark {
  position: absolute;
  left: 50%;
  top: -5px;
  bottom: -5px;
  width: 1px;
  background: #ffe5a0;
  box-shadow: 0 0 6px #d4af37;
}

.vault-gauge-mark::after {
  content: "45";
  position: absolute;
  top: -14px;
  left: -6px;
  font-size: 9px;
  font-weight: 800;
  color: #d4af37;
}

.vault-gauge output {
  flex: 0 0 74px;
  text-align: right;
  font-style: italic;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transform: skewX(-7deg);
  color: #d4af37;
}

.vault-gauge.is-past output {
  color: #ffe5a0;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

/* Gold-beveled one-tap trigger */
.vault-reveal-btn {
  position: relative;
  padding: 14px 34px;
  font-size: 15px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0b0d10;
  background: linear-gradient(180deg, #f6e3a1 0%, #d4af37 46%, #a07c22 54%, #c79c35 100%);
  border: 1px solid #f7e7b0;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px #5a4614,
    0 0 0 4px rgba(212, 175, 55, 0.18),
    0 10px 26px rgba(212, 175, 55, 0.32);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.vault-reveal-btn:hover {
  filter: brightness(1.08);
}

.vault-reveal-btn:active {
  transform: translateY(1px);
}

.vault-reveal-btn:focus-visible,
.vault-enter-btn:focus-visible {
  outline: 1px dashed #ffe5a0;
  outline-offset: 4px;
}

.vault-hint {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #9a917c;
}

.vault-beats {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vault-beats li {
  padding: 4px 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5d5748;
  border: 0.5px solid rgba(212, 175, 55, 0.22);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.vault-beats li.is-done {
  color: #a8945d;
  border-color: rgba(212, 175, 55, 0.4);
}

.vault-beats li.is-current {
  color: #0b0d10;
  background: #d4af37;
  border-color: #ffe5a0;
}

.vault-enter-btn {
  display: none;
  padding: 9px 22px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #d4af37;
  background: transparent;
  border: 1px solid #d4af37;
  border-radius: 0;
  cursor: pointer;
}

.vault-entrance.is-revealed .vault-enter-btn {
  display: inline-block;
  animation: vaultPulse 1.4s ease-in-out infinite;
}

@keyframes vaultPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0); }
}

.vault-status {
  margin: 0;
  min-height: 1em;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #6f6853;
}

/* ---------------- RIGHT: LEONA COMPANION STAGE ---------------- */
.vault-stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0b0d10;
}

/* Five Leona scenes stacked; data-scene on the stage picks the live one */
.leona-scene {
  position: absolute;
  inset: -2%;
  background-image: var(--scene-img);
  background-position: var(--scene-pos, 50% 50%);
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  filter: contrast(1.05) brightness(0.92);
  transition: opacity 0.7s ease;
}

.vault-stage[data-scene="1"] .leona-scene[data-scene="1"],
.vault-stage[data-scene="2"] .leona-scene[data-scene="2"],
.vault-stage[data-scene="3"] .leona-scene[data-scene="3"],
.vault-stage[data-scene="4"] .leona-scene[data-scene="4"],
.vault-stage[data-scene="5"] .leona-scene[data-scene="5"] {
  opacity: 1;
}

/* sleeping scenes breathe */
.leona-scene[data-scene="1"],
.leona-scene[data-scene="2"] {
  animation: leonaBreathe 7s ease-in-out infinite;
}

@keyframes leonaBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* eyes on the bars: a hard, fast cut with a slow push-in */
.leona-scene[data-scene="4"] {
  transition: opacity 0.18s ease;
  transform: scale(1.06);
}

.vault-stage[data-scene="4"] .leona-scene[data-scene="4"] {
  transform: scale(1);
  transition: opacity 0.18s ease, transform 2.4s ease-out;
}

/* the roar: punches in from scale */
.leona-scene[data-scene="5"] {
  transform: scale(1.14);
  transition: opacity 0.3s ease, transform 1.4s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.vault-stage[data-scene="5"] .leona-scene[data-scene="5"] {
  transform: scale(1);
}

.vault-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 60% 45%, transparent 40%, rgba(11, 13, 16, 0.85) 100%),
    linear-gradient(90deg, rgba(11, 13, 16, 0.9) 0%, transparent 18%);
}

.vault-bars {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  padding: 0 5%;
  pointer-events: none;
}

.vault-bars i {
  width: 1.5%;
  min-width: 7px;
  height: 100%;
  opacity: 0; /* the painted scenes carry their own bars; these only appear to shatter */
  background: linear-gradient(90deg, #121317 0%, #5f5a4c 32%, #d4af37 50%, #5f5a4c 68%, #101114 100%);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.85);
}

@keyframes barShatter {
  0% { opacity: 0; transform: none; }
  28% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, -300px)) rotate(var(--r, 20deg)); }
}

.vault-flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 55% 40%, rgba(255, 240, 200, 0.95), rgba(212, 175, 55, 0.4) 40%, transparent 70%);
}

.vault-stage-copy {
  position: absolute;
  left: 7%;
  bottom: 14%;
  z-index: 4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2.6vw, 40px);
  font-style: italic;
  letter-spacing: 0.04em;
  color: #f3ead2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

.vault-stage-line {
  display: none;
}

.vault-stage[data-scene="1"] .vault-stage-line[data-scene="1"],
.vault-stage[data-scene="2"] .vault-stage-line[data-scene="2"],
.vault-stage[data-scene="3"] .vault-stage-line[data-scene="3"],
.vault-stage[data-scene="4"] .vault-stage-line[data-scene="4"],
.vault-stage[data-scene="5"] .vault-stage-line[data-scene="5"] {
  display: block;
}

.vault-stage-line[data-scene="5"] {
  color: #ffe5a0;
}

.vault-telemetry {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 5%;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(212, 175, 55, 0.5);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #8d846c;
}

.vault-telemetry b {
  font-family: "Segoe UI", Helvetica, sans-serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.06em;
  color: #d4af37;
}

.vault-telemetry small {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: #6f6853;
}

/* ---------------- THE UNLOCK (beats III -> IV) ---------------- */
.vault-stage.bars-unlocked .vault-bars {
  animation: barsRattle 0.09s linear 0s 5;
}

@keyframes barsRattle {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

.vault-stage.bars-unlocked .vault-bars i {
  animation: barShatter 1.25s cubic-bezier(0.3, 1.2, 0.4, 1) calc(0.35s + var(--i, 0) * 40ms) both;
}

.vault-stage.bars-unlocked .vault-flash {
  animation: vaultFlash 0.7s ease-out 0.5s 1;
}

@keyframes vaultFlash {
  0% { opacity: 0; }
  15% { opacity: 0.85; }
  100% { opacity: 0; }
}

.vault-stage.bars-unlocked {
  animation: roarShake 0.12s linear 0.5s 6;
}

@keyframes roarShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 2px); }
  75% { transform: translate(4px, -2px); }
}

@media (prefers-reduced-motion: reduce) {
  .leona-scene,
  .vault-stage.bars-unlocked,
  .vault-stage.bars-unlocked .vault-bars,
  .vault-stage.bars-unlocked .vault-bars i,
  .vault-entrance.is-revealed .vault-enter-btn {
    animation: none;
  }
}

/* ---------------- PHONE: THE ZOETROPE OWNS THE SCREEN ---------------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 900px) {
  .vault-entrance {
    grid-template-columns: 100%;
  }

  .vault-console {
    grid-row: 1;
    grid-column: 1;
    width: 100vw;
    border-right: none;
    box-shadow: none;
    justify-content: center;
    padding: 2vh 4vw;
  }

  .zoetrope-mount {
    width: 92vw;
    max-width: 440px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  .vault-gauge {
    width: 92vw;
    max-width: 440px;
  }

  .vault-reveal-btn {
    width: 92vw;
    max-width: 440px;
  }

  /* Leona sits behind the wheel and erupts on the unlock */
  .vault-stage {
    position: absolute;
    inset: 0;
    grid-row: 1;
    grid-column: 1;
    opacity: 0.18;
    transition: opacity 0.4s ease 0.5s;
  }

  .vault-stage.bars-unlocked {
    opacity: 0.55;
  }

  /* portrait cut of the roar for tall screens */
  .leona-scene[data-scene="5"] {
    background-image: var(--scene-img-phone, var(--scene-img));
    background-position: var(--scene-pos-phone, var(--scene-pos, 50% 50%));
  }

  .vault-stage-copy,
  .vault-telemetry {
    display: none;
  }

  .vault-beats li {
    padding: 3px 5px;
    font-size: 8.5px;
    letter-spacing: 0.06em;
  }
}

@media (max-height: 640px) {
  .vault-hint,
  .vault-status {
    display: none;
  }
}
