@font-face {
  font-family: 'Sanctuary Title'; src: url(../assets/fonts/pt-serif-title.woff2) format('woff2');
  font-style: normal; font-weight: 700; font-display: swap;
}

/* Разметка заставки видна уже в первом кадре, пока загружается модуль сцены. */
@supports (transform: scale(calc(1px / 1px))) {
  #stage-wrap { container-type: size; }
  #phone:not([style]) {
    left: 50%; top: 50%;
    transform: scale(min(calc((100cqw - 28px) / 1156px), calc((100cqh - 28px) / 2416px))) translate(-50%, -50%);
  }
}
body:has(#opening) :is(#dev, #dev-toggle) { visibility: hidden; }

#opening {
  position: absolute; inset: 0; z-index: 90; overflow: hidden; isolation: isolate;
  color: #f1dcba; text-align: center;
  background: radial-gradient(ellipse at 50% 52%, #486766, #252734 50%, #13131d 87%);
}
.opening-painting { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
#opening::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #14111d44, transparent 34% 68%, #100f196b 100%);
}
.opening-heading { position: absolute; top: 11.2%; left: 4%; right: 4%; }
.opening-heading h1 {
  margin: 0; font: 700 128px/.98 'Sanctuary Title', Georgia, serif; text-transform: uppercase;
  color: #f7deac; text-shadow: 0 4px 0 #533a30, 0 8px 22px #100e18ab;
}
.opening-heading h1 span {
  display: flex; align-items: center; justify-content: center; gap: 35px;
  margin-bottom: 11px; color: #e7c69a; font-size: 55px; letter-spacing: .19em; text-indent: .19em;
}
.opening-heading h1 span::before, .opening-heading h1 span::after {
  content: ''; width: 96px; height: 3px; background: linear-gradient(90deg, transparent, #c19a6e);
}
.opening-heading h1 span::after { transform: scaleX(-1); }
.opening-heading h1 strong { display: block; font-weight: inherit; letter-spacing: .025em; }
.opening-rule { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 31px; }
.opening-rule::before, .opening-rule::after { content: ''; width: 91px; height: 2px; background: #af8b62b3; }
.opening-rule i { width: 15px; height: 15px; border: 3px solid #d8b178; transform: rotate(45deg); }

.opening-controls {
  position: absolute; bottom: 9.5%; left: 14%; right: 14%; height: 150px;
  display: grid; align-items: center; justify-items: center;
}
.opening-controls > :is(.opening-loading, .opening-start) { grid-area: 1 / 1; }
.opening-loading {
  width: 88%; opacity: 1; visibility: visible;
  transition: opacity 210ms ease-out, visibility 0s linear;
}
.opening-loading > div { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.opening-loading label, .opening-error { font-size: 39px; font-weight: 650; text-shadow: 0 3px 7px #121018; }
.opening-loading span { color: #edd1a1; font-size: 35px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opening-loading progress {
  display: block; width: 100%; height: 15px; padding: 2px; overflow: hidden; appearance: none;
  border: 2px solid #927b59; border-radius: 12px; background: #211d26;
}
.opening-loading progress::-webkit-progress-bar { border-radius: 8px; background: #211d26; }
.opening-loading progress::-webkit-progress-value { border-radius: 8px; background: linear-gradient(90deg, #b27347, #f3d395); transition: width 160ms ease-out; }
.opening-loading progress::-moz-progress-bar { border-radius: 8px; background: linear-gradient(90deg, #b27347, #f3d395); }
.opening-start {
  width: 555px; height: 146px; font-family: inherit; font-size: 57px; opacity: 0; visibility: hidden;
  transition: opacity 280ms ease-out, visibility 0s linear;
}
.opening-start:focus-visible { outline: 5px solid #fff1c5; outline-offset: 11px; }
.opening-start:active { filter: brightness(1.07); }
#opening:is([data-state="ready"], [data-state="error"]) .opening-loading {
  opacity: 0; visibility: hidden; transition-delay: 0s, 210ms;
}
#opening:is([data-state="ready"], [data-state="error"]) .opening-start { opacity: 1; visibility: visible; transition-delay: 90ms, 0s; }
.opening-error { position: absolute; bottom: 100%; margin: 0 0 28px; }
:root[data-reduced-motion="true"] #opening :is(.opening-loading, .opening-start) { transition-duration: 100ms, 0s; transition-delay: 0s; }
