.opening-screen[hidden] { display: none; }
.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: hidden;
  isolation: isolate;
  color: #f6f0e2;
  background: #050a0c;
  opacity: 1;
  transition: opacity 600ms ease;
  font-family: inherit;
  letter-spacing: 0;
}
html.atlas-opening-active body { overflow: hidden; }
html.atlas-opening-active .app-shell { visibility: hidden; }
html.atlas-opening-active .opening-screen[hidden] { display: block; }
.opening-screen.is-leaving { opacity: 0; pointer-events: none; }
.opening-scene, .opening-labels { position: absolute; inset: 0; }
.opening-scene canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 600ms ease; }
.is-ready .opening-scene canvas { opacity: 1; }
.opening-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 10, 12, .58), transparent 35%, transparent 72%, rgba(5, 10, 12, .86));
}
.opening-masthead {
  position: absolute;
  z-index: 3;
  top: max(28px, env(safe-area-inset-top));
  left: 38px;
  right: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.opening-wordmark { font-size: 11px; color: #a3b4b3; }
.opening-skip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 4px 0 12px;
  border: 0;
  background: transparent;
  color: #b6c5c3;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.opening-skip:hover { color: #fff5dc; }
.opening-skip:focus-visible { outline: 1px solid #ddbd7b; outline-offset: 5px; }
.opening-arrow { --tool-icon: url("./assets/icons/arrow-right.svg"); }
.opening-copy {
  position: absolute;
  z-index: 2;
  top: 16%;
  left: 24px;
  right: 24px;
  text-align: center;
  pointer-events: none;
}
.opening-overline { margin: 0 0 18px; font-size: 12px; color: #cfb886; opacity: 0; transform: translateY(10px); }
.opening-copy h2 {
  margin: 0;
  color: #fcf1d6;
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 78px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 3px 24px #020505, 0 1px 1px #000;
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 1600ms ease, transform 1800ms cubic-bezier(.2,.7,.2,1), filter 1800ms ease;
}
.opening-copy p:last-child {
  margin: 20px 0 0;
  color: #d9e0d7;
  font-size: 18px;
  line-height: 1.6;
  text-shadow: 0 2px 14px #000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1000ms ease, transform 1200ms ease;
}
.opening-screen[data-phase="1"] .opening-copy h2,
.opening-screen[data-phase="2"] .opening-copy h2,
.opening-screen[data-phase="3"] .opening-copy h2 { opacity: 1; transform: none; filter: none; }
.opening-screen:not([data-phase="0"]) .opening-overline,
.opening-screen:not([data-phase="0"]) .opening-copy p:last-child { opacity: 1; transform: none; transition: opacity 1400ms ease, transform 1400ms ease; }
.opening-screen[data-phase="3"] .opening-copy { opacity: .98; }
.opening-labels { pointer-events: none; overflow: hidden; }
.opening-place {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: 176px;
  padding: 6px 9px;
  color: #fff7e5;
  font-size: 15px;
  line-height: 1.25;
  background: rgba(3, 12, 18, .78);
  border-left: 2px solid #bdad87;
  border-radius: 2px;
  text-shadow: 0 1px 3px #000;
  opacity: 0;
  will-change: transform;
}
.opening-place strong { font-weight: 650; }
.opening-place > span { color: #e6dcc5; font-size: 13px; line-height: 1.3; }
.opening-place.is-selected { border-left-color: #ffe2a1; background: rgba(3, 12, 18, .9); }
.opening-footer {
  position: absolute;
  z-index: 2;
  left: 38px;
  right: 38px;
  bottom: max(32px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  pointer-events: none;
}
.opening-era { display: grid; gap: 6px; width: 240px; }
.opening-era span { color: #c2d0cb; font-size: 12px; }
.opening-era strong { color: #fff0cf; font-size: 27px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 2px 10px #000; }
.opening-rule { height: 1px; background: rgba(156,181,175,.22); position: relative; }
.opening-rule::after { content: ""; position: absolute; inset: 0; background: #cbb076; transform: scaleX(var(--opening-progress,0)); transform-origin: left; }
.opening-signature { margin: 0; color: #c2d0cb; font-size: 12px; }
.opening-credits p { color: #bdc5bf; font-size: 12px; line-height: 1.8; }
.opening-credits a { color: #ddbd7b; text-underline-offset: 3px; }

@media (max-width: 760px) {
  .opening-masthead { top: max(18px, env(safe-area-inset-top)); left: 20px; right: 20px; }
  .opening-wordmark { font-size: 9px; }
  .opening-copy { top: 19%; left: 14px; right: 14px; }
  .opening-copy h2 { font-size: 44px; }
  .opening-copy p:last-child { margin-top: 16px; font-size: 14px; }
  .opening-overline { font-size: 11px; margin-bottom: 12px; }
  .opening-place { font-size: 13px; padding: 5px 7px; max-width: 146px; }
  .opening-place > span { font-size: 12px; }
  .opening-era { width: 180px; }
  .opening-era span { font-size: 11px; }
  .opening-era strong { font-size: 24px; }
  .opening-footer { left: 20px; right: 20px; bottom: max(26px, env(safe-area-inset-bottom)); gap: 14px; }
  .opening-signature { display: none; }
  .opening-footer { grid-template-columns: auto 1fr; }
}
@media (max-width: 360px) { .opening-copy h2 { font-size: 38px; } }
@media (max-height: 550px) {
  .opening-copy { top: 21%; }
  .opening-copy h2 { font-size: 42px; }
  .opening-copy p:last-child { margin-top: 8px; font-size: 14px; }
  .opening-overline { margin-bottom: 8px; }
  .opening-footer { bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .opening-screen, .opening-screen * { transition: none !important; animation: none !important; }
}
