:root {
  --sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #6f8496; color: #f2f5f8;
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
  user-select: none; cursor: default;
}

#scene { position: fixed; inset: 0; }
#scene canvas { display: block; }

/* 一层极轻的暗角。物理上不该有，但它让画面立刻"像一张照片"。 */
#vig {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(ellipse 78% 78% at 50% 46%, transparent 46%, rgba(20, 28, 36, 0.42) 100%);
}

/* 胶片颗粒，压住色带，也压住"CG 感" */
#grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 5;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(3) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

#hud {
  position: fixed; inset: 0; z-index: 10; pointer-events: none;
  transition: opacity 0.6s ease;
}
#hud.hidden { opacity: 0; }

#tips {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; gap: 20px;
  font-size: 11.5px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
#tips b {
  font-weight: 600; color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 3px;
  padding: 1px 5px; margin-right: 4px; font-size: 10px;
}

#quest {
  position: absolute; right: 28px; top: 24px;
  display: flex; align-items: baseline; gap: 8px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}
.q-label { font-size: 11px; letter-spacing: 0.2em; color: rgba(255, 245, 232, 0.5); }
.q-num { font-size: 26px; font-weight: 300; color: #ffe9cd; letter-spacing: 0.04em; }
.q-of { font-size: 12px; color: rgba(255, 245, 232, 0.38); }

#homeWrap {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
}
#homeDir {
  position: absolute; left: 0; top: 0; margin: -10px 0 0 -22px;
  font-size: 11.5px; letter-spacing: 0.14em; white-space: nowrap;
  color: #ffcf96; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  opacity: 0; transition: opacity 0.3s ease;
}

#prompt {
  position: absolute; left: 50%; top: calc(50% + 44px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(18, 14, 12, 0.5); border: 1px solid rgba(255, 236, 214, 0.18);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.16s ease;
}
#prompt.show { opacity: 1; }
#prompt b { font-size: 13.5px; font-weight: 600; color: #fff5e8; letter-spacing: 0.06em; }
#prompt .w {
  font-size: 10.5px; letter-spacing: 0.1em; color: #ffcf96;
  border: 1px solid rgba(255, 207, 150, 0.4); border-radius: 999px; padding: 1px 8px;
}
#prompt em {
  font-style: normal; font-size: 11px; letter-spacing: 0.06em;
  color: rgba(255, 245, 232, 0.5);
}

#chargeBar {
  position: absolute; left: 50%; top: calc(50% + 78px); transform: translateX(-50%);
  width: 110px; height: 2px; border-radius: 2px; background: rgba(255, 245, 232, 0.16);
  overflow: hidden;
}
#charge {
  width: 100%; height: 100%; background: #ffcf96; transform-origin: left center;
  transform: scaleX(0); transition: transform 0.04s linear;
}

#scaleNote {
  position: absolute; left: 28px; top: 24px;
  font-size: 11px; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

#overlay {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(30, 42, 54, 0.72), rgba(12, 18, 24, 0.94));
  backdrop-filter: blur(10px);
  transition: opacity 0.7s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.card { width: min(560px, 86vw); text-align: center; }
.kicker {
  font-size: 10.5px; letter-spacing: 0.42em; color: rgba(255, 255, 255, 0.34);
}
.card h1 {
  margin: 16px 0 0; font-size: clamp(52px, 9vw, 88px); font-weight: 200;
  letter-spacing: 0.28em; margin-left: 0.28em; line-height: 1;
  background: linear-gradient(160deg, #eaf2f8, #9db6cb 60%, #c8b49a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card p {
  margin: 30px auto 0; max-width: 430px;
  font-size: 13.5px; line-height: 2.05; color: #c3cfda; letter-spacing: 0.03em;
}
.card p.sub { margin-top: 18px; font-size: 12.5px; color: rgba(195, 207, 218, 0.62); }
.card p b { color: #fff; font-weight: 600; }

#startBtn {
  margin-top: 34px; padding: 12px 42px;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.24em; color: #eef4f9;
  background: transparent; border: 1px solid rgba(238, 244, 249, 0.3); border-radius: 999px;
  cursor: pointer; transition: all 0.25s ease;
}
#startBtn:hover {
  background: #eef4f9; color: #14202a; border-color: #eef4f9; letter-spacing: 0.3em;
}
.foot { margin-top: 16px; font-size: 10.5px; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.26); }

#loading {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: #14202a; color: rgba(255, 255, 255, 0.4);
  font-size: 12px; letter-spacing: 0.3em;
  transition: opacity 0.5s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
