/* 拜耶斯家的门 · 视觉层
 * 3D 画面在底层，文字只做极克制的叠加。
 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050303;
  --red: #ff2b1d;
  --red-soft: rgba(255, 96, 72, 0.86);
  --red-dim: rgba(255, 76, 54, 0.36);
  --ash: rgba(240, 230, 220, 0.80);
  --ash-dim: rgba(238, 228, 220, 0.44);
  --ash-ghost: rgba(238, 228, 220, 0.14);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --mono: "SF Mono", "Consolas", "Menlo", monospace;
  --display: Georgia, "Times New Roman", "Songti SC", serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ash);
  font-family: var(--serif);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#stage { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }

.hidden { display: none !important; }

/* ---------- 胶片质感 ---------- */
#scan {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.30) 0px,
    rgba(0, 0, 0, 0.30) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  opacity: 0.30;
  mix-blend-mode: multiply;
}
#vig {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, transparent 30%, rgba(0, 0, 0, 0.40) 70%, rgba(0, 0, 0, 0.88) 100%);
  transition: background 1.1s ease;
}
#vig.hot {
  background: radial-gradient(ellipse at 50% 46%, transparent 22%, rgba(52, 2, 0, 0.30) 55%, rgba(12, 0, 0, 0.92) 100%);
}
#aberr {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 40, 18, 0.16), rgba(120, 0, 0, 0.34));
  mix-blend-mode: screen;
}

/* ---------- 左上标识 ---------- */
#brand {
  position: fixed;
  left: clamp(18px, 2.6vw, 40px);
  top: clamp(16px, 2.4vh, 30px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.brand-en {
  font-family: var(--mono);
  font-size: clamp(9px, 0.72vw, 11px);
  letter-spacing: 0.42em;
  color: var(--red-dim);
}
.brand-cn {
  font-family: var(--serif);
  font-size: clamp(13px, 1.02vw, 16px);
  letter-spacing: 0.34em;
  color: var(--ash-dim);
}

/* ---------- 摄像头回看窗 ---------- */
#camWrap {
  position: fixed;
  right: clamp(16px, 2.4vw, 36px);
  top: clamp(54px, 8vh, 88px);
  width: clamp(150px, 15vw, 224px);
  aspect-ratio: 16 / 9;
  z-index: 4;
  border: 1px solid rgba(255, 76, 54, 0.28);
  border-radius: 3px;
  overflow: hidden;
  background: #0a0706;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 10px 34px rgba(0, 0, 0, 0.6);
  filter: saturate(0.62) contrast(1.14) brightness(0.9);
}
#cam { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; pointer-events: none; }
#skel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#camLabel {
  position: absolute; left: 6px; top: 4px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  color: rgba(255, 120, 96, 0.55);
}
#handDot {
  position: absolute; right: 7px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 90, 70, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, box-shadow 0.2s;
}
#handDot.on { background: #ff5a46; box-shadow: 0 0 10px rgba(255, 60, 40, 0.95); }

/* ---------- 静音 ---------- */
#soundBtn {
  position: fixed;
  right: clamp(16px, 2.4vw, 36px);
  bottom: clamp(18px, 3.2vh, 32px);
  z-index: 4;
  width: 30px; height: 30px;
  background: none;
  border: 1px solid rgba(238, 228, 220, 0.12);
  border-radius: 50%;
  color: var(--ash-dim);
  font-family: var(--serif);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.7;
  transition: color 0.3s, border-color 0.3s, opacity 0.3s;
}
#soundBtn:hover { opacity: 1; border-color: rgba(255, 76, 54, 0.45); color: var(--ash); }
#soundBtn.muted { color: var(--red-soft); border-color: rgba(255, 76, 54, 0.45); }

/* ---------- 拼词面板 ---------- */
#wordPanel {
  position: fixed;
  left: clamp(18px, 2.6vw, 40px);
  top: clamp(70px, 10.4vh, 116px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  pointer-events: none;
  text-align: left;
  animation: wordIn 0.8s ease both;
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#wordCaption {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: rgba(255, 120, 96, 0.62);
}
#wordSlots { display: flex; align-items: flex-end; gap: clamp(5px, 0.7vw, 11px); }
#wordSlots .slot {
  width: clamp(20px, 2vw, 32px);
  height: clamp(28px, 2.9vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: clamp(19px, 2.2vw, 34px);
  color: rgba(238, 228, 220, 0.24);
  border-bottom: 1px solid rgba(238, 228, 220, 0.16);
  transition: color 0.25s, border-color 0.25s, text-shadow 0.25s;
}
#wordSlots .slot.space { width: clamp(10px, 1.2vw, 20px); border-bottom-color: transparent; }
#wordSlots .slot.next { color: rgba(255, 120, 96, 0.85); border-bottom-color: rgba(255, 76, 54, 0.6); }
#wordSlots .slot.done {
  color: #f7e9dc;
  border-bottom-color: rgba(255, 92, 60, 0.85);
  text-shadow: 0 0 18px rgba(255, 60, 30, 0.8), 0 0 40px rgba(255, 40, 20, 0.4);
}
#wordFoot {
  font-family: var(--serif);
  font-size: clamp(10px, 0.82vw, 12px);
  letter-spacing: 0.16em;
  color: rgba(238, 228, 220, 0.36);
}
#wordFoot b { color: rgba(255, 90, 60, 0.7); font-weight: 400; margin: 0 4px; }
#wordFoot span { color: rgba(255, 140, 112, 0.85); font-family: var(--mono); }

/* ---------- 底部 HUD ---------- */
#hud {
  position: fixed;
  left: 50%;
  bottom: clamp(30px, 5.4vh, 62px);
  transform: translateX(-50%);
  z-index: 3;
  width: min(460px, 74vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.6s ease;
}
#stageLine {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: clamp(10px, 0.78vw, 12px);
  letter-spacing: 0.34em;
  color: var(--ash-dim);
  transition: opacity 0.4s;
}
#stageEn { color: var(--red-soft); }
.sep { color: var(--ash-ghost); letter-spacing: 0; }
#stageCn { font-family: var(--serif); letter-spacing: 0.3em; }

#meter {
  position: relative;
  width: 100%;
  height: 2px;
  background: rgba(238, 228, 220, 0.10);
}
#meterFill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 48, 32, 0.55), var(--red));
  box-shadow: 0 0 12px rgba(255, 44, 28, 0.65);
  transition: width 0.18s linear;
}
#ticks {
  position: absolute; inset: 0;
  display: flex; justify-content: space-between;
  pointer-events: none;
}
#ticks .tick {
  width: 1px; height: 6px; margin-top: -2px;
  background: rgba(238, 228, 220, 0.18);
}
#ticks .tick.on { background: rgba(255, 76, 54, 0.9); box-shadow: 0 0 8px rgba(255, 60, 40, 0.7); }

#hint {
  font-family: var(--serif);
  font-size: clamp(13px, 1.0vw, 16px);
  letter-spacing: 0.20em;
  line-height: 1.7;
  color: var(--ash);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.85);
  transition: opacity 0.5s;
}

/* ---------- 调试行 ---------- */
#debug {
  position: fixed;
  left: clamp(18px, 2.6vw, 40px);
  bottom: clamp(16px, 2.8vh, 28px);
  z-index: 3;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(238, 228, 220, 0.24);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.6s;
}

/* ---------- 阶段大字 ---------- */
#bigline {
  position: fixed;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%) scale(0.97);
  z-index: 3;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#bigline.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#bigEn {
  font-family: var(--display);
  font-size: clamp(34px, 5.6vw, 86px);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.06;
  color: #ff2a1c;
  text-shadow:
    0 0 6px rgba(255, 90, 60, 0.55),
    0 0 26px rgba(255, 34, 18, 0.55),
    0 0 72px rgba(190, 6, 0, 0.55),
    0 2px 0 rgba(70, 0, 0, 0.6);
}
#bigCn {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(12px, 1.05vw, 17px);
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: rgba(255, 176, 160, 0.72);
}

/* ---------- 颠倒世界标题 ---------- */
#udTitle {
  position: fixed;
  left: 50%;
  top: clamp(54px, 8.6vh, 110px);
  transform: translateX(-50%) scale(1.03);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity 1.1s ease, transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#udTitle.show { opacity: 1; transform: translateX(-50%) scale(1); }
#udTitle.fade { opacity: 0.26; }
#udTitle .small {
  font-family: var(--mono);
  font-size: clamp(10px, 0.86vw, 13px);
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: rgba(255, 150, 120, 0.65);
}
#udTitle .big {
  font-family: var(--display);
  font-size: clamp(34px, 5.2vw, 82px);
  line-height: 0.96;
  letter-spacing: 0.10em;
  white-space: nowrap;
  color: #ff2d1a;
  text-shadow:
    0 0 10px rgba(255, 70, 40, 0.65),
    0 0 46px rgba(220, 12, 0, 0.7),
    0 0 120px rgba(150, 0, 0, 0.8),
    0 3px 0 rgba(50, 0, 0, 0.7);
  animation: udJitter 5.2s steps(1, end) infinite;
}
@keyframes udJitter {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, -1px); }
}

/* ---------- 字幕 ---------- */
#subtitle {
  position: fixed;
  left: 50%;
  top: clamp(150px, 23vh, 208px);
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--serif);
  font-size: clamp(15px, 1.4vw, 22px);
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: rgba(255, 236, 226, 0.92);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 40px rgba(160, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  white-space: nowrap;
}
#subtitle.show { opacity: 1; }

/* ---------- Boss 血条 ---------- */
#boss {
  position: fixed;
  left: 50%;
  top: clamp(26px, 4.6vh, 50px);
  transform: translateX(-50%);
  z-index: 3;
  width: min(540px, 62vw);
  pointer-events: none;
}
#bossLabel {
  font-family: var(--mono);
  font-size: clamp(9px, 0.78vw, 11px);
  letter-spacing: 0.34em;
  color: rgba(255, 120, 96, 0.75);
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
}
#bossHpText { color: rgba(255, 200, 180, 0.7); }
#bossBar {
  height: 3px;
  background: rgba(238, 228, 220, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}
#bossFill {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, #8d0f02, #ff3a16 60%, #ff9a6a);
  box-shadow: 0 0 16px rgba(255, 50, 20, 0.85);
  transition: width 0.25s ease;
}

/* ---------- 蓄力条 ---------- */
#charge {
  position: fixed;
  left: 50%;
  bottom: clamp(34px, 6vh, 64px);
  transform: translateX(-50%);
  z-index: 3;
  width: min(300px, 40vw);
  text-align: center;
  pointer-events: none;
}
#chargeTrack {
  height: 2px;
  background: rgba(238, 228, 220, 0.12);
}
#chargeFill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, rgba(255, 190, 120, 0.5), #fff3d2);
  box-shadow: 0 0 14px rgba(255, 220, 160, 0.85);
  transition: width 0.08s linear;
}
#chargeLabel {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(255, 214, 190, 0.45);
  transition: color 0.3s;
}
#charge.ready #chargeLabel { color: #ffd9a8; }
#charge.ready #chargeFill { box-shadow: 0 0 22px rgba(255, 240, 200, 1); }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%; top: clamp(24px, 4.2vh, 54px);
  transform: translate(-50%, -6px);
  z-index: 5;
  padding: 7px 16px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(255, 214, 204, 0.9);
  background: rgba(18, 6, 5, 0.74);
  border-left: 2px solid rgba(255, 76, 54, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 错误诊断 ---------- */
#errDetail {
  position: fixed;
  left: 50%; top: clamp(62px, 9.6vh, 108px);
  transform: translateX(-50%);
  z-index: 6;
  max-width: min(72vw, 780px);
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: #ff9a86;
  background: rgba(12, 4, 3, 0.9);
  border-left: 2px solid rgba(255, 76, 54, 0.7);
  word-break: break-all;
  white-space: pre-wrap;
  pointer-events: none;
}

/* ---------- 眨眼过场 ---------- */
#blink { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
#blink .lid { position: absolute; left: 0; right: 0; height: 52%; background: #000; }
#blink .lid.top { top: 0; transform: translateY(-100%); animation: lidTop 0.38s ease-in forwards; }
#blink .lid.bot { bottom: 0; transform: translateY(100%); animation: lidBot 0.38s ease-in forwards; }
@keyframes lidTop { to { transform: translateY(0); } }
@keyframes lidBot { to { transform: translateY(0); } }

/* ---------- 进入页（电影海报） ---------- */
#gate {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 clamp(22px, 7vw, 118px);
  overflow: hidden;
  background: #050202;
  transition: opacity 1.0s ease;
}
#gate.hide { opacity: 0; pointer-events: none; }
.gate-bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(ellipse at 74% 46%, rgba(255, 150, 80, 0.13), transparent 46%),
    radial-gradient(ellipse at 22% 78%, rgba(78, 12, 40, 0.12), transparent 52%),
    radial-gradient(ellipse at 46% 42%, #1a0b07 0%, #0a0404 54%, #040202 100%);
  filter: saturate(1.08);
}
.gate-room {
  position: absolute; right: 0; top: 0;
  width: min(54vw, 780px); height: 100%;
  pointer-events: none;
}
.gate-grain {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.20) 0 1px, transparent 1px 3px);
  opacity: 0.42; mix-blend-mode: multiply;
}
#gate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 62% 48%, transparent 26%, rgba(0, 0, 0, 0.55) 72%, rgba(0, 0, 0, 0.92) 100%);
}
.gate-bar {
  position: absolute; left: 0; right: 0; height: clamp(26px, 7vh, 62px);
  background: #000; z-index: 3; pointer-events: none;
}
.gate-bar.top { top: 0; }
.gate-bar.bot { bottom: 0; }
.gate-side {
  position: absolute; right: clamp(16px, 2.2vw, 30px); top: 50%;
  transform: translateY(-50%) rotate(90deg);
  z-index: 3;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.52em;
  color: rgba(255, 150, 120, 0.30);
  white-space: nowrap; pointer-events: none;
}

/* 活着的裂口 */
.rift {
  position: absolute; right: 14%; top: 50%;
  transform: translateY(-50%);
  width: min(25vw, 286px); height: min(62vh, 560px);
  animation: riftBreath 5.2s ease-in-out infinite;
}
.rift-halo {
  position: absolute; inset: -52% -60%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(255, 168, 100, 0.16), rgba(255, 96, 36, 0.08) 40%, transparent 70%);
  filter: blur(38px);
}
/* 被撕开的细长裂口：一枚发光的黑色杏形裂隙，边缘只是一层暖色余烬 */
.rift-fibers {
  position: absolute; inset: 0;
  clip-path: polygon(
    50% 0.3%, 53.4% 1.2%, 56.3% 5%, 59.1% 8.4%, 61.9% 11.4%, 64.4% 15.3%,
    67% 19.3%, 69.6% 23.7%, 71.2% 29.8%, 71.8% 36.6%, 72.9% 43.1%, 73.7% 50%,
    73.6% 57.1%, 73.1% 64.1%, 71.9% 70.9%, 69.4% 76%, 66.7% 80.2%, 64.6% 85.1%,
    62.2% 89.6%, 59.3% 92.5%, 56.4% 95.3%, 53.2% 96.9%, 50% 96.3%, 46.8% 96.2%,
    43.4% 97.1%, 40% 95.7%, 37% 92.1%, 34.3% 87.9%, 32.2% 82.2%, 30.9% 75.6%,
    29.3% 69.7%, 27.7% 63.7%, 27.3% 56.8%, 27.7% 50%, 28% 43.4%, 28.9% 37.1%,
    30.1% 31%, 30.7% 24.1%, 31.9% 17.3%, 34.5% 12.6%, 37.3% 8.8%, 40.2% 5.2%,
    43.4% 3.2%, 46.7% 1.9%);
  background: linear-gradient(180deg,
    rgba(255, 206, 154, 0.55), rgba(255, 142, 74, 0.42) 38%,
    rgba(255, 126, 58, 0.38) 62%, rgba(255, 186, 126, 0.50));
  filter: blur(12px);
  transform: scale(1.05);
  animation: riftGlow 6.5s ease-in-out infinite;
}
.rift-veins { display: none; }
.rift-maw {
  position: absolute; inset: 0;
  clip-path: polygon(
    50% 0.3%, 53.4% 1.2%, 56.3% 5%, 59.1% 8.4%, 61.9% 11.4%, 64.4% 15.3%,
    67% 19.3%, 69.6% 23.7%, 71.2% 29.8%, 71.8% 36.6%, 72.9% 43.1%, 73.7% 50%,
    73.6% 57.1%, 73.1% 64.1%, 71.9% 70.9%, 69.4% 76%, 66.7% 80.2%, 64.6% 85.1%,
    62.2% 89.6%, 59.3% 92.5%, 56.4% 95.3%, 53.2% 96.9%, 50% 96.3%, 46.8% 96.2%,
    43.4% 97.1%, 40% 95.7%, 37% 92.1%, 34.3% 87.9%, 32.2% 82.2%, 30.9% 75.6%,
    29.3% 69.7%, 27.7% 63.7%, 27.3% 56.8%, 27.7% 50%, 28% 43.4%, 28.9% 37.1%,
    30.1% 31%, 30.7% 24.1%, 31.9% 17.3%, 34.5% 12.6%, 37.3% 8.8%, 40.2% 5.2%,
    43.4% 3.2%, 46.7% 1.9%);
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 170, 110, 0.10), transparent 46%),
    linear-gradient(90deg, #050406 0%, #000 16%, #000 84%, #050406 100%);
  filter:
    drop-shadow(0 0 14px rgba(255, 176, 112, 0.45))
    drop-shadow(0 0 48px rgba(255, 104, 44, 0.22));
}
.rift-maw::after {
  content: ""; position: absolute; inset: 34% 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 178, 118, 0.12), transparent 70%);
  filter: blur(14px);
}
.rift-teeth { display: none; }
.gate-figure {
  position: absolute; left: 8%; bottom: 15%;
  width: 30px; height: 132px;
  background: linear-gradient(180deg, #0a0303, #030101);
  border-radius: 44% 40% 26% 26%;
  filter: blur(1.2px);
  box-shadow: 0 0 34px 10px rgba(255, 60, 20, 0.10);
}
.gate-figure::before {
  content: ""; position: absolute; left: 6px; top: -22px;
  width: 17px; height: 19px; border-radius: 50%; background: #070202;
}
.gate-figure::after {
  content: ""; position: absolute; left: 50%; bottom: -8px;
  width: 86px; height: 14px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,0.55), transparent 70%);
}

@keyframes riftSpin { to { transform: rotate(360deg); } }
@keyframes riftBreath {
  0%, 100% { transform: translateY(-50%) scale(1); filter: brightness(1); }
  46% { transform: translateY(-50%) scale(1.035) scaleX(0.985); filter: brightness(1.16); }
}
@keyframes riftGlow {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; filter: blur(4px); }
}

.gate-inner {
  position: relative; z-index: 2;
  text-align: left;
  max-width: min(620px, 52vw);
  padding: 0;
}
.gate-kicker {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono);
  font-size: clamp(9px, 0.74vw, 11px);
  letter-spacing: 0.38em;
  color: rgba(238, 228, 220, 0.36);
  margin-bottom: clamp(14px, 2.4vh, 26px);
}
.gate-kicker .rule { flex: 0 0 34px; height: 1px; background: rgba(255, 76, 54, 0.45); }
.gate-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(52px, 8.6vw, 150px);
  line-height: 0.86;
  letter-spacing: 0.02em;
  color: #ff2a1c;
  text-shadow:
    0 0 9px rgba(255, 90, 60, 0.50),
    0 0 42px rgba(255, 30, 15, 0.50),
    0 0 120px rgba(170, 4, 0, 0.62),
    2px 4px 0 rgba(52, 0, 0, 0.62);
  animation: neon 5.2s ease-in-out infinite;
}
.gate-title .t1, .gate-title .t2 { display: block; }
.gate-title .t2 { margin-left: 0.10em; letter-spacing: 0.12em; }
@keyframes neon {
  0%, 100% { opacity: 0.93; }
  46% { opacity: 1; }
  48% { opacity: 0.74; }
  50% { opacity: 1; }
  72% { opacity: 0.88; }
}
.gate-cn {
  margin-top: clamp(18px, 2.8vh, 28px);
  padding-left: 14px;
  border-left: 2px solid rgba(255, 72, 40, 0.62);
  font-family: var(--serif);
  font-size: clamp(13px, 1.24vw, 19px);
  letter-spacing: 0.44em;
  color: rgba(240, 230, 220, 0.52);
}
.gate-line {
  margin-top: clamp(20px, 3.4vh, 34px);
  font-family: var(--serif);
  font-size: clamp(14px, 1.12vw, 18px);
  letter-spacing: 0.24em;
  color: rgba(238, 228, 220, 0.76);
}
.gate-meta {
  margin-top: clamp(18px, 2.8vh, 28px);
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(238, 228, 220, 0.30);
}
.gate-meta i {
  font-style: normal; margin-right: 6px;
  color: rgba(255, 120, 90, 0.72);
}
#startBtn {
  margin-top: clamp(24px, 4.2vh, 42px);
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 5px;
  padding: 15px 44px 14px 30px;
  background: linear-gradient(100deg, rgba(58, 6, 2, 0.55), rgba(12, 3, 3, 0.30));
  border: 1px solid rgba(255, 76, 54, 0.42);
  border-left: 3px solid rgba(255, 76, 54, 0.95);
  color: rgba(255, 232, 224, 0.94);
  cursor: pointer;
  text-align: left;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s, transform 0.35s;
}
#startBtn .btn-en {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.34em;
  color: rgba(255, 146, 120, 0.72);
}
#startBtn .btn-cn {
  font-family: var(--serif); font-size: clamp(14px, 1.1vw, 17px);
  letter-spacing: 0.36em;
}
#startBtn:hover {
  background: linear-gradient(100deg, rgba(96, 10, 3, 0.66), rgba(20, 4, 3, 0.4));
  border-color: rgba(255, 94, 62, 0.92);
  box-shadow: 0 0 34px rgba(255, 50, 20, 0.30), inset 0 0 26px rgba(255, 50, 20, 0.14);
  transform: translateX(2px);
}
#loadNote {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 176, 150, 0.42);
  min-height: 14px;
  transition: color 0.3s;
}
#loadNote.ready { color: rgba(140, 220, 190, 0.62); }
.gate-steps {
  margin-top: clamp(20px, 3.2vh, 32px);
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-size: clamp(11px, 0.88vw, 13px);
  letter-spacing: 0.08em;
  color: rgba(238, 228, 220, 0.40);
}
.gate-steps b { font-weight: 400; color: rgba(255, 96, 72, 0.78); margin-right: 4px; }
.gate-fine {
  margin-top: 14px;
  max-width: 540px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(238, 228, 220, 0.30);
  line-height: 1.9;
}
.gate-fine.dim { color: rgba(238, 228, 220, 0.18); }
.gate-foot {
  position: absolute; left: 0; right: 0; bottom: calc(clamp(26px, 7vh, 62px) + 16px);
  z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(22px, 7vw, 118px);
}
.gate-diff { display: flex; align-items: center; gap: 6px; }
.diff-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.28em;
  color: rgba(238, 228, 220, 0.34); margin-right: 4px;
}
.gate-diff .diff {
  padding: 4px 10px 3px;
  background: rgba(10, 4, 4, 0.5);
  border: 1px solid rgba(238, 228, 220, 0.14);
  color: rgba(238, 228, 220, 0.48);
  font-family: var(--serif); font-size: 11px; letter-spacing: 0.16em;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.gate-diff .diff.on {
  border-color: rgba(255, 76, 54, 0.72);
  color: rgba(255, 214, 200, 0.95);
  background: rgba(72, 8, 3, 0.5);
}
#shareBtn, #shareEnd {
  padding: 5px 12px 4px;
  background: none;
  border: 1px solid rgba(238, 228, 220, 0.16);
  color: rgba(238, 228, 220, 0.46);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
#shareBtn:hover, #shareEnd:hover {
  border-color: rgba(255, 90, 60, 0.6);
  color: rgba(255, 214, 200, 0.9);
}
.gate-foot .gate-fine { margin: 0; text-align: right; }

/* ---------- 结局 ---------- */
#ending {
  position: fixed; inset: 0; z-index: 11;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(90, 10, 4, 0.42), transparent 66%),
    linear-gradient(180deg, rgba(4, 2, 2, 0.86) 0%, rgba(2, 1, 1, 0.95) 100%);
  backdrop-filter: blur(3px);
  animation: endIn 1.2s ease both;
}
@keyframes endIn { from { opacity: 0; } to { opacity: 1; } }
.end-inner { text-align: center; padding: 0 24px; max-width: 780px; }
.end-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(255, 120, 96, 0.5);
}
#ending h2 {
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.4vw, 76px);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: rgba(246, 238, 230, 0.94);
  text-shadow: 0 0 30px rgba(255, 60, 20, 0.4);
}
.end-line {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: clamp(13px, 1.05vw, 16px);
  letter-spacing: 0.2em;
  color: rgba(238, 228, 220, 0.46);
}
.end-stats {
  margin-top: clamp(26px, 4.4vh, 44px);
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 10px 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(238, 228, 220, 0.38);
}
.end-stats b { color: rgba(255, 150, 120, 0.9); font-weight: 400; }
#againBtn {
  margin-top: clamp(26px, 4.4vh, 44px);
  padding: 12px 38px 11px;
  background: rgba(10, 3, 3, 0.4);
  border: 1px solid rgba(255, 76, 54, 0.42);
  color: rgba(255, 226, 216, 0.9);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  cursor: pointer;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}
#againBtn:hover {
  background: rgba(60, 6, 2, 0.55);
  border-color: rgba(255, 90, 60, 0.9);
  box-shadow: 0 0 24px rgba(255, 50, 20, 0.3);
}
.end-fine {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(238, 228, 220, 0.24);
}

/* ---------- 战斗 HUD ---------- */
#combatHud {
  position: fixed; left: clamp(18px, 2.6vw, 40px); bottom: clamp(58px, 10vh, 96px);
  z-index: 3; width: min(280px, 46vw);
  pointer-events: none;
}
#levelBanner {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px;
  font-family: var(--mono);
  letter-spacing: 0.24em;
}
#levelEn { font-size: 10px; color: rgba(255, 110, 84, 0.72); }
#levelCn { font-family: var(--serif); font-size: 12px; letter-spacing: 0.22em; color: rgba(238, 228, 220, 0.5); }
#hpLabel {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.26em;
  color: rgba(238, 228, 220, 0.44);
  margin-bottom: 6px;
}
#hpLabel b { font-weight: 400; color: rgba(255, 180, 160, 0.9); font-size: 11px; }
#hpBar {
  height: 3px; background: rgba(238, 228, 220, 0.10);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
#hpFill {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, rgba(255, 210, 150, 0.85), #ffd9a8);
  box-shadow: 0 0 12px rgba(255, 214, 160, 0.55);
  transition: width 0.25s ease, background 0.4s;
}
#hpFill.low { background: linear-gradient(90deg, #8d0f02, #ff3a16); box-shadow: 0 0 14px rgba(255, 50, 20, 0.7); }
#warning {
  position: fixed; left: 50%; top: 30%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 4;
  font-family: var(--display);
  font-size: clamp(54px, 9vw, 120px);
  line-height: 1;
  color: #ff3a18;
  text-shadow: 0 0 16px rgba(255, 50, 20, 0.9), 0 0 70px rgba(200, 10, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#warning.show { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: warnPulse 0.55s ease-in-out infinite; }
@keyframes warnPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
#weakHint {
  position: fixed; left: 50%; bottom: clamp(74px, 13vh, 120px);
  transform: translateX(-50%);
  z-index: 3;
  padding: 5px 12px 4px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  color: rgba(255, 232, 190, 0.85);
  background: rgba(20, 6, 2, 0.55);
  border-left: 2px solid rgba(255, 200, 120, 0.75);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
  white-space: nowrap;
}
#weakHint.show { opacity: 1; }
#combatHud .hit { animation: hudHit 0.3s ease; }
@keyframes hudHit {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

#ending .end-actions { display: flex; gap: 12px; justify-content: center; margin-top: clamp(26px, 4.4vh, 44px); flex-wrap: wrap; }
#ending .end-actions #againBtn { margin-top: 0; }
#ending.defeat h2 { color: #ff6a4a; text-shadow: 0 0 34px rgba(255, 40, 10, 0.6); }
#ending.defeat { background:
  radial-gradient(ellipse at 50% 46%, rgba(120, 8, 2, 0.55), transparent 66%),
  linear-gradient(180deg, rgba(10, 2, 1, 0.9) 0%, rgba(2, 1, 1, 0.97) 100%); }

/* ---------- 战斗态收敛 UI ---------- */
body.combat #hud { display: none !important; }
body.combat #meter { opacity: 0; }
body.combat #debug { opacity: 0.35; }
body.combat #wordPanel { display: none !important; }
body.combat #camWrap { opacity: 0.72; }

/* =====================================================================
 * 移动端 / 竖屏适配
 * ===================================================================== */
@media (max-width: 720px), (max-height: 540px) {
  #gate { align-items: flex-end; padding: 0 22px calc(clamp(26px, 7vh, 62px) + 132px); }
  .gate-bg { background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 70, 26, 0.18), transparent 48%),
    radial-gradient(ellipse at 50% 70%, rgba(88, 8, 44, 0.14), transparent 52%),
    linear-gradient(180deg, #150a08 0%, #080404 60%, #040202 100%); }
  .gate-room { width: 100%; opacity: 0.72; }
  .rift { right: 50%; top: 26%; transform: translate(50%, -50%); width: 30vw; height: 40vh; animation: none; }
  @keyframes riftBreathM { 0%,100% { transform: translate(50%, -50%) scale(1); } 46% { transform: translate(50%, -50%) scale(1.04); } }
  .rift { animation: riftBreathM 5.2s ease-in-out infinite; }
  .rift-teeth { opacity: 0.22; }
  .gate-figure { left: 46%; bottom: 32%; height: 92px; width: 22px; }
  .gate-inner { max-width: 100%; }
  .gate-title { font-size: clamp(42px, 12.4vw, 78px); }
  .gate-cn { font-size: 13px; letter-spacing: 0.36em; margin-top: 12px; }
  .gate-line { font-size: 14px; letter-spacing: 0.18em; margin-top: 10px; }
  .gate-meta { margin-top: 12px; }
  .gate-meta, .gate-steps { gap: 6px 14px; font-size: 10px; }
  .gate-steps { margin-top: 10px; font-size: 9px; gap: 4px 10px; }
  #startBtn { margin-top: 14px; padding: 12px 30px 11px 20px; }
  #loadNote { font-size: 9px; margin-top: 8px; }
  .gate-fine { margin-top: 8px; font-size: 9px; line-height: 1.7; }
  .gate-foot {
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start;
    gap: 6px 10px;
    padding: 0 22px;
    bottom: calc(clamp(26px, 7vh, 62px) + 2px);
  }
  .gate-foot .gate-fine { display: none; }
  #shareBtn { padding: 4px 8px 3px; font-size: 9px; letter-spacing: 0.08em; }
  .gate-diff .diff { padding: 3px 8px 2px; font-size: 10px; }
  .gate-side { display: none; }
  .gate-bar { height: 4vh; }
  .gate-kicker { letter-spacing: 0.24em; margin-bottom: 12px; }

  #brand { left: 14px; top: 12px; gap: 4px; }
  .brand-en { font-size: 8px; letter-spacing: 0.3em; }
  .brand-cn { font-size: 11px; letter-spacing: 0.22em; }

  #camWrap {
    right: 10px; top: auto; bottom: calc(clamp(18px, 3.2vh, 32px) + 46px);
    width: 108px;
    opacity: 0.9;
  }
  #camLabel { font-size: 7px; }
  #soundBtn { right: 10px; bottom: calc(clamp(18px, 3.2vh, 32px) + 8px); width: 26px; height: 26px; }

  #wordPanel { left: 14px; top: 52px; gap: 6px; }
  #wordCaption { font-size: 8px; letter-spacing: 0.22em; }
  #wordSlots .slot { width: 20px; height: 28px; font-size: 18px; }
  #wordFoot { font-size: 9px; letter-spacing: 0.08em; }

  #hud { width: 86vw; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  #stageLine { font-size: 9px; letter-spacing: 0.22em; }
  #hint { font-size: 12px; letter-spacing: 0.12em; line-height: 1.6; }
  #bigEn { font-size: clamp(30px, 10vw, 54px); }
  #bigCn { font-size: 11px; letter-spacing: 0.34em; }
  #subtitle { font-size: 13px; letter-spacing: 0.14em; top: 16vh; white-space: normal; max-width: 86vw; text-align: center; }

  #boss { width: 78vw; top: 12px; }
  #bossLabel { font-size: 8px; letter-spacing: 0.2em; }
  #udTitle { top: 46px; }
  #udTitle .big { font-size: clamp(28px, 9vw, 52px); }
  #udTitle .small { font-size: 9px; letter-spacing: 0.42em; }

  #combatHud { left: 14px; bottom: auto; top: 44px; width: 168px; }
  #levelBanner { margin-bottom: 7px; }
  #levelEn { font-size: 8px; letter-spacing: 0.16em; }
  #levelCn { font-size: 10px; letter-spacing: 0.14em; }
  #hpLabel { font-size: 8px; margin-bottom: 4px; }
  #hpLabel b { font-size: 9px; }
  #weakHint { font-size: 8.5px; letter-spacing: 0.1em; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  #charge { width: 54vw; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
  #chargeLabel { font-size: 8px; letter-spacing: 0.18em; }

  #debug { left: 14px; bottom: 6px; font-size: 8px; opacity: 0.25; }
  #toast { font-size: 10px; padding: 6px 10px; letter-spacing: 0.1em; white-space: normal; max-width: 80vw; text-align: center; }
  #ending .end-stats { gap: 8px 18px; font-size: 10px; }
  .end-inner { max-width: 92vw; }
}
@media (max-height: 430px) and (orientation: landscape) {
  #gate { align-items: center; padding: 0 30px; }
  .rift { width: 30vw; height: 58vh; right: 8%; top: 50%; transform: translateY(-50%); }
  .gate-foot { flex-direction: row; align-items: center; }
  #camWrap { bottom: auto; top: 46px; width: 122px; }
  #combatHud { top: auto; bottom: 12px; }
}

/* =====================================================================
 * 视觉重做：封面收敛 / 任务卡 / 交互文字强化
 * ===================================================================== */

/* ---------- 封面：只留一句话的层级 ---------- */
#gate { background: #060303; }
#gate::before {
  content: "";
  position: absolute; inset: clamp(14px, 2.2vh, 24px) clamp(14px, 2vw, 26px);
  border: 1px solid rgba(238, 228, 220, 0.06);
  pointer-events: none; z-index: 2;
}
.gate-inner { max-width: min(560px, 50vw); padding-bottom: 8vh; }
.gate-kicker {
  font-size: clamp(9px, 0.72vw, 10.5px);
  letter-spacing: 0.46em;
  color: rgba(238, 228, 220, 0.30);
  margin-bottom: clamp(18px, 3vh, 30px);
}
.gate-kicker .rule { flex: 0 0 42px; background: rgba(255, 76, 54, 0.62); }
.gate-title {
  font-size: clamp(56px, 9.2vw, 158px);
  letter-spacing: 0.03em;
  line-height: 0.9;
}
.gate-cn {
  margin-top: clamp(20px, 3vh, 30px);
  padding-left: 16px;
  border-left: 2px solid rgba(255, 72, 40, 0.72);
  font-size: clamp(14px, 1.3vw, 20px);
  letter-spacing: 0.5em;
  color: rgba(244, 234, 226, 0.62);
}
.gate-line {
  margin-top: clamp(16px, 2.6vh, 24px);
  font-size: clamp(13px, 1.02vw, 16px);
  letter-spacing: 0.22em;
  color: rgba(238, 228, 220, 0.48);
}
#startBtn {
  margin-top: clamp(30px, 5vh, 52px);
  padding: 16px 52px 15px 30px;
  position: relative;
  border-color: rgba(255, 76, 54, 0.34);
  background: linear-gradient(100deg, rgba(58, 6, 2, 0.50), rgba(12, 3, 3, 0.22));
}
#startBtn::after {
  content: "→";
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono); font-size: 14px;
  color: rgba(255, 140, 110, 0.75);
  transition: transform 0.35s ease, color 0.35s ease;
}
#startBtn:hover::after { transform: translate(3px, -50%); color: #ffb9a4; }
#startBtn .btn-cn { letter-spacing: 0.42em; font-size: clamp(15px, 1.15vw, 18px); }
#loadNote { font-size: 9.5px; letter-spacing: 0.16em; margin-top: 14px; }
.gate-foot { bottom: calc(clamp(26px, 7vh, 62px) + 6px); }
.gate-foot .gate-fine { display: none; }
#shareBtn { font-size: 9px; }

/* 封面上的裂口再放大一点，作为唯一的重心 */
.rift { width: min(28vw, 320px); height: min(66vh, 600px); }
.rift-halo { inset: -60% -70%; filter: blur(46px); opacity: 0.9; }

/* ---------- 任务卡 ---------- */
#brief {
  position: fixed; inset: 0; z-index: 9;
  display: grid; place-items: center;
  padding: 22px;
}
#brief.hidden { display: none !important; }
.brief-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(28, 8, 4, 0.52), rgba(3, 1, 1, 0.9) 68%),
    linear-gradient(180deg, rgba(4, 2, 2, 0.7), rgba(2, 1, 1, 0.92));
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.7s ease;
}
#brief.show .brief-veil { opacity: 1; }
.brief-card {
  position: relative;
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding: clamp(24px, 4vh, 38px) clamp(22px, 3vw, 40px) clamp(20px, 3vh, 30px);
  background:
    linear-gradient(163deg, rgba(30, 15, 10, 0.97), rgba(10, 6, 4, 0.98) 62%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(255, 88, 56, 0.26);
  border-left: 3px solid rgba(255, 74, 42, 0.92);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.85),
    0 0 60px rgba(120, 16, 4, 0.18),
    inset 0 0 70px rgba(80, 12, 4, 0.20);
  opacity: 0;
  transform: translateY(30px) scale(0.962);
  filter: blur(9px);
  transition:
    opacity 0.7s ease,
    transform 0.9s cubic-bezier(0.16, 0.84, 0.28, 1),
    filter 0.85s ease;
  scrollbar-width: none;
}
.brief-card::-webkit-scrollbar { display: none; }
#brief.show .brief-card { opacity: 1; transform: none; filter: none; }
#brief.out .brief-card {
  opacity: 0; transform: translateY(-20px) scale(0.985); filter: blur(7px);
  transition-duration: 0.5s;
}
.brief-card > * { opacity: 0; }
#brief.show .brief-card > * { animation: briefRow 0.72s cubic-bezier(0.2, 0.9, 0.24, 1) forwards; }
#brief.show .brief-card > *:nth-child(1) { animation-delay: 0.10s; }
#brief.show .brief-card > *:nth-child(2) { animation-delay: 0.18s; }
#brief.show .brief-card > *:nth-child(3) { animation-delay: 0.24s; }
#brief.show .brief-card > *:nth-child(4) { animation-delay: 0.30s; }
#brief.show .brief-card > *:nth-child(5) { animation-delay: 0.36s; }
#brief.show .brief-card > *:nth-child(6) { animation-delay: 0.42s; }
#brief.show .brief-card > *:nth-child(7) { animation-delay: 0.50s; }
#brief.show .brief-card > *:nth-child(8) { animation-delay: 0.58s; }
@keyframes briefRow {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.brief-stamp {
  position: absolute; right: clamp(16px, 2.6vw, 30px); top: clamp(74px, 10vh, 92px);
  padding: 7px 11px 6px;
  font-family: var(--serif); font-size: 11px; letter-spacing: 0.22em;
  color: rgba(255, 92, 62, 0.72);
  border: 2px solid rgba(255, 78, 48, 0.40);
  border-radius: 2px;
  transform: rotate(-8deg);
  pointer-events: none;
  text-shadow: 0 0 12px rgba(255, 60, 30, 0.4);
}
.brief-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.26em;
  color: rgba(255, 138, 110, 0.62);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(238, 228, 220, 0.08);
}
.brief-when { color: rgba(238, 228, 220, 0.30); font-size: 9px; }
.brief-title {
  margin-top: clamp(18px, 3vh, 26px);
  max-width: 74%;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: 0.10em;
  color: #ff3a20;
  text-shadow: 0 0 22px rgba(255, 60, 30, 0.45), 0 0 70px rgba(160, 10, 0, 0.5);
}
.brief-sub {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.28em;
  color: rgba(255, 170, 146, 0.58);
}
.brief-rule {
  height: 1px; margin: clamp(16px, 2.4vh, 22px) 0;
  background: linear-gradient(90deg, rgba(255, 76, 54, 0.55), rgba(255, 76, 54, 0.04));
}
.brief-goal {
  font-family: var(--serif);
  font-size: 14px; letter-spacing: 0.14em;
  color: rgba(238, 228, 220, 0.62);
}
.brief-goal b {
  font-weight: 400; margin-left: 6px;
  color: #ffe4cc; letter-spacing: 0.24em;
  text-shadow: 0 0 18px rgba(255, 120, 70, 0.5);
}
.brief-steps { list-style: none; margin-top: clamp(14px, 2.2vh, 20px); display: grid; gap: 11px; }
.brief-steps li {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 9px 0 9px 2px;
  border-bottom: 1px solid rgba(238, 228, 220, 0.055);
}
.brief-steps li:last-child { border-bottom: none; }
.brief-steps i {
  font-style: normal;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: rgba(255, 106, 76, 0.85);
  padding-top: 2px;
}
.brief-steps span { display: flex; flex-direction: column; gap: 4px; }
.brief-steps b {
  font-weight: 400;
  font-family: var(--serif);
  font-size: 14.5px; letter-spacing: 0.12em;
  color: rgba(246, 236, 228, 0.92);
}
.brief-steps em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.08em;
  color: rgba(238, 228, 220, 0.50);
}
.brief-note {
  margin-top: 14px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: rgba(238, 228, 220, 0.28);
}
.brief-foot {
  margin-top: clamp(18px, 3vh, 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
#briefBtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 11px 26px 10px 18px;
  background: linear-gradient(100deg, rgba(96, 12, 4, 0.6), rgba(18, 5, 3, 0.3));
  border: 1px solid rgba(255, 84, 52, 0.42);
  border-left: 3px solid rgba(255, 84, 52, 0.95);
  color: rgba(255, 236, 228, 0.95);
  font-family: var(--serif); font-size: 14px; letter-spacing: 0.24em;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
#briefBtn em {
  font-style: normal;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.24em;
  color: rgba(255, 150, 122, 0.6);
}
#briefBtn:hover {
  background: linear-gradient(100deg, rgba(132, 18, 6, 0.7), rgba(26, 6, 4, 0.4));
  border-color: rgba(255, 104, 70, 0.9);
  box-shadow: 0 0 30px rgba(255, 60, 30, 0.24);
}
.brief-count {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em;
  color: rgba(238, 228, 220, 0.22);
}
.brief-grain {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  opacity: 0.35; mix-blend-mode: multiply;
}

/* ---------- 字母面板：看得出来现在是哪个字 ---------- */
#wordPanel {
  padding: 14px 18px 13px;
  gap: 10px;
  background: linear-gradient(152deg, rgba(18, 9, 6, 0.66), rgba(8, 4, 3, 0.34));
  border-left: 2px solid rgba(255, 76, 54, 0.55);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
}
#wordCaption {
  font-size: 10px;
  letter-spacing: 0.30em;
  color: rgba(255, 142, 112, 0.86);
  text-shadow: 0 0 16px rgba(255, 70, 40, 0.35);
}
#wordSlots { gap: clamp(7px, 0.9vw, 13px); }
#wordSlots .slot {
  width: clamp(26px, 2.5vw, 38px);
  height: clamp(38px, 3.7vw, 54px);
  font-size: clamp(24px, 2.7vw, 40px);
  border-bottom-width: 2px;
  border-bottom-color: rgba(238, 228, 220, 0.22);
}
#wordSlots .slot.space { width: clamp(12px, 1.4vw, 22px); }
#wordSlots .slot.next {
  color: #ff8f6c;
  border-bottom-color: rgba(255, 92, 56, 0.9);
  text-shadow: 0 0 22px rgba(255, 70, 36, 0.75);
  animation: slotPulse 1.5s ease-in-out infinite;
}
@keyframes slotPulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
#wordSlots .slot.done { color: #fff2e4; }
#wordFoot {
  font-size: clamp(11px, 0.86vw, 12.5px);
  color: rgba(238, 228, 220, 0.46);
}
#wordAim {
  display: inline-block;
  min-width: 1.2em;
  font-size: clamp(14px, 1.1vw, 17px) !important;
  color: #ffcbb0 !important;
  text-shadow: 0 0 16px rgba(255, 110, 60, 0.7);
}

/* ---------- 战斗 HUD ---------- */
#boss { top: clamp(30px, 5vh, 54px); width: min(580px, 66vw); }
#bossLabel {
  font-size: clamp(10px, 0.8vw, 11.5px);
  letter-spacing: 0.26em;
  margin-bottom: 9px;
  color: rgba(255, 128, 100, 0.9);
}
.boss-name { display: flex; align-items: baseline; gap: 9px; }
.boss-name em {
  font-style: normal;
  font-family: var(--serif);
  font-size: 11px; letter-spacing: 0.2em;
  color: rgba(255, 200, 180, 0.5);
}
#bossHpText { font-size: 13px; color: rgba(255, 214, 190, 0.92); letter-spacing: 0.1em; }
#bossBar {
  position: relative;
  height: 5px;
  background: rgba(238, 228, 220, 0.10);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 22px rgba(120, 10, 0, 0.35);
}
#bossFill { box-shadow: 0 0 18px rgba(255, 50, 20, 0.9); }
#bossTicks {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0 calc(10% - 1px),
    rgba(6, 2, 2, 0.9) calc(10% - 1px) 10%);
  pointer-events: none;
}

#combatHud {
  width: min(300px, 48vw);
  padding: 12px 16px 13px;
  background: linear-gradient(150deg, rgba(20, 9, 5, 0.78), rgba(8, 4, 3, 0.46));
  border-left: 2px solid rgba(255, 76, 54, 0.45);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}
#levelBanner { margin-bottom: 11px; gap: 9px; }
#levelEn {
  font-size: 10.5px; letter-spacing: 0.26em;
  color: #ff8a68;
  text-shadow: 0 0 16px rgba(255, 70, 40, 0.5);
}
#levelCn { font-size: 13.5px; letter-spacing: 0.18em; color: rgba(244, 234, 226, 0.78); }
#hpLabel { font-size: 9.5px; letter-spacing: 0.22em; margin-bottom: 7px; color: rgba(238, 228, 220, 0.55); }
#hpLabel b { font-size: 15px; color: #ffd2b8; letter-spacing: 0.06em; }
#hpBar { height: 5px; }
#hpFill { box-shadow: 0 0 16px rgba(255, 214, 160, 0.65); }

#syncPanel { margin-top: 13px; }
#syncLabel {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  color: rgba(255, 206, 170, 0.62);
}
#syncLabel b { font-weight: 400; font-size: 11px; color: #ffe2c0; letter-spacing: 0.08em; }
#syncDots { display: flex; gap: 6px; margin-top: 7px; }
#syncDots i {
  flex: 1; height: 3px;
  background: rgba(238, 228, 220, 0.12);
  transition: background 0.35s, box-shadow 0.35s;
}
#syncDots i.on {
  background: linear-gradient(90deg, #ffa45c, #ffe9c8);
  box-shadow: 0 0 12px rgba(255, 190, 120, 0.85);
}
#syncPanel.pulse #syncLabel { color: #ffe0b0; text-shadow: 0 0 16px rgba(255, 180, 100, 0.6); }

#weakHint {
  font-size: 10.5px; letter-spacing: 0.16em;
  color: #ffe6b8;
  padding: 7px 15px 6px;
  border-left: 2px solid rgba(255, 214, 140, 0.95);
  background: rgba(26, 8, 2, 0.7);
  box-shadow: 0 0 30px rgba(255, 140, 60, 0.18);
}
#chargeLabel { font-size: 10px; letter-spacing: 0.24em; color: rgba(255, 224, 200, 0.62); }
#chargeTrack { height: 3px; }
#charge.ready #chargeLabel { color: #ffe6bd; }
body.combat #toast { top: auto; bottom: clamp(150px, 22vh, 210px); }

/* ---------- 移动端：只保留必要信息 ---------- */
@media (max-width: 720px), (max-height: 540px) {
  #gate { padding: 0 22px calc(clamp(20px, 5vh, 40px) + 86px); }
  .gate-inner { max-width: 100%; padding-bottom: 0; }
  .gate-kicker { font-size: 8.5px; letter-spacing: 0.26em; margin-bottom: 16px; white-space: nowrap; }
  .gate-room { opacity: 0.6; }
  .rift { width: 46vw; height: 27vh; right: 50%; top: 15%; transform: translate(50%, -50%); }
  .rift-halo {
    inset: -55% -70%;
    background: radial-gradient(ellipse at 50% 50%,
      rgba(255, 176, 110, 0.30), rgba(255, 96, 36, 0.15) 45%, transparent 72%);
    filter: blur(30px); opacity: 0.95;
  }
  .rift-fibers { filter: blur(9px); opacity: 0.95; }
  .rift-maw {
    filter:
      drop-shadow(0 0 10px rgba(255, 182, 120, 0.55))
      drop-shadow(0 0 40px rgba(255, 108, 46, 0.35));
  }
  .gate-title { font-size: clamp(44px, 13vw, 74px); }
  .gate-cn { font-size: 13px; letter-spacing: 0.42em; margin-top: 14px; }
  .gate-line { font-size: 13px; margin-top: 12px; }
  #startBtn { margin-top: 22px; padding: 13px 42px 12px 22px; }
  #loadNote { font-size: 9px; margin-top: 10px; }

  .brief-card { padding: 20px 18px 18px; max-height: 84vh; }
  .brief-stamp { font-size: 9px; padding: 5px 8px 4px; right: 14px; top: 66px; letter-spacing: 0.14em; }
  .brief-head { font-size: 8.5px; letter-spacing: 0.18em; padding-bottom: 11px; }
  .brief-when { font-size: 8px; }
  .brief-title { font-size: 25px; margin-top: 16px; }
  .brief-sub { font-size: 9px; letter-spacing: 0.2em; }
  .brief-goal { font-size: 12.5px; }
  .brief-steps { gap: 8px; margin-top: 12px; }
  .brief-steps li { gap: 10px; padding: 7px 0; }
  .brief-steps b { font-size: 13px; }
  .brief-steps em { font-size: 9px; }
  .brief-note { font-size: 8.5px; margin-top: 11px; }
  .brief-foot { margin-top: 14px; gap: 10px; }
  #briefBtn { padding: 9px 18px 8px 14px; font-size: 12.5px; }
  .brief-count { font-size: 8px; letter-spacing: 0.22em; }

  #wordPanel { left: 12px; top: calc(52px + env(safe-area-inset-top, 0px)); padding: 10px 12px 10px; gap: 7px; }
  #wordCaption { font-size: 8.5px; letter-spacing: 0.2em; }
  #wordSlots { gap: 6px; }
  #wordSlots .slot { width: 21px; height: 30px; font-size: 19px; }
  #wordSlots .slot.space { width: 10px; }
  #wordFoot { font-size: 9.5px; letter-spacing: 0.06em; }

  body.combat #brand { display: none; }
  #combatHud { left: 10px; top: calc(34px + env(safe-area-inset-top, 0px)); width: 162px; padding: 8px 10px 9px; }
  #levelBanner { flex-wrap: nowrap; white-space: nowrap; gap: 6px; margin-bottom: 8px; }
  #levelEn { font-size: 8px; letter-spacing: 0.18em; }
  #levelCn { font-size: 10.5px; letter-spacing: 0.08em; }
  #hpLabel { font-size: 8px; }
  #hpLabel b { font-size: 12px; }
  #hpBar { height: 4px; }
  #syncLabel { font-size: 8px; letter-spacing: 0.12em; }
  #syncLabel b { font-size: 9px; }
  #syncDots { gap: 4px; margin-top: 5px; }
  #boss { width: 92vw; top: calc(8px + env(safe-area-inset-top, 0px)); }
  #bossLabel { font-size: 8.5px; letter-spacing: 0.16em; margin-bottom: 6px; }
  .boss-name em { font-size: 9px; }
  #bossBar { height: 4px; }
  #udTitle { top: 21vh; }
  #udTitle .big { font-size: clamp(26px, 8.4vw, 40px); letter-spacing: 0.06em; }
  #udTitle .small { font-size: 8px; letter-spacing: 0.4em; }
  #subtitle { top: 27vh; font-size: 12px; letter-spacing: 0.14em; }
  #weakHint { font-size: 9px; letter-spacing: 0.08em; padding: 5px 10px 4px; }
  #chargeLabel { font-size: 8.5px; }
  body.combat #toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
