/* ============================================================
   凝视之间 · Between the Stares
   dreamcore / horror-vigil aesthetic
   ============================================================ */

:root {
  /* palette */
  --ink: #0a0712;
  --ink-2: #11091f;
  --paper: #f2f0e6;
  --paper-dim: #a8a396;
  --monitor: #7cffb2;
  --monitor-dim: #2c7a4a;
  --alert: #ff2d55;
  --alert-glow: #ff6080;
  --gold: #d4a85a;
  --violet: #6a3aa8;

  /* type */
  --font-display: 'Cinzel', 'Noto Serif SC', serif;
  --font-body: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --font-mono: 'VT323', 'Share Tech Mono', monospace;
  --font-cn: 'Noto Serif SC', 'Cormorant Garamond', serif;

  /* effects */
  --scanline-color: rgba(0, 0, 0, 0.28);
  --vignette-strength: 0.85;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  cursor: default;
  user-select: none;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 35%, #1a0f2e 0%, var(--ink) 55%, #03020a 100%);
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ============================================================
   全局氛围层
   ============================================================ */
.overlay-scanlines,
.overlay-noise,
.overlay-vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
}
.overlay-scanlines {
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
}
.overlay-noise {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.05;
  mix-blend-mode: overlay;
  animation: noiseShift 0.4s steps(3) infinite;
}
.overlay-vignette {
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 0, 0, 0.4) 70%,
    rgba(0, 0, 0, 0.85) 100%
  );
}
@keyframes noiseShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   阶段切换
   ============================================================ */
[data-panel] { position: absolute; inset: 0; }
/* 覆盖 hidden 属性,确保 phase 切换时 panel 正确显示 */
[data-phase="splash"] [data-panel="splash"] { display: flex; }
[data-phase="watch"] [data-panel="watch"]   { display: block; }
[data-phase="jumpscare"] [data-panel="jumpscare"] { display: block; }
[data-phase="splash"] [data-panel="watch"],
[data-phase="splash"] [data-panel="jumpscare"] { display: none; }
[data-phase="watch"] [data-panel="splash"],
[data-phase="watch"] [data-panel="jumpscare"] { display: none; }
[data-phase="jumpscare"] [data-panel="splash"],
[data-phase="jumpscare"] [data-panel="watch"] { display: none; }

/* ============================================================
   启动页 · Splash
   ============================================================ */
.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
.splash-inner {
  width: 100%;
  max-width: 640px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.splash-eyebrow {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.25em;
  color: var(--monitor);
  opacity: 0.7;
  margin-bottom: 28px;
  animation: pulse 3.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.95; }
}

.splash-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.95;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.splash-title-zh {
  font-family: var(--font-cn);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-indent: 0.35em; /* 视觉居中补偿 */
  color: var(--paper);
  text-shadow:
    0 0 18px rgba(124, 255, 178, 0.15),
    0 0 40px rgba(106, 58, 168, 0.25);
}
.splash-title-en {
  font-family: var(--font-display);
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}
.splash-sub {
  font-family: var(--font-cn);
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 2;
  margin: 32px auto 28px;
  color: var(--paper-dim);
  max-width: 480px;
}
.splash-sub em {
  font-style: normal;
  color: var(--alert);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px rgba(255, 45, 85, 0.5);
}
.splash-instructions {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--paper-dim);
  margin-bottom: 32px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.splash-instructions p:nth-child(2) { opacity: 0.7; font-size: 14px; }

/* ----- 主题选择器 ----- */
.subject-picker {
  border: 1px solid rgba(212, 168, 90, 0.3);
  padding: 20px;
  margin: 0 auto 28px;
  max-width: 540px;
  text-align: left;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
}
.subject-picker::before,
.subject-picker::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--gold);
  opacity: 0.5;
}
.subject-picker::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.subject-picker::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.picker-label {
  display: block;
  font-family: var(--font-mono);
  cursor: pointer;
  margin-bottom: 12px;
}
.picker-title {
  display: block;
  color: var(--paper);
  font-size: 18px;
  letter-spacing: 0.12em;
}
.picker-hint {
  display: block;
  color: var(--paper-dim);
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.picker-zone {
  position: relative;
  min-height: 96px;
  border: 1px dashed rgba(124, 255, 178, 0.3);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.picker-zone:hover,
.picker-zone:focus,
.picker-zone.dragover {
  border-color: var(--alert);
  background: rgba(255, 45, 85, 0.04);
  outline: none;
}
.picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-align: center;
}
.picker-icon {
  font-size: 26px;
  color: var(--monitor);
  opacity: 0.7;
}
.picker-examples {
  font-size: 13px;
  opacity: 0.55;
  margin-top: 4px;
}
.picker-thumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.picker-thumbs:empty { display: none; }
.picker-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(124, 255, 178, 0.4);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}
.picker-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.picker-thumb-remove {
  position: absolute;
  top: 1px; right: 1px;
  width: 18px; height: 18px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--alert);
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  border: 0;
}
.picker-thumb-remove:hover { background: var(--alert); color: #000; }
.picker-status {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--monitor);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* ----- 状态 & 按钮 ----- */
.splash-status {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--paper-dim);
  margin-bottom: 20px;
  min-height: 22px;
  letter-spacing: 0.08em;
}
.splash-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 36px;
  border: 1px solid var(--alert);
  color: var(--alert);
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.25em;
  background: transparent;
  position: relative;
  transition: all 0.18s;
  margin-bottom: 16px;
}
.splash-btn::before, .splash-btn::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border: 1px solid var(--alert);
}
.splash-btn::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.splash-btn::after  { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.splash-btn:hover:not(:disabled) {
  background: var(--alert);
  color: var(--ink);
  box-shadow: 0 0 30px rgba(255, 45, 85, 0.5);
  letter-spacing: 0.32em;
}
.splash-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--paper-dim);
  color: var(--paper-dim);
}
.splash-btn-bracket {
  color: inherit;
  font-weight: 100;
}

.splash-error {
  font-family: var(--font-mono);
  color: var(--alert);
  font-size: 15px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--alert);
  background: rgba(255, 45, 85, 0.08);
  letter-spacing: 0.04em;
}

.splash-loading {
  margin: 20px auto 0;
  max-width: 360px;
}
.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(124, 255, 178, 0.15);
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--monitor), var(--gold));
  transition: width 0.3s;
}
.loading-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--monitor);
  margin-top: 8px;
  letter-spacing: 0.08em;
}

.splash-footer {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-dim);
  margin-top: 40px;
  letter-spacing: 0.3em;
  opacity: 0.5;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   监控页 · Watch
   ============================================================ */
.watch {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}
.watch-video {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scaleX(-1); /* 镜像 */
  width: 100%;
  height: 100%;
  object-fit: contain; /* 展示完整画面,允许黑边(完整人脸) */
  filter: contrast(1.08) saturate(0.85) brightness(0.85);
  z-index: 1;
  background: #000;
}
.watch-canvas {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  object-fit: contain;
}
.watch-crt {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 3px,
      rgba(0, 0, 0, 0) 4px
    );
  mix-blend-mode: multiply;
}

/* 距离压迫暗角:由 JS 控制 --p 值,内圈从 0% 收缩到 70% */
.watch-pressure {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent calc(var(--p, 0%) - 5%),
    transparent calc(var(--p, 0%) - 2%),
    rgba(0, 0, 0, 0.6) calc(var(--p, 0%) + 8%),
    rgba(0, 0, 0, 0.95) calc(var(--p, 0%) + 18%)
  );
  transition: background 0.25s ease-out;
}

/* 触发前警告边框 */
.watch-warning {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border: 3px solid var(--alert);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow:
    inset 0 0 60px rgba(255, 45, 85, 0.4),
    inset 0 0 120px rgba(255, 45, 85, 0.2);
  animation: warnPulse 0.5s ease-in-out infinite;
}
.watch-warning.active { opacity: 1; }
@keyframes warnPulse {
  0%, 100% { box-shadow: inset 0 0 40px rgba(255, 45, 85, 0.3), inset 0 0 80px rgba(255, 45, 85, 0.1); }
  50%      { box-shadow: inset 0 0 80px rgba(255, 45, 85, 0.7), inset 0 0 160px rgba(255, 45, 85, 0.3); }
}
.warning-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  color: var(--alert);
  font-size: 38px;
  letter-spacing: 0.5em;
  text-shadow: 0 0 18px var(--alert-glow);
  font-weight: 700;
}

/* ----- HUD ----- */
.hud {
  position: absolute;
  z-index: 6;
  font-family: var(--font-mono);
  color: var(--monitor);
  text-shadow: 0 0 6px rgba(124, 255, 178, 0.5);
  line-height: 1.1;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.hud-tl { top: 24px; left: 24px; }
.hud-tr { top: 24px; right: 24px; text-align: right; }
.hud-bl { bottom: 80px; left: 24px; }
.hud-br { bottom: 80px; right: 24px; text-align: right; }

.hud-label {
  font-size: 14px;
  opacity: 0.6;
  letter-spacing: 0.25em;
  margin-bottom: 4px;
}
.hud-value {
  font-size: 30px;
  letter-spacing: 0.1em;
  color: var(--paper);
  text-shadow: 0 0 8px rgba(124, 255, 178, 0.7);
}
.hud-sub {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 0.15em;
}

.hud-tl .hud-sub { color: var(--alert); }

/* 距离/眼睛状态颜色 */
.hud-tr .hud-value.alert { color: var(--alert); text-shadow: 0 0 10px var(--alert); }
.hud-bl .hud-value.closed { color: var(--gold); }
.hud-bl .hud-value.open   { color: var(--monitor); }

/* 底部距离计 */
.watch-meter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: min(560px, 80vw);
  font-family: var(--font-mono);
  color: var(--monitor);
  text-shadow: 0 0 4px rgba(124, 255, 178, 0.5);
  pointer-events: none;
}
.meter-label {
  font-size: 12px;
  letter-spacing: 0.4em;
  opacity: 0.6;
  margin-bottom: 4px;
  text-align: center;
}
.meter-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(124, 255, 178, 0.12);
  border: 1px solid rgba(124, 255, 178, 0.3);
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--monitor), var(--gold), var(--alert));
  transition: width 0.18s;
  box-shadow: 0 0 8px var(--monitor);
}
.meter-tick {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 14px;
  background: var(--monitor);
  opacity: 0.5;
}
.meter-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.6;
  letter-spacing: 0.2em;
}

/* 顶部控件容器 */
.watch-controls {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 12px;
  pointer-events: auto;
}
.watch-btn {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  padding: 7px 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  cursor: pointer;
  user-select: none;
}
.watch-test {
  color: var(--monitor);
  border-color: var(--monitor);
  text-shadow: 0 0 6px rgba(124, 255, 178, 0.6);
}
.watch-test:hover {
  color: var(--ink);
  background: var(--monitor);
  box-shadow: 0 0 20px rgba(124, 255, 178, 0.6);
}
.watch-test:active {
  transform: scale(0.96);
}
.watch-exit {
  color: var(--paper-dim);
  border-color: rgba(242, 240, 230, 0.25);
}
.watch-exit:hover {
  color: var(--alert);
  border-color: var(--alert);
  background: rgba(255, 45, 85, 0.1);
}

/* 调试:自动触发 */
.watch-debug {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 7;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 12px;
  border: 1px dashed rgba(212, 168, 90, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  pointer-events: auto;
}
.watch-debug input { accent-color: var(--gold); cursor: pointer; }
.watch-debug .debug-hint {
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

/* 实时状态条 */
.watch-status {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px;
  border: 1px solid rgba(124, 255, 178, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper-dim);
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}
.status-dot.detecting { background: var(--monitor); color: var(--monitor); animation: dotPulse 1s ease-in-out infinite; }
.status-dot.armed     { background: var(--gold);    color: var(--gold); }
.status-dot.trigger   { background: var(--alert);   color: var(--alert); animation: dotPulse 0.3s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ============================================================
   触发页 · Jumpscare
   ============================================================ */
.jumpscare {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: shakeBig 0.6s steps(8) 1;
}
.jumpscare.shake { animation: shakeBig 0.6s steps(8) 1; }
@keyframes shakeBig {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-12px, 6px); }
  20%  { transform: translate(10px, -8px); }
  30%  { transform: translate(-8px, -6px); }
  40%  { transform: translate(8px, 10px); }
  50%  { transform: translate(-6px, 4px); }
  60%  { transform: translate(6px, -4px); }
  70%  { transform: translate(-4px, 2px); }
  80%  { transform: translate(4px, -2px); }
  90%  { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

.jumpscare-img {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  z-index: 1;
  will-change: transform, filter;
}
.jumpscare-img.born {
  animation: jumpscareBorn 1.2s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}
@keyframes jumpscareBorn {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-2deg); filter: brightness(2) contrast(1.5) hue-rotate(0deg); }
  20%  { transform: translate(-50%, -50%) scale(1.25) rotate(1deg); filter: brightness(1.2) contrast(1.3) hue-rotate(15deg); }
  40%  { transform: translate(-50%, -50%) scale(1.05) rotate(-0.5deg); filter: brightness(1) contrast(1.1) hue-rotate(-10deg); }
  100% { transform: translate(-50%, -50%) scale(1.0) rotate(0deg); filter: brightness(1) contrast(1) hue-rotate(0deg); }
}

/* 三层 RGB 错位 — 使用 drop-shadow 实现色散 */
.glitch {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1.18);
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity, filter;
}
.glitch-r.show { animation: glitchR 0.6s steps(6) 1; }
.glitch-g.show { animation: glitchG 0.6s steps(6) 1; }
.glitch-b.show { animation: glitchB 0.6s steps(6) 1; }

@keyframes glitchR {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
  20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(14px, 4px); filter: drop-shadow(12px 0 0 #ff0040); }
  40%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1.18) translate(-10px, -6px); filter: drop-shadow(-14px 0 0 #ff0040); }
  60%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(10px, 0); filter: drop-shadow(10px 0 0 #ff0040); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
}
@keyframes glitchG {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
  20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(0, -10px); filter: drop-shadow(0 -10px 0 #00ff80); }
  40%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1.18) translate(0, 8px); filter: drop-shadow(0 10px 0 #00ff80); }
  60%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(0, -4px); filter: drop-shadow(0 -8px 0 #00ff80); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
}
@keyframes glitchB {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
  20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(-14px, 2px); filter: drop-shadow(-12px 0 0 #4060ff); }
  40%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1.18) translate(10px, -4px); filter: drop-shadow(14px 0 0 #4060ff); }
  60%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.18) translate(-10px, 0); filter: drop-shadow(-10px 0 0 #4060ff); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18) translate(0, 0);    filter: drop-shadow(0 0 0 transparent); }
}

/* 切片错位 */
.glitch-slices {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.glitch-slices.show {
  animation: sliceShow 0.6s steps(4) 1;
}
.glitch-slices .slice {
  position: absolute;
  left: 0; right: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  mix-blend-mode: lighten;
  filter: hue-rotate(180deg) saturate(2);
}
@keyframes sliceShow {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

.jumpscare-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.jumpscare-flash.flash { animation: whiteFlash 0.5s ease-out 1; }
@keyframes whiteFlash {
  0%   { opacity: 0; }
  5%   { opacity: 0.9; }
  20%  { opacity: 0.3; }
  100% { opacity: 0; }
}

.jumpscare-text {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(20px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: 0.4em;
  color: var(--alert);
  text-shadow: 0 0 24px var(--alert-glow);
  z-index: 4;
  opacity: 0;
  white-space: nowrap;
}
.jumpscare-text.show { animation: textShow 1.4s steps(8) 1; }
@keyframes textShow {
  0%   { opacity: 0; transform: translate(-50%, 30px); }
  30%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* 触发页退场 */
.jumpscare.fadeout {
  animation: fadeOut 0.6s ease-out forwards;
}
@keyframes fadeOut {
  to { opacity: 0; }
}

/* ============================================================
   屏幕震动(全局) — 触发瞬间短暂抖动
   ============================================================ */
body.shake-screen { animation: bodyShake 0.4s steps(6) 1; }
@keyframes bodyShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 4px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, -4px); }
  80% { transform: translate(4px, 3px); }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
  .splash { padding: 24px 16px; }
  .hud-value { font-size: 22px; }
  .warning-text { font-size: 22px; letter-spacing: 0.3em; }
  .watch-exit { font-size: 12px; padding: 4px 10px; }
}
