/* Ultra-clear crystal optical glass & gentle full-size 3D parallax stage for WANLI */

/* Gentle 3D perspective stage & -5% overscan bleed to preserve full-size artwork without edge gaps */
.scene {
  perspective: 1200px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  touch-action: none;
}

.screen {
  touch-action: none;
}

.screen.scrollable {
  touch-action: pan-y;
}

.ly {
  inset: -5%;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: none;
  transform:
    translateZ(calc((var(--d, 0.5) - 0.5) * 14px))
    rotateX(calc(var(--cam-rx, 0deg) * (0.85 + var(--d, 0.5) * 0.20)))
    rotateY(calc(var(--cam-ry, 0deg) * (0.85 + var(--d, 0.5) * 0.20)))
    scale(1);
  will-change: transform;
}

/* Keep foreground overlay aligned with full-size scene bounds */
.ly-ov {
  inset: -5%;
}

/* Replace layout-based margin-left drift with compositor-only camera.js ambient motion */
.scene.drift .ly {
  animation: none !important;
}

/* Keep bottom mist scrim minimal so scenery details stay crisp behind crystal glass */
.mist {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 68%,
    rgba(243, 236, 221, 0.02) 88%,
    rgba(18, 22, 34, 0.04) 100%
  );
}

/* Top-left minimalist crystal-glass trail & altitude pill */
.elev-bar {
  position: absolute;
  left: 14px;
  top: calc(12px + var(--sat));
  z-index: 9;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  max-width: calc(100% - 66px);
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.14) 55%,
    rgba(255, 255, 255, 0.08) 100%
  );
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow:
    0 6px 20px rgba(15, 22, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  color: #121722;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
  transition: opacity 0.45s ease;
}

.elev-bar.hide {
  opacity: 0;
}

.elev-bar.on-dark {
  background: linear-gradient(
    155deg,
    rgba(12, 16, 26, 0.28),
    rgba(10, 14, 22, 0.18)
  );
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow:
    0 6px 20px rgba(6, 8, 14, 0.22),
    inset 0 1px 0 rgba(255, 250, 240, 0.32),
    inset 0 -1px 0 rgba(255, 250, 240, 0.10);
  color: #fffcf5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

@media (min-width: 600px) {
  .elev-bar {
    max-width: calc(100% - 158px);
  }
}

.elev-svg {
  width: 58px;
  height: 15px;
  flex: none;
  display: block;
  overflow: visible;
}

.elev-val {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  white-space: nowrap;
  flex: none;
}

.elev-pl {
  font-size: 11px;
  letter-spacing: 1.5px;
  opacity: .88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Diegetic Canvas 2D layer & zero-jump whisper cue */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  pointer-events: auto;
  touch-action: none;
}

.fx-cue {
  margin-top: 0;
  font-size: 11.5px;
  letter-spacing: 3px;
  color: rgba(18, 23, 34, 0.88);
  text-align: center;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
  animation: breathe 2.4s ease-in-out infinite;
}

.slip.glass-dark .fx-cue,
.screen[data-beat="bus"] .slip .fx-cue,
.screen[data-beat="window"] .slip .fx-cue,
.screen[data-beat="chonggu"] .slip .fx-cue,
.screen[data-beat="meadow"] .slip .fx-cue,
.screen[data-beat="meet"] .slip .fx-cue,
.screen[data-beat="xianuoduoji"] .slip .fx-cue,
.screen[data-beat="pearl_1"] .slip .fx-cue,
.screen[data-beat="pearl_2"] .slip .fx-cue,
.screen[data-beat="farewell"] .slip .fx-cue,
.screen[data-beat="hearth"] .slip .fx-cue {
  color: rgba(255, 252, 245, 0.92);
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

/* Top-left weather pill: positioned cleanly below .elev-bar */
.wtag {
  top: calc(48px + var(--sat));
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.14) 55%,
    rgba(255, 255, 255, 0.08) 100%
  );
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow:
    0 6px 20px rgba(15, 22, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  color: #121722;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
}

.wtag i {
  box-shadow: 0 0 6px rgba(226, 179, 90, 0.65);
}

/* Light crystal optical glass card (bright snow, sky, highland water) */
.slip {
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.14) 52%,
    rgba(255, 255, 255, 0.08) 100%
  );
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow:
    0 12px 32px rgba(15, 22, 34, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  color: #121722;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
}

.slip .head,
.slip .hint {
  color: rgba(18, 23, 34, 0.88);
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
}

.slip .head .no,
.slip .interact-hint {
  color: #c43820;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
}

.slip .head .pl,
.slip .t {
  color: #121722;
}

.slip .done-note {
  color: #194f59;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
}

.slip .hold-bar {
  background: rgba(18, 23, 34, 0.20);
}

.slip .hold-bar i {
  background: #c43820;
}

/* Choice & tactile pills on light crystal glass */
.choice button,
.slip .interact-pill {
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 3px 12px rgba(15, 22, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
  color: #121722;
  text-shadow:
    0 1px 3px rgba(255, 255, 255, 0.94),
    0 0 10px rgba(255, 255, 255, 0.65);
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease;
}

.choice button:active,
.slip .interact-pill:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.22);
}

.choice button b {
  color: #c43820;
}

/* Ultra-sheer dark crystal optical glass (.glass-dark + shadowed/dusk/night beats) */
.slip.glass-dark,
.screen[data-beat="bus"] .slip,
.screen[data-beat="window"] .slip,
.screen[data-beat="chonggu"] .slip,
.screen[data-beat="meadow"] .slip,
.screen[data-beat="meet"] .slip,
.screen[data-beat="xianuoduoji"] .slip,
.screen[data-beat="pearl_1"] .slip,
.screen[data-beat="pearl_2"] .slip,
.screen[data-beat="farewell"] .slip,
.screen[data-beat="hearth"] .slip {
  background: linear-gradient(
    155deg,
    rgba(12, 16, 26, 0.24),
    rgba(10, 14, 22, 0.14)
  );
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow:
    0 12px 32px rgba(6, 8, 14, 0.24),
    inset 0 1px 0 rgba(255, 250, 240, 0.32),
    inset 0 -1px 0 rgba(255, 250, 240, 0.10);
  color: #fffcf5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .head,
.slip.glass-dark .hint,
.screen[data-beat="bus"] .slip .head,
.screen[data-beat="bus"] .slip .hint,
.screen[data-beat="window"] .slip .head,
.screen[data-beat="window"] .slip .hint,
.screen[data-beat="chonggu"] .slip .head,
.screen[data-beat="chonggu"] .slip .hint,
.screen[data-beat="meadow"] .slip .head,
.screen[data-beat="meadow"] .slip .hint,
.screen[data-beat="meet"] .slip .head,
.screen[data-beat="meet"] .slip .hint,
.screen[data-beat="xianuoduoji"] .slip .head,
.screen[data-beat="xianuoduoji"] .slip .hint,
.screen[data-beat="pearl_1"] .slip .head,
.screen[data-beat="pearl_1"] .slip .hint,
.screen[data-beat="pearl_2"] .slip .head,
.screen[data-beat="pearl_2"] .slip .hint,
.screen[data-beat="farewell"] .slip .head,
.screen[data-beat="farewell"] .slip .hint,
.screen[data-beat="hearth"] .slip .head,
.screen[data-beat="hearth"] .slip .hint {
  color: rgba(255, 252, 245, 0.92);
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .head .no,
.slip.glass-dark .choice button b,
.screen[data-beat="bus"] .slip .head .no,
.screen[data-beat="window"] .slip .head .no,
.screen[data-beat="chonggu"] .slip .head .no,
.screen[data-beat="chonggu"] .slip .choice button b,
.screen[data-beat="meadow"] .slip .head .no,
.screen[data-beat="meet"] .slip .head .no,
.screen[data-beat="meet"] .slip .choice button b,
.screen[data-beat="xianuoduoji"] .slip .head .no,
.screen[data-beat="pearl_1"] .slip .head .no,
.screen[data-beat="pearl_2"] .slip .head .no,
.screen[data-beat="pearl_2"] .slip .choice button b,
.screen[data-beat="farewell"] .slip .head .no,
.screen[data-beat="hearth"] .slip .head .no {
  color: #ff9c82;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .head .pl,
.slip.glass-dark .done-note,
.screen[data-beat="bus"] .slip .head .pl,
.screen[data-beat="window"] .slip .head .pl,
.screen[data-beat="chonggu"] .slip .head .pl,
.screen[data-beat="chonggu"] .slip .done-note,
.screen[data-beat="meadow"] .slip .head .pl,
.screen[data-beat="meet"] .slip .head .pl,
.screen[data-beat="meet"] .slip .done-note,
.screen[data-beat="xianuoduoji"] .slip .head .pl,
.screen[data-beat="pearl_1"] .slip .head .pl,
.screen[data-beat="pearl_2"] .slip .head .pl,
.screen[data-beat="pearl_2"] .slip .done-note,
.screen[data-beat="farewell"] .slip .head .pl,
.screen[data-beat="hearth"] .slip .head .pl,
.screen[data-beat="hearth"] .slip .done-note {
  color: #f7e3b5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .t,
.screen[data-beat="bus"] .slip .t,
.screen[data-beat="window"] .slip .t,
.screen[data-beat="chonggu"] .slip .t,
.screen[data-beat="meadow"] .slip .t,
.screen[data-beat="meet"] .slip .t,
.screen[data-beat="xianuoduoji"] .slip .t,
.screen[data-beat="pearl_1"] .slip .t,
.screen[data-beat="pearl_2"] .slip .t,
.screen[data-beat="farewell"] .slip .t,
.screen[data-beat="hearth"] .slip .t {
  color: #fffcf5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .interact-hint,
.screen[data-beat="chonggu"] .slip .interact-hint,
.screen[data-beat="meet"] .slip .interact-hint,
.screen[data-beat="pearl_2"] .slip .interact-hint,
.screen[data-beat="hearth"] .slip .interact-hint {
  color: #ffbfa8;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .hold-bar,
.screen[data-beat="meet"] .slip .hold-bar {
  background: rgba(255, 250, 240, 0.24);
}

.slip.glass-dark .hold-bar i,
.screen[data-beat="meet"] .slip .hold-bar i {
  background: #ff9c82;
}

.slip.glass-dark .choice button,
.slip.glass-dark .interact-pill,
.screen[data-beat="chonggu"] .slip .choice button,
.screen[data-beat="chonggu"] .slip .interact-pill,
.screen[data-beat="meet"] .slip .choice button,
.screen[data-beat="meet"] .slip .interact-pill,
.screen[data-beat="pearl_2"] .slip .choice button,
.screen[data-beat="pearl_2"] .slip .interact-pill,
.screen[data-beat="hearth"] .slip .interact-pill {
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 3px 12px rgba(6, 8, 14, 0.16),
    inset 0 1px 0 rgba(255, 250, 240, 0.32);
  color: #fffcf5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

.slip.glass-dark .choice button:active,
.slip.glass-dark .interact-pill:active,
.screen[data-beat="chonggu"] .slip .choice button:active,
.screen[data-beat="chonggu"] .slip .interact-pill:active,
.screen[data-beat="meet"] .slip .choice button:active,
.screen[data-beat="meet"] .slip .interact-pill:active,
.screen[data-beat="pearl_2"] .slip .choice button:active,
.screen[data-beat="pearl_2"] .slip .interact-pill:active,
.screen[data-beat="hearth"] .slip .interact-pill:active {
  background: rgba(255, 255, 255, 0.20);
}

/* Curtain prompt pill: sheer smoky crystal */
.curtain-hint {
  background: linear-gradient(
    155deg,
    rgba(12, 16, 26, 0.32) 0%,
    rgba(10, 14, 22, 0.20) 100%
  );
  -webkit-backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  backdrop-filter: blur(2px) saturate(140%) contrast(1.02);
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow:
    0 8px 24px rgba(12, 16, 24, 0.22),
    inset 0 1px 0 rgba(255, 250, 240, 0.32);
  color: #fffcf5;
  text-shadow:
    0 1px 3px rgba(6, 8, 14, 0.92),
    0 0 10px rgba(6, 8, 14, 0.55);
}

/* Non-backdrop-filter fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .elev-bar,
  .wtag {
    background: rgba(250, 251, 254, 0.86);
  }
  .elev-bar.on-dark {
    background: rgba(14, 18, 28, 0.84);
  }
  .slip {
    background: linear-gradient(155deg, rgba(252, 250, 246, 0.88), rgba(242, 246, 250, 0.82));
  }
  .choice button,
  .slip .interact-pill {
    background: rgba(255, 255, 255, 0.84);
  }
  .slip.glass-dark,
  .screen[data-beat="bus"] .slip,
  .screen[data-beat="window"] .slip,
  .screen[data-beat="chonggu"] .slip,
  .screen[data-beat="meadow"] .slip,
  .screen[data-beat="meet"] .slip,
  .screen[data-beat="xianuoduoji"] .slip,
  .screen[data-beat="pearl_1"] .slip,
  .screen[data-beat="pearl_2"] .slip,
  .screen[data-beat="farewell"] .slip,
  .screen[data-beat="hearth"] .slip {
    background: linear-gradient(155deg, rgba(14, 18, 28, 0.86), rgba(10, 14, 22, 0.80));
  }
  .slip.glass-dark .choice button,
  .slip.glass-dark .interact-pill,
  .screen[data-beat="chonggu"] .slip .choice button,
  .screen[data-beat="chonggu"] .slip .interact-pill,
  .screen[data-beat="meet"] .slip .choice button,
  .screen[data-beat="meet"] .slip .interact-pill,
  .screen[data-beat="pearl_2"] .slip .choice button,
  .screen[data-beat="pearl_2"] .slip .interact-pill,
  .screen[data-beat="hearth"] .slip .interact-pill {
    background: rgba(34, 40, 56, 0.78);
  }
  .curtain-hint {
    background: rgba(14, 18, 28, 0.84);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ly {
    transform: none !important;
  }
  .fx-cue {
    animation: none !important;
  }
  .elev-bar {
    transition-duration: .18s !important;
  }
}
