*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #03060D;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #F4F1E8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

:root {
  --ink: #F5F1E8;
  --muted: #A4B4D0;
  --dim: #6E809E;
  --navy: #050A16;
  --card: rgba(18, 32, 58, .82);
  --line: rgba(158, 205, 255, .14);
  --orange: #FF8A3D;
  --orange-hi: #FFB35C;
  --orange-deep: #F06A17;
  --teal: #5EE6C8;
  --red: #FF5E6C;
  --moon: #9BD8FF;
}

button { font-family: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid #FFB35C; outline-offset: 3px; }

[hidden] { display: none !important; }

.app {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--navy);
  isolation: isolate;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   开始页
   ============================================================ */
.start {
  background:
    radial-gradient(120% 55% at 50% 105%, rgba(255, 138, 61, .13), transparent 70%),
    #050A16;
  overflow: hidden;
}

.start-hero {
  position: relative;
  flex: 1 1 0;
  min-height: 270px;
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 0;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  background-size: 340% auto;
  background-position: 90% 22%;
  transform: scale(1.03);
  transform-origin: 60% 40%;
  animation: heroDrift 24s ease-in-out infinite alternate;
  filter: saturate(1.03) brightness(.96);
}

.hero-eye-glow {
  position: absolute;
  left: 33%;
  top: 22%;
  width: 36%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(126, 205, 255, .4) 0%, rgba(70, 150, 255, .12) 38%, transparent 70%);
  filter: blur(10px);
  mix-blend-mode: screen;
  animation: eyeGlow 5.2s ease-in-out infinite;
  pointer-events: none;
}

.hero-fog {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .5;
  pointer-events: none;
}

.fog-a {
  width: 70%;
  height: 42%;
  left: -18%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(71, 129, 205, .3), transparent 70%);
  animation: fogDrift 18s ease-in-out infinite alternate;
}

.fog-b {
  width: 55%;
  height: 36%;
  right: -12%;
  bottom: 0;
  background: radial-gradient(circle, rgba(255, 145, 70, .16), transparent 70%);
  animation: fogDrift 22s ease-in-out infinite alternate-reverse;
}

.start-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(3, 8, 18, .92) 0%, rgba(3, 8, 18, .5) 18%, transparent 48%),
    linear-gradient(to bottom, rgba(3, 8, 18, .55) 0%, transparent 20%, transparent 52%, rgba(5, 10, 22, .78) 84%, #050A16 100%);
  pointer-events: none;
  z-index: 2;
}

.start-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 100px 20px rgba(2, 6, 15, .6);
  pointer-events: none;
  z-index: 2;
}

.clock {
  position: absolute;
  z-index: 3;
  top: calc(env(safe-area-inset-top) + 15px);
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(4, 8, 16, .5);
  border: 1px solid rgba(255, 84, 70, .18);
  color: #FF5A4C;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 0 8px rgba(255, 70, 55, .75);
  backdrop-filter: blur(6px);
}

.clock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FF5A4C;
  box-shadow: 0 0 7px #FF5A4C;
  animation: blink 2s steps(1, end) infinite;
}

.start-body {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 0 22px calc(env(safe-area-inset-bottom) + 16px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .22em;
  color: #FFAD73;
}

.eyebrow-line {
  width: 18px;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 138, 61, .9), rgba(255, 138, 61, .05));
  box-shadow: 0 0 8px rgba(255, 138, 61, .5);
}

.title {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: clamp(32px, 9.4vw, 41px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: .015em;
  color: #F8F3E8;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .07);
}

.title-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: .8em;
  height: .8em;
  margin-left: .16em;
  margin-top: .01em;
  border-radius: 50%;
  font-size: .46em;
  font-weight: 900;
  letter-spacing: 0;
  color: #2B1305;
  background: linear-gradient(160deg, #FFC172, #FF8A3D 58%, #F06A17);
  border: 1px solid rgba(255, 228, 195, .6);
  box-shadow: 0 4px 14px rgba(255, 122, 40, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.lead {
  margin: 0 0 17px;
  font-size: 13px;
  line-height: 1.68;
  color: #A6B5CE;
  letter-spacing: .01em;
}

.start-cta-wrap { position: relative; }

.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 219, 173, .6);
  background: linear-gradient(180deg, #FFB45E 0%, #FF8A3D 48%, #F5731F 100%);
  color: #2B1305;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: .03em;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 12px 30px rgba(255, 120, 40, .34),
    0 2px 6px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(150, 58, 0, .32);
  transition: transform .16s ease, box-shadow .16s ease, opacity .2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.cta .mp-icon { width: 22px; height: 22px; }

.cta-shine {
  position: absolute;
  top: -30%;
  left: -45%;
  width: 35%;
  height: 160%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: rotate(18deg);
  animation: shine 4.2s ease-in-out infinite;
  pointer-events: none;
}

.cta:active {
  transform: scale(.978) translateY(1px);
  box-shadow:
    0 5px 16px rgba(255, 120, 40, .28),
    inset 0 1px 0 rgba(255, 255, 255, .4),
    inset 0 -1px 0 rgba(150, 58, 0, .3);
}

.cta:disabled {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .09);
  color: #7B8CA6;
  box-shadow: none;
  cursor: default;
}

.cta:disabled .cta-shine { display: none; }

.cta-caption {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: #8596B2;
}

.cta-caption.is-record {
  color: #FFB27C;
}

.start-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: #8293B0;
  font-size: 9.5px;
  letter-spacing: .03em;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.meta-item .mp-icon {
  width: 12px;
  height: 12px;
  color: #94A8C8;
}

.meta-sep {
  width: 1px;
  height: 9px;
  background: rgba(255, 255, 255, .12);
}

.start-rule {
  margin: 12px 0 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: #596A87;
}

/* ============================================================
   游戏页
   ============================================================ */
.game {
  background: #04080F;
}

.game-bg {
  position: absolute;
  inset: -18px;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 92% 28%;
  filter: blur(9px) brightness(.5) saturate(.9);
  opacity: .5;
  transform: scale(1.06);
  pointer-events: none;
}

.game-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(56, 106, 180, .16), transparent 70%),
    linear-gradient(180deg, rgba(3, 7, 15, .5) 0%, rgba(3, 7, 15, .28) 24%, rgba(3, 7, 15, .78) 62%, #04080F 100%);
  pointer-events: none;
}

.hud {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 11px) 16px 0;
}

.night-pill,
.hearts {
  display: flex;
  align-items: center;
  height: 32px;
  border-radius: 999px;
  background: rgba(9, 19, 37, .72);
  border: 1px solid rgba(158, 205, 255, .15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.night-pill {
  gap: 7px;
  padding: 0 11px;
  color: #D2E0F4;
  font-size: 11.5px;
  letter-spacing: .03em;
}

.night-pill > .mp-icon {
  width: 15px;
  height: 15px;
  color: #8FD2FF;
  filter: drop-shadow(0 0 5px rgba(120, 190, 255, .5));
}

.night-pill b { font-weight: 700; }

.night-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 3px;
}

.night-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .18);
  transition: all .3s ease;
}

.night-dots i.done {
  background: var(--teal);
  box-shadow: 0 0 6px rgba(94, 230, 200, .6);
}

.night-dots i.now {
  width: 10px;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 138, 61, .7);
}

.hearts {
  gap: 3px;
  padding: 0 9px;
}

.hearts .mp-icon {
  width: 17px;
  height: 17px;
  color: #FF6170;
  filter: drop-shadow(0 0 5px rgba(255, 80, 100, .45));
  transition: transform .3s ease, color .3s ease, opacity .3s ease;
}

.hearts .mp-icon.lost {
  color: rgba(255, 255, 255, .13);
  filter: none;
  transform: scale(.82);
}

.hearts .mp-icon.breaking {
  animation: heartBreak .6s ease forwards;
}

.game-main {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 14px);
}

/* 怪物横幅 */
.monster-banner {
  position: relative;
  flex: 1 1 auto;
  min-height: 154px;
  max-height: 560px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(158, 205, 255, .16);
  background: #08111F;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05);
  animation: bannerIn .5s cubic-bezier(.2, .7, .2, 1) both;
}

.banner-art {
  position: absolute;
  inset: 0;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  background-size: 300% auto;
  background-position: 88% 20%;
  filter: saturate(1.05) brightness(.94);
  transform: scale(1.02);
  transition: transform 1.2s ease, filter 1.2s ease;
  animation: bannerBreathe 14s ease-in-out infinite alternate;
}

.monster-banner.is-danger .banner-art {
  filter: saturate(1.15) brightness(.86) contrast(1.06);
  transform: scale(1.06);
}

.banner-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(4, 9, 19, .98) 0%, rgba(4, 9, 19, .9) 24%, rgba(4, 9, 19, .28) 58%, transparent 78%),
    linear-gradient(to right, rgba(4, 9, 19, .52), transparent 42%),
    radial-gradient(90% 60% at 50% 0%, transparent 40%, rgba(3, 7, 14, .45) 100%);
  pointer-events: none;
}

.banner-top {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-pill,
.sense-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: .08em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.live-pill {
  color: #FFC29B;
  background: rgba(30, 12, 8, .5);
  border: 1px solid rgba(255, 120, 80, .28);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FF6A50;
  box-shadow: 0 0 8px #FF6A50;
  animation: blink 1.5s ease-in-out infinite;
}

.sense-pill {
  color: #C9E8FF;
  background: rgba(8, 22, 42, .52);
  border: 1px solid rgba(140, 205, 255, .26);
  letter-spacing: .12em;
}

.sense-pill .mp-icon {
  width: 13px;
  height: 13px;
  color: #93D6FF;
}

.banner-copy {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
}

.banner-copy h2 {
  margin: 0 0 5px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: .015em;
  color: #F6F8FF;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}

.monster-desc {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.62;
  color: #AABAD4;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 倒计时 */
.timer { flex: 0 0 auto; padding: 0 3px; }

.timer-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 9.5px;
  letter-spacing: .09em;
  color: #7E92B1;
}

.timer-copy b {
  font-size: 13px;
  font-weight: 700;
  color: #FFB179;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  transition: color .2s;
}

.timer-copy b em {
  margin-left: 1px;
  font-style: normal;
  font-size: 9px;
  opacity: .65;
}

.timer-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}

.timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFD08A, #FF8A3D 55%, #FF5F33);
  box-shadow: 0 0 12px rgba(255, 138, 61, .55);
  transition: width .12s linear, background .3s;
}

.timer.urgent .timer-fill {
  background: linear-gradient(90deg, #FF7B45, #FF3B4E);
  box-shadow: 0 0 16px rgba(255, 60, 80, .7);
  animation: urgentBlink .55s ease-in-out infinite;
}

.timer.urgent .timer-copy b { color: #FF6D74; }

/* 选择区 */
.choice {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.choice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.choice-head h3 {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #F1F5FF;
}

.choice-head h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  margin-right: 7px;
  border-radius: 2px;
  background: linear-gradient(180deg, #FFC172, #FF7A28);
  box-shadow: 0 0 9px rgba(255, 138, 61, .6);
}

.choice-sub {
  font-size: 9.5px;
  letter-spacing: .03em;
  color: #657795;
  white-space: nowrap;
}

.rule-hint {
  margin: 0;
  padding: 5px 9px;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .04em;
  color: #FFB583;
  background: rgba(255, 138, 61, .075);
  border: 1px dashed rgba(255, 138, 61, .2);
  border-radius: 8px;
}

.rule-hint.gone { display: none; }

.spots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.spot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(158, 205, 255, .13);
  background: linear-gradient(165deg, rgba(26, 45, 78, .86), rgba(10, 19, 37, .94));
  box-shadow: 0 9px 22px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), border-color .18s, box-shadow .18s, opacity .2s;
}

.spot:active { transform: scale(.968); }

.spot-photo {
  position: relative;
  display: block;
  height: 70px;
  border-radius: 11px;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  filter: saturate(.92) brightness(.82);
  overflow: hidden;
  transition: filter .2s;
}

.spot-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 13, 26, .72) 0%, transparent 55%);
}

.spot-bed .spot-photo {
  background-size: 349% auto;
  background-position: 1.8% 84.4%;
}

.spot-curtain .spot-photo {
  background-size: 349% auto;
  background-position: 47.4% 12.9%;
}

.spot-cabinet .spot-photo {
  background-size: 512% auto;
  background-position: 100% 62.3%;
}

.spot-name {
  padding: 0 2px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: #F0F5FF;
}

.spot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 28px;
  padding: 0 1px 1px;
  align-content: flex-start;
}

.tag {
  display: inline-block;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid rgba(162, 201, 255, .07);
  background: rgba(255, 255, 255, .055);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: .01em;
  color: #94A8C6;
  white-space: nowrap;
}

.spot.is-selected {
  border-color: rgba(255, 154, 83, .85);
  background: linear-gradient(165deg, rgba(48, 50, 62, .92), rgba(24, 26, 34, .96));
  box-shadow: 0 0 0 1px rgba(255, 138, 61, .35), 0 12px 28px rgba(255, 115, 35, .22);
  transform: translateY(-2px);
}

.spot.is-selected .spot-photo {
  filter: saturate(1.1) brightness(1.02);
}

.spot-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #2B1305;
  background: linear-gradient(160deg, #FFC172, #FF8A3D);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
  z-index: 2;
}

.spot-check .mp-icon { width: 13px; height: 13px; }
.spot.is-selected .spot-check { display: flex; }

.spot.is-burned {
  opacity: .4;
  filter: grayscale(.75);
  pointer-events: none;
}

.spot.is-burned .spot-photo { filter: grayscale(.9) brightness(.6); }

.spot.is-burned::after {
  content: "它翻过这里";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 28px;
  z-index: 3;
  padding: 3px 0;
  text-align: center;
  font-size: 8.5px;
  letter-spacing: .06em;
  color: #FF9A9A;
  background: rgba(19, 5, 9, .74);
  border: 1px solid rgba(255, 94, 108, .25);
  border-radius: 5px;
}

.spot.is-correct {
  border-color: rgba(94, 230, 200, .75);
  box-shadow: 0 0 0 1px rgba(94, 230, 200, .3), 0 10px 26px rgba(20, 170, 140, .2);
}

.spot.is-correct .spot-check {
  display: flex;
  background: linear-gradient(160deg, #9CF7E2, #4FD8B6);
}

.cta-hide {
  height: 52px;
  margin-top: 1px;
  font-size: 15px;
  letter-spacing: .05em;
}

.cta-hide .mp-icon { width: 18px; height: 18px; }

/* ============================================================
   安全过夜
   ============================================================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-safe {
  background: rgba(3, 7, 15, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.safe-card {
  width: 100%;
  max-width: 326px;
  padding: 26px 22px 20px;
  text-align: center;
  border-radius: 26px;
  border: 1px solid rgba(120, 220, 200, .2);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(94, 230, 200, .12), transparent 65%),
    linear-gradient(170deg, rgba(18, 35, 58, .97), rgba(7, 15, 28, .99));
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07);
  animation: popIn .32s cubic-bezier(.2, .8, .2, 1) both;
}

.safe-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: #0A2A24;
  background: linear-gradient(160deg, #B9FBEA, #4FD8B6 60%, #27BE9C);
  box-shadow: 0 0 0 7px rgba(94, 230, 200, .08), 0 10px 28px rgba(35, 200, 165, .3), inset 0 1px 0 rgba(255, 255, 255, .65);
  animation: badgePop .45s cubic-bezier(.2, .9, .2, 1) both;
}

.safe-badge .mp-icon { width: 34px; height: 34px; }

.safe-eyebrow {
  margin: 0 0 5px;
  font-size: 9.5px;
  letter-spacing: .18em;
  color: #6FE0C8;
}

.safe-title {
  margin: 0 0 7px;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: .03em;
  color: #F5FBF8;
}

.safe-flavor {
  margin: 0 auto 16px;
  max-width: 248px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #A5B8C9;
}

.safe-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.safe-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4FD8B6, #A6F7E4);
  box-shadow: 0 0 9px rgba(94, 230, 200, .5);
  transition: width 1.75s linear;
}

.safe-next {
  margin: 10px 0 0;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: #71859D;
  animation: softBlink 1.4s ease-in-out infinite;
}

/* ============================================================
   被发现
   ============================================================ */
.overlay-caught {
  z-index: 50;
  overflow: hidden;
  background: #0B0305;
  animation: shake .42s cubic-bezier(.36, .07, .19, .97) both;
}

.caught-bg {
  position: absolute;
  inset: -6%;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  background-size: 330% auto;
  background-position: 92% 26%;
  filter: brightness(.5) contrast(1.18) saturate(1.25);
  animation: caughtZoom 4.5s ease-out both;
}

.caught-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% 38%, rgba(255, 58, 64, .42), transparent 68%),
    linear-gradient(180deg, rgba(20, 2, 5, .3) 0%, rgba(12, 2, 4, .78) 58%, #080204 100%);
  mix-blend-mode: screen;
  animation: flash 1.3s ease-out both;
  pointer-events: none;
}

.overlay-caught::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 2, 4, .2) 0%, rgba(8, 2, 4, .55) 45%, rgba(8, 2, 4, .96) 100%);
  pointer-events: none;
}

.caught-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  margin-top: auto;
  padding-bottom: calc(env(safe-area-inset-bottom) + 6px);
  text-align: center;
  animation: caughtIn .45s .12s cubic-bezier(.2, .8, .2, 1) both;
}

.caught-eyebrow {
  margin: 0 0 9px;
  font-size: 9.5px;
  letter-spacing: .38em;
  color: #FF6B74;
  text-shadow: 0 0 12px rgba(255, 60, 80, .6);
}

.caught-title {
  margin: 0 0 10px;
  font-size: 33px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: .02em;
  color: #FFF3EF;
  text-shadow: 0 4px 32px rgba(255, 40, 50, .4), 0 2px 2px rgba(0, 0, 0, .5);
}

.caught-flavor {
  margin: 0 auto 16px;
  max-width: 300px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #E4B9B9;
}

.caught-heart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin-bottom: 20px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 80, 90, .09);
  border: 1px solid rgba(255, 80, 90, .22);
  color: #FF9AA0;
  font-size: 10.5px;
  letter-spacing: .05em;
}

.caught-heart .mp-icon {
  width: 14px;
  height: 14px;
  color: #FF5E6C;
  filter: drop-shadow(0 0 6px rgba(255, 70, 90, .6));
}

.cta-retry {
  height: 54px;
  background: linear-gradient(180deg, #FF9C6A 0%, #FF5F55 55%, #E43E3E 100%);
  border-color: rgba(255, 210, 190, .45);
  color: #260707;
  box-shadow: 0 12px 30px rgba(230, 50, 50, .3), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.cta-retry .mp-icon { width: 19px; height: 19px; }

/* ============================================================
   结束页 / 天亮
   ============================================================ */
.end {
  align-items: center;
  justify-content: center;
  padding: 28px 24px calc(env(safe-area-inset-bottom) + 22px);
  overflow: hidden;
  text-align: center;
}

.end-bg {
  position: absolute;
  inset: -4%;
  background-image: url("images/gen/night-room.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 92% 30%;
}

.lose-bg {
  background-size: 330% auto;
  background-position: 92% 30%;
  filter: brightness(.28) saturate(.55) contrast(1.1);
}

.lose-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 50% at 50% 45%, rgba(120, 16, 24, .32), transparent 70%),
    linear-gradient(180deg, rgba(6, 2, 4, .55), rgba(6, 2, 4, .92));
}

.win-bg {
  filter: sepia(.42) saturate(1.35) brightness(.62) hue-rotate(-18deg);
  background-position: 35% 50%;
}

.win-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 55% at 50% 18%, rgba(255, 187, 110, .42), transparent 68%),
    linear-gradient(180deg, rgba(36, 20, 20, .1) 0%, rgba(14, 9, 14, .8) 48%, #08060B 70%, #08060B 100%);
}

.end-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
}

.end-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
}

.lose-icon {
  color: #FF8A8E;
  background: rgba(255, 70, 80, .1);
  border: 1px solid rgba(255, 80, 90, .28);
  box-shadow: 0 0 0 8px rgba(255, 50, 60, .04);
}

.lose-icon .mp-icon { width: 28px; height: 28px; }

.win-icon {
  color: #4A2407;
  background: linear-gradient(160deg, #FFE0A8, #FFB35C 55%, #FF8A3D);
  box-shadow: 0 0 0 8px rgba(255, 170, 90, .08), 0 12px 34px rgba(255, 150, 60, .35), inset 0 1px 0 rgba(255, 255, 255, .65);
  animation: sunFloat 5s ease-in-out infinite;
}

.win-icon .mp-icon { width: 32px; height: 32px; }

.end-eyebrow {
  margin: 0 0 8px;
  font-size: 9.5px;
  letter-spacing: .2em;
  color: #C2A392;
}

.end-title {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: .04em;
  color: #F6EFE6;
  text-shadow: 0 4px 34px rgba(0, 0, 0, .7);
}

.lose .end-title { color: #F2DAD8; }
.win-title { color: #FFF6E7; text-shadow: 0 0 40px rgba(255, 160, 70, .45), 0 4px 26px rgba(0, 0, 0, .6); }

.end-lead {
  margin: 0 auto 18px;
  max-width: 290px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #B9A9A7;
}

.win .end-lead { color: #DCC9B4; }

.end-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 22px;
  padding: 11px 16px;
  width: fit-content;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #9E8D8C;
}

.end-stat b { font-size: 18px; font-weight: 800; color: #FFB08A; letter-spacing: .02em; }

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
}

.win-stat {
  padding: 10px 4px 9px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 200, 150, .14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.win-stat b {
  display: block;
  margin-bottom: 3px;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: #FFD9A8;
  font-variant-numeric: tabular-nums;
}

.win-stat span {
  font-size: 8.5px;
  letter-spacing: .05em;
  color: #A79080;
}

.ghost-btn {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: transparent;
  color: #9AA6B8;
  font-size: 12px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.ghost-btn:active { background: rgba(255, 255, 255, .07); }
.ghost-btn.light { color: #CBB7A2; border-color: rgba(255, 210, 160, .18); }

/* ============================================================
   动画
   ============================================================ */
@keyframes heroDrift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.075) translate3d(-1.4%, -1.2%, 0); }
}

@keyframes fogDrift {
  from { transform: translate3d(-3%, 2%, 0) scale(1); }
  to { transform: translate3d(5%, -3%, 0) scale(1.12); }
}

@keyframes eyeGlow {
  0%, 100% { opacity: .35; transform: scale(.94); }
  50% { opacity: .8; transform: scale(1.06); }
}

@keyframes blink {
  0%, 46%, 52%, 100% { opacity: 1; }
  48%, 50% { opacity: .25; }
}

@keyframes shine {
  0%, 58% { left: -55%; opacity: 0; }
  64% { opacity: .8; }
  82% { left: 125%; opacity: .8; }
  88%, 100% { left: 125%; opacity: 0; }
}

@keyframes bannerBreathe {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1%, -1.4%, 0); }
}

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes urgentBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

@keyframes heartBreak {
  0% { transform: scale(1); color: #FF6170; }
  30% { transform: scale(1.5) rotate(-12deg); color: #FFD0D4; }
  100% { transform: scale(.82); color: rgba(255, 255, 255, .13); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes softBlink {
  0%, 100% { opacity: .45; }
  50% { opacity: .95; }
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  12% { transform: translate(-8px, 3px) rotate(-.6deg); }
  26% { transform: translate(7px, -4px) rotate(.5deg); }
  40% { transform: translate(-5px, 2px) rotate(-.35deg); }
  55% { transform: translate(4px, -2px) rotate(.25deg); }
  72% { transform: translate(-2px, 1px) rotate(-.1deg); }
  88% { transform: translate(1px, 0) rotate(0); }
}

@keyframes caughtZoom {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

@keyframes flash {
  0% { opacity: .1; }
  8% { opacity: 1; }
  22% { opacity: .35; }
  100% { opacity: .55; }
}

@keyframes caughtIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sunFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ============================================================
   自适应
   ============================================================ */
@media (max-height: 700px) {
  .start-hero { min-height: 235px; }
  .title { font-size: clamp(29px, 8.8vw, 36px); }
  .lead { font-size: 12px; margin-bottom: 13px; }
  .cta { height: 52px; font-size: 15.5px; }
  .start-meta { margin-top: 12px; }
  .start-rule { margin-top: 9px; }
  .monster-banner { min-height: 138px; }
  .spot-photo { height: 62px; }
  .spot-tags { min-height: 26px; }
  .cta-hide { height: 48px; }
  .game-main { gap: 8px; padding-top: 9px; }
  .choice { gap: 7px; }
}

@media (max-height: 640px) {
  .start-body { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .start-hero { min-height: 190px; }
  .start-meta { display: none; }
  .start-rule { display: none; }
  .lead { margin-bottom: 11px; }
  .monster-banner { min-height: 118px; }
  .banner-copy h2 { font-size: 17px; }
  .monster-desc { -webkit-line-clamp: 2; font-size: 10.5px; }
  .spot-photo { height: 54px; }
  .spot { border-radius: 13px; }
  .spot-tags { min-height: 24px; }
  .tag { font-size: 8px; padding: 2.5px 4px; }
  .choice-head h3 { font-size: 14px; }
  .cta-hide { height: 46px; font-size: 14px; }
  .game-main { gap: 7px; padding-bottom: calc(env(safe-area-inset-bottom) + 9px); }
}

@media (max-width: 350px) {
  .night-dots { display: none; }
  .start-body { padding-left: 18px; padding-right: 18px; }
  .game-main { padding-left: 12px; padding-right: 12px; }
  .hud { padding-left: 12px; padding-right: 12px; }
  .spot-name { font-size: 11.5px; }
  .choice-sub { display: none; }
}

@media (min-width: 520px) and (min-height: 700px) {
  .app {
    height: min(920px, calc(100dvh - 32px));
    border-radius: 30px;
    box-shadow:
      0 40px 100px rgba(0, 0, 0, .8),
      0 0 0 1px rgba(150, 200, 255, .1),
      0 0 90px rgba(255, 138, 61, .05);
  }
  body {
    background:
      radial-gradient(50% 40% at 50% 45%, rgba(28, 56, 98, .35), transparent 70%),
      #03060D;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
