/* 首屏关键样式独立于游戏包：只有渐变、字与尘埃，资源未到也能立即呈现。 */
#first-light {
  --progress: 0;
  overflow: hidden;
  isolation: isolate;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(ellipse at 75% 46%, #393023 0, #1d1916 26%, #100e10 68%);
  transition:
    opacity 0.65s ease,
    visibility 0.65s;
}
#first-light.departing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.first-light-grain {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background: repeating-linear-gradient(94deg, transparent 0 4px, #ac80590c 5px 6px);
}
.first-light-window {
  position: absolute;
  width: 30vw;
  height: 74vh;
  right: 12%;
  top: 8%;
  border: clamp(9px, 1.3vw, 22px) solid #292118;
  box-shadow:
    inset 0 0 0 2px #6b533223,
    12px 20px 65px #0008;
  background: linear-gradient(90deg, #141315 49.5%, #5f4b34 50%, #181517 50.5%);
  transform: perspective(900px) rotateY(-16deg);
  opacity: 0.8;
}
.first-light-window::before {
  content: "";
  position: absolute;
  top: 36%;
  left: 0;
  width: 100%;
  height: 12px;
  background: #30271d;
  box-shadow: 0 2px 0 #8a6f3920;
}
.first-light-crack {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: calc(2px + var(--progress) * 11px);
  background: linear-gradient(0deg, #ad7f40, #fff6cd 45%, #f6e8a8 82%, #d4ac6d);
  box-shadow:
    0 0 14px #fce2a4b3,
    0 0 55px #e6b57466;
  transform-origin: center;
  animation: first-light-breathe 5s ease-in-out infinite;
  transition: width 0.6s ease;
}
.first-light-beam {
  position: absolute;
  inset: -12% -4% -28% 14%;
  clip-path: polygon(70% 11%, 72% 11%, 62% 100%, 0 100%);
  background: linear-gradient(
    137deg,
    transparent 15%,
    #ffedba04 39%,
    #ffe9ab2e 63%,
    #e9c98a08 79%,
    transparent
  );
  mix-blend-mode: screen;
  opacity: calc(0.36 + var(--progress) * 0.64);
  transform-origin: 70% 12%;
  animation: first-light-ray 9s ease-in-out infinite alternate;
}
.first-light-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.first-light-motes i {
  position: absolute;
  width: calc(2px + var(--i) * 0.24px);
  aspect-ratio: 1;
  left: calc(42% + var(--i) * 3.9%);
  top: calc(12% + var(--i) * 6%);
  border-radius: 50%;
  background: #fff0c4;
  box-shadow: 0 0 7px #ead09c70;
  opacity: 0;
  animation: first-light-drift calc(8s + var(--i) * 0.35s) calc(var(--i) * -0.9s) linear infinite;
}
.first-light-copy {
  position: absolute;
  left: 13%;
  top: 50%;
  transform: translateY(-47%);
  width: min(370px, 52vw);
}
.first-light-eyebrow {
  color: #ac9574;
  font-size: 11px;
  letter-spacing: 0.5em;
  margin: 0 0 24px;
}
.first-light-copy h1 {
  font-family: "Songti SC", "SimSun", serif;
  font-weight: 400;
  font-size: clamp(74px, 9vw, 132px);
  letter-spacing: 0.2em;
  white-space: nowrap;
  margin: 0 0 24px;
  line-height: 1.12;
  text-shadow: 0 0 45px #f1d09d18;
}
.first-light-quote {
  color: #c2b5a0;
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(14px, 1.3vw, 19px);
  letter-spacing: 0.13em;
  line-height: 1.8;
  margin: 0 0 58px;
}
.first-light-progress {
  height: 1px;
  background: #e8c07926;
  position: relative;
}
.first-light-progress span {
  display: block;
  width: calc(var(--progress) * 100%);
  height: 1px;
  background: #efd49e;
  box-shadow: 0 0 10px #e9cb9377;
  transition: width 0.25s linear;
}
.first-light-progress span::after {
  content: "";
  float: right;
  width: 4px;
  height: 4px;
  background: #fff3ca;
  border-radius: 50%;
  transform: translateY(-1.5px);
  box-shadow: 0 0 8px #f8dda7;
}
.first-light-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  color: #a99982;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.first-light-percent {
  color: #d7b883;
  font-variant-numeric: tabular-nums;
}
.first-light-foot {
  position: absolute;
  bottom: 6%;
  left: 13%;
  margin: 0;
  color: #887b6b;
  font-size: 11px;
  letter-spacing: 0.15em;
}
.first-light-retry {
  margin-top: 24px;
  padding: 10px 18px;
  background: #30251e;
  border: 1px solid #9a7951;
  color: #f2dfbe;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.first-light-retry:focus-visible {
  outline: 2px solid #f2dfbe;
  outline-offset: 4px;
}
.first-light-noscript {
  position: absolute;
  bottom: 16%;
  left: 13%;
  color: #f0cd91;
}
#first-light[data-failed="true"] .first-light-progress {
  opacity: 0.35;
}
@keyframes first-light-breathe {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}
@keyframes first-light-ray {
  from {
    transform: rotate(-1.5deg);
  }
  to {
    transform: rotate(1.5deg);
  }
}
@keyframes first-light-drift {
  0% {
    transform: translate(24px, -30px);
    opacity: 0;
  }
  25%,
  65% {
    opacity: 0.55;
  }
  100% {
    transform: translate(-85px, 85px);
    opacity: 0;
  }
}
@media (max-width: 600px) {
  .first-light-window {
    width: 55vw;
    right: -12%;
    height: 62vh;
    top: 12%;
    opacity: 0.55;
  }
  .first-light-copy {
    left: 9%;
    width: 76vw;
  }
  .first-light-copy h1 {
    font-size: 92px;
  }
  .first-light-foot {
    left: 9%;
    font-size: 10px;
    max-width: 82vw;
    line-height: 1.8;
  }
  .first-light-quote {
    margin-bottom: 44px;
  }
  .first-light-beam {
    inset: -5% -20% -15% 0;
  }
}
@media (max-height: 500px) {
  .first-light-copy {
    top: 46%;
  }
  .first-light-copy h1 {
    font-size: 56px;
    margin-bottom: 10px;
  }
  .first-light-eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
  }
  .first-light-quote {
    margin-bottom: 20px;
    font-size: 12px;
  }
  .first-light-meta {
    margin-top: 10px;
    font-size: 10px;
  }
  .first-light-retry {
    margin-top: 12px;
    padding: 6px 12px;
  }
  .first-light-foot {
    bottom: 4%;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #first-light,
  #first-light * {
    animation: none;
    transition: none;
  }
  .first-light-motes i {
    opacity: 0.3;
  }
}
