/* Standalone loading layer: never depend on the 3D renderer to paint it. */
#loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px;
  background: radial-gradient(ellipse at 50% 45%, #2b2119 0%, #17120e 58%, #0c0805 100%);
  color: #e8d7bc;
  text-align: center;
  font: 12px 'Courier Prime', monospace;
  letter-spacing: .19em;
  opacity: 1;
  transition: opacity .38s ease;
}
#loading.is-dismissing {opacity: 0; pointer-events: none}
.opening-file {
  position: relative;
  width: min(430px, 100%);
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  overflow: hidden;
  border: 1px solid #cfb69866;
  background: linear-gradient(145deg, #34271b 0%, #231b15 65%, #1a140f 100%);
  box-shadow: 0 22px 75px #0503029c, inset 0 0 0 8px #cfb6980a;
}
.opening-file-rule {position: absolute; top: 15px; left: 17px; right: 17px; height: 1px; background: #cfb69850}
.opening-file-corner {position: absolute; top: 26px; left: 24px; font-size: 10px; color: #c9a974; letter-spacing: .22em}
.opening-file img {filter: drop-shadow(0 0 16px #bb9b6450)}
.opening-file strong {font: 700 clamp(18px, 5vw, 24px) 'Courier Prime', monospace; letter-spacing: .16em}
.opening-file strong span {color: #c5a56e}
.opening-scan {
  position: absolute;
  inset: 0 auto 0 -30%;
  width: 26%;
  background: linear-gradient(90deg, transparent, #d4aa5523 65%, #eac58e52 70%, transparent);
  transform: skewX(-12deg);
  animation: archive-scan 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes archive-scan {to {left: 120%}}
#loadingText {margin: 0; line-height: 1.6}
#loadingRetry:not([hidden]) {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid #cfb698;
  background: #322417;
  color: #f5e4c8;
  font: inherit;
  letter-spacing: .04em;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .opening-scan {animation: none; left: 30%; opacity: .2}
  #loading {transition: none}
}