/* =========================================================
   穿越求生记 · AppEyes H5
   竖屏、单页、原生 HTML/CSS/JS
   ========================================================= */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E5671C;
  --orange-dark: #B4470E;
  --ink: #2A1A12;
  --ink-2: #4B3021;
  --muted: #92745C;
  --cream: #FFF7EA;
  --paper: #FFFBF4;
  --jade: #4C9C86;
  --gold: #F3C969;
  --red: #D9533F;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #140C09;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.hidden { display: none !important; }
b, strong { font-weight: 800; }

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  background: #140C09;
}
.screen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 520px;
  transform: translateX(-50%);
  overflow: hidden;
}
.mp-icon { flex: 0 0 auto; }

/* =========================================================
   开始页
   ========================================================= */
.start {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(62% 38% at 68% 18%, rgba(255, 221, 165, 0.62), transparent 72%),
    radial-gradient(95% 54% at 50% 106%, rgba(255, 126, 55, 0.38), transparent 62%),
    linear-gradient(180deg, #24122B 0%, #4A2237 20%, #8B393C 40%, #D1653E 59%, #F49C54 76%, #FFC77C 100%);
  scrollbar-width: none;
}
.start::-webkit-scrollbar { display: none; }

.start-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.start::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 10, 12, 0.18) 0%, transparent 26%, rgba(28, 12, 10, 0.16) 54%, rgba(24, 11, 8, 0.74) 78%, rgba(18, 8, 6, 0.94) 100%);
  z-index: 3;
}

.start-sun {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #FFF8D9 0%, #FFE3A3 34%, #FFAE5C 58%, rgba(255, 138, 61, 0) 72%);
  filter: blur(1px);
  box-shadow: 0 0 70px 20px rgba(255, 174, 92, 0.32);
  opacity: 0.85;
}

/* 时间裂隙 */
.rift {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 150px;
  height: 232px;
  transform: translateX(-50%) rotate(7deg);
  z-index: 2;
  animation: riftSway 9s ease-in-out infinite;
}
.rift-glow {
  position: absolute;
  inset: -56px -46px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 180, 95, 0.38), rgba(255, 120, 60, 0.12) 44%, transparent 68%);
  filter: blur(12px);
  animation: riftPulse 4.2s ease-in-out infinite;
}
.rift-core {
  position: absolute;
  inset: 13% 33%;
  border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  background: linear-gradient(180deg, rgba(255, 250, 220, 0.95) 0%, rgba(255, 196, 110, 0.85) 34%, rgba(255, 116, 54, 0.6) 66%, rgba(96, 34, 22, 0.08) 100%);
  filter: blur(1.5px);
  box-shadow: 0 0 38px 8px rgba(255, 167, 82, 0.55), inset 0 0 18px rgba(255, 250, 220, 0.85);
  animation: riftPulse 3.4s ease-in-out infinite;
}
.rift-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(255, 220, 170, 0.46);
  border-radius: 50%;
}
.rift-ring.r1 { width: 118px; height: 190px; transform: translate(-50%, -50%) rotate(0deg); animation: ringSpin 16s linear infinite; }
.rift-ring.r2 { width: 150px; height: 232px; border-style: dashed; border-color: rgba(255, 205, 145, 0.32); transform: translate(-50%, -50%) rotate(22deg); animation: ringSpin 24s linear infinite reverse; }
.rift-ring.r3 { width: 88px; height: 150px; border-color: rgba(255, 240, 205, 0.28); transform: translate(-50%, -50%) rotate(-18deg); animation: ringSpin 20s linear infinite; }
.rift-spark {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #FFE2AC;
  box-shadow: 0 0 10px 2px rgba(255, 196, 110, 0.8);
  animation: sparkFloat 5s ease-in-out infinite;
}
.rift-spark.s1 { left: 8%; top: 62%; animation-delay: 0s; }
.rift-spark.s2 { right: 6%; top: 38%; width: 3px; height: 3px; animation-delay: 1.4s; }
.rift-spark.s3 { left: 48%; bottom: 2%; width: 4px; height: 4px; animation-delay: 2.6s; }

.start-cloud {
  position: absolute;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 228, 200, 0.22);
  filter: blur(5px);
}
.start-cloud::before, .start-cloud::after {
  content: ""; position: absolute; border-radius: 50%; background: inherit;
}
.start-cloud::before { width: 60%; height: 26px; left: 12%; top: -12px; }
.start-cloud::after { width: 44%; height: 22px; right: 12%; top: -9px; }
.cloud-a { width: 150px; top: 19%; left: -20px; animation: cloudDrift 28s linear infinite; }
.cloud-b { width: 110px; top: 31%; right: -30px; opacity: 0.7; animation: cloudDrift 36s linear infinite reverse; }
.cloud-c { width: 84px; top: 45%; left: 22%; opacity: 0.5; animation: cloudDrift 42s linear infinite; }

.start-skyline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 52%;
  z-index: 1;
}
.start-lanterns { animation: lanternFlicker 4s ease-in-out infinite; }
.birds { animation: birdsDrift 12s ease-in-out infinite; }

.start-traveler {
  position: absolute;
  left: 11%;
  bottom: 29%;
  width: 84px;
  z-index: 2;
  opacity: 0.92;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
  animation: travelerBreath 4.4s ease-in-out infinite;
}
.start-traveler svg { display: block; width: 100%; height: auto; }

.start-top {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 76%;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(30, 14, 18, 0.4);
  border: 1px solid rgba(255, 224, 190, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #FFC077, #E5671C);
  border: 1.5px solid rgba(255, 246, 230, 0.6);
  display: grid;
  place-items: center;
}
.player-avatar img, .player-avatar svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.player-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.player-meta b {
  font-size: 12.5px;
  color: #FFF4E2;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-meta small { margin-top: 2px; font-size: 9.5px; color: rgba(255, 226, 195, 0.66); letter-spacing: 0.3px; }
.sound-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #FFE4C2;
  background: rgba(30, 14, 18, 0.4);
  border: 1px solid rgba(255, 224, 190, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.sound-btn .mp-icon { width: 19px; height: 19px; }
.sound-btn:active { transform: scale(0.92); }
.sound-btn.muted { opacity: 0.55; }

.start-ui {
  position: relative;
  z-index: 6;
  margin-top: auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44vh 22px calc(18px + var(--safe-bottom));
}
.start-ui > * { animation: riseIn 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
.start-ui > *:nth-child(1) { animation-delay: 0.04s; }
.start-ui > *:nth-child(2) { animation-delay: 0.1s; }
.start-ui > *:nth-child(3) { animation-delay: 0.16s; }
.start-ui > *:nth-child(4) { animation-delay: 0.22s; }
.start-ui > *:nth-child(5) { animation-delay: 0.28s; }
.start-ui > *:nth-child(6) { animation-delay: 0.34s; }

.eyebrow {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.6px;
  color: #FFD2A2;
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.18);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.game-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 48px;
  font-size: clamp(42px, 13.4vw, 58px);
  line-height: 1.02;
  letter-spacing: 3px;
  color: #FFF6E7;
  text-shadow: 0 3px 0 rgba(84, 30, 10, 0.28), 0 14px 34px rgba(0, 0, 0, 0.42);
}
.game-title span {
  position: relative;
  color: #FFB264;
  display: inline-block;
}
.game-title span::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -4px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 138, 61, 0.7), transparent 70%);
  filter: blur(3px);
}
.tagline {
  margin: 15px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 238, 219, 0.78);
  letter-spacing: 0.2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.tagline b { color: #FFD08C; font-weight: 800; }
.goal-line {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 11px 0 0;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(40, 18, 14, 0.3);
  border: 1px solid rgba(255, 214, 160, 0.2);
  color: rgba(255, 226, 192, 0.82);
  font-size: 10px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.goal-line .mp-icon { width: 13px; height: 13px; color: #FFB25E; }

.start-record {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 17px 0 18px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(38, 18, 14, 0.34);
  border: 1px solid rgba(255, 225, 190, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.record-item { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.record-label { font-size: 9px; letter-spacing: 1.4px; color: rgba(255, 218, 180, 0.55); }
.record-item b {
  font-size: 13.5px;
  color: #FFEBD1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-item:first-child b { font-size: 18px; color: #FFC57E; line-height: 1.15; }
.record-line { width: 1px; background: rgba(255, 225, 190, 0.14); flex: 0 0 auto; }

/* 按钮 */
.cta {
  position: relative;
  width: 100%;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #FFAD5C 0%, #FF8A3D 46%, #F0691B 100%);
  box-shadow: 0 7px 0 #A63E0B, 0 16px 32px rgba(255, 107, 26, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #3B1804;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.cta:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #A63E0B, 0 8px 18px rgba(255, 107, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.cta-glow {
  position: absolute;
  top: -40%;
  left: -30%;
  width: 46%;
  height: 180%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: rotate(14deg);
  animation: ctaShine 4.2s ease-in-out infinite;
}
.cta-text {
  position: relative;
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 3px;
  padding-left: 34px;
}
.cta-arrow {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 249, 236, 0.92);
  color: #D95B11;
  box-shadow: 0 2px 6px rgba(120, 40, 0, 0.22);
}
.cta-arrow .mp-icon { width: 21px; height: 21px; }
.text-btn {
  margin: 11px auto 0;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255, 233, 208, 0.72);
  letter-spacing: 0.6px;
}
.text-btn .mp-icon { width: 16px; height: 16px; opacity: 0.8; }
.text-btn:active { background: rgba(255, 255, 255, 0.08); }

/* =========================================================
   游戏页
   ========================================================= */
.game {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #F5E2C4;
  overflow: hidden;
  animation: screenIn 0.35s ease both;
}

/* 状态栏 */
.hud {
  position: relative;
  z-index: 12;
  padding: calc(9px + var(--safe-top)) 15px 10px;
  color: var(--cream);
  background:
    radial-gradient(120% 120% at 18% -20%, rgba(255, 138, 61, 0.28), transparent 55%),
    linear-gradient(180deg, #2A1710 0%, #3B2116 64%, #4A291B 100%);
  box-shadow: 0 8px 22px rgba(64, 28, 10, 0.28);
  border-radius: 0 0 20px 20px;
}
.hud::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 130, 0.28), transparent);
}
.hud-top { display: flex; align-items: center; gap: 7px; }
.day-pill, .weather-pill, .coin-pill {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.day-pill {
  background: rgba(255, 138, 61, 0.16);
  border: 1px solid rgba(255, 150, 85, 0.42);
  color: #FFD9B4;
  padding-left: 8px;
}
.day-pill .mp-icon { width: 15px; height: 15px; color: #FFB066; }
.day-pill b { color: #FFF3E2; font-size: 14px; margin: 0 2px; }
.day-pill em { font-style: normal; font-size: 9px; color: rgba(255, 216, 180, 0.55); }
.weather-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 235, 215, 0.12);
  color: rgba(255, 238, 218, 0.85);
}
.weather-pill .mp-icon { width: 14px; height: 14px; color: #FFCE7C; }
.coin-pill {
  margin-left: auto;
  background: linear-gradient(180deg, rgba(255, 204, 112, 0.2), rgba(255, 166, 72, 0.1));
  border: 1px solid rgba(255, 196, 96, 0.35);
  color: #FFD98C;
  padding-left: 8px;
}
.coin-pill .mp-icon { width: 15px; height: 15px; color: #FFD06F; }
.coin-pill b { font-size: 14px; color: #FFF0C9; min-width: 10px; text-align: right; }
.coin-pill span { font-size: 9px; color: rgba(255, 220, 156, 0.65); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.stat {
  min-width: 0;
  padding: 6px 8px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 240, 225, 0.09);
}
.stat-head { display: flex; align-items: center; gap: 3px; font-size: 9.5px; color: rgba(255, 235, 215, 0.68); }
.stat-head .mp-icon { width: 12px; height: 12px; }
.stat-head b { margin-left: auto; font-size: 12px; color: #FFF0DC; letter-spacing: 0.3px; }
.stat-bar {
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}
.stat-bar i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), background 0.3s ease;
}
.stat[data-stat="stamina"] .stat-head .mp-icon { color: #6FD3A0; }
.stat[data-stat="stamina"] .stat-bar i { background: linear-gradient(90deg, #4FB27E, #8BE3B4); }
.stat[data-stat="satiety"] .stat-head .mp-icon { color: #FFC96A; }
.stat[data-stat="satiety"] .stat-bar i { background: linear-gradient(90deg, #E8A02E, #FFD779); }
.stat[data-stat="health"] .stat-head .mp-icon { color: #FF8C7E; }
.stat[data-stat="health"] .stat-bar i { background: linear-gradient(90deg, #D95A49, #FF9A89); }
.stat.low { border-color: rgba(255, 120, 90, 0.45); background: rgba(190, 60, 40, 0.16); }
.stat.low .stat-head b { color: #FF9F8D; }
.stat.low .stat-bar i { animation: lowBar 1.3s ease-in-out infinite; }
.stat.high .stat-head b { color: #9DF0BE; }

/* 场景 */
.scene {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  isolation: isolate;
  background: #FFD39A;
  transition: background 0.9s ease;
}
.scene[data-phase="morning"] { background: linear-gradient(180deg, #FFE3B0 0%, #FFC982 42%, #FFAE68 72%, #E8894C 100%); }
.scene[data-phase="noon"] { background: linear-gradient(180deg, #BCE2F2 0%, #FFE0AA 48%, #FFC47B 76%, #EFA05E 100%); }
.scene[data-phase="dusk"] { background: linear-gradient(180deg, #74405F 0%, #C96048 32%, #F28B4E 62%, #FFB36A 100%); }
.scene[data-phase="night"] { background: linear-gradient(180deg, #1A1A38 0%, #33254A 34%, #58334F 64%, #82484C 100%); }

.scene-sky { position: absolute; inset: 0; pointer-events: none; }
.celestial { position: absolute; border-radius: 50%; transition: opacity 0.8s ease, transform 0.8s ease; }
.sun {
  top: 9%;
  right: 10%;
  width: 66px;
  height: 66px;
  background: radial-gradient(circle at 42% 40%, #FFFCE5 0%, #FFE9AE 36%, #FFBE6E 62%, rgba(255, 190, 110, 0) 74%);
  box-shadow: 0 0 46px 12px rgba(255, 210, 130, 0.42);
}
.scene[data-phase="noon"] .sun { top: 5%; right: 22%; width: 56px; height: 56px; }
.scene[data-phase="dusk"] .sun {
  top: 28%;
  right: 12%;
  width: 78px;
  height: 78px;
  background: radial-gradient(circle at 50% 50%, #FFF3CF 0%, #FFC46E 30%, #FF7B3C 58%, rgba(255, 110, 50, 0) 72%);
}
.scene[data-phase="night"] .sun { opacity: 0; transform: translateY(26px) scale(0.55); }
.moon {
  top: 8%;
  right: 14%;
  width: 44px;
  height: 44px;
  opacity: 0;
  transform: translateY(-16px) scale(0.7);
  background: radial-gradient(circle at 38% 35%, #FFFDF0 0%, #F6EBC9 40%, #D8C9A4 64%, rgba(216, 201, 164, 0) 72%);
  box-shadow: 0 0 36px 8px rgba(255, 246, 210, 0.24);
}
.scene[data-phase="night"] .moon { opacity: 1; transform: translateY(0) scale(1); }

.scene-stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #FFF8DD 40%, transparent 100%),
    radial-gradient(1px 1px at 26% 9%, #FFF8DD 40%, transparent 100%),
    radial-gradient(1.6px 1.6px at 41% 23%, #FFE9BE 40%, transparent 100%),
    radial-gradient(1px 1px at 56% 12%, #FFF8DD 40%, transparent 100%),
    radial-gradient(1.2px 1.2px at 68% 30%, #FFF2CF 40%, transparent 100%),
    radial-gradient(1px 1px at 82% 16%, #FFF8DD 40%, transparent 100%),
    radial-gradient(1.4px 1.4px at 91% 34%, #FFE9BE 40%, transparent 100%),
    radial-gradient(1px 1px at 76% 47%, #FFF8DD 40%, transparent 100%),
    radial-gradient(1px 1px at 33% 40%, #FFF2CF 40%, transparent 100%),
    radial-gradient(1.3px 1.3px at 8% 38%, #FFF8DD 40%, transparent 100%);
}
.scene[data-phase="night"] .scene-stars { opacity: 0.9; }

.scene-cloud {
  position: absolute;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.5);
  filter: blur(3px);
}
.scene-cloud::before, .scene-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.scene-cloud::before { width: 58%; height: 22px; left: 10%; top: -10px; }
.scene-cloud::after { width: 40%; height: 18px; right: 10%; top: -7px; }
.sc1 { width: 96px; top: 13%; left: -24px; opacity: 0.65; animation: cloudDrift 30s linear infinite; }
.sc2 { width: 68px; top: 24%; right: 6%; opacity: 0.42; animation: cloudDrift 40s linear infinite reverse; }
.sc3 { width: 54px; top: 34%; left: 30%; opacity: 0.3; animation: cloudDrift 35s linear infinite; }
.scene[data-phase="night"] .scene-cloud { background: rgba(200, 200, 235, 0.14); }

.scene-city {
  position: absolute;
  left: -2%;
  bottom: 0;
  width: 104%;
  height: 86%;
  z-index: 1;
  transition: filter 0.9s ease;
  filter: saturate(0.92);
}
.scene[data-phase="dusk"] .scene-city { filter: saturate(0.82) brightness(0.88); }
.scene[data-phase="night"] .scene-city { filter: brightness(0.48) saturate(0.55) hue-rotate(-12deg); }

.scene-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(165, 91, 44, 0.08) 0%, rgba(158, 84, 40, 0.28) 55%, rgba(112, 54, 25, 0.52) 100%);
  pointer-events: none;
}
.scene[data-phase="night"] .scene-ground {
  background: linear-gradient(180deg, rgba(30, 20, 40, 0.1) 0%, rgba(24, 14, 30, 0.4) 60%, rgba(16, 8, 16, 0.66) 100%);
}

.scene-stall {
  position: absolute;
  left: -6px;
  bottom: 8px;
  width: 46%;
  height: 72%;
  max-width: 200px;
  max-height: 170px;
  z-index: 3;
  filter: drop-shadow(0 8px 10px rgba(80, 35, 12, 0.25));
}
.scene[data-phase="night"] .scene-stall { filter: brightness(0.62) saturate(0.8) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4)); }
.lantern-glow-soft { opacity: 0.5; transition: opacity 0.8s ease; }
.scene[data-phase="dusk"] .lantern-glow-soft { opacity: 0.85; }
.scene[data-phase="night"] .lantern-glow-soft { opacity: 1; animation: lanternFlicker 3s ease-in-out infinite; }
.scene[data-phase="night"] .city-lanterns circle { opacity: 0.55; }
.stall-cat { transform-origin: 150px 150px; animation: catTail 5s ease-in-out infinite; }

.hero-char {
  position: absolute;
  right: 9px;
  bottom: 12px;
  width: 36%;
  height: 77%;
  max-width: 150px;
  max-height: 208px;
  z-index: 4;
  transform-origin: 50% 100%;
  animation: charBob 3.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 8px rgba(80, 32, 10, 0.22));
}
.hero-char svg { display: block; width: 100%; height: 100%; overflow: visible; }
.char-shadow { display: none; }
.scene[data-phase="night"] .hero-char { filter: brightness(0.8) saturate(0.85) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }
.hero-char.do-work { animation: charWork 0.72s ease; }
.hero-char.do-forage { animation: charForage 0.72s ease; }
.hero-char.do-sell { animation: charSell 0.72s ease; }
.hero-char.do-rest { animation: charRest 0.8s ease; }
.char-phone { animation: phoneGlow 2.6s ease-in-out infinite; transform-origin: 109px 107px; }

.scene-tag {
  position: absolute;
  top: 9px;
  left: 12px;
  z-index: 7;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(42, 24, 16, 0.5);
  border: 1px solid rgba(255, 226, 190, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFE9CE;
  font-size: 9.5px;
  letter-spacing: 0.5px;
}
.scene-tag .mp-icon { width: 12px; height: 12px; color: #FFC37A; }
.scene-tag em {
  font-style: normal;
  margin-left: 2px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 226, 190, 0.22);
  color: rgba(255, 226, 190, 0.68);
}
.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  box-shadow: inset 0 -26px 34px rgba(70, 30, 8, 0.3), inset 0 18px 30px rgba(255, 240, 210, 0.12);
  transition: box-shadow 0.6s ease;
}
.game.danger .scene-vignette { animation: dangerVignette 1.5s ease-in-out infinite; }
.scene-particles { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  bottom: -8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 214, 150, 0.75);
  box-shadow: 0 0 6px 1px rgba(255, 184, 96, 0.45);
  animation: particleRise linear infinite;
  opacity: 0;
}
.scene[data-phase="night"] .particle { background: rgba(255, 235, 170, 0.9); box-shadow: 0 0 8px 2px rgba(255, 210, 120, 0.5); }
.float-layer { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
.float-text {
  position: absolute;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #FFF6DE;
  text-shadow: 0 2px 0 rgba(75, 28, 8, 0.55), 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: floatUp 1.15s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  white-space: nowrap;
}
.float-text.bad { color: #FFD0C7; }
.float-text.good { color: #FFF0B8; }

/* 操作区 */
.sheet {
  position: relative;
  z-index: 14;
  margin-top: -14px;
  padding: 7px 15px calc(9px + var(--safe-bottom));
  border-radius: 23px 23px 0 0;
  background:
    radial-gradient(120% 60% at 50% -10%, #FFFDF8 0%, #FFF9EF 52%, #FBF1E1 100%);
  box-shadow: 0 -10px 28px rgba(90, 42, 14, 0.22);
}
.sheet-grip {
  width: 38px;
  height: 4px;
  margin: 0 auto 5px;
  border-radius: 99px;
  background: #E4CEB1;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 7px; }
.sheet-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink);
  line-height: 1.15;
}
.sheet-sub {
  margin: 2px 0 0;
  max-width: 190px;
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 8px;
  border-radius: 999px;
  background: #F8EBD7;
  border: 1px solid #EEDCC2;
  font-size: 9.5px;
  color: #9A7754;
  white-space: nowrap;
}
.ap-label { letter-spacing: 0.5px; }
.ap-dots { display: flex; gap: 3px; margin: 0 2px; }
.ap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E3C9A7;
  transition: background 0.25s ease, transform 0.25s ease;
}
.ap-dot.on { background: var(--orange); box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.16); }
.ap-num { font-size: 13.5px; color: var(--orange-deep); line-height: 1; }
.ap-unit { color: #A98763; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 85px;
  padding: 8px 9px 8px;
  text-align: left;
  border-radius: 15px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFCF5 100%);
  border: 1px solid #EDD9BD;
  box-shadow: 0 2px 0 #E8CFAC, 0 5px 12px rgba(115, 63, 22, 0.06);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
  overflow: hidden;
}
.action::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 138, 61, 0.05);
}
.action:active:not(.disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 #E8CFAC, 0 2px 5px rgba(115, 63, 22, 0.06);
}
.action.disabled { opacity: 0.48; filter: saturate(0.55); }
.action-top { display: flex; align-items: center; gap: 6px; width: 100%; }
.action-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #FFEAD5, #FFDDBB);
  color: #D75E1B;
  box-shadow: inset 0 1px 0 #FFF8EA;
}
.action-icon .mp-icon { width: 17px; height: 17px; }
.action-name { font-size: 13px; font-weight: 900; color: #302016; letter-spacing: 0.2px; line-height: 1.2; }
.action-cost {
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 5px;
  background: #F8ECDB;
  color: #A47B54;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}
.action-desc {
  margin-left: 35px;
  margin-top: -1px;
  font-size: 9px;
  line-height: 1.25;
  color: #9A7B60;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-fx { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; padding-top: 4px; }
.fx {
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  white-space: nowrap;
}
.fx.pos { background: #E8F4EC; color: #347A5C; }
.fx.neg { background: #FBE9E2; color: #B04C35; }
.fx.neu { background: #F4EADA; color: #8A684A; }
.fx.risk { background: #FFF4DC; color: #B47B1E; }

.tip-line {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #F6E9D6;
  border: 1px solid #F0E0C9;
  color: #916E50;
  font-size: 9.5px;
  line-height: 1.35;
}
.tip-line .mp-icon { width: 13px; height: 13px; color: #D9863B; }
.tip-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   浮层
   ========================================================= */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px calc(18px + var(--safe-bottom));
  background: rgba(24, 11, 7, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.22s ease both;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 378px;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 20px 18px calc(17px + var(--safe-bottom) * 0.4);
  border-radius: 25px;
  background:
    radial-gradient(120% 40% at 50% 0%, #FFFFFF 0%, #FFFBF3 42%, #FFF7EB 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 60px rgba(35, 14, 5, 0.4), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  animation: modalPop 0.32s cubic-bezier(0.18, 0.9, 0.28, 1.15) both;
  scrollbar-width: none;
}
.modal-card::-webkit-scrollbar { display: none; }
.modal-card.night-card {
  background:
    radial-gradient(90% 46% at 72% 0%, rgba(120, 108, 190, 0.28), transparent 64%),
    linear-gradient(180deg, #241F43 0%, #2A2246 44%, #332544 100%);
  color: #F6ECDB;
  border-color: rgba(190, 180, 235, 0.22);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #F6EBDD;
  color: #8C6E53;
}
.modal-close .mp-icon { width: 18px; height: 18px; }
.modal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.event-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #FFEDD8, #FFD9B2);
  color: #D25C18;
  box-shadow: 0 4px 12px rgba(230, 110, 30, 0.18), inset 0 1px 0 #FFF8EA;
  transform: rotate(-3deg);
}
.event-icon .mp-icon { width: 26px; height: 26px; }
.modal-kicker {
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 2.4px;
  font-weight: 800;
  color: #C96A2B;
  text-transform: uppercase;
}
.modal-title {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  color: #2D1B11;
  letter-spacing: 0.5px;
}
.modal-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.8;
  color: #6E5039;
  letter-spacing: 0.2px;
}
.modal-text b { color: #B84F13; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  width: 100%;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-radius: 14px;
  background: #FFFDF8;
  border: 1px solid #ECD8BE;
  box-shadow: 0 2px 0 #EAD2B1;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.choice:active { transform: translateY(2px); box-shadow: 0 0 0 #EAD2B1; }
.choice:disabled { opacity: 0.45; }
.choice-num {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #FFE9D2;
  color: #C45B1B;
  font-size: 11px;
  font-weight: 900;
}
.choice-main { flex: 1; min-width: 0; }
.choice-main b { display: block; font-size: 13px; color: #352218; line-height: 1.3; }
.choice-main small { display: block; margin-top: 2px; font-size: 10px; color: #A08064; line-height: 1.3; }
.choice-arrow { color: #C9A987; }
.choice-arrow .mp-icon { width: 18px; height: 18px; }
.modal-btn {
  width: 100%;
  height: 50px;
  margin-top: 13px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFA454, #F27020);
  color: #3B1804;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 5px 0 #A83F0B, 0 12px 22px rgba(240, 105, 26, 0.26);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.modal-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #A83F0B, 0 5px 10px rgba(240, 105, 26, 0.2); }
.modal-btn .mp-icon { width: 20px; height: 20px; }
.modal-btn.ghost {
  margin-top: 8px;
  background: transparent;
  color: #9A7658;
  box-shadow: none;
  height: 42px;
  font-size: 13px;
  letter-spacing: 1px;
}
.result-box {
  margin: 13px 0 2px;
  padding: 12px 13px;
  border-radius: 14px;
  background: #F8EEDF;
  border: 1px dashed #E5CDAE;
}
.result-line { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; line-height: 1.65; color: #5E422D; }
.result-line .mp-icon { width: 16px; height: 16px; color: #C56B25; margin-top: 2px; }
.delta-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.delta {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  background: #FFFDF8;
  border: 1px solid #EBD9C1;
  color: #7E5C3E;
}
.delta.pos { color: #347A5C; background: #ECF7F0; border-color: #D5EBDE; }
.delta.neg { color: #B04C35; background: #FBEDE8; border-color: #F2D8D0; }

/* 夜晚总结 */
.night-head { text-align: center; padding: 4px 0 13px; }
.night-moon {
  width: 66px;
  height: 66px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFE9B8;
  background: radial-gradient(circle at 38% 35%, rgba(255, 249, 221, 0.26), rgba(255, 249, 221, 0.04) 65%);
  border: 1px solid rgba(255, 236, 190, 0.22);
  box-shadow: 0 0 34px rgba(255, 226, 160, 0.16);
}
.night-moon .mp-icon { width: 34px; height: 34px; }
.night-kicker { margin: 0; font-size: 9.5px; letter-spacing: 2.5px; color: rgba(226, 211, 255, 0.7); font-weight: 800; }
.night-title { margin: 5px 0 0; font-family: var(--serif); font-size: 22px; color: #FFF2D9; letter-spacing: 1px; }
.night-quote {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-left: 2px solid rgba(255, 177, 105, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(236, 226, 250, 0.74);
  text-align: left;
}
.night-deltas {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.night-delta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: rgba(244, 235, 226, 0.8); }
.night-delta .mp-icon { width: 14px; height: 14px; color: #FFBE83; }
.night-delta b { margin-left: auto; font-size: 12px; color: #FFB49A; }
.night-delta.pos b { color: #9EE7BB; }
.night-btn {
  width: 100%;
  height: 50px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFB163, #F27A29);
  color: #361504;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 5px 0 #9D3C0A, 0 10px 22px rgba(0, 0, 0, 0.24);
}
.night-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9D3C0A; }
.night-btn .mp-icon { width: 20px; height: 20px; }

/* 玩法说明 */
.help-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 4px; }
.help-item { display: flex; gap: 10px; align-items: flex-start; }
.help-num {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #FFE9D2;
  color: #C45B1B;
  font-size: 11px;
  font-weight: 900;
}
.help-item b { display: block; font-size: 12.5px; color: #3A2518; line-height: 1.4; }
.help-item p { margin: 2px 0 0; font-size: 11px; line-height: 1.55; color: #8C6C51; }
.help-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #F8EEDD;
  border: 1px dashed #E6CFB0;
  font-size: 10.5px;
  line-height: 1.6;
  color: #856448;
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(300px + var(--safe-bottom));
  transform: translate(-50%, 16px);
  z-index: 150;
  max-width: 82%;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(40, 22, 14, 0.92);
  border: 1px solid rgba(255, 210, 160, 0.18);
  color: #FFECD4;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   结束页
   ========================================================= */
.end {
  overflow-y: auto;
  color: var(--cream);
  background: #160D0A;
  scrollbar-width: none;
  animation: screenIn 0.35s ease both;
}
.end::-webkit-scrollbar { display: none; }
.end-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(70% 48% at 50% 16%, rgba(255, 150, 70, 0.2), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(150, 55, 25, 0.32), transparent 66%),
    linear-gradient(180deg, #1B1120 0%, #25141A 44%, #160D0A 100%);
}
.end-stars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 16% 12%, #FFEAC4 40%, transparent 100%),
    radial-gradient(1px 1px at 32% 7%, #FFF6E0 40%, transparent 100%),
    radial-gradient(1.3px 1.3px at 48% 16%, #FFE2B4 40%, transparent 100%),
    radial-gradient(1px 1px at 64% 9%, #FFF6E0 40%, transparent 100%),
    radial-gradient(1.4px 1.4px at 79% 18%, #FFEAC4 40%, transparent 100%),
    radial-gradient(1px 1px at 91% 8%, #FFF6E0 40%, transparent 100%),
    radial-gradient(1px 1px at 24% 28%, #FFE2B4 40%, transparent 100%),
    radial-gradient(1.2px 1.2px at 86% 31%, #FFEAC4 40%, transparent 100%);
}
.end-glow {
  position: absolute;
  top: 7%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 156, 76, 0.24), transparent 66%);
  filter: blur(8px);
  animation: endGlowPulse 5s ease-in-out infinite;
}
.end-skyline { position: absolute; left: 0; bottom: 0; width: 100%; height: 30%; }
.end-wrap {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 520px;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ending-art {
  position: relative;
  height: 208px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  flex: 0 0 auto;
}
.art-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.art-rings span {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 190, 120, 0.22);
  border-radius: 50%;
  animation: ringSpin 22s linear infinite;
}
.art-rings span:nth-child(1) { width: 138px; height: 138px; }
.art-rings span:nth-child(2) { width: 184px; height: 184px; border-style: dashed; border-color: rgba(255, 190, 120, 0.13); animation-direction: reverse; animation-duration: 30s; }
.art-rings span:nth-child(3) { width: 236px; height: 236px; border-color: rgba(255, 190, 120, 0.08); animation-duration: 40s; }
.art-core {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 38% 32%, #FFF3CD 0%, #FFC46F 24%, #F27A29 54%, #8E3213 82%);
  box-shadow: 0 0 0 10px rgba(255, 154, 78, 0.09), 0 0 46px 12px rgba(255, 140, 60, 0.36);
  animation: coreBreathe 4s ease-in-out infinite;
}
.art-core .mp-icon { width: 44px; height: 44px; color: #4A1C06; opacity: 0.86; }
.art-sparks i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FFDDA0;
  box-shadow: 0 0 8px 2px rgba(255, 190, 100, 0.65);
  animation: sparkFloat 4.6s ease-in-out infinite;
}
.art-sparks i:nth-child(1) { left: 22%; top: 36%; }
.art-sparks i:nth-child(2) { right: 20%; top: 28%; width: 3px; height: 3px; animation-delay: 1.1s; }
.art-sparks i:nth-child(3) { left: 33%; bottom: 18%; animation-delay: 2s; }
.art-sparks i:nth-child(4) { right: 29%; bottom: 24%; width: 3px; height: 3px; animation-delay: 0.6s; }
.art-sparks i:nth-child(5) { left: 50%; top: 8%; animation-delay: 3s; }
.art-caption {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(30, 14, 12, 0.56);
  border: 1px solid rgba(255, 220, 180, 0.16);
  color: rgba(255, 228, 200, 0.76);
  font-size: 9.5px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.ending-art[data-tone="bad"] .art-core {
  background: radial-gradient(circle at 38% 32%, #E9DDE0 0%, #A98C96 26%, #5D4550 56%, #241820 84%);
  box-shadow: 0 0 0 10px rgba(120, 95, 110, 0.06), 0 0 40px 10px rgba(120, 70, 90, 0.2);
}
.ending-art[data-tone="bad"] .art-core .mp-icon { color: #F1DDE3; opacity: 0.72; }
.ending-art[data-tone="bad"] .art-rings span { border-color: rgba(200, 170, 190, 0.14); }
.ending-art[data-tone="bad"] .art-sparks i { background: #D8C7D2; box-shadow: 0 0 8px 2px rgba(180, 140, 160, 0.5); }
.ending-art[data-tone="stay"] .art-core {
  background: radial-gradient(circle at 38% 32%, #FFF2C8 0%, #FFCF7A 26%, #D97A2E 56%, #6F2E12 84%);
}
.ending-art[data-tone="stay"] .art-caption { color: rgba(255, 213, 164, 0.8); }

.end-card {
  position: relative;
  border-radius: 26px;
  padding: 19px 18px 15px;
  background:
    radial-gradient(120% 50% at 50% 0%, #FFFFFF 0%, #FFFBF3 46%, #FFF6E8 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--ink);
  animation: riseIn 0.55s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.end-kicker {
  margin: 0;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 2.4px;
  color: #C96A2B;
  text-transform: uppercase;
}
.end-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #2B1A10;
}
.end-story {
  margin: 8px 0 13px;
  font-size: 12px;
  line-height: 1.75;
  color: #7A5A40;
  letter-spacing: 0.1px;
}
.score-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 15px;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 154, 70, 0.26), transparent 60%),
    linear-gradient(135deg, #3A2116, #2A170F);
  border: 1px solid #4E2E1D;
  box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.12);
}
.score-main { display: flex; flex-direction: column; gap: 1px; }
.score-label { font-size: 8.5px; letter-spacing: 2px; color: rgba(255, 214, 170, 0.55); }
.score-main b { font-size: 34px; line-height: 1.02; color: #FFCE83; letter-spacing: 1px; font-family: var(--serif); }
.score-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.grade {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #FFD98E, #F3903B);
  color: #4A1C06;
  font-size: 19px;
  font-weight: 900;
  font-family: var(--serif);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}
.new-record {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #FFE1A9;
  background: rgba(255, 138, 61, 0.2);
  border: 1px solid rgba(255, 170, 100, 0.35);
  border-radius: 4px;
  padding: 1px 4px;
  animation: dotPulse 1.8s ease-in-out infinite;
}
.best-small { font-size: 8.5px; color: rgba(255, 220, 180, 0.55); }
.best-small b { color: rgba(255, 230, 196, 0.9); }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 13px; }
.end-stat {
  padding: 7px 4px;
  border-radius: 10px;
  background: #F8EDDD;
  border: 1px solid #EFDFC8;
  text-align: center;
}
.end-stat span { display: block; font-size: 8px; color: #A28163; letter-spacing: 0.4px; }
.end-stat b { display: block; margin-top: 3px; font-size: 13px; color: #50331F; line-height: 1.1; }
.end-stat b em { font-style: normal; font-size: 8.5px; color: #A28163; margin-left: 1px; }
.end-card .cta { height: 52px; border-radius: 15px; }
.end-card .cta-text { font-size: 15.5px; letter-spacing: 2.5px; }
.end-card .cta-arrow { width: 34px; height: 34px; }
.end-card .text-btn { color: #9A7658; font-size: 11.5px; margin-top: 7px; }

/* =========================================================
   动画
   ========================================================= */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(22px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes riftSway { 0%, 100% { transform: translateX(-50%) rotate(7deg); } 50% { transform: translateX(-50%) rotate(3deg) translateY(-6px); } }
@keyframes riftPulse { 0%, 100% { opacity: 0.78; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes endGlowPulse { 0%, 100% { opacity: 0.72; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.07); } }
@keyframes ringSpin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes sparkFloat { 0%, 100% { opacity: 0.2; transform: translateY(0) scale(0.7); } 45% { opacity: 1; transform: translateY(-18px) scale(1.1); } 70% { opacity: 0.7; transform: translateY(-26px) scale(0.9); } }
@keyframes cloudDrift { from { transform: translateX(-16px); } 50% { transform: translateX(18px); } to { transform: translateX(-16px); } }
@keyframes lanternFlicker { 0%, 100% { opacity: 0.8; } 42% { opacity: 1; } 58% { opacity: 0.72; } 76% { opacity: 0.95; } }
@keyframes birdsDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(10px, -5px); } }
@keyframes travelerBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ctaShine { 0%, 62% { transform: translateX(-180%) rotate(14deg); } 82%, 100% { transform: translateX(420%) rotate(14deg); } }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes charBob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(0.4deg); } }
@keyframes charWork { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(2px) rotate(-4deg); } 55% { transform: translateY(4px) rotate(5deg); } 78% { transform: translateY(1px) rotate(-2deg); } }
@keyframes charForage { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-14px) rotate(-3deg); } 65% { transform: translateX(-6px) rotate(2deg); } }
@keyframes charSell { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-5px) rotate(-2deg); } 55% { transform: translateY(-2px) rotate(2deg); } }
@keyframes charRest { 0%, 100% { transform: translateY(0) scaleY(1); } 45% { transform: translateY(5px) scaleY(0.94); } 75% { transform: translateY(2px) scaleY(0.98); } }
@keyframes phoneGlow { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
@keyframes catTail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(2deg); } }
@keyframes particleRise { 0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); } 12% { opacity: 0.8; } 65% { opacity: 0.55; } 100% { opacity: 0; transform: translateY(-150px) translateX(18px) scale(1.05); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); } 16% { opacity: 1; transform: translate(-50%, -2px) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -52px) scale(1); } }
@keyframes lowBar { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes dangerVignette { 0%, 100% { box-shadow: inset 0 -26px 34px rgba(70, 30, 8, 0.3), inset 0 0 26px rgba(180, 30, 15, 0.08); } 50% { box-shadow: inset 0 -26px 34px rgba(70, 30, 8, 0.3), inset 0 0 62px rgba(180, 30, 15, 0.32); } }
@keyframes coreBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* =========================================================
   响应式
   ========================================================= */
@media (max-height: 740px) {
  .start-ui { padding-top: 40vh; }
  .game-title { font-size: clamp(38px, 12vw, 50px); }
  .tagline { font-size: 12px; margin-top: 11px; }
  .start-record { margin: 13px 0 14px; padding: 8px 12px; }
  .cta { height: 53px; }
  .cta-text { font-size: 15.5px; }
  .sheet { padding-top: 6px; }
  .action { min-height: 79px; padding: 7px 8px; }
  .action-desc { display: none; }
  .action-name { font-size: 12.5px; }
  .scene { min-height: 122px; }
  .tip-line { margin-top: 5px; min-height: 22px; }
  .sheet-sub { display: none; }
  .ending-art { height: 174px; }
  .end-title { font-size: 28px; }
}
@media (max-height: 640px) {
  .start-ui { padding-top: 34vh; }
  .start-record { margin: 10px 0 11px; }
  .tagline br { display: none; }
  .tagline { font-size: 11.5px; line-height: 1.6; }
  .sheet-head { padding-bottom: 5px; }
  .action { min-height: 71px; }
  .action-icon { width: 25px; height: 25px; border-radius: 8px; }
  .action-icon .mp-icon { width: 15px; height: 15px; }
  .action-desc { display: none; }
  .scene { min-height: 104px; }
  .tip-line { display: none; }
  .sheet { padding-bottom: calc(7px + var(--safe-bottom)); }
  .hud { padding-bottom: 7px; }
  .stat { padding: 5px 7px 6px; }
  .ending-art { height: 150px; }
  .art-core { width: 76px; height: 76px; }
  .art-core .mp-icon { width: 36px; height: 36px; }
  .end-wrap { justify-content: flex-start; }
}
@media (max-width: 350px) {
  .start-ui { padding-left: 16px; padding-right: 16px; }
  .actions { gap: 6px; }
  .action-name { font-size: 12px; }
  .day-pill, .weather-pill, .coin-pill { padding: 0 7px; }
  .stat-head span { display: none; }
  .stat-head b { font-size: 12.5px; margin-left: 4px; }
  .sheet { padding-left: 12px; padding-right: 12px; }
  .end-title { font-size: 26px; }
}
@media (min-width: 521px) {
  body { background: radial-gradient(80% 70% at 50% 40%, #2A1712 0%, #120A07 70%); }
  .screen { box-shadow: 0 0 80px rgba(0, 0, 0, 0.5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
