/* Full-Bleed First-Person Interactive Cinema Stage (/theater) — Mobile & Desktop Polished */
.cinema-body {
  margin: 0;
  padding: 0;
  background: #03060d;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cinema-body.archive-open {
  overflow-y: auto;
}

/* Full-Viewport Camera Stage */
.cinema-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #03060d;
  z-index: 1;
}

/* Exact 1376x768 Aspect-Locked World Layer driven by smooth rAF camera physics */
.cinema-world {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0) scale(1);
  transform-origin: 50% 50%;
  will-change: transform;
}

.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* Volumetric Mist & Soft Edge Vignette */
.cinema-vignette {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(3, 6, 13, 0) 42%, rgba(3, 6, 13, 0.72) 100%),
    linear-gradient(180deg, rgba(3, 6, 13, 0.72) 0%, rgba(3, 6, 13, 0) 16%, rgba(3, 6, 13, 0) 66%, rgba(3, 6, 13, 0.94) 100%);
}

/* Gentle Volumetric Mist Crossfade Overlay (No harsh jarring flash) */
.cinema-veil {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(242, 218, 166, 0.28) 0%, rgba(5, 9, 18, 0.98) 76%);
  transition: opacity 0.85s cubic-bezier(0.32, 0.08, 0.24, 1);
}
.cinema-veil.active { opacity: 1; }

/* Ambient Dust & Organic Guiding Fireflies Canvas */
#dust-canvas {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.78;
}

/* ======================================================
   IN-WORLD INTERACTIVE LAYERS (Inside .cinema-world)
   ====================================================== */
.world-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s ease;
}
.world-layer.active {
  opacity: 1;
  pointer-events: auto;
}

/* --- Act I: Keeper Astrolabe Threshold Beacon --- */
.sanctuary-beacon {
  position: absolute;
  left: 50%;
  top: 67%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #f6e7c5;
  padding: 14px;
}
.beacon-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(235, 210, 155, 0.75);
  background: radial-gradient(circle, rgba(235, 210, 155, 0.28) 0%, rgba(216, 180, 106, 0.03) 68%, transparent 100%);
  box-shadow: 0 0 32px rgba(216, 180, 106, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: pulseSoft 3.2s ease-in-out infinite;
}
.sanctuary-beacon:hover .beacon-ring {
  transform: scale(1.1);
  box-shadow: 0 0 54px rgba(235, 210, 155, 0.78);
}
.beacon-caption {
  font-family: var(--font-serif);
  font-size: 14.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.96);
  background: rgba(5, 9, 18, 0.64);
  border: 1px solid rgba(216, 180, 106, 0.38);
  padding: 6px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

/* --- Act II: Architectural Door Hotspots (Directly Over the 3 Stone Doors) --- */
.door-hotspot {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 48% 48% 4px 4px / 22% 22% 4px 4px;
  overflow: visible;
  transition: opacity 0.6s ease;
}
.door-aura {
  position: absolute;
  inset: -3%;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.55s ease;
  box-shadow: inset 0 0 42px var(--door-accent, rgba(216, 180, 106, 0.45)),
              0 0 48px var(--door-accent, rgba(216, 180, 106, 0.36));
  border: 1px solid rgba(240, 218, 170, 0.42);
  pointer-events: none;
}
.door-hotspot:hover .door-aura,
.door-hotspot.focused .door-aura,
.door-hotspot.opening .door-aura {
  opacity: 1;
}

/* Soft Volumetric Light Seam Parting When Chosen Door Opens */
.door-seam {
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 2%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.92), var(--door-accent, #ebd29b));
  box-shadow: 0 0 24px 6px var(--door-accent, rgba(235, 210, 155, 0.68));
  opacity: 0;
  transition: width 1.45s cubic-bezier(0.22, 0.08, 0.22, 1), opacity 0.55s ease, filter 1.2s ease;
  pointer-events: none;
  border-radius: 45% 45% 2px 2px;
  filter: blur(1px);
}
.door-hotspot:hover .door-seam { opacity: 0.38; width: 3px; }
.door-hotspot.opening .door-seam {
  opacity: 0.96;
  width: 86%;
  filter: blur(8px);
  box-shadow: 0 0 84px 36px var(--door-accent, rgba(245, 222, 168, 0.85));
}

.diegetic-tag {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}
.door-hotspot:hover .diegetic-tag,
.door-hotspot.focused .diegetic-tag {
  transform: translate(-50%, -56%) scale(1.05);
}
.door-hotspot.opening .diegetic-tag,
.door-hotspot.dimmed {
  opacity: 0.16;
  pointer-events: none;
}

.tag-diamond {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: 1px solid rgba(242, 220, 170, 0.9);
  background: rgba(235, 210, 155, 0.32);
  box-shadow: 0 0 18px rgba(235, 210, 155, 0.72);
  animation: pulseSoft 2.8s ease-in-out infinite;
}
.tag-title {
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.3vw, 19px);
  color: #faf5e8;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(5, 9, 18, 0.65);
  border: 1px solid rgba(216, 180, 106, 0.38);
  backdrop-filter: blur(8px);
}
.tag-sub {
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d8b46a;
  text-shadow: 0 2px 10px #000;
}

/* --- Act III: Real Crossroads Path Beacons & Organic Guiding Light Canvas --- */
#trail-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.path-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 12px 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
}
.path-hotspot:hover, .path-hotspot.focused {
  transform: translate(-50%, -56%) scale(1.06);
}
.path-hotspot.dimmed { opacity: 0.14; pointer-events: none; }

.path-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(235, 210, 155, 0.85);
  background: radial-gradient(circle, rgba(235, 210, 155, 0.4) 0%, rgba(216, 180, 106, 0.05) 68%, transparent 100%);
  box-shadow: 0 0 28px rgba(235, 210, 155, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf5e8;
  font-family: var(--font-serif);
  font-size: 15px;
  animation: pulseSoft 2.8s ease-in-out infinite;
}

/* --- Act IV: Organic In-Scene Ritual Halo Over the Actual Lantern / Window --- */
.ritual-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 8;
}
.ritual-ring-outer {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1.5px solid rgba(242, 218, 165, 0.88);
  background: radial-gradient(circle, rgba(245, 222, 168, 0.34) 0%, rgba(216, 180, 106, 0.04) 68%, transparent 100%);
  box-shadow: 0 0 46px rgba(235, 210, 155, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff6e0;
  font-size: 24px;
  animation: pulseSoft 2.5s ease-in-out infinite;
  transition: transform 0.35s ease;
}
.ritual-hotspot:hover .ritual-ring-outer { transform: scale(1.12); }

/* ======================================================
   RAZOR-CLEAN SINGLE-ROW TOP HUD (Mobile + Desktop)
   ====================================================== */
.cinema-hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 10px;
  pointer-events: none;
}
.cinema-hud-top > * { pointer-events: auto; }

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hud-act-label {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ebd29b;
  text-shadow: 0 2px 10px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hud-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(5, 9, 18, 0.66);
  border: 1px solid rgba(216, 180, 106, 0.35);
  backdrop-filter: blur(10px);
  color: #ebd29b;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.hud-pill:hover { background: rgba(216, 180, 106, 0.18); color: #fff; }

/* ======================================================
   BOTTOM CINEMA SUBTITLE DOCK
   ====================================================== */
.cinema-subtitle-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 14;
  padding: 34px 20px 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(3, 6, 13, 0) 0%, rgba(3, 6, 13, 0.8) 42%, rgba(3, 6, 13, 0.96) 100%);
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.cinema-subtitle-dock > * { pointer-events: auto; }
.cinema-subtitle-dock.hidden {
  opacity: 0;
  pointer-events: none;
}
.subtitle-speaker {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d8b46a;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px #000;
}
.subtitle-text {
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 2.2vw, 1.58rem);
  line-height: 1.38;
  color: #faf6ed;
  max-width: 740px;
  margin: 0 auto;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.98);
  transition: opacity 0.28s ease;
}

.mobile-scene-tabs {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.scene-tab-btn {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(8, 13, 25, 0.82);
  border: 1px solid rgba(216, 180, 106, 0.4);
  color: #ebd29b;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.scene-tab-btn.active {
  background: linear-gradient(135deg, #e5c681, #c39a4b);
  color: #070b14;
  font-weight: 500;
}

/* ======================================================
   ACT IV OMEN MODAL — 100% CENTERED FLEXBOX (NEVER CLIPS!)
   ====================================================== */
.omen-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 68px 16px 24px;
  background: rgba(3, 6, 13, 0.48);
  overflow-y: auto;
}
.omen-modal-backdrop.visible {
  display: flex;
  animation: modalFadeIn 0.55s ease forwards;
}

.omen-float-panel {
  width: min(620px, 100%);
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  background: rgba(8, 13, 25, 0.84);
  border: 1px solid rgba(216, 180, 106, 0.52);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.78);
  margin: auto;
}

/* ======================================================
   ACT V DAWN OVERLAY — 100% CENTERED & SCROLLABLE ON MOBILE
   ====================================================== */
.dawn-center-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 76px 16px 36px;
  overflow-y: auto;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.dawn-center-overlay.visible {
  display: flex;
  animation: modalFadeIn 0.7s ease forwards;
}

.dawn-verdict-hero {
  width: min(780px, 100%);
  margin: auto 0 20px;
  background: rgba(6, 10, 20, 0.58);
  border: 1px solid rgba(216, 180, 106, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 28px 24px;
}
.dawn-verdict-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3.4vw, 2.55rem);
  color: #fffaf0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.85);
  margin: 10px 0 12px;
}

.archive-drawer {
  width: min(920px, 100%);
  text-align: left;
  display: none;
  margin-top: 8px;
  padding-bottom: 24px;
}
.archive-drawer.open {
  display: block;
  animation: modalFadeIn 0.55s ease forwards;
}

@keyframes modalFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes pulseSoft {
  0%, 100% { transform: scale(1); opacity: 0.84; }
  50% { transform: scale(1.07); opacity: 1; }
}

@media (max-width: 780px) {
  .mobile-scene-tabs { display: flex; }
  .cinema-hud-top { padding: 12px 14px; }
  .hud-pill { padding: 0 10px; height: 32px; font-size: 11px; }
  .hud-pill .pill-label { display: none; }
  .tag-title { font-size: 13px; padding: 4px 11px; }
  .beacon-caption { font-size: 12.5px; padding: 5px 12px; }
  .omen-float-panel { padding: 22px 18px; }
  .dawn-verdict-hero { padding: 22px 18px; }
}
