/* 极寒求生 — 移动端优先的末世生存游戏界面 */
:root {
  --orange: #FF8A3D;
  --orange-2: #FF6B1A;
  --orange-soft: rgba(255, 138, 61, 0.14);
  --bg: #070E15;
  --panel: #111C27;
  --panel-2: #16232F;
  --line: rgba(255, 255, 255, 0.085);
  --text: #F3F7FA;
  --muted: #94A7B8;
  --dim: #657A8C;
  --blue: #6FC8F2;
  --green: #7ED957;
  --red: #FF5D4D;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, #122635 0%, #070E15 62%, #050A0F 100%);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }

.game {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #0A141D;
  position: relative;
}

/* ============ 场景 ============ */
.scene {
  position: relative;
  flex: 0 0 auto;
  height: clamp(252px, 38vh, 360px);
  overflow: hidden;
  background: #0B1D2A;
  isolation: isolate;
}

.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.scene-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: background 0.7s ease;
  background: linear-gradient(180deg, rgba(7, 18, 28, 0.05), rgba(5, 12, 18, 0.52));
}

body[data-weather="clear"] .scene-tint {
  background: linear-gradient(180deg, rgba(7, 18, 28, 0), rgba(5, 12, 18, 0.34));
}
body[data-weather="snow"] .scene-tint {
  background: linear-gradient(180deg, rgba(118, 164, 198, 0.08), rgba(5, 12, 18, 0.5));
}
body[data-weather="hail"] .scene-tint {
  background: linear-gradient(180deg, rgba(160, 200, 230, 0.14), rgba(5, 13, 20, 0.54));
}
body[data-weather="tornado"] .scene-tint {
  background: linear-gradient(180deg, rgba(70, 105, 86, 0.16), rgba(4, 10, 13, 0.62));
}
body[data-weather="tsunami"] .scene-tint {
  background: linear-gradient(180deg, rgba(38, 98, 148, 0.2), rgba(2, 8, 14, 0.58));
}
body[data-weather="severe"] .scene-tint {
  background: linear-gradient(180deg, rgba(82, 72, 160, 0.16), rgba(2, 6, 12, 0.6));
}

.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 10, 16, 0.42) 0%, transparent 22%, transparent 66%, rgba(4, 10, 16, 0.72) 100%),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(2, 7, 12, 0.42) 100%);
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.fx-snow, .fx-hail {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body[data-weather="snow"] .fx-snow,
body[data-weather="severe"] .fx-snow { opacity: 1; }
body[data-weather="tornado"] .fx-snow { opacity: 0.55; }
body[data-weather="hail"] .fx-snow { opacity: 0.25; }
body[data-weather="hail"] .fx-hail { opacity: 1; }

.snow-bit {
  position: absolute;
  top: -14px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: snowFall var(--d) linear var(--delay) infinite;
  will-change: transform, opacity;
}

@keyframes snowFall {
  0% { transform: translate3d(0, -16px, 0); opacity: 0; }
  8% { opacity: 0.85; }
  85% { opacity: 0.6; }
  100% { transform: translate3d(var(--drift), 430px, 0); opacity: 0; }
}

.hail-bit {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, #FFFFFF, #B9E5FF);
  box-shadow: 0 0 5px rgba(210, 240, 255, 0.55);
  opacity: 0;
  transform: rotate(18deg);
  animation: hailFall var(--d) linear var(--delay) infinite;
  will-change: transform, opacity;
}

@keyframes hailFall {
  0% { transform: translate3d(0, -24px, 0) rotate(18deg); opacity: 0; }
  10% { opacity: 0.95; }
  100% { transform: translate3d(var(--drift), 440px, 0) rotate(18deg); opacity: 0.15; }
}

/* 龙卷风 */
.fx-tornado {
  position: absolute;
  right: 5%;
  top: 2%;
  width: 116px;
  height: 84%;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

body[data-weather="tornado"] .fx-tornado { opacity: 0.92; }

.tornado-funnel {
  position: absolute;
  inset: 0;
  clip-path: polygon(6% 0, 94% 0, 62% 100%, 38% 100%);
  background:
    repeating-linear-gradient(180deg, rgba(225, 242, 252, 0.52) 0 2px, rgba(225, 242, 252, 0.04) 2px 11px),
    linear-gradient(180deg, rgba(205, 228, 240, 0.22), rgba(68, 104, 128, 0.1));
  filter: blur(0.7px);
  mix-blend-mode: screen;
  animation: tornadoSway 3.6s ease-in-out infinite, tornadoBands 0.8s linear infinite;
}

@keyframes tornadoSway {
  0%, 100% { transform: translateX(-7px) skewX(2deg); }
  50% { transform: translateX(7px) skewX(-2deg); }
}

@keyframes tornadoBands {
  to { background-position: 0 22px, 0 0; }
}

.tornado-debris { position: absolute; inset: auto 0 5% 0; height: 30%; }
.tornado-debris i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #DCEBF4;
  opacity: 0.7;
  animation: debrisFly 1.6s ease-in-out infinite;
}
.tornado-debris i:nth-child(1) { left: 34%; animation-delay: 0s; }
.tornado-debris i:nth-child(2) { left: 52%; top: 20%; animation-delay: 0.35s; }
.tornado-debris i:nth-child(3) { left: 44%; top: 52%; animation-delay: 0.7s; }
.tornado-debris i:nth-child(4) { left: 60%; top: 36%; animation-delay: 1.05s; }

@keyframes debrisFly {
  0% { transform: translate(0, 22px); opacity: 0; }
  30% { opacity: 0.85; }
  100% { transform: translate(-34px, -22px); opacity: 0; }
}

/* 海啸 */
.fx-tsunami {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -5%;
  height: 58%;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(58%);
}

body[data-weather="tsunami"] .fx-tsunami {
  opacity: 1;
  animation: waveSweep 5.2s ease-in-out infinite;
}

.fx-tsunami svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 -8px 18px rgba(90, 190, 225, 0.25));
}

@keyframes waveSweep {
  0% { transform: translateX(58%); }
  20% { transform: translateX(0); }
  78% { transform: translateX(0); }
  100% { transform: translateX(58%); }
}

/* 夜晚遮罩与危机边缘 */
.night-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #02070C;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.scene.is-night .night-mask { opacity: 0.62; }

.scene-critical {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 0 rgba(255, 70, 50, 0);
  transition: box-shadow 0.5s ease;
}
body.is-critical .scene-critical {
  box-shadow: inset 0 0 70px rgba(255, 56, 40, 0.34);
  animation: criticalPulse 1.9s ease-in-out infinite;
}
@keyframes criticalPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 场景抖动 */
.scene.shake { animation: sceneShake 0.58s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes sceneShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ============ HUD ============ */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.hud-right { align-items: flex-end; }

.day-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 12px 7px;
  border-radius: 14px;
  background: rgba(8, 17, 26, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  line-height: 1;
}
.day-label { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.day-pill strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.28);
}
.day-unit { font-size: 11px; color: var(--muted); }

.disaster-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 138, 61, 0.13);
  border: 1px solid rgba(255, 138, 61, 0.24);
  color: #FFC795;
  font-size: 10.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disaster-mini .mp-icon { width: 13px; height: 13px; flex: 0 0 auto; }
.disaster-mini.is-urgent {
  background: rgba(255, 106, 60, 0.22);
  border-color: rgba(255, 138, 61, 0.55);
  color: #FFE0CB;
  animation: urgentPulse 1.6s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(255, 138, 61, 0); }
}

.temp-pill, .weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(8, 17, 26, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.temp-pill { color: #BFE6FA; font-weight: 700; font-variant-numeric: tabular-nums; }
.temp-pill .mp-icon { width: 15px; height: 15px; color: #9FD6F4; }
.weather-pill { color: #E8F3FA; }
.weather-pill .mp-icon { width: 15px; height: 15px; color: var(--orange); }
.weather-pill span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scene-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 34px;
  z-index: 6;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(240, 248, 254, 0.8);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scene-caption::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.8);
  flex: 0 0 auto;
}

/* ============ 主面板 ============ */
.panel {
  position: relative;
  z-index: 8;
  flex: 1 0 auto;
  margin-top: -22px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #142230 0%, #0D1822 52%, #0A131C 100%);
  box-shadow: 0 -16px 38px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-grab {
  width: 38px;
  height: 4px;
  margin: 0 auto 1px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

/* 天气夜报 */
.night-card {
  padding: 11px 13px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(255, 138, 61, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(31, 52, 69, 0.92), rgba(17, 29, 40, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 8px 18px rgba(0, 0, 0, 0.16);
}
.night-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.night-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--orange);
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.22);
}
.night-icon .mp-icon { width: 23px; height: 23px; }
.night-text { min-width: 0; flex: 1; }
.night-text h2 { font-size: 16px; font-weight: 750; letter-spacing: 0.01em; line-height: 1.2; }
.night-text p {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.night-temp {
  flex: 0 0 auto;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #C4E9FC;
  font-variant-numeric: tabular-nums;
}
.night-temp.is-req { font-size: 14px; color: #FFC795; letter-spacing: 0; }
.night-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.night-effects span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}
.night-effects .mp-icon { width: 12px; height: 12px; }
.night-effects span:nth-child(1) .mp-icon { color: var(--orange); }
.night-effects span:nth-child(2) .mp-icon { color: var(--blue); }
.night-effects .extra { color: #FFB4A8; border-color: rgba(255, 93, 77, 0.2); background: rgba(255, 93, 77, 0.09); }
.night-effects .extra .mp-icon { width: 12px; height: 12px; color: #FF8B7C; }

/* 状态 */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-card {
  padding: 10px 11px 9px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1A2937 0%, #13202C 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 14px rgba(0, 0, 0, 0.14);
  min-width: 0;
}
.stat-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}
.stat-icon { display: inline-flex; color: var(--orange); }
.stat-icon .mp-icon { width: 16px; height: 16px; }
.warmth .stat-icon { color: #6FC8F2; }
.stat-head b {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.bar {
  height: 7px;
  margin-top: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
}
.durability .bar-fill {
  background: linear-gradient(90deg, #FF6B1A, #FFC46B);
  box-shadow: 0 0 10px rgba(255, 138, 61, 0.45);
}
.warmth .bar-fill {
  background: linear-gradient(90deg, #3E96D1, #8FE3FF);
  box-shadow: 0 0 10px rgba(111, 200, 242, 0.4);
}
.bar-fill.is-low { background: linear-gradient(90deg, #E8342B, #FF8B6C) !important; box-shadow: 0 0 10px rgba(255, 70, 50, 0.45) !important; }
.stat-note {
  margin-top: 6px;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-note.is-warn { color: #FF9F86; }

/* 资源 */
.resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.res {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 8px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
}
.res .mp-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.res:nth-child(1) .mp-icon { color: #C9965A; }
.res:nth-child(2) .mp-icon { color: #FFB74D; }
.res:nth-child(3) .mp-icon { color: #7ED957; }
.res span { white-space: nowrap; }
.res b {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.res.pulse { animation: resourcePop 0.32s ease; }
@keyframes resourcePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); background: rgba(255, 138, 61, 0.12); border-color: rgba(255, 138, 61, 0.3); }
  100% { transform: scale(1); }
}

/* 行动 */
.actions { display: flex; flex-direction: column; gap: 7px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.section-head h3 { font-size: 12px; font-weight: 650; color: var(--text); letter-spacing: 0.02em; line-height: 1; }
.ap { display: flex; gap: 3px; margin-top: 5px; }
.ap-dot {
  width: 13px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.ap-dot.on { background: var(--orange); box-shadow: 0 0 6px rgba(255, 138, 61, 0.55); }
.ap-text { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(180deg, #1A2A38 0%, #14212D 100%);
  color: var(--text);
  text-align: left;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.action:active { transform: scale(0.972); background: #203444; border-color: rgba(255, 138, 61, 0.28); }
.action > .mp-icon { width: 21px; height: 21px; flex: 0 0 auto; color: var(--orange); }
.action:nth-child(3) > .mp-icon { color: #FFB74D; }
.action .a-copy { display: flex; flex-direction: column; min-width: 0; }
.action .a-title { font-size: 12.5px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.action .a-sub { margin-top: 2px; font-size: 9.5px; color: var(--dim); line-height: 1.2; white-space: nowrap; }
.action:disabled { opacity: 0.42; cursor: default; }
.action:disabled > .mp-icon { color: var(--dim); }
.action:disabled:active { transform: none; background: linear-gradient(180deg, #1A2A38 0%, #14212D 100%); border-color: rgba(255, 255, 255, 0.075); }

/* 升级卡 */
.upgrade-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 138, 61, 0.42);
  background: linear-gradient(90deg, rgba(255, 138, 61, 0.14), rgba(255, 138, 61, 0.035));
  color: var(--text);
  text-align: left;
  transition: transform 0.12s ease, border-color 0.2s ease;
  animation: upgradeGlow 2.4s ease-in-out infinite;
}
.upgrade-card:active { transform: scale(0.985); }
.upgrade-card:disabled { animation: none; opacity: 0.72; }
.upgrade-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 138, 61, 0.18);
  color: var(--orange);
}
.upgrade-icon .mp-icon { width: 19px; height: 19px; }
.upgrade-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.u-title { font-size: 12px; font-weight: 700; line-height: 1.2; }
.u-sub { margin-top: 2px; font-size: 9.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-go {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 9px;
  background: linear-gradient(135deg, #FF9A4D, #FF6B1A);
  color: #221006;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 107, 26, 0.25);
}
@keyframes upgradeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.12); }
  50% { box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.05); }
}

/* 主按钮 */
.primary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 9px 13px;
  border-radius: 15px;
  background: linear-gradient(135deg, #FFA257 0%, #FF7A24 52%, #FF6B1A 100%);
  color: #231106;
  box-shadow: 0 10px 24px rgba(255, 107, 26, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.12s ease, filter 0.2s ease, opacity 0.2s ease;
  text-align: left;
}
.primary:active { transform: scale(0.982); filter: brightness(0.96); }
.primary:disabled { filter: grayscale(0.55); opacity: 0.55; cursor: default; }
.primary-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(35, 17, 6, 0.13);
  color: #2A1408;
}
.primary-icon .mp-icon { width: 21px; height: 21px; }
.primary-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.primary-text b { font-size: 15.5px; font-weight: 800; letter-spacing: 0.02em; line-height: 1.15; }
.primary-text small {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.primary-arrow { flex: 0 0 auto; display: inline-flex; opacity: 0.62; }
.primary-arrow .mp-icon { width: 20px; height: 20px; }

/* 页脚 */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 1px;
  font-size: 10px;
  color: var(--dim);
}
.best { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.best .mp-icon { width: 13px; height: 13px; color: #D7A95A; }
.foot-btns { display: flex; align-items: center; gap: 5px; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.ghost-btn:active { background: rgba(255, 255, 255, 0.07); }
.ghost-btn:disabled { opacity: 0.4; cursor: default; }
.ghost-btn .mp-icon { width: 13px; height: 13px; }
.ghost-btn.is-off { opacity: 0.45; }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(3, 8, 13, 0.72);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(255, 138, 61, 0.09), transparent 55%),
    linear-gradient(180deg, #192836 0%, #0E1923 100%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55);
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheetUp {
  from { transform: translateY(22px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.modal-close .mp-icon { width: 17px; height: 17px; }

.modal-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  color: var(--orange);
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.26);
  box-shadow: 0 8px 24px rgba(255, 138, 61, 0.12);
}
.modal-icon .mp-icon { width: 30px; height: 30px; }
.modal-icon.red { color: #FF7C6B; background: rgba(255, 93, 77, 0.13); border-color: rgba(255, 93, 77, 0.3); box-shadow: 0 8px 24px rgba(255, 93, 77, 0.12); }
.modal-icon.blue { color: #8FDFFF; background: rgba(111, 200, 242, 0.13); border-color: rgba(111, 200, 242, 0.3); box-shadow: 0 8px 24px rgba(111, 200, 242, 0.12); }

.modal h2 {
  padding-right: 26px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.modal > p {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
#modalBody { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.65; }

.rule-list { display: flex; flex-direction: column; gap: 11px; }
.rule { display: flex; gap: 10px; align-items: flex-start; }
.rule > span {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 7px;
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.25);
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
}
.rule b { display: block; color: var(--text); font-size: 12.5px; font-weight: 650; }
.rule p { margin-top: 2px; font-size: 11px; line-height: 1.55; color: var(--muted); }
.rule-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 138, 61, 0.08);
  border: 1px solid rgba(255, 138, 61, 0.16);
  font-size: 10.5px;
  line-height: 1.5;
  color: #FFC795;
}
.rule-note .mp-icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

.compare {
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
}
.compare-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.compare-row + .compare-row { margin-top: 7px; }
.compare-row b { font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.compare-row b.ok { color: #8BE38A; }
.compare-row b.bad { color: #FF7C6B; }
.compare-bar {
  height: 7px;
  margin-top: 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.compare-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4BC96F, #9BF08C); }
.compare-bar span.bad { background: linear-gradient(90deg, #E8342B, #FF8B6C); }
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}
.result-badge.ok { color: #9BF08C; background: rgba(75, 201, 111, 0.1); border: 1px solid rgba(75, 201, 111, 0.22); }
.result-badge.bad { color: #FF9E8E; background: rgba(255, 93, 77, 0.1); border: 1px solid rgba(255, 93, 77, 0.24); }

.reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.reward-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 10.5px;
  color: var(--text);
}
.reward-row .mp-icon { width: 14px; height: 14px; }
.reward-row span:nth-child(1) .mp-icon { color: #C9965A; }
.reward-row span:nth-child(2) .mp-icon { color: #FFB74D; }
.reward-row span:nth-child(3) .mp-icon { color: #7ED957; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 13px;
}
.result-grid > div {
  padding: 9px 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.065);
  text-align: center;
}
.result-grid span { display: block; font-size: 9.5px; color: var(--dim); line-height: 1.2; }
.result-grid b { display: block; margin-top: 4px; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.result-tip { margin-top: 11px; font-size: 10.5px; line-height: 1.6; color: var(--dim); }
.result-tip b { color: #FFC795; }

.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 17px; }
.btn-primary, .btn-secondary {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 750;
  transition: transform 0.12s ease, filter 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #FFA257, #FF6B1A);
  color: #231106;
  box-shadow: 0 8px 20px rgba(255, 107, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:active { transform: scale(0.982); filter: brightness(0.96); }
.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 600;
}
.btn-secondary:active { background: rgba(255, 255, 255, 0.07); }

/* ============ 轻提示 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 86vw;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(16, 28, 39, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 小屏适配 */
@media (max-width: 360px) {
  .scene { height: clamp(240px, 36vh, 320px); }
  .panel { padding-left: 12px; padding-right: 12px; gap: 9px; }
  .action { min-height: 50px; padding: 8px; gap: 6px; }
  .action .a-title { font-size: 11.5px; }
  .action .a-sub { font-size: 9px; }
  .night-text h2 { font-size: 15px; }
  .primary-text b { font-size: 14.5px; }
  .day-pill strong { font-size: 22px; }
  .hud-top { padding-left: 12px; padding-right: 12px; }
  .scene-caption { left: 12px; right: 12px; }
}

@media (min-width: 600px) {
  .game {
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
  }
}

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