/* =========================================================
   晚上躲怪物10 — 夜行潜行解谜
   ========================================================= */
:root {
  --bg: #05070f;
  --ink: #f5efe5;
  --muted: #9aa1b2;
  --muted-2: #6d7487;
  --orange: #ff8a3d;
  --orange-2: #ffb27a;
  --orange-deep: #e86418;
  --danger: #ff4b55;
  --teal: #7fe7d4;
  --blue: #7f9cff;
  --glass: rgba(9, 13, 24, 0.62);
  --line: rgba(255, 255, 255, 0.13);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #03040a;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  background:
    radial-gradient(60% 50% at 18% 8%, rgba(35, 52, 96, 0.32), transparent 70%),
    radial-gradient(50% 40% at 86% 90%, rgba(255, 122, 47, 0.10), transparent 70%),
    #03040a;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 2px solid var(--orange-2);
  outline-offset: 3px;
}

img { display: block; max-width: 100%; }

.mp-icon { flex: 0 0 auto; }

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.85);
}

/* =========================================================
   封面
   ========================================================= */
.cover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #05070f;
}
.cover[hidden] { display: none; }

.cover-bg {
  position: absolute;
  inset: -7%;
  background-image: url("images/gen/gptimg_1795276476_look.png");
  background-size: cover;
  background-position: 70% 42%;
  filter: blur(22px) brightness(0.34) saturate(0.92);
  transform: scale(1.05);
  opacity: 0.95;
  pointer-events: none;
}

.cover-fog {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 6, 14, 0.64) 0%, rgba(4, 6, 14, 0.05) 30%, rgba(4, 6, 14, 0.36) 58%, rgba(4, 6, 14, 0.96) 88%, #04060e 100%),
    radial-gradient(90% 55% at 50% 30%, transparent 30%, rgba(3, 5, 12, 0.52) 100%);
  pointer-events: none;
}

.cover-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.34) 0.5px, transparent 0.7px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 20px);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-end;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #d8b8a0;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.9);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.eyebrow-rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(255, 178, 122, 0.4), transparent);
}

.poster {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 178, 0.22);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.66),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.2);
  background: #0a0f1a;
  transform: translateZ(0);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% 44%;
  filter: saturate(1.06) contrast(1.04) brightness(0.96);
}
.poster-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 6, 14, 0.28) 0%, transparent 28%, transparent 64%, rgba(3, 6, 14, 0.76) 100%),
    radial-gradient(95% 80% at 50% 45%, transparent 55%, rgba(3, 5, 12, 0.4) 100%);
  pointer-events: none;
}
.poster figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 244, 232, 0.84);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.poster-time { color: var(--orange-2); }
.poster-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(4, 7, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  letter-spacing: 0.1em;
  font-weight: 500;
}
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 178, 122, 0.55);
  pointer-events: none;
}
.corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }

.cover-head { margin-top: 20px; }
.cover-head h1 {
  margin: 0;
  font-size: clamp(34px, 10.6vw, 47px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 900;
  color: #faf5ec;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.85);
}
.cover-head .accent { color: var(--orange); }
.title-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.9em;
  height: 0.78em;
  margin-left: 7px;
  padding: 0 0.1em;
  font-size: 0.52em;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: 0.24em;
  color: #ffe0c7;
  border: 1.5px solid rgba(255, 138, 61, 0.7);
  border-radius: 9px;
  box-shadow: 0 0 20px rgba(255, 138, 61, 0.18), inset 0 0 16px rgba(255, 138, 61, 0.12);
  text-shadow: none;
}
.tagline {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.78;
  color: #b4bac9;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.mech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.mech-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 17, 30, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #cdd2dd;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mech-row .mp-icon { width: 14px; height: 14px; color: var(--orange-2); }

.start-btn {
  position: relative;
  width: 100%;
  height: 56px;
  margin-top: 18px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #241005;
  background: linear-gradient(135deg, #ffc08c 0%, #ff9a55 34%, #ff7d2e 68%, #ef6417 100%);
  box-shadow:
    0 16px 34px rgba(245, 99, 28, 0.3),
    0 2px 0 rgba(255, 216, 184, 0.65) inset,
    0 -3px 0 rgba(126, 44, 4, 0.25) inset;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.start-btn::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 40%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: rotate(18deg);
  animation: shine 4.6s ease-in-out infinite;
}
.start-btn .mp-icon { width: 22px; height: 22px; }
.start-btn:active { transform: scale(0.982); box-shadow: 0 8px 20px rgba(245, 99, 28, 0.26), 0 2px 0 rgba(255, 216, 184, 0.5) inset; }

.cover-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #6e7689;
}
.cover-foot b { color: #cfd4df; font-weight: 600; font-variant-numeric: tabular-nums; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: #565d70; }

/* =========================================================
   游戏画面
   ========================================================= */
.game {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  background: #04060c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.game[hidden] { display: none; }
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.hud-top {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hud-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
  min-width: 0;
}

.glass-btn {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5efe5;
  background: rgba(9, 13, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.1s ease, background 0.15s ease;
}
.glass-btn .mp-icon { width: 21px; height: 21px; }
.glass-btn:active { transform: scale(0.93); background: rgba(255, 138, 61, 0.22); }

.minimap-shell {
  position: relative;
  width: 86px;
  height: 118px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(5, 9, 17, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.minimap-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 45%);
  pointer-events: none;
}
#minimap { width: 100%; height: 100%; display: block; }
.minimap-label {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 7px;
  letter-spacing: 0.18em;
  color: rgba(210, 220, 240, 0.42);
  pointer-events: none;
}

.stat-row { display: flex; gap: 7px; }
.stat {
  height: 38px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  background: rgba(7, 11, 21, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.stat .mp-icon { width: 17px; height: 17px; color: var(--orange-2); }
.stat b {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f6f1e8;
  font-variant-numeric: tabular-nums;
}
.stat-key.filled { border-color: rgba(255, 178, 122, 0.45); box-shadow: 0 0 22px rgba(255, 138, 61, 0.18), 0 8px 22px rgba(0, 0, 0, 0.3); }
.stat-key.filled .mp-icon { color: #ffd29e; filter: drop-shadow(0 0 6px rgba(255, 138, 61, 0.7)); }

.objective {
  max-width: min(228px, 62vw);
  min-height: 30px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  background: rgba(7, 11, 21, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c7ccd8;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: left;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.obj-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.8);
  animation: dotPulse 2.2s ease-in-out infinite;
}
.objective.danger { border-color: rgba(255, 75, 85, 0.5); color: #ffc9cc; background: rgba(46, 8, 12, 0.55); }
.objective.danger .obj-dot { background: var(--danger); box-shadow: 0 0 10px rgba(255, 75, 85, 0.9); animation-duration: 0.8s; }
.objective.safe { border-color: rgba(127, 231, 212, 0.34); color: #c8f6ee; background: rgba(7, 30, 28, 0.5); }
.objective.safe .obj-dot { background: var(--teal); box-shadow: 0 0 10px rgba(127, 231, 212, 0.8); }
.objective.pulse { animation: objPulse 0.5s ease; }

.toast {
  position: absolute;
  top: 27%;
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 82%;
  padding: 10px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(255, 138, 61, 0.3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 138, 61, 0.08);
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em; color: #fff5e9; }
.toast-sub { font-size: 10px; color: #aab1c0; line-height: 1.4; }
.toast-sub:empty { display: none; }
.toast.danger { border-color: rgba(255, 75, 85, 0.55); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 75, 85, 0.14); }
.toast.gold { border-color: rgba(255, 200, 120, 0.55); }
.toast.teal { border-color: rgba(127, 231, 212, 0.45); }

.interact-btn {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 148px);
  z-index: 12;
  height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 192, 140, 0.97), rgba(255, 125, 46, 0.97));
  border: 1px solid rgba(255, 234, 214, 0.5);
  box-shadow: 0 14px 30px rgba(242, 96, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #261006;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.interact-btn.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.interact-btn:active { transform: translate(-50%, 0) scale(0.96); }
.interact-btn .mp-icon { width: 20px; height: 20px; }
.interact-btn.quiet {
  background: rgba(10, 15, 27, 0.76);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  color: #f1ecdf;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hud-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--safe-bottom) + 18px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.joystick {
  position: relative;
  width: 132px;
  height: 132px;
  margin-left: -4px;
  pointer-events: auto;
  touch-action: none;
}
.joy-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 138, 61, 0.12), rgba(5, 9, 18, 0.5) 62%),
    rgba(6, 10, 19, 0.35);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.5),
    0 0 0 8px rgba(255, 255, 255, 0.022),
    0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.joy-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  opacity: 0.4;
}
.joy-arrow.up { top: 9px; left: 50%; margin-left: -5px; border-bottom-color: rgba(255, 255, 255, 0.75); border-top: 0; }
.joy-arrow.down { bottom: 9px; left: 50%; margin-left: -5px; border-top-color: rgba(255, 255, 255, 0.75); border-bottom: 0; }
.joy-arrow.left { left: 9px; top: 50%; margin-top: -5px; border-right-color: rgba(255, 255, 255, 0.75); border-left: 0; }
.joy-arrow.right { right: 9px; top: 50%; margin-top: -5px; border-left-color: rgba(255, 255, 255, 0.75); border-right: 0; }
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 34% 28%, #fff8ee 0%, #e5ddd0 38%, #b7afa2 72%, #8c857b 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -4px 8px rgba(0, 0, 0, 0.18) inset;
  will-change: transform;
  transition: transform 0.06s linear;
  pointer-events: none;
}
.joystick.active .joy-knob { transition: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 138, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
.joystick.active .joy-base { border-color: rgba(255, 178, 122, 0.42); }

.action-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}
.stamina-wrap {
  width: 118px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  margin-right: 6px;
  overflow: hidden;
  opacity: 0.9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) inset;
}
#staminaBar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd08a, var(--orange) 70%, #ff6a1e);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.6);
  transition: width 0.1s linear;
}
#staminaBar.low { background: linear-gradient(90deg, #ff9a9d, var(--danger)); box-shadow: 0 0 8px rgba(255, 75, 85, 0.55); }
.action-row { display: flex; align-items: flex-end; gap: 10px; }
.action-btn {
  pointer-events: auto;
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #e9e4da;
  background: rgba(8, 12, 22, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: transform 0.1s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  touch-action: none;
}
.action-btn .mp-icon { width: 27px; height: 27px; }
.action-btn em { font-style: normal; font-size: 8.5px; letter-spacing: 0.12em; color: #b9bec9; }
.action-btn:active { transform: scale(0.93); }
.action-btn:disabled { opacity: 0.34; }
.hide-btn.ready {
  border-color: rgba(127, 231, 212, 0.6);
  background: radial-gradient(circle at 50% 30%, rgba(127, 231, 212, 0.2), rgba(8, 16, 22, 0.72));
  box-shadow: 0 0 24px rgba(127, 231, 212, 0.16), 0 10px 26px rgba(0, 0, 0, 0.38);
}
.hide-btn.ready .mp-icon { color: #a9f4e6; }
.hide-btn.ready em { color: #a9f4e6; }
.hide-btn.hidden-state {
  border-color: rgba(255, 138, 61, 0.66);
  background: radial-gradient(circle at 50% 30%, rgba(255, 138, 61, 0.22), rgba(20, 11, 7, 0.78));
}
.hide-btn.hidden-state .mp-icon { color: #ffc08c; }
.sprint-btn {
  width: 76px;
  height: 76px;
  border-color: rgba(255, 178, 122, 0.4);
  background: radial-gradient(circle at 36% 24%, rgba(255, 170, 110, 0.3), rgba(26, 14, 8, 0.78) 68%);
  color: #ffe0c6;
}
.sprint-btn .mp-icon { width: 30px; height: 30px; color: #ffc490; }
.sprint-btn em { color: #e5b28c; }
.sprint-btn.pressed { transform: scale(0.93); border-color: rgba(255, 178, 122, 0.8); box-shadow: 0 0 26px rgba(255, 138, 61, 0.28), 0 10px 26px rgba(0, 0, 0, 0.38); }
.sprint-btn.empty { opacity: 0.5; }

.hidden-badge {
  position: absolute;
  top: calc(var(--safe-top) + 126px);
  left: 50%;
  z-index: 14;
  width: min(246px, 68%);
  padding: 10px 14px 11px;
  border-radius: 14px;
  background: rgba(5, 12, 18, 0.76);
  border: 1px solid rgba(127, 231, 212, 0.34);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 26px rgba(127, 231, 212, 0.08);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hidden-badge.show { opacity: 1; transform: translate(-50%, 0); }
.hb-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #b5f3e8;
}
.hb-top .mp-icon { width: 15px; height: 15px; }
.breath-track {
  height: 5px;
  margin: 8px 0 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
#breathBar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fe7d4, #4fc6b6);
  box-shadow: 0 0 10px rgba(127, 231, 212, 0.55);
  transition: width 0.12s linear, background 0.2s ease;
}
#breathBar.low { background: linear-gradient(90deg, #ff9a6a, var(--danger)); box-shadow: 0 0 10px rgba(255, 75, 85, 0.6); }
.hb-sub { font-size: 9px; letter-spacing: 0.05em; color: #7e93a0; }

.chase-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(118, 0, 10, 0.16) 66%, rgba(90, 0, 8, 0.55) 100%);
  box-shadow: inset 0 0 90px rgba(255, 30, 40, 0.28);
  transition: opacity 0.32s ease;
}
.chase-vignette.on { opacity: 1; animation: dangerPulse 1.15s ease-in-out infinite; }
.hide-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 52%, transparent 12%, rgba(2, 5, 9, 0.42) 45%, rgba(1, 3, 7, 0.88) 100%);
  transition: opacity 0.35s ease;
}
.hide-vignette.on { opacity: 1; }
.flash {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  background: #fff4e8;
}
.flash.go { animation: flashOnce 0.38s ease-out; }
.flash.red { background: #ff3b44; }
.flash.gold { background: #ffd7a0; }
.escape-fade {
  position: absolute;
  inset: 0;
  z-index: 29;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 214, 166, 0.95), rgba(255, 138, 61, 0.55) 38%, rgba(12, 8, 6, 0.98) 100%);
  transition: opacity 1.05s ease;
}
.escape-fade.on { opacity: 1; }

/* =========================================================
   弹窗
   ========================================================= */
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 18px) 20px calc(var(--safe-bottom) + 18px);
  background: rgba(2, 4, 9, 0.66);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.modal::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: url("images/gen/gptimg_1795276476_look.png");
  background-size: cover;
  background-position: 60% 45%;
  filter: blur(28px) brightness(0.3) saturate(0.85);
  opacity: 0.55;
  pointer-events: none;
}
.modal.show { opacity: 1; visibility: visible; }
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 354px;
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 36px);
  overflow-y: auto;
  padding: 24px 22px calc(18px + var(--safe-bottom));
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 138, 61, 0.09), transparent 55%),
    linear-gradient(180deg, rgba(23, 27, 42, 0.97), rgba(9, 12, 21, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.modal.show .modal-card { transform: translateY(0) scale(1); }
.modal-kicker {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--orange-2);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.modal-card h2 {
  margin: 2px 0 7px;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f8f3ea;
}
.modal-card p {
  margin: 0;
  color: #9ba2b3;
  font-size: 12px;
  line-height: 1.7;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aeb4c1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-close .mp-icon { width: 17px; height: 17px; }
.modal-close:active { transform: scale(0.92); }

.mini-stats {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}
.mini-stats > div {
  flex: 1;
  padding: 11px 8px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.mini-stats span { display: block; font-size: 9px; letter-spacing: 0.12em; color: #7f8798; margin-bottom: 4px; }
.mini-stats b { display: block; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: #f2ede3; font-variant-numeric: tabular-nums; }

.primary-btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffc08c, #ff8a3d 55%, #ef6417);
  color: #261005;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 28px rgba(240, 96, 24, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.1s ease;
}
.primary-btn:active { transform: scale(0.982); }
.ghost-row { display: flex; gap: 8px; margin-top: 10px; }
.ghost-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #cfd4df;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  transition: transform 0.1s ease, background 0.15s ease;
}
.ghost-btn .mp-icon { width: 16px; height: 16px; color: #9fa7b7; }
.ghost-btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.08); }
.text-btn {
  display: inline-block;
  margin-top: 9px;
  padding: 10px 14px;
  color: #798093;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.text-btn:active { color: #b5bdcc; }

/* 月纹锁 */
.lock-card { padding-bottom: calc(14px + var(--safe-bottom)); }
.lock-clue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 17px 0 14px;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.clue-label { font-size: 9.5px; letter-spacing: 0.16em; color: #858d9e; }
.clue-icons { display: flex; gap: 15px; color: #ffd3a7; }
.clue-icons .mp-icon { width: 22px; height: 22px; filter: drop-shadow(0 0 8px rgba(255, 138, 61, 0.4)); }
.dials {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 15px 10px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 138, 61, 0.13);
}
.dial {
  width: 78px;
  height: 90px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #ffd7b6;
  background: linear-gradient(160deg, rgba(255, 190, 130, 0.12), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.1s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.dial .mp-icon { width: 34px; height: 34px; }
.dial span { font-size: 8.5px; letter-spacing: 0.2em; color: #838b9d; }
.dial:active { transform: scale(0.94); }
.dial.ok {
  border-color: rgba(255, 178, 122, 0.7);
  color: #ffc38e;
  box-shadow: 0 0 22px rgba(255, 138, 61, 0.2), inset 0 0 22px rgba(255, 138, 61, 0.09);
}
.dial.ok span { color: #ffb27a; }
.lock-hint {
  min-height: 17px;
  margin: 12px 0 4px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #7f8798;
}
.lock-hint.ok { color: var(--teal); }

/* 结算 */
.end-card { text-align: center; }
.end-emblem {
  width: 68px;
  height: 68px;
  margin: 3px auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 65%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #ffc08c;
}
.end-emblem .mp-icon { width: 34px; height: 34px; }
.end-card.lose .end-emblem {
  background: radial-gradient(circle at 36% 28%, rgba(255, 75, 85, 0.22), rgba(60, 4, 10, 0.4) 68%);
  border-color: rgba(255, 75, 85, 0.32);
  color: #ff8b92;
  box-shadow: 0 0 30px rgba(255, 45, 60, 0.12);
}
.end-card.win .end-emblem {
  background: radial-gradient(circle at 36% 28%, rgba(255, 196, 130, 0.28), rgba(80, 40, 8, 0.34) 68%);
  border-color: rgba(255, 178, 122, 0.36);
  color: #ffd0a0;
  box-shadow: 0 0 34px rgba(255, 138, 61, 0.16);
}
.end-card.lose .modal-kicker { color: #ff8b92; }
.end-card.win .modal-kicker { color: var(--orange-2); }
.end-card.win h2 { color: #ffe7cd; }

/* =========================================================
   动画
   ========================================================= */
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
@keyframes objPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes shine {
  0%, 55% { left: -30%; opacity: 0; }
  68% { opacity: 1; }
  85%, 100% { left: 125%; opacity: 0; }
}
@keyframes dangerPulse {
  0%, 100% { opacity: 0.68; }
  50% { opacity: 1; }
}
@keyframes flashOnce {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  100% { opacity: 0; }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   适配
   ========================================================= */
@media (max-height: 760px) {
  .cover-content { padding-top: calc(var(--safe-top) + 16px); }
  .poster { aspect-ratio: 1.72 / 1; border-radius: 15px; }
  .eyebrow { margin-bottom: 10px; }
  .cover-head { margin-top: 14px; }
  .cover-head h1 { font-size: clamp(30px, 9.4vw, 40px); }
  .tagline { margin-top: 8px; font-size: 12px; line-height: 1.65; }
  .mech-row { margin-top: 11px; }
  .mech-row span { height: 25px; font-size: 9.5px; }
  .start-btn { height: 50px; margin-top: 13px; font-size: 15.5px; }
  .cover-foot { margin-top: 9px; }
  .joystick { width: 118px; height: 118px; }
  .joy-knob { width: 48px; height: 48px; }
  .action-btn { width: 62px; height: 62px; }
  .action-btn .mp-icon { width: 24px; height: 24px; }
  .sprint-btn { width: 68px; height: 68px; }
  .hud-bottom { bottom: calc(var(--safe-bottom) + 12px); }
  .interact-btn { bottom: calc(var(--safe-bottom) + 126px); }
  .minimap-shell { width: 78px; height: 107px; }
  .hidden-badge { top: calc(var(--safe-top) + 112px); }
}

@media (max-height: 640px) {
  .poster { display: none; }
  .mech-row { display: none; }
  .cover-head { margin-top: 0; }
  .cover-head h1 { font-size: 31px; }
  .tagline { font-size: 12px; }
  .start-btn { margin-top: 14px; }
  .cover-content { justify-content: flex-end; }
  .modal-card { padding-top: 20px; }
}

@media (min-width: 700px) and (min-height: 700px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(40% 45% at 15% 20%, rgba(64, 92, 160, 0.16), transparent 70%),
      radial-gradient(40% 40% at 85% 80%, rgba(255, 122, 47, 0.08), transparent 70%);
    pointer-events: none;
  }
  .app { border-radius: 26px; margin: 10px 0; height: calc(100dvh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
