/* ======================================================
   Sayonara_Alice.exe — v72.10
   Immersive tablet stage + deterministic dual buffers
   ------------------------------------------------------
   Desktop and mobile compositions from v72.09 are kept.
   This final layer owns only:
   - buffer visibility safety (especially lane B)
   - tablet landscape immersive overlay composition
   - tablet portrait large dual-stage stack
====================================================== */

/* ------------------------------------------------------------------
   1. Deterministic video visibility.
   Never reveal a preload slot just because its lane is enabled.
------------------------------------------------------------------ */
.v72-opening[data-memory-mode="dual"] .v72-opening-video {
  display: block !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.v72-opening[data-memory-mode="dual"] .v72-opening-video.is-prepared,
.v72-opening[data-memory-mode="dual"] .v72-opening-video.is-incoming {
  opacity: 0 !important;
  visibility: visible !important;
}

.v72-opening[data-memory-mode="dual"] .v72-opening-video.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

.v72-opening[data-memory-mode="dual"] .v72-opening-video.is-incoming {
  z-index: 3 !important;
}

/* ------------------------------------------------------------------
   2. Tablet landscape / compact desktop.
   The two portraits fill the scene. Copy overlays the lower-left area
   of memory A instead of shrinking the whole stage to make room.
------------------------------------------------------------------ */
@media (min-width: 700px) and (max-width: 1199px) and
       (min-height: 600px) and (orientation: landscape) {
  .v72-opening[data-memory-mode="dual"] {
    --v72-tablet-landscape-stage: min(95vw, 1080px);
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-shell {
    position: relative !important;
    width: 100% !important;
    min-height: 100svh !important;
    padding: clamp(.75rem, 1.8vw, 1.2rem) clamp(.8rem, 2.2vw, 1.5rem) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    row-gap: clamp(.45rem, 1.2vh, .85rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-header {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-dual-memory-stage {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    width: var(--v72-tablet-landscape-stage) !important;
    max-width: var(--v72-tablet-landscape-stage) !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: calc(100svh - 5.6rem) !important;
    aspect-ratio: 1040 / 686 !important;
    margin: 0 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-copy {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: start !important;
    width: min(42vw, 25rem) !important;
    max-width: min(42vw, 25rem) !important;
    margin: clamp(1rem, 4vw, 3rem) 0 0 clamp(.75rem, 2.5vw, 1.8rem) !important;
    padding: 0 !important;
    transform: translateY(15%) !important;
    text-align: left !important;
    z-index: 14 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-copy::before {
    inset: -2.8rem -3.2rem -2.9rem -2.6rem !important;
    opacity: calc(var(--v72-adaptive-copy-surface) + .23) !important;
    background:
      radial-gradient(ellipse at 25% 52%, rgb(1 4 12 / .99) 0%, rgb(1 4 12 / .9) 37%, rgb(1 4 12 / .55) 59%, transparent 84%) !important;
    filter: blur(10px) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-kicker,
  .v72-opening[data-memory-mode="dual"] .v72-opening-actions {
    justify-content: flex-start !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-sayonara {
    font-size: clamp(2.45rem, 5.7vw, 4.55rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-alice {
    font-size: clamp(2.95rem, 6.8vw, 5.35rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-subtitle {
    width: 100% !important;
    max-width: 23rem !important;
    margin: clamp(.7rem, 1.4vh, 1rem) 0 0 !important;
    text-align: left !important;
    font-size: clamp(.78rem, 1.45vw, .98rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-actions {
    width: 100% !important;
    max-width: 24rem !important;
    margin: clamp(.72rem, 1.5vh, 1.05rem) 0 0 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-enter,
  .v72-opening[data-memory-mode="dual"] .v72-archive-link {
    min-height: 40px !important;
    padding: .65rem .9rem !important;
    font-size: clamp(.55rem, 1.05vw, .67rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-footer {
    grid-column: 1 !important;
    grid-row: 3 !important;
    position: relative !important;
  }
}

/* Very short tablet landscape: preserve the full-width stage and compact
   only the copy, never the portraits. */
@media (min-width: 700px) and (max-width: 1199px) and
       (min-height: 600px) and (max-height: 760px) and
       (orientation: landscape) {
  .v72-opening[data-memory-mode="dual"] {
    --v72-tablet-landscape-stage: min(93vw, 980px);
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-copy {
    width: min(38vw, 22rem) !important;
    max-width: min(38vw, 22rem) !important;
    transform: translateY(12%) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-sayonara {
    font-size: clamp(2.15rem, 5.1vw, 3.85rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-alice {
    font-size: clamp(2.6rem, 6.05vw, 4.55rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-footer {
    display: none !important;
  }
}

/* ------------------------------------------------------------------
   3. Tablet portrait.
   Keep both portraits large (nearly viewport width), then place a compact
   centred copy directly below. No thumbnail stage, no giant dead zone.
------------------------------------------------------------------ */
@media (min-width: 700px) and (max-width: 1199px) and
       (min-height: 600px) and (orientation: portrait) {
  .v72-opening[data-memory-mode="dual"] {
    --v72-tablet-portrait-stage: min(96vw, 62rem);
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-shell {
    position: relative !important;
    width: 100% !important;
    min-height: 100svh !important;
    padding: clamp(.8rem, 2.2vw, 1.35rem) clamp(.75rem, 2vw, 1.25rem) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto auto !important;
    align-content: center !important;
    justify-items: center !important;
    row-gap: clamp(.55rem, 1.35vh, 1rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-header {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: relative !important;
    inset: auto !important;
    width: min(96vw, 62rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-dual-memory-stage {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    width: var(--v72-tablet-portrait-stage) !important;
    max-width: var(--v72-tablet-portrait-stage) !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 1040 / 686 !important;
    margin: 0 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-copy {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: start !important;
    justify-self: center !important;
    width: min(88vw, 38rem) !important;
    max-width: min(88vw, 38rem) !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    text-align: center !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-copy::before {
    inset: -1.35rem -2rem -1.4rem !important;
    opacity: calc(var(--v72-adaptive-copy-surface) + .14) !important;
    background: radial-gradient(ellipse at 50% 48%, rgb(1 4 12 / .96), rgb(1 4 12 / .65) 54%, transparent 85%) !important;
    filter: blur(8px) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-kicker,
  .v72-opening[data-memory-mode="dual"] .v72-opening-actions {
    justify-content: center !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-sayonara {
    font-size: clamp(2.75rem, 7.2vw, 5rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-title-alice {
    font-size: clamp(3.25rem, 8.55vw, 5.9rem) !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-subtitle {
    width: 100% !important;
    max-width: 31rem !important;
    margin: clamp(.55rem, 1.15vh, .85rem) auto 0 !important;
    text-align: center !important;
    font-size: clamp(.78rem, 1.8vw, 1rem) !important;
    line-height: 1.38 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-actions {
    width: min(78vw, 31rem) !important;
    max-width: min(78vw, 31rem) !important;
    margin: clamp(.62rem, 1.25vh, .9rem) auto 0 !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-enter,
  .v72-opening[data-memory-mode="dual"] .v72-archive-link {
    min-height: 42px !important;
  }

  .v72-opening[data-memory-mode="dual"] .v72-opening-footer {
    grid-column: 1 !important;
    grid-row: 4 !important;
    position: relative !important;
    width: min(96vw, 62rem) !important;
  }
}

/* Keep the already approved single-video mobile layout untouched. */
