:root {
  --cream: #fff9f0;
  --cream-dark: #f2e4d0;
  --wood-frame: #b57c4e;
  --wood-border: #82522d;
  --cell-a: #f7ebd9;
  --cell-b: #eee0c9;
  --text-dark: #442c1d;
  --text-sub: #8b6f5c;
  --green-1: #63d471;
  --green-2: #2ca84f;
  --green-shadow: #1e7c38;
  --orange-1: #ffb347;
  --orange-2: #ee6c38;
  --orange-shadow: #b5451b;
  --blue-1: #6bc5ff;
  --blue-2: #3b8eea;
  --blue-shadow: #2361ad;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-dark);
}

/* 桌面端氛围暗暖背景，衬托中间竖屏精品手游 */
.stage-bg {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 25%, #3d2e24 0%, #1f1713 75%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: min(100vw, 440px);
  height: min(100vh, 880px);
  border-radius: 30px;
  overflow: hidden;
  background: #2b211b;
  box-shadow:
    0 0 0 6px #4a372a,
    0 0 0 8px rgba(255, 224, 178, 0.18),
    0 28px 70px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
}

@media (max-width: 500px) {
  .phone-frame {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ==================== 顶部悬浮手游状态栏 ==================== */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, rgba(35, 24, 18, 0.72) 0%, rgba(35, 24, 18, 0) 100%);
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 250, 242, 0.95);
  border: 2px solid #f4c152;
  border-radius: 99px;
  padding: 2px 8px 2px 2px;
  box-shadow: 0 4px 0 rgba(120, 72, 20, 0.35);
}

.lvl-star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe066, #f59b1d);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(120, 56, 0, 0.6);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.6);
}

.lvl-bar-wrap {
  width: 34px;
  height: 8px;
  border-radius: 99px;
  background: #e7d6be;
  overflow: hidden;
}

.lvl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5cd66c, #2eb84a);
  transition: width 0.35s ease;
}

.hud-resources {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 9px 0 6px;
  border-radius: 99px;
  background: rgba(255, 251, 245, 0.96);
  border: 2px solid #e7d1b5;
  box-shadow: 0 3px 0 rgba(88, 56, 32, 0.28);
  font-weight: 900;
  font-size: 13px;
  color: var(--text-dark);
}

.hud-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.hud-pill.energy {
  background: linear-gradient(180deg, #fff5be, #ffd966);
  border-color: #efaa24;
  color: #7c4200;
}

.hud-pill.energy .ico {
  font-size: 14px;
  animation: boltPulse 1.6s infinite;
}

@keyframes boltPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.hud-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #f0dec6;
  background: linear-gradient(180deg, #ffffff, #f2e2ce);
  box-shadow: 0 3px 0 rgba(94, 62, 38, 0.35);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-circle-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(94, 62, 38, 0.35);
}

/* 发现新图鉴欢庆横幅 */
.discovery-banner {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fff5d1, #ffd670);
  border: 2.5px solid #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  width: max-content;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  border-radius: 18px;
  padding: 6px 16px 6px 8px;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: normal;
  line-height: 1.4;
  line-break: strict;
  overflow-wrap: anywhere;
}
.discovery-banner > div { min-width: 0; }

.discovery-banner.show {
  transform: translateX(-50%) translateY(0);
}

.discovery-banner img {
  flex: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
}

.discovery-banner strong {
  display: block;
  font-size: 13px;
  color: #6b3600;
}

.discovery-banner small {
  display: block;
  font-size: 11px;
  color: #9e5a08;
  font-weight: 700;
}

/* ==================== 场景切换 ==================== */
.scene {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.scene.active {
  display: flex;
}

/* ==================== 场景 A：全屏老宅装修 ==================== */
.scene-home {
  background: #23262b;
}

.home-canvas {
  container-type: size;
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-room-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  --site-x: calc(50cqw + max(100cqw, 100cqh) * var(--worksite-x, 0));
  --pan-x: calc(clamp(22px, var(--site-x), calc(100cqw - 22px)) - var(--site-x));
  object-position: calc(50% + var(--pan-x)) center;
  transition: filter 0.65s ease, transform 0.65s ease;
  animation: roomBreathe 12s infinite ease-in-out;
}

@keyframes roomBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.028); }
}

.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.home-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(24, 18, 14, 0.55) 0%, rgba(24, 18, 14, 0) 22%, rgba(24, 18, 14, 0) 74%, rgba(24, 18, 14, 0.72) 100%);
  pointer-events: none;
}

.home-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 248, 210, 0.96), rgba(255, 200, 90, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.home-flash.burst {
  opacity: 1;
}

.home-room-switcher {
  position: absolute;
  top: 52px;
  left: 12px;
  right: 12px;
  z-index: 25;
  display: flex;
  gap: 6px;
}

.room-chip {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(241, 216, 165, 0.5);
  background: rgba(42, 31, 24, 0.78);
  color: #f5e9d7;
  backdrop-filter: blur(5px);
  border-radius: 11px;
  padding: 4px 2px;
  font-size: clamp(10px, 2.85vw, 12px);
  line-height: 1.15;
  font-weight: 750;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.room-chip.active {
  background: linear-gradient(150deg, #89623d, #634327);
  color: #fff5db;
  border-color: #efcf91;
  box-shadow: inset 0 0 0 2px #ffdeb724;
}

.home-chapter-pill {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(32, 24, 18, 0.72);
  border: 1.5px solid rgba(255, 224, 172, 0.4);
  backdrop-filter: blur(8px);
  color: #fff2dc;
  padding: 4px 10px 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ch-status {
  color: #ffd670;
  font-weight: 900;
}

.compare-chip {
  margin-left: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* 开工签与原画同幅呼吸，细金环指向正在装修的实物。 */
.home-pins {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  container-type: size;
  animation: roomBreathe 12s infinite ease-in-out;
}

.renovate-pin {
  --image-side: max(100cqw, 100cqh);
  --photo-left: clamp(22px, calc(50cqw + var(--image-side) * var(--photo-x)), calc(100cqw - 22px));
  --photo-top: calc(50cqh + var(--image-side) * var(--photo-y));
  --paper-left: clamp(calc(var(--tag-half) + 8px), var(--photo-left), calc(100cqw - var(--tag-half) - 8px));
  --paper-top: calc(var(--photo-top) - 52px);
  --ring-x: calc(50% + var(--photo-left) - var(--paper-left));
  --ring-y: calc(var(--photo-top) - var(--paper-top));
  position: absolute;
  left: var(--paper-left);
  top: var(--paper-top);
  transform: translateX(-50%);
  width: calc(2 * var(--tag-half));
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #4e321c;
  font: 750 13px/1.2 var(--font, sans-serif);
  cursor: pointer;
  pointer-events: auto;
}

.renovate-pin.pin-below {
  --paper-top: max(172px, calc(var(--photo-top) + 8px));
}

.pin-caption {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 29px;
  border: 1px solid #ab8452;
  border-radius: 4px 11px 4px 11px;
  background: linear-gradient(145deg, #fff8e7, #f0dfbd);
  box-shadow: inset 0 0 0 2px #fff9e6b3, 0 2px 6px #301b0f75;
  letter-spacing: .01em;
  white-space: nowrap;
}

.pin-cost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 5px;
  border-left: 1px solid #bb9a68;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pin-cost img { width: 14px; height: 14px; object-fit: contain; }
.renovate-pin.locked .pin-caption { background: linear-gradient(145deg, #f4e8d4, #e4d3b8); color: #635340; }
.renovate-pin:focus-visible .pin-caption { outline: 3px solid white; outline-offset: 2px; }
.renovate-pin:active .pin-caption { box-shadow: inset 0 1px 4px #8b653d88; }

.renovate-pin::before, .pin-site {
  content: "";
  position: absolute;
  left: var(--ring-x);
  pointer-events: none;
}

.renovate-pin::before {
  top: 34px;
  height: calc(var(--ring-y) - 34px);
  border-left: 1px solid #fbe2a3;
  filter: drop-shadow(0 0 1px #4d331f);
}
.renovate-pin.pin-below::before {
  top: var(--ring-y);
  height: calc(10px - var(--ring-y));
}
.pin-site {
  top: var(--ring-y);
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.pin-site::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid #9d6e34;
  background: #fff1c9;
  box-shadow: 0 0 0 2px #e2b55b, 0 1px 3px 3px #412a1766;
}
.renovate-pin.ready .pin-site::after { animation: worksiteLight 2.4s ease-out infinite; }
@keyframes worksiteLight {
  0%, 100% { box-shadow: 0 0 0 2px #e2b55b, 0 0 0 3px #ffe3a075; }
  65% { box-shadow: 0 0 0 2px #e2b55b, 0 0 0 8px #ffe3a000; }
}
@media (prefers-reduced-motion: reduce) {
  .home-room-img, .home-pins, .renovate-pin.ready .pin-site::after { animation: none; }
}

@keyframes pinFloat {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -62%); }
}

/* 左下角圆键 */
.home-dock-left {
  position: absolute;
  bottom: 18px;
  left: 12px;
  z-index: 30;
  display: flex;
  gap: 8px;
}

.dock-btn {
  position: relative;
  width: 58px;
  height: 62px;
  border-radius: 18px;
  border: 2px solid #fff3df;
  background: linear-gradient(180deg, #fffdf8, #f2dec3);
  box-shadow: 0 5px 0 #9f754d, 0 10px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-dark);
}

.dock-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #9f754d;
}

.dock-ico { font-size: 22px; line-height: 1; }
.dock-lbl { font-size: 10px; font-weight: 800; }

.red-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff4747;
  border: 2px solid #fff;
  display: none;
}

.red-dot.show { display: block; }

/* 右下角超大去合成按钮 */
.play-merge-btn {
  position: absolute;
  bottom: 16px;
  right: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 10px;
  border-radius: 22px;
  border: 3px solid #fff2cc;
  background: linear-gradient(180deg, #ffb84d 0%, #ee6d33 100%);
  box-shadow: 0 6px 0 #ad4114, 0 12px 24px rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  overflow: visible;
  animation: softPulse 2.4s infinite ease-in-out;
}

.play-merge-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #ad4114;
}

.play-merge-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
}

.pm-text {
  text-align: left;
}

.pm-text strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 2px 3px rgba(130, 40, 0, 0.45);
}

.pm-text small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.92;
}

.badge-pill {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  background: #2ec456;
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.badge-pill.gold {
  background: #ff4f4f;
}

.badge-pill.show {
  display: flex;
}

@keyframes softPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ==================== 场景 B：7×9 大棋盘合成场景 ==================== */
.scene-board {
  background: linear-gradient(180deg, #5e4434 0%, #f5e9d8 15%, #efe0ca 100%);
  padding-top: 48px;
}

/* 顾客订单横向传送带 */
.orders-belt {
  display: flex;
  gap: 8px;
  padding: 6px 10px 8px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.orders-belt::-webkit-scrollbar { display: none; }

.order-card {
  flex: 0 0 132px;
  background: linear-gradient(180deg, #ffffff, #fcf4e8);
  border: 2px solid #e4cfb4;
  border-radius: 16px;
  padding: 6px 7px;
  box-shadow: 0 4px 0 rgba(126, 86, 52, 0.22);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.15s;
}

.order-card.ready {
  border-color: #3cc45f;
  background: linear-gradient(180deg, #effef2, #ffffff);
  box-shadow: 0 4px 0 #268c40, 0 0 14px rgba(60, 196, 95, 0.35);
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-who {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-who img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f9ead7;
  object-fit: cover;
  border: 1.5px solid #e5c9a7;
}

.order-who span {
  font-size: 11px;
  font-weight: 800;
}

.order-prize {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff2c6;
  color: #b56500;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
}

.order-prize img {
  width: 13px;
  height: 13px;
}

.order-items {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.req-box {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #f6ead9;
  border: 1.5px solid #e3cdb1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.req-box.met {
  background: #e3f9e8;
  border-color: #3cc45f;
}

.req-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.req-lvl {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 9px;
  font-weight: 900;
  background: #5b3d29;
  color: #fff;
  padding: 1px 4px;
  border-radius: 6px;
}

.req-ok {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2ec456;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.deliver-btn {
  border: none;
  border-radius: 10px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #62d873, #29a84b);
  box-shadow: 0 3px 0 #1c7834;
  cursor: pointer;
}

.deliver-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1c7834;
}

/* 7×9 大棋盘 */
.board-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 2px 10px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-wood-frame {
  width: 100%;
  height: 100%;
  max-height: 540px;
  background: linear-gradient(160deg, #c79367, #9e6b43);
  border: 3px solid var(--wood-border);
  border-radius: 18px;
  padding: 6px;
  box-shadow:
    inset 0 2px 4px rgba(255, 240, 214, 0.45),
    0 6px 0 #754a29,
    0 12px 22px rgba(68, 44, 29, 0.25);
}

.merge-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(9, minmax(0, 1fr));
  gap: 3.5px;
  touch-action: none;
}

.cell {
  min-width: 0;
  min-height: 0;
  position: relative;
  border-radius: 9px;
  background: var(--cell-a);
  box-shadow: inset 0 2px 3px rgba(128, 90, 56, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
}

.cell.alt { background: var(--cell-b); }

.cell.selected {
  background: #fff8e6;
  box-shadow: inset 0 0 0 2.5px #ee723b, 0 0 10px rgba(238, 114, 59, 0.4);
  z-index: 2;
}

.cell.merge-hint {
  background: #fff3b8;
  box-shadow: inset 0 0 0 3px #f5aa1c, 0 0 18px rgba(245, 170, 28, 0.85);
  transform: scale(1.08);
  z-index: 4;
}

/* 全盘智能磁吸高亮：拖起物品时自动点亮所有可合成目标 */
.cell.can-merge-glow {
  box-shadow: inset 0 0 0 2.5px #ffd24d, 0 0 14px rgba(255, 208, 66, 0.72);
  background: #fff9df;
  animation: magnetPulse 0.9s infinite ease-in-out;
  z-index: 3;
}

@keyframes magnetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 果冻按压形变动效 */
.jelly-squish {
  animation: jellySquish 0.34s cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes jellySquish {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.22, 0.78); }
  55% { transform: scale(0.9, 1.14); }
  80% { transform: scale(1.05, 0.96); }
  100% { transform: scale(1, 1); }
}

/* 棋盘极轻微爽感震屏 */
.board-shake {
  animation: boardShake 0.22s ease;
}

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1.5px); }
  50% { transform: translate(2px, -1.5px); }
  75% { transform: translate(-1.5px, -1px); }
}

/* 飘浮 Q 弹描边爽感字 */
.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 900;
  color: #fff8d6;
  text-shadow:
    -1.5px -1.5px 0 #7a3e00,
    1.5px -1.5px 0 #7a3e00,
    -1.5px 1.5px 0 #7a3e00,
    1.5px 1.5px 0 #7a3e00,
    0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
  animation: floatUpPop 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatUpPop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  22% { opacity: 1; transform: translate(-50%, -85%) scale(1.18); }
  70% { opacity: 1; transform: translate(-50%, -140%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(0.92); }
}

.cell.swap-hint {
  box-shadow: inset 0 0 0 2px #3cc45f;
}

.cell.dragging-source .piece {
  opacity: 0.2;
  transform: scale(0.8);
}

/* 🕸️ 蜘蛛网积灰封印格 */
.cell.cobweb {
  background: #d7cec3;
  box-shadow: inset 0 0 10px rgba(60, 50, 42, 0.35);
}

.cell.cobweb .piece img {
  filter: grayscale(0.65) opacity(0.68);
}

.cobweb-overlay {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.55) 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  border: 1.5px dashed rgba(130, 118, 108, 0.55);
}

.cobweb-tag {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  opacity: 0.85;
}

/* 🫧 七彩合成泡泡 */
.piece.is-bubble {
  animation: bubbleBob 2.2s infinite ease-in-out;
}

.bubble-shell {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.85) 0%, rgba(160, 224, 255, 0.26) 45%, rgba(255, 166, 228, 0.36) 80%, rgba(255, 255, 255, 0.65) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 8px rgba(173, 216, 255, 0.7), 0 3px 8px rgba(96, 148, 224, 0.35);
  pointer-events: none;
}

.bubble-timer {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  background: #4e8ef7;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 99px;
  white-space: nowrap;
}

@keyframes bubbleBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2.5px) scale(1.04); }
}

.piece {
  position: relative;
  width: 90%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(58, 36, 18, 0.24));
}

.piece.is-gen::before {
  content: '';
  position: absolute;
  inset: 2%;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(255, 224, 120, 0.68), rgba(255, 190, 60, 0.05));
  z-index: -1;
}

.piece.is-chest {
  animation: chestWiggle 2.4s infinite ease-in-out;
}

@keyframes chestWiggle {
  0%, 80%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-6deg) scale(1.06); }
  92% { transform: rotate(6deg) scale(1.06); }
}

.p-lvl {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 1.5px 4px;
  border-radius: 5px;
  background: rgba(68, 44, 29, 0.85);
  color: #fff;
}

.p-bolt {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe77a, #f3951a);
  color: #633100;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
}

.p-order {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2ec456;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

.pop-in {
  animation: popIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.3); opacity: 0.3; }
  70% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); }
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* 选中物品信息条 */
.info-ribbon {
  margin: 2px 10px 4px;
  padding: 6px 10px;
  border-radius: 13px;
  background: rgba(255, 252, 246, 0.94);
  border: 1.5px solid #e4cfb4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  flex-shrink: 0;
}

.info-left {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.info-thumb {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f8eedf;
  border: 1px solid #e4cfb4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.info-thumb img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.info-meta { min-width: 0; }
.info-title {
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
.info-sub {
  font-size: 10px;
  color: var(--text-sub);
  white-space: normal;
  overflow-wrap: anywhere;
}

.info-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.rib-btn {
  border: none;
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #68c2ff, #3687e3);
  box-shadow: 0 2.5px 0 #1f5da6;
}

.rib-btn.sell {
  background: linear-gradient(180deg, #ffa654, #e36c30);
  box-shadow: 0 2.5px 0 #a34315;
}

.rib-btn.green {
  background: linear-gradient(180deg, #62d873, #29a84b);
  box-shadow: 0 2.5px 0 #1c7834;
}

/* 底部手游大按钮栏 */
.board-footer {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.8fr 0.95fr 0.95fr;
  gap: 6px;
  padding: 4px 10px 10px;
  flex-shrink: 0;
}

.game-btn {
  position: relative;
  border: 2px solid #fff5e3;
  border-radius: 15px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
  transition: transform 0.1s;
}

.game-btn:active {
  transform: translateY(3px);
}

.gb-ico { font-size: 17px; line-height: 1.1; }
.gb-lbl { font-size: 10px; font-weight: 900; }
.gb-lbl em { font-style: normal; }

.game-btn.home-back {
  background: linear-gradient(180deg, var(--green-1), var(--green-2));
  box-shadow: 0 4px 0 var(--green-shadow);
}

.game-btn.merge-all {
  background: linear-gradient(180deg, var(--orange-1), var(--orange-2));
  box-shadow: 0 4px 0 var(--orange-shadow);
}

.game-btn.undo {
  background: linear-gradient(180deg, #b8c2cc, #8592a1);
  box-shadow: 0 4px 0 #5b6673;
}

.game-btn.storage {
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  box-shadow: 0 4px 0 var(--blue-shadow);
}

.game-btn.supply {
  background: linear-gradient(180deg, #ffe066, #efa01d);
  box-shadow: 0 4px 0 #b06c08;
  color: #5b2e00;
}

/* 飞行层 & 拖拽幽灵 */
.fly-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

.fly-sprite {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.fly-sprite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3));
}

.drag-ghost {
  position: fixed;
  width: 66px;
  height: 66px;
  pointer-events: none;
  z-index: 999;
  display: none;
  transform: translate(-50%, -58%) scale(1.18);
}

.drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35));
}

/* ==================== 手游弹窗 ==================== */
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(24, 16, 12, 0.62);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-mask.open { display: flex; }

/* 从卡册打开详情时保留下面的卡册，关闭详情即可继续翻阅。 */
#cardDetailModal, #memoryBookModal { z-index: 101; }

.game-modal, .story-sheet {
  width: 100%;
  max-height: 82%;
  background: var(--cream);
  border: 3px solid #e6cfa9;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popIn 0.24s ease;
}

.game-modal.tall { max-height: 88%; }

.gm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gm-head h3 {
  font-size: 16px;
  font-weight: 900;
}

.gm-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #eedcc3;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.gm-tip {
  font-size: 11px;
  color: var(--text-sub);
}

/* 3D 立体通用按钮 */
.btn-3d {
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 13px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
}

.btn-3d.full { width: 100%; }
.btn-3d.sm { padding: 7px 10px; font-size: 12px; }
.btn-3d.green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); box-shadow: 0 4px 0 var(--green-shadow); }
.btn-3d.blue { background: linear-gradient(180deg, var(--blue-1), var(--blue-2)); box-shadow: 0 4px 0 var(--blue-shadow); }
.btn-3d.red { background: linear-gradient(180deg, #ff7b7b, #d94343); box-shadow: 0 4px 0 #9e2626; }
.btn-3d:active { transform: translateY(2px); }

/* 装修清单 */
.task-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e7d4ba;
  border-radius: 14px;
  padding: 9px 10px;
}

.task-row.done { background: #f2fbf4; border-color: #c5e8cd; opacity: 0.8; }

.task-left { display: flex; align-items: center; gap: 8px; }
.task-ico { font-size: 22px; }
.task-name { font-size: 13px; font-weight: 800; }
.task-sub { font-size: 10px; color: var(--text-sub); }

/* 三选一风格卡片 */
.style-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.style-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 2px solid #e6d1b5;
  border-radius: 16px;
  padding: 11px 12px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}

.style-card:hover {
  border-color: #ee723b;
  background: #fff8ef;
  transform: scale(1.01);
}

.style-card strong { font-size: 14px; display: block; }
.style-card small { font-size: 11px; color: var(--text-sub); }
.style-tag {
  background: #ffecd6;
  color: #c4581f;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* 剧情卡片 */
.story-top { display: flex; align-items: center; gap: 10px; }
.story-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: #faeedc;
  object-fit: cover;
  border: 2px solid #e7cba3;
}
.story-name { font-size: 16px; font-weight: 900; }
.story-role { font-size: 11px; color: var(--text-sub); }
.story-bubble {
  background: #f8eee0;
  border-radius: 14px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.story-reward-tip {
  background: #fff4cf;
  color: #8f5300;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* 卡牌集册 */
.cards-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-set {
  background: #fff;
  border: 1.5px solid #e7d4ba;
  border-radius: 16px;
  padding: 10px;
}

.card-set-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mem-card {
  background: linear-gradient(180deg, #fff9ec, #f7e6c8);
  border: 1.5px solid #e6c68a;
  border-radius: 11px;
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.mem-card.locked {
  background: #f0e8de;
  border-color: #dcd0c1;
}

.mem-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.mem-card.locked img {
  filter: brightness(0) opacity(0.16);
}

.mem-card span {
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.mem-stars {
  font-size: 9px;
  color: #e69500;
}

/* 仓库 & 补给 & 图鉴 & 设置 */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  overflow-y: auto;
}

.storage-slot {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #f3e6d3;
  border: 1.5px dashed #d4ba99;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.storage-slot.filled { background: #fff; border-style: solid; border-color: #e5cca8; }
.storage-slot img { width: 82%; height: 82%; object-fit: contain; }

.supply-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  overflow-y: auto;
}

.supply-card {
  background: #fff;
  border: 1.5px solid #e5cca8;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.supply-card img { width: 50px; height: 50px; object-fit: contain; }
.supply-card strong { font-size: 13px; }
.supply-card small { font-size: 10px; color: var(--text-sub); }

.album-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.album-chain h4 { font-size: 13px; margin-bottom: 6px; }
.album-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.album-cell {
  background: #fff;
  border: 1px solid #e7d4ba;
  border-radius: 10px;
  padding: 5px 3px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.album-cell img { width: 40px; height: 40px; object-fit: contain; }
.album-cell.locked img { filter: brightness(0) opacity(0.16); }
.album-cell span { font-size: 10px; color: var(--text-sub); }

.settings-list { display: flex; flex-direction: column; gap: 10px; }
.setting-row, .setting-box {
  background: #fff;
  border: 1.5px solid #e7d4ba;
  border-radius: 14px;
  padding: 10px 12px;
}
.setting-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.setting-row strong, .setting-box strong { display: block; font-size: 13px; }
.setting-row small, .setting-box small { font-size: 10px; color: var(--text-sub); }
.setting-row input { width: 18px; height: 18px; accent-color: #ee6c38; }
.save-btns { display: flex; gap: 6px; margin-top: 8px; }
.save-btns .btn-3d { flex: 1; }

/* Toast：不遮挡顶部订单栏，简洁单条居中底部偏上 */
.toast-host {
  position: absolute;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  width: 86%;
  align-items: center;
}

.toast {
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.45;
  line-break: strict;
  overflow-wrap: anywhere;
  background: rgba(40, 28, 20, 0.92);
  color: #fff6e6;
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: popIn 0.2s ease;
  text-align: center;
}

/* ==================== 注入灵魂升级包样式 ==================== */
.hud-right-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-circle-btn.muted {
  opacity: 0.55;
  filter: grayscale(0.8);
}

/* 1. 房间真实风格氛围层（三选一风格真正改变画面！） */
.room-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.atmo-sunrays {
  position: absolute;
  inset: -20%;
  background: linear-gradient(125deg,
    rgba(255, 244, 200, 0) 20%,
    rgba(255, 238, 178, 0.28) 38%,
    rgba(255, 250, 224, 0.08) 52%,
    rgba(255, 232, 160, 0.22) 66%,
    rgba(255, 244, 200, 0) 82%);
  opacity: 0;
  transition: opacity 0.8s ease;
  animation: rayDrift 7s infinite ease-in-out;
}

.room-atmosphere.style-sun .atmo-sunrays { opacity: 1; }

@keyframes rayDrift {
  0%, 100% { transform: translateX(-3%) rotate(0deg); }
  50% { transform: translateX(3%) rotate(1.5deg); }
}

.atmo-warmglow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 52%, rgba(255, 164, 72, 0.34), rgba(196, 98, 36, 0.12) 48%, transparent 78%);
  opacity: 0;
  transition: opacity 0.8s ease;
  animation: fireFlicker 2.8s infinite ease-in-out;
}

.room-atmosphere.style-warm .atmo-warmglow { opacity: 1; }

@keyframes fireFlicker {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.atmo-fairylights {
  position: absolute;
  top: 128px;
  left: 8%;
  right: 8%;
  height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1.5px solid rgba(255, 234, 185, 0.45);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.room-atmosphere.style-dreamy .atmo-fairylights { opacity: 1; }

.atmo-fairylights span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff5ba;
  box-shadow: 0 0 12px 4px rgba(255, 222, 122, 0.9);
  animation: bulbTwinkle 1.8s infinite ease-in-out;
}

.atmo-fairylights span:nth-child(even) {
  margin-top: 8px;
  background: #ffd1ec;
  box-shadow: 0 0 12px 4px rgba(255, 166, 220, 0.85);
  animation-delay: 0.6s;
}

@keyframes bulbTwinkle {
  0%, 100% { opacity: 0.6; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 2. 现场魔法施工演出 */
.magic-build-fx {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.magic-build-fx.playing { display: flex; }

.magic-sweep {
  position: absolute;
  left: 0;
  right: 0;
  height: 110px;
  background: linear-gradient(180deg, transparent, rgba(255, 240, 175, 0.88), transparent);
  top: -120px;
  animation: sweepDown 1.1s 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sweepDown {
  0% { top: -120px; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}

.magic-cloud {
  position: absolute;
  font-size: 56px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  animation: cloudWork 0.75s ease-in-out forwards;
}

@keyframes cloudWork {
  0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
  25% { transform: scale(1.25) rotate(10deg); opacity: 1; }
  50% { transform: scale(1.05) rotate(-10deg); opacity: 1; }
  75% { transform: scale(1.3) rotate(8deg); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.magic-ribbon {
  position: absolute;
  background: linear-gradient(135deg, #ffe27a, #f59b25);
  color: #632e00;
  border: 3px solid #fff;
  padding: 9px 22px;
  border-radius: 99px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  opacity: 0;
  animation: ribbonPop 1.15s 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ribbonPop {
  0% { transform: scale(0.4); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95) translateY(-16px); opacity: 0; }
}

/* 3. 常驻老宅的“活人”女主林晚 */
.resident-hero {
  position: absolute;
  left: 14px;
  bottom: 92px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  cursor: pointer;
}

.hero-speech {
  max-width: 215px;
  background: rgba(255, 252, 245, 0.96);
  color: var(--text-dark);
  border: 2px solid #f0cfa4;
  border-radius: 16px 16px 16px 4px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
  animation: speechPop 0.35s ease;
}

@keyframes speechPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hero-avatar-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8eb, #f3d7b3);
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  overflow: visible;
  animation: heroFloat 3.2s infinite ease-in-out;
}

.hero-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hero-avatar-wrap.cheer {
  animation: heroCheer 0.55s ease;
}

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

@keyframes heroCheer {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-16px) scale(1.12); }
  65% { transform: translateY(-4px) scale(0.96); }
}

.hero-heart {
  position: absolute;
  top: -10px;
  right: -6px;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
}

.hero-heart.pop {
  animation: heartFly 0.85s ease forwards;
}

@keyframes heartFly {
  0% { opacity: 1; transform: translateY(0) scale(0.6); }
  50% { opacity: 1; transform: translateY(-16px) scale(1.25); }
  100% { opacity: 0; transform: translateY(-30px) scale(1); }
}

/* 4. 顾客活人催单小话 */
.order-quote {
  font-size: 9.5px;
  color: #9e6a42;
  background: #fdf3e3;
  border-radius: 7px;
  padding: 2px 5px;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-card.ready .order-quote {
  background: #dff8e5;
  color: #1f7f3a;
}

/* 5. 连击与狂热时光能量条 */
.fever-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 4px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 250, 240, 0.9);
  border: 1.5px solid #e4cfb4;
  flex-shrink: 0;
}

.fever-strip.fever-on {
  background: linear-gradient(90deg, #ffde59, #ff8f3f, #ff5e9c);
  border-color: #fff;
  box-shadow: 0 0 18px rgba(255, 160, 50, 0.75);
  animation: feverBarPulse 0.7s infinite alternate;
}

.fever-strip.fever-on .fever-label {
  color: #fff;
  text-shadow: 0 1px 2px rgba(120, 30, 0, 0.6);
}

@keyframes feverBarPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.015); }
}

.fever-label {
  font-size: 11px;
  font-weight: 900;
  color: #b5571e;
  white-space: nowrap;
}

.fever-track {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(140, 96, 62, 0.2);
  overflow: hidden;
}

.fever-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffca3a, #ff595e);
  transition: width 0.25s ease;
}

.combo-pill {
  font-size: 11px;
  font-weight: 900;
  padding: 1px 8px;
  border-radius: 99px;
  background: #ffece0;
  color: #c84b1a;
  white-space: nowrap;
}

.combo-pill.hot {
  background: linear-gradient(135deg, #ff7043, #ffca28);
  color: #fff;
  transform: scale(1.08);
}

/* 狂热时光棋盘七彩流光边框 */
.board-wood-frame.fever-glow {
  border-color: #ffe066;
  box-shadow:
    0 0 0 3px #ff9b42,
    0 0 26px rgba(255, 194, 51, 0.9),
    inset 0 0 16px rgba(255, 240, 160, 0.65);
}

/* 6. 电影感开场爽文短剧舞台 */
.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}

.intro-overlay.open { display: flex; }

.intro-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 12, 10, 0.52) 0%, rgba(16, 12, 10, 0.85) 100%),
    url('../assets/rooms/living_stage0.png') center / cover no-repeat;
  filter: blur(2px) brightness(0.75);
}

.intro-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.intro-stage {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.intro-tag {
  background: rgba(255, 214, 112, 0.22);
  border: 1px solid rgba(255, 214, 112, 0.6);
  color: #ffe49c;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.intro-portrait-wrap {
  position: relative;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6e6, #ebd0ac);
  border: 4px solid #ffe4aa;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: popIn 0.35s ease;
}

.intro-portrait-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.intro-mood {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 34px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  animation: pinFloat 1.5s infinite ease-in-out;
}

.intro-dialog-box {
  width: 100%;
  background: rgba(255, 250, 242, 0.97);
  border: 3px solid #e6cfa9;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-speaker {
  font-size: 15px;
  font-weight: 900;
  color: #b54d20;
}

.intro-line {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dark);
  min-height: 54px;
}

/* ==================== 2.0 策略正式版新增样式 ==================== */
.crisis-ticker {
  position: absolute;
  top: 128px;
  left: 12px;
  right: 12px;
  z-index: 24;
  background: linear-gradient(115deg, #513b30eb, #49332bee);
  border: 1px solid rgba(255, 214, 155, 0.52);
  color: #fff2db;
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.crisis-ticker.solved {
  background: rgba(48, 77, 54, 0.92);
  border-color: #abcd99;
}

/* 短屏给吊灯和地面留下完整施工区，角色与对话共用底部一行。 */
@media (max-height: 660px) and (orientation: portrait) {
  .home-room-switcher { top: 41px; }
  .home-chapter-pill { top: 78px; }
  .crisis-ticker { top: 105px; padding: 3px 7px; font-size: 10px; line-height: 1.2; }
  .resident-hero {
    left: 10px;
    bottom: 84px;
    flex-direction: row-reverse;
    align-items: center;
    gap: 7px;
  }
  .hero-avatar-wrap { width: 48px; height: 48px; flex: none; }
  .hero-speech { max-width: min(191px, calc(100vw - 98px)); border-radius: 12px 12px 12px 4px; }
}

/* 📦 封尘硬纸箱格（相邻合成震碎！） */
.cell.crate {
  background: linear-gradient(145deg, #c99a6b, #9e6e40);
  border: 2px solid #784e27;
  box-shadow: inset 0 2px 4px rgba(255, 232, 198, 0.45), inset 0 -3px 5px rgba(72, 42, 16, 0.35);
}

.crate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.crate-box small {
  font-size: 8px;
  font-weight: 900;
  color: #fff3dc;
  background: rgba(74, 42, 14, 0.72);
  padding: 0 4px;
  border-radius: 4px;
  margin-top: 2px;
}

/* 🔒 等级封锁区 */
.cell.locked-zone {
  background: repeating-linear-gradient(-45deg, #5d4a3c, #5d4a3c 6px, #4e3d31 6px, #4e3d31 12px);
  border: 1.5px solid #3c2e24;
  cursor: not-allowed;
}

.lock-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
  color: #f5dfb8;
  font-weight: 900;
  opacity: 0.9;
}

.lock-badge small {
  font-size: 8.5px;
}

/* 稀有副链物品 & 神器（剪刀、万能卡） */
.emoji-piece {
  width: 86%;
  height: 86%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.emoji-piece.sub-item {
  background: radial-gradient(circle at 30% 25%, #fff6ff, #e6c6ff 55%, #b26ce6 100%);
  border: 2px solid #ffe484;
}

.emoji-piece.tool-scissors {
  background: radial-gradient(circle at 30% 25%, #ffffff, #bde5ff 55%, #4fa3f7 100%);
  border: 2px solid #fff;
  animation: chestWiggle 2.2s infinite;
}

.emoji-piece.tool-joker {
  background: radial-gradient(circle at 30% 25%, #fffbe0, #ffd859 55%, #f28c28 100%);
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(255, 200, 48, 0.8);
  animation: chestWiggle 1.8s infinite;
}

/* 👑 王牌终极单 & ⏱️ 限时加急单 */
.order-card.vip {
  border-color: #b565f5;
  background: linear-gradient(180deg, #faf0ff, #ffffff);
  box-shadow: 0 4px 0 #7b35b8;
}

.order-card.rush {
  border-color: #ff5c5c;
  background: linear-gradient(180deg, #fff1f1, #ffffff);
  box-shadow: 0 4px 0 #c93232;
}

.order-tag-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
}

.order-tag-bar.vip {
  background: linear-gradient(90deg, #9d4edd, #c77dff);
  color: #fff;
}

.order-tag-bar.rush {
  background: linear-gradient(90deg, #ff4d4d, #ff884d);
  color: #fff;
}

.req-emoji {
  font-size: 22px;
}

/* 🐷 砸金猪互动台 */
.piggy-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 6px 4px;
}

.piggy-bank {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4b8, #ffc947 65%, #e68a19 100%);
  border: 4px solid #fff;
  box-shadow: 0 10px 26px rgba(210, 120, 10, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 62px;
  animation: heroFloat 2.4s infinite ease-in-out;
}

.piggy-bank.smashed {
  animation: jellySquish 0.4s ease;
}

.piggy-info {
  font-size: 14px;
  font-weight: 900;
  color: #8f4e00;
}

/* ==================== 3.0 激情终极版新增样式 ==================== */
/* 宿敌表姐人气冲刺赛进度条 */
.race-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 10px 4px;
  padding: 4px 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(84, 34, 118, 0.9), rgba(145, 52, 138, 0.9));
  border: 1.5px solid #ffd87a;
  color: #fff;
  box-shadow: 0 3px 10px rgba(84, 34, 118, 0.3);
  cursor: pointer;
  flex-shrink: 0;
}

.race-badge {
  font-size: 10.5px;
  font-weight: 900;
  color: #ffe37a;
  white-space: nowrap;
}

.race-track {
  position: relative;
  flex: 1;
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.race-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.race-fill.rival {
  background: rgba(255, 102, 128, 0.72);
  z-index: 1;
}

.race-fill.player {
  background: linear-gradient(90deg, #ffe259, #ffa751);
  box-shadow: 0 0 8px rgba(255, 226, 89, 0.85);
  z-index: 2;
}

.race-goal {
  font-size: 10.5px;
  font-weight: 900;
  color: #fff6d1;
  white-space: nowrap;
}

/* 3D 硬纸箱与稀有副链紫金光晕 */
.cell.crate {
  background: #e2cfb6;
  border: none;
  box-shadow: inset 0 2px 4px rgba(100, 64, 32, 0.22);
}

.crate-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(58, 34, 14, 0.3));
}

.crate-hint {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 900;
  background: rgba(96, 54, 18, 0.85);
  color: #fff5df;
  padding: 0 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.piece.is-sub::before {
  content: '';
  position: absolute;
  inset: 2%;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(214, 158, 255, 0.65), rgba(164, 92, 235, 0.08));
  z-index: -1;
}

.piece.is-artifact::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 232, 120, 0.85), rgba(255, 180, 40, 0));
  z-index: -1;
  animation: pulseBolt 1.4s infinite;
}

/* 全屏彩带烟花画布 */
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 97;
}

/* 屏幕正中大号炫彩连击/暴击跳级爆破字 */
.big-callout {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  z-index: 92;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 6px 13px;
  border: 1px solid #eac579;
  border-radius: 14px;
  background: linear-gradient(180deg, #674326, #50311d);
  box-shadow: 0 3px 12px rgba(57, 32, 12, .30);
  font-size: clamp(18px, 5.2vw, 25px);
  line-height: 1.33;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff7cc;
  text-align: center;
  white-space: normal;
  line-break: strict;
  overflow-wrap: anywhere;
  text-wrap: balance;
  opacity: 0;
  text-shadow: 0 1px 2px #48240f;
}
.callout-phrase { display: inline-block; max-width: 100%; vertical-align: top; }

.big-callout.boom {
  animation: calloutBoom 1.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes calloutBoom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); }
  18% { opacity: 1; transform: translate(-50%, -53%) scale(1.035); }
  78% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -66%) scale(0.98); }
}

.phone-frame:has(.modal-mask.open) :is(.big-callout, .discovery-banner, .guide-hand) {
  visibility: hidden;
}
.phone-frame:has(#receiptModal.open, #storyModal.open) .toast-host {
  z-index: 98;
}

/* 新手前 60 秒 Q 弹小手指引导 */
.guide-hand {
  position: absolute;
  z-index: 94;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -10%);
}

.guide-hand.show { display: flex; }

.hand-finger {
  font-size: 32px;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.45));
  animation: handPoke 0.9s infinite ease-in-out;
}

.hand-tip {
  background: rgba(34, 22, 14, 0.9);
  color: #ffe89e;
  border: 1.5px solid #ffd466;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  margin-top: -2px;
}

@keyframes handPoke {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.1); }
}

/* ==================== 仪式感与惊喜彩蛋终极样式 ==================== */
/* 1. 电影海报开屏封面 + 3D 真实法式双开木门推门入宅 */
.splash-overlay {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1100px;
}

.splash-overlay.open { display: flex; }

.splash-bg {
  position: absolute;
  inset: -6%;
  background:
    linear-gradient(180deg, rgba(24, 15, 10, 0.28) 0%, rgba(24, 15, 10, 0.72) 100%),
    url('../assets/rooms/living_stage2.png') center / cover no-repeat;
  animation: splashZoom 14s infinite alternate ease-in-out;
  transition: opacity 1.1s ease, transform 1.2s ease;
}

@keyframes splashZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* 门缝倾泻出的金色圣光束 */
.door-light-beam {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 50%, rgba(255, 245, 195, 0.96) 0%, rgba(255, 210, 110, 0.55) 35%, rgba(255, 190, 80, 0) 72%);
  opacity: 0;
  transform: scaleX(0.05);
  pointer-events: none;
  transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 左右两扇真实立体法式雕花木门 */
.splash-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(72, 43, 25, 0.86) 0%, rgba(48, 28, 16, 0.92) 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55);
  transition: transform 1.2s cubic-bezier(0.32, 0.08, 0.16, 1), opacity 1.1s ease;
  pointer-events: none;
  backface-visibility: hidden;
}

.splash-door.left {
  left: 0;
  transform-origin: left center;
  border-right: 3px solid #e6b868;
}

.splash-door.right {
  right: 0;
  transform-origin: right center;
  border-left: 3px solid #e6b868;
}

.door-panel-deco {
  position: absolute;
  inset: 28px 18px;
  border: 2px solid rgba(242, 200, 122, 0.38);
  border-radius: 14px;
  box-shadow: inset 0 0 0 6px rgba(255, 224, 164, 0.06);
}

.door-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 44px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffe799, #c98622);
  border: 1.5px solid #fff3c4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
}

.splash-door.left .door-handle { right: 12px; }
.splash-door.right .door-handle { left: 12px; }

/* 点击「推开老宅大门」触发 3D 推门 + 金光轰然倾泻！ */
.splash-overlay.opening .splash-content {
  opacity: 0;
  transform: scale(1.18);
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.splash-overlay.opening .splash-bg {
  opacity: 0;
  transform: scale(1.25);
}

.splash-overlay.opening .door-light-beam {
  opacity: 1;
  transform: scaleX(1.35);
}

.splash-overlay.opening .splash-door.left {
  transform: rotateY(-108deg);
  opacity: 0.15;
}

.splash-overlay.opening .splash-door.right {
  transform: rotateY(108deg);
  opacity: 0.15;
}

/* 老宅 ⇄ 棋盘丝滑镜头切入动效 */
.scene.active {
  display: flex;
  animation: sceneEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sceneEnter {
  0% { opacity: 0.35; transform: scale(1.035); }
  100% { opacity: 1; transform: scale(1); }
}

.splash-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  gap: 14px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.splash-kicker {
  background: rgba(255, 218, 120, 0.22);
  border: 1.5px solid rgba(255, 226, 140, 0.7);
  color: #ffeaad;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.splash-title {
  font-size: 38px;
  line-height: 1.18;
  font-weight: 900;
  color: #fff8de;
  text-shadow:
    0 3px 0 #a34d18,
    0 6px 0 #662908,
    0 12px 28px rgba(0, 0, 0, 0.65);
  letter-spacing: 2px;
}

.splash-portrait {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8e8, #f2d2a7);
  border: 4px solid #ffe49c;
  box-shadow: 0 0 32px rgba(255, 214, 112, 0.65), 0 12px 26px rgba(0, 0, 0, 0.5);
  animation: heroFloat 3s infinite ease-in-out;
}

.splash-portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.splash-sub {
  font-size: 13px;
  color: #f7e4c8;
  font-weight: 700;
  letter-spacing: 1px;
}

.splash-enter-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  border-radius: 99px;
  border: 3px solid #fff3c4;
  background: linear-gradient(180deg, #ffcb52 0%, #ee6d33 100%);
  box-shadow: 0 7px 0 #a63d12, 0 14px 32px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  animation: softPulse 2s infinite ease-in-out;
}

.splash-enter-btn:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #a63d12;
}

/* 2. 🏆 荣耀颁奖盛典弹窗（旋转圣光射线 + 战利品依次弹跳） */
.ceremony-stage {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sunburst-rays {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 224, 112, 0.34) 0deg 15deg,
    rgba(255, 224, 112, 0) 15deg 30deg
  );
  animation: spinRays 16s linear infinite;
  pointer-events: none;
}

@keyframes spinRays {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ceremony-card {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(180deg, #fffdf5 0%, #fcedd2 100%);
  border: 3.5px solid #ffd56b;
  border-radius: 26px;
  padding: 20px 18px 18px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ceremony-crown {
  font-size: 46px;
  margin-top: -42px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
  animation: heroFloat 2s infinite ease-in-out;
}

.ceremony-ribbon {
  background: linear-gradient(90deg, #f59b25, #ffcf4d, #f59b25);
  color: #6b2e00;
  border: 2px solid #fff;
  padding: 5px 22px;
  border-radius: 99px;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(180, 96, 12, 0.35);
}

.ceremony-sub {
  font-size: 13px;
  color: #7d573c;
  font-weight: 700;
  line-height: 1.5;
}

.ceremony-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 6px 0;
  width: 100%;
}

.prize-tile {
  width: 84px;
  background: #fff;
  border: 2px solid #f0cfa0;
  border-radius: 16px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 6px 14px rgba(160, 100, 40, 0.18);
  animation: popIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.prize-tile img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.prize-tile span {
  font-size: 11px;
  font-weight: 900;
  color: #6b3b18;
}

/* 3. 📸 拍立得前后对比纪念照 */
.polaroid-card {
  width: 100%;
  max-width: 390px;
  background: #fffdf8;
  border-radius: 18px;
  padding: 16px 14px 18px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
  transform: rotate(-1deg);
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: center;
  animation: popIn 0.35s ease;
}

.polaroid-badge {
  font-size: 12px;
  font-weight: 900;
  color: #b55422;
  letter-spacing: 1px;
}

.polaroid-photos {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pola-half {
  position: relative;
  flex: 1;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #ead6bc;
}

.pola-half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pola-lbl {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.pola-lbl.old { background: rgba(34, 28, 24, 0.78); color: #ddd; }
.pola-lbl.new { background: linear-gradient(90deg, #ffae34, #ee6c38); color: #fff; }
.pola-arrow { font-size: 18px; font-weight: 900; color: #ee723b; }
.polaroid-caption { font-size: 16px; font-weight: 900; color: var(--text-dark); }
.polaroid-sign { font-size: 12px; color: #9c7a62; font-style: italic; margin-top: -4px; }

/* 4. 🐱 老宅隐藏彩蛋：招财小橘猫 */
.lucky-cat {
  position: absolute;
  right: 16px;
  bottom: 98px;
  z-index: 26;
  display: none;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  animation: heroFloat 2.1s infinite ease-in-out;
}

.lucky-cat.show { display: flex; }

.cat-face {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4d6, #ffbe66);
  border: 2.5px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.cat-bubble {
  margin-top: -4px;
  background: #ff6b6b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1.5px solid #fff;
}

/* 5. 🎈 天降漂浮惊喜气球 */
.sky-balloon {
  position: absolute;
  top: 168px;
  left: -90px;
  z-index: 95;
  display: none;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
}

.sky-balloon.flying {
  display: flex;
  animation: flyAcross 11s linear forwards;
}

@keyframes flyAcross {
  0% { left: -80px; transform: translateY(0px) rotate(-6deg); }
  25% { transform: translateY(-16px) rotate(6deg); }
  50% { transform: translateY(8px) rotate(-5deg); }
  75% { transform: translateY(-14px) rotate(5deg); }
  100% { left: 112%; transform: translateY(0px) rotate(-4deg); }
}

.balloon-body {
  font-size: 36px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.balloon-tag {
  background: linear-gradient(90deg, #ff5e9c, #ff9f43);
  color: #fff;
  border: 1.5px solid #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* 6. 🎁 隐藏盲盒三选一 */
.mystery-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 2px;
}

.mystery-box {
  background: linear-gradient(180deg, #fff6db, #ffd57a);
  border: 2.5px solid #fff;
  border-radius: 18px;
  padding: 16px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 0 #c98316, 0 10px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  animation: chestWiggle 2s infinite;
}

.mystery-box:active { transform: translateY(4px); }
.mystery-box img { width: 54px; height: 54px; object-fit: contain; }
.mystery-box span { font-size: 11px; font-weight: 900; color: #753e00; }

/* ==================== 过关惊喜弹幕雨 & 棋盘闪电链特效 ==================== */
.danmaku-item {
  position: absolute;
  right: -240px;
  z-index: 135;
  background: rgba(255, 252, 242, 0.94);
  color: #5e3214;
  border: 2px solid #ffd266;
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: danmakuFly 3.6s linear forwards;
}

@keyframes danmakuFly {
  0% { transform: translateX(0); opacity: 0.95; }
  85% { opacity: 1; }
  100% { transform: translateX(-680px); opacity: 0; }
}

/* 棋盘欧皇金光闪屏 */
.gold-flash-screen {
  position: absolute;
  inset: 0;
  z-index: 138;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 238, 150, 0.72), rgba(255, 190, 60, 0));
  animation: goldFlashFade 0.55s ease forwards;
}

@keyframes goldFlashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==================== 紧迫感心跳告警动效 ==================== */
.race-bar.urgent {
  background: linear-gradient(90deg, #b81d24, #e53935);
  border-color: #ffe066;
  box-shadow: 0 0 18px rgba(255, 62, 62, 0.85);
  animation: urgentPulse 0.65s infinite alternate;
}

@keyframes urgentPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.025); }
}

.order-card.rush.urgent {
  border-color: #ff2a2a;
  box-shadow: 0 0 18px rgba(255, 42, 42, 0.75);
  animation: urgentPulse 0.55s infinite alternate;
}

/* ==================== v11 全宅竣工三房亮灯 & 小屏/横屏防遮挡适配 ==================== */
.grand-finale-card {
  max-width: 410px;
  transform: rotate(0deg);
}

.grand-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.trio-room {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e6c68a;
  filter: brightness(0.25) saturate(0.3);
  transform: scale(0.92);
  transition: filter 0.7s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
}

.trio-room.lit {
  filter: brightness(1.06) saturate(1.12);
  transform: scale(1);
  box-shadow: 0 0 18px rgba(255, 210, 96, 0.85);
}

.trio-room img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trio-room span {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 22, 14, 0.82);
  color: #ffe89e;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
}

/* 强化三选一不同风格对应的房间色调氛围差异 */
.home-room-img.tone-sun { filter: brightness(1.06) saturate(1.08) sepia(0.06) !important; }
.home-room-img.tone-warm { filter: brightness(0.98) saturate(1.18) sepia(0.22) contrast(1.06) !important; }
.home-room-img.tone-dreamy { filter: brightness(1.04) saturate(1.14) hue-rotate(-10deg) !important; }

/* 320×568 小屏与 844×390 横屏防遮挡紧凑适配 */
@media (max-height: 640px) {
  .scene-board { padding-top: 40px; }
  .hud-top { padding: 5px 8px; }
  .hud-pill { height: 26px; font-size: 11.5px; }
  .orders-belt { padding: 3px 8px 4px; gap: 6px; }
  .order-card { flex: 0 0 116px; padding: 4px 6px; gap: 3px; }
  .req-box { width: 34px; height: 34px; }
  .req-box img { width: 28px; height: 28px; }
  .race-bar, .fever-strip { padding: 2px 8px; margin-bottom: 2px; }
  .board-stage { padding: 1px 8px 2px; }
  .board-wood-frame { padding: 4px; height: 100%; }
  .merge-grid { gap: 2px; }
  .info-ribbon { min-height: 36px; padding: 3px 8px; margin: 2px 8px; }
  .info-thumb { width: 28px; height: 28px; }
  .board-footer { padding: 2px 8px 6px; gap: 4px; }
  .game-btn { padding: 4px 2px; border-radius: 11px; }
  .gb-ico { font-size: 14px; }
  .gb-lbl { font-size: 9px; }
}

/* 窄屏为设置和三个常用入口保留独立触点。 */
@media (max-width: 385px) {
  .hud-top { gap: 3px; padding-inline: 6px; }
  .level-badge { flex: 0 1 58px; min-width: 31px; gap: 3px; padding-right: 5px; }
  .lvl-star { flex: 0 0 23px; width: 23px; height: 23px; }
  .lvl-bar-wrap { flex: 1; min-width: 0; max-width: 27px; }
  .hud-resources, .hud-right-btns { flex-shrink: 0; gap: 3px; }
  .hud-pill { gap: 2px; padding-inline: 4px; font-size: 12px; }
  .hud-pill img { width: 16px; height: 16px; }
  .hud-circle-btn { width: 29px; height: 29px; font-size: 15px; }
  .home-dock-left { left: 8px; gap: 4px; }
  .dock-btn { width: clamp(45px, 13.5vw, 52px); height: 55px; }
  .play-merge-btn { right: 9px; gap: 5px; padding: 8px 9px; }
  .play-merge-btn img { width: 32px; height: 32px; }
  .pm-text strong { font-size: 15px; }
  .fever-strip { flex-wrap: wrap; gap: 2px 4px; margin-inline: 8px; padding-inline: 5px; }
  .fever-label { font-size: 10px; }
  .fever-track { min-width: 14px; }
  .combo-pill { padding-inline: 5px; }
  .order-who { gap: 3px; }
  .order-who img { width: 21px; height: 21px; }
  .order-who span { white-space: nowrap; }
  .order-prize { padding-inline: 4px; }
}

@media (max-height: 440px) {
  .orders-belt { padding: 2px 6px; gap: 4px; }
  .order-card { flex: 0 0 112px; padding: 3px 5px; gap: 2px; }
  .order-quote, .order-tag-bar { display: none; }
  .req-box { width: 28px; height: 28px; }
  .req-box img { width: 22px; height: 22px; }
  .deliver-btn { padding: 2px 4px; font-size: 10px; }
  .race-bar { display: none; }
  .info-ribbon { display: none; }
}

/* 金币小铺入口与典藏鎏金拍立得相框 */
.hud-pill.clickable {
  cursor: pointer;
}

.coin-shop-plus {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ee6c38;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

.polaroid-card.gold-frame {
  background: linear-gradient(180deg, #fff9e3, #f9df9b);
  border: 4px solid #f5b932;
  box-shadow: 0 0 32px rgba(255, 206, 72, 0.8), 0 20px 50px rgba(0, 0, 0, 0.55);
}

/* ==================== v13 17项全套升级样式 ==================== */
/* 加急单常驻秒数快速定位入口 */
.orders-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.orders-wrap .orders-belt {
  flex: 1;
}

.rush-anchor-btn {
  position: absolute;
  right: 8px;
  top: 4px;
  z-index: 12;
  border: 2px solid #fff;
  background: linear-gradient(90deg, #ff4d4d, #ff884d);
  color: #fff;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(220, 40, 40, 0.45);
  cursor: pointer;
}

/* 空投礼物落点脉冲高亮圈（项08） */
.cell.gift-spotlight {
  box-shadow: inset 0 0 0 3px #ff5e9c, 0 0 22px rgba(255, 94, 156, 0.95) !important;
  background: #fff0f7 !important;
  animation: magnetPulse 0.65s infinite ease-in-out;
  z-index: 6;
}

/* 全宅合照底部双按钮 */
.finale-btns {
  display: flex;
  gap: 8px;
}

.finale-btns .btn-3d {
  flex: 1;
}

/* 📖 杂志样刊亲手拆封（项10） */
.mag-wrap {
  width: 100%;
  max-width: 370px;
}

.mag-cover {
  position: relative;
  background: linear-gradient(180deg, #fffdf8, #f7ead4);
  border: 3px solid #e6b868;
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  animation: popIn 0.3s ease;
}

.mag-sealed-paper {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: repeating-linear-gradient(45deg, #c99a6b, #c99a6b 12px, #be8e5e 12px, #be8e5e 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #fff8e6;
  transition: transform 0.65s cubic-bezier(0.65, 0, 0.25, 1), opacity 0.55s ease;
}

.mag-sealed-paper.torn {
  transform: translateY(-105%) rotate(-6deg);
  opacity: 0;
  pointer-events: none;
}

.seal-stamp {
  background: rgba(120, 42, 16, 0.85);
  border: 2px dashed #ffe299;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 900;
}

.mag-sealed-paper p {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.mag-masthead {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #6b2e10;
}

.mag-honor {
  display: inline-block;
  margin: 0 auto;
  background: linear-gradient(90deg, #f59b25, #ffcf4d, #f59b25);
  color: #5c2800;
  padding: 3px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 900;
}

.mag-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #e6c68a;
}

.mag-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-style-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 22, 14, 0.82);
  color: #ffe89e;
  padding: 3px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mag-byline {
  font-size: 13px;
  font-weight: 900;
  color: #8f5126;
}

/* 🧾 交单签收单弹窗（项11） */
.receipt-card {
  width: 100%;
  max-width: 360px;
  background: #fffdf6;
  border: 3px solid #e6c68a;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popIn 0.28s ease;
}

.receipt-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.receipt-head img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid #f0cfa4;
  object-fit: cover;
  background: #faeedc;
}

.receipt-who { font-size: 15px; font-weight: 900; color: var(--text-dark); }
.receipt-quote { font-size: 12.5px; color: #b55422; font-weight: 800; margin-top: 2px; line-height: 1.4; }

.receipt-items {
  display: flex;
  justify-content: center;
  gap: 10px;
  background: #f8eee0;
  border-radius: 14px;
  padding: 10px;
}

.receipt-item-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #e6cfb0;
  border-radius: 10px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.receipt-item-chip img { width: 28px; height: 28px; object-fit: contain; }

.receipt-rewards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.receipt-rew-pill {
  background: #fff5d1;
  border: 1.5px solid #f2c45a;
  color: #8c4d00;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 900;
}

.order-round-goal {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff2c8;
  color: #6c4625;
  font-size: 10px;
  white-space: nowrap;
}
.round-receipt-text {
  margin: 3px 0;
  color: #6a482b;
  font-weight: 800;
  text-align: center;
}
.round-receipt-actions { display: flex; gap: 8px; }
.round-receipt-actions button { flex: 1 1 0; min-width: 0; }
.round-receipt-actions .gold {
  background: linear-gradient(180deg, #ffdfa0, #f4c16c);
  color: #533115;
  border: 1px solid #b97b37;
  box-shadow: 0 3px 0 #925e29;
  text-shadow: none;
}
.round-receipt-actions [hidden] { display: none; }

/* 🃏 卡牌未读红点 + 翻面读手记 + 纪念册（项16/17） */
.mem-card { position: relative; cursor: pointer; }
.mem-card .unread-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff3b30;
  border: 1.5px solid #fff;
}

.cd-flip-stage {
  position: relative;
  min-height: 220px;
  cursor: pointer;
}

.cd-face {
  background: linear-gradient(180deg, #fffaf0, #f7e4c1);
  border: 2.5px solid #e6c68a;
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cd-face img { width: 88px; height: 88px; object-fit: contain; }
.cd-stars { color: #f09c00; font-size: 16px; }
.cd-face p { font-size: 13px; line-height: 1.6; color: var(--text-dark); font-weight: 700; }
.cd-face small { font-size: 11px; color: #9c7456; }
.cd-back { display: none; background: linear-gradient(180deg, #fdf6e3, #f3dfb8); }
.cd-flip-stage.flipped .cd-front { display: none; }
.cd-flip-stage.flipped .cd-back { display: flex; }
.cd-note-title { font-size: 14px; font-weight: 900; color: #8c4d14; }
.cd-note-text { font-size: 14px; line-height: 1.7; padding: 8px 4px; }

.mb-locked-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 8px;
}
.mb-locked-cover img { width: 80px; height: 80px; object-fit: contain; animation: heroFloat 2s infinite; }
.mb-open-body { display: none; flex-direction: column; gap: 10px; }
.mb-scene-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 2px solid #e6c68a; }
.mb-desc { font-size: 13px; line-height: 1.6; color: var(--text-dark); }

/* 项05：手机横屏（844×390）专业双栏可滚动布局，63/63 格全可触达 + 存仓/出售/交单完整可用！ */
@media (max-height: 460px) and (min-width: 560px) {
  .phone-frame {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .scene-board {
    display: none;
    padding-top: 40px;
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 6px;
    display: none;
  }
  .scene-board.active {
    display: grid;
    grid-template-columns: minmax(290px, 44%) 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "orders board"
      "fever board"
      "info board"
      "footer board";
    column-gap: 10px;
    row-gap: 4px;
  }
  .orders-wrap { grid-area: orders; }
  .orders-belt { display: flex !important; padding: 2px; gap: 6px; }
  .order-card { flex: 0 0 124px; padding: 4px 6px; }
  .race-bar { display: none; }
  .fever-strip { grid-area: fever; margin: 0; }
  .info-ribbon { grid-area: info; display: flex !important; margin: 0; align-self: start; }
  .board-footer { grid-area: footer; padding: 0; align-self: end; }
  .board-stage {
    grid-area: board;
    height: 100%;
    overflow-y: auto;
    align-items: flex-start;
    padding: 0 2px;
  }
  .board-wood-frame {
    height: auto;
    max-height: none;
    min-height: 360px;
    aspect-ratio: 7 / 9;
  }
}

/* 老宅主界面：资源、房间导航、实景状态、操作分层排版。 */
.scene-home {
  --home-gutter: clamp(10px, 3vw, 15px);
  --home-dock-h: clamp(53px, 15vw, 61px);
  --home-dock-y: 13px;
}
.phone-frame:has(#sceneHome.active) .hud-top {
  gap: 4px;
  padding: 7px clamp(6px, 2.7vw, 14px) 5px;
}
.phone-frame:has(#sceneHome.active) .level-badge { flex: 0 1 66px; min-width: 31px; gap: 3px; padding-right: 4px; }
.phone-frame:has(#sceneHome.active) .lvl-star { flex: none; }
.phone-frame:has(#sceneHome.active) .lvl-bar-wrap { min-width: 0; flex: 1; }
.phone-frame:has(#sceneHome.active) .hud-resources { gap: 3px; }
.phone-frame:has(#sceneHome.active) .hud-pill { gap: 2px; padding-inline: clamp(4px, 1.2vw, 7px); font-variant-numeric: tabular-nums; }
.phone-frame:has(#sceneHome.active) .hud-right-btns { flex: none; gap: 4px; }

.home-room-switcher {
  top: 48px;
  inset-inline: var(--home-gutter);
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  background: #2f251ee8;
  border: 1px solid #cbb18a90;
  border-radius: 12px;
  box-shadow: 0 2px 6px #231a1640;
}
.room-chip {
  min-height: 31px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  backdrop-filter: none;
  color: #f6e9d5;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.3;
}
.room-chip.active {
  background: linear-gradient(145deg, #986a3c, #714c2d);
  border-color: #e6bd7c;
  color: #fff9ea;
}
.home-chapter-pill {
  top: 91px;
  left: var(--home-gutter);
  right: var(--home-gutter);
  min-height: 29px;
  transform: none;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 2px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  backdrop-filter: none;
  padding-inline: 0;
}
.home-chapter-pill .ch-status { padding: 4px 8px; border-radius: 6px; background: #33271fe8; color: #ffe3a7; font-size: 13px; line-height: 1.35; white-space: normal; }
.home-chapter-pill .ch-sep, .home-chapter-pill #homeChapterText { display: none; }
.compare-chip {
  flex: none;
  min-height: 25px;
  padding: 2px 8px;
  margin: 0;
  background: #3c3026ed;
  border: 1px solid #dcc5a07d;
  font-size: 11px;
}
.crisis-ticker {
  top: 124px;
  left: var(--home-gutter);
  right: auto;
  width: max-content;
  max-width: calc(100% - 2 * var(--home-gutter));
  padding: 5px 9px;
  border: 0;
  border-left: 2px solid #e4b576;
  border-radius: 2px 8px 8px 2px;
  background: linear-gradient(90deg, #332720e6, #352820bb);
  color: #fff1dc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-wrap: pretty;
}
.home-dock-left {
  left: var(--home-gutter);
  bottom: var(--home-dock-y);
  align-items: stretch;
  gap: clamp(4px, 1.4vw, 7px);
}
.dock-btn {
  width: clamp(44px, 14vw, 59px);
  height: var(--home-dock-h);
  gap: 3px;
  padding-inline: 1px;
}
.dock-lbl { font-size: clamp(10px, 2.8vw, 12px); line-height: 1.15; white-space: nowrap; }
.play-merge-btn {
  bottom: var(--home-dock-y);
  right: var(--home-gutter);
  height: var(--home-dock-h);
  min-width: clamp(145px, 41vw, 185px);
  gap: clamp(3px, 1.2vw, 8px);
  padding: 4px clamp(7px, 2vw, 12px);
}
.play-merge-btn img { width: clamp(28px, 9vw, 39px); height: auto; }
.pm-text strong { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: clamp(15px, 4.2vw, 18px); line-height: 1.25; }
.pm-text small { margin-top: 1px; font-size: clamp(11px, 3.1vw, 13px); line-height: 1.3; white-space: nowrap; color: #542b17; opacity: 1; }
.resident-hero {
  left: var(--home-gutter);
  bottom: calc(var(--home-dock-y) + var(--home-dock-h) + 14px);
  max-width: calc(100% - 83px);
  flex-direction: row-reverse;
  align-items: center;
  gap: 7px;
}
.hero-avatar-wrap { flex: none; width: clamp(42px, 13vw, 56px); height: clamp(42px, 13vw, 56px); }
.hero-speech {
  min-width: 0;
  max-width: 218px;
  padding: 6px 9px;
  border-width: 1px;
  border-radius: 12px 12px 12px 4px;
  font-size: clamp(12px, 3.1vw, 13px);
  line-height: 1.45;
  font-weight: 650;
  text-wrap: pretty;
}
.lucky-cat { bottom: calc(var(--home-dock-y) + var(--home-dock-h) + 13px); right: var(--home-gutter); }

@media (max-height: 660px) and (orientation: portrait) {
  .home-room-switcher { top: 42px; }
  .home-chapter-pill { top: 81px; }
  .crisis-ticker { top: 113px; padding-block: 3px; font-size: 11px; }
}
@media (max-height: 660px) and (orientation: portrait) {
  .home-canvas:has(.pin-below) .home-room-switcher { top: 39px; }
  .home-canvas:has(.pin-below) .room-chip { min-height: 27px; }
  .home-canvas:has(.pin-below) .home-chapter-pill { top: 75px; min-height: 25px; }
  .home-canvas:has(.pin-below) .crisis-ticker { top: 104px; padding-block: 2px; line-height: 1.3; }
}
@media (max-height: 460px) and (min-width: 560px) {
  .scene-home {
    --home-rail: clamp(232px, 30vw, 272px);
    --home-dock-h: 53px;
    align-items: flex-end;
    background: linear-gradient(120deg, #443226, #2d231d 35%);
  }
  .home-canvas {
    flex: none;
    width: calc(100% - var(--home-rail));
    margin-left: auto;
    overflow: visible;
  }
  .home-room-switcher, .home-chapter-pill, .crisis-ticker, .resident-hero {
    left: calc(var(--home-gutter) - var(--home-rail));
    right: auto;
    width: calc(var(--home-rail) - 2 * var(--home-gutter));
  }
  .home-room-switcher { top: 52px; }
  .room-chip { font-size: 11px; white-space: normal; }
  .home-chapter-pill { top: 102px; }
  .crisis-ticker { top: 140px; max-width: calc(var(--home-rail) - 2 * var(--home-gutter)); }
  .resident-hero { max-width: none; justify-content: flex-end; bottom: 85px; }
  .hero-avatar-wrap { width: 42px; height: 42px; }
  .hero-speech { flex: 1; font-size: 12px; }
  .renovate-pin.pin-below { --paper-top: calc(var(--photo-top) + 8px); }
  .scene-home .lucky-cat { bottom: 81px; }
}

/* 任务的操作整块保留，收据按材料自然换行。 */
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; flex: none; }
.task-row > button { white-space: nowrap; }
.task-left { min-width: 0; gap: 5px; }
.task-ico { flex: none; }
.task-left > div { min-width: 0; }
.task-name { line-height: 1.36; text-wrap: balance; }
.task-sub { margin-top: 2px; font-size: 11px; line-height: 1.4; }
.style-card small { display: block; margin-top: 2px; line-height: 1.45; text-wrap: pretty; }
.story-sheet { min-height: 0; }
.story-top, .story-reward-tip, #btnCloseStory { flex: none; }
.story-avatar { flex: none; }
.story-name { line-height: 1.33; text-wrap: balance; }
.story-bubble { min-height: 0; overflow-y: auto; }
.receipt-card { max-height: 100%; overflow-y: auto; }
.receipt-card > * { flex: none; }
.receipt-items:empty, .receipt-rewards:empty { display: none; }
.receipt-head img { flex: none; }
.receipt-items { flex-wrap: wrap; gap: 6px; }
.receipt-item-chip { max-width: 100%; }
.receipt-item-chip span { white-space: nowrap; }
.receipt-item-chip img { flex: none; }
.round-receipt-text { font-size: 14px; line-height: 1.45; text-wrap: balance; }
.round-receipt-actions button { line-height: 1.3; }
@media (max-width: 359px) {
  .task-row { padding-inline: 7px; gap: 4px; }
  .task-row .btn-3d.sm { padding-inline: 7px; }
  .task-ico { font-size: 19px; }
  .task-name { font-size: 13px; }
  .receipt-item-chip { padding: 4px 6px; gap: 4px; }
  .receipt-items { padding-inline: 5px; }
}

/* 收工印只出现在本局达标的小票上。 */
.round-seal {
  align-self: center;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 5px 17px;
  border: 3px double #954728;
  border-radius: 5px;
  color: #88391e;
  background: #fff5df;
  font-size: clamp(18px, 5vw, 23px);
  line-height: 1.3;
  text-align: center;
}
.round-seal[hidden] { display: none; }
.round-receipt-text { white-space: pre-line; }

/* 本局目标和时钟共用固定的一行，连击与狂热保留各自的进度。 */
.fever-strip {
  display: grid;
  grid-template-columns: auto minmax(12px, 1fr) auto;
  grid-template-areas: "round round round" "label track combo";
  align-items: center;
  gap: 2px 6px;
  padding: 3px 8px;
  border-radius: 12px;
}
.round-status {
  grid-area: round;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.round-status .order-round-goal {
  padding: 0;
  color: #54371d;
  background: transparent;
  font-size: 12px;
  line-height: 1.3;
}
.round-clock {
  display: inline-flex;
  align-items: baseline;
  flex: none;
  justify-content: center;
  gap: 5px;
  min-width: 76px;
  padding: 1px 7px;
  border-radius: 7px;
  background: #f2e6d0;
  color: #493420;
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
}
.round-clock::before { content: "剩余"; font-size: 10px; font-weight: 650; }
.round-clock[data-phase="warning"] { color: #663b04; background: #ffd58c; }
.round-clock[data-phase="urgent"] {
  color: #fff8ed;
  background: #951e22;
  animation: roundClockPulse 1s ease-out infinite;
}
.round-clock[data-phase="ended"] { color: #74443b; background: #efddd2; }
@keyframes roundClockPulse {
  from { box-shadow: 0 0 0 0 #a53232aa; }
  to { box-shadow: 0 0 0 4px #a5323200; }
}
@media (prefers-reduced-motion: reduce) {
  .round-clock[data-phase="urgent"], .fever-strip.fever-on { animation: none; }
}
.fever-strip .fever-label { grid-area: label; }
.fever-strip .fever-track { grid-area: track; }
.fever-strip .combo-pill { grid-area: combo; justify-self: end; }
@media (max-height: 660px) {
  .fever-strip { padding-block: 2px; row-gap: 1px; }
}

/* 一局结算以印章、战绩和下一步收束，普通签收沿用顾客小票。 */
#receiptModal[data-outcome="win"] .round-seal {
  color: #58330d;
  background: linear-gradient(120deg, #fff4cd, #f6c666 55%, #ffe7a0);
  border-color: #a56a1a;
  box-shadow: inset 0 0 0 2px #fff1bd, 0 2px 7px #b385383d;
}
#receiptModal[data-outcome="loss"] .round-seal {
  color: #fff5e5;
  background: linear-gradient(120deg, #8c3541, #6c2435);
  border-color: #6a2531;
  box-shadow: inset 0 0 0 2px #eab2a1;
}
#receiptModal:is([data-outcome="win"], [data-outcome="loss"]) .round-seal {
  padding: 7px clamp(10px, 4vw, 19px);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.round-record {
  align-self: center;
  max-width: 100%;
  margin: -3px 0 2px;
  color: #684628;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-wrap: balance;
}
.round-record[hidden], #receiptModal:not([data-outcome="win"]):not([data-outcome="loss"]) .round-record { display: none; }
#receiptModal[data-outcome="loss"] #btnCloseReceipt {
  flex: .85;
  background: #f3e9d8;
  border: 1px solid #c9ab82;
  color: #654b39;
  box-shadow: 0 2px 0 #bd9f77;
}
#receiptModal[data-outcome="loss"] #btnNextOrderRound {
  flex: 1.25;
  background: linear-gradient(180deg, #ad4755, #833344);
  border-color: #682634;
  box-shadow: 0 3px 0 #5a2331;
  color: #fff9ef;
}
.round-receipt-actions button { min-height: 44px; }
.round-receipt-actions button:focus-visible { outline: 3px solid #533519; outline-offset: 1px; }
@media (max-height: 460px) and (min-width: 560px) {
  #receiptModal:is([data-outcome="win"], [data-outcome="loss"]) .receipt-card {
    display: grid;
    width: min(100%, 650px);
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "seal seal" "customer summary" "items record" "rewards actions";
    align-items: center;
    column-gap: 18px;
    row-gap: 8px;
  }
  #receiptModal:is([data-outcome="win"], [data-outcome="loss"]) .round-seal { grid-area: seal; justify-self: center; }
  #receiptModal .receipt-head { grid-area: customer; }
  #receiptModal .receipt-items { grid-area: items; }
  #receiptModal .receipt-rewards { grid-area: rewards; }
  #receiptModal .round-receipt-text { grid-area: summary; }
  #receiptModal .round-record { grid-area: record; }
  #receiptModal .round-receipt-actions { grid-area: actions; }
}

/* 当前房间的故事与装修入口归在原位置，保留房间导航和实景空间。 */
.home-chapter-pill { gap: 5px; }
.home-chapter-pill .ch-status { min-width: 0; padding-inline: 6px; text-wrap: balance; }
.chapter-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.chapter-recall {
  min-height: 27px;
  padding: 2px 7px;
  border: 0;
  border-bottom: 1px solid #dcb87c;
  border-radius: 4px;
  color: #ffe4ad;
  background: #33271fe8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chapter-recall:focus-visible, #btnTaskDrawer:focus-visible { outline: 2px solid white; outline-offset: 2px; }
#btnTaskDrawer {
  width: clamp(54px, 16vw, 75px);
  border-color: #ffdda5;
  background: linear-gradient(155deg, #fff0c5, #e9b668);
  box-shadow: 0 4px 0 #895c31, 0 6px 14px #35241780;
}
#btnTaskDrawer .dock-lbl { color: #513217; font-size: clamp(11px, 3.05vw, 13px); }
@media (max-width: 349px) {
  .home-dock-left { gap: 4px; }
  .home-dock-left .dock-btn:not(#btnTaskDrawer) { width: 42px; }
}
@media (max-height: 460px) and (min-width: 560px) {
  .home-chapter-pill { top: 103px; }
  .chapter-actions { gap: 3px; }
  .chapter-recall, .compare-chip { font-size: 11px; padding-inline: 4px; }
  .crisis-ticker { top: 151px; }
}

/* 已装修房间完整入镜；开工签和图片使用同一正方形坐标。 */
.home-canvas[data-furnished="true"] { background: radial-gradient(ellipse at 52% 54%, #49413a, #24272a 61%, #24272a); }
.home-canvas[data-furnished="true"] .home-room-img { object-fit: contain; object-position: center; }
.home-canvas[data-furnished="true"] .renovate-pin { --image-side: min(100cqw, 100cqh); }

/* ==================== v15 邪恶王稚元 Boss 搞破坏 & 关卡专属障碍样式 ==================== */
.boss-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 10px 4px;
  padding: 4px 9px;
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(64, 18, 36, 0.92), rgba(124, 24, 52, 0.9));
  border: 1.5px solid #ff708d;
  color: #fff2f5;
  box-shadow: 0 4px 12px rgba(124, 24, 52, 0.32);
  flex-shrink: 0;
}

.boss-strip.danger {
  background: linear-gradient(90deg, #a6112b, #e52b48);
  border-color: #ffe066;
  animation: urgentPulse 0.6s infinite alternate;
}

.boss-strip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ffd266;
  object-fit: cover;
  background: #ffe8ee;
  flex-shrink: 0;
}

.boss-info {
  flex: 1;
  min-width: 0;
}

.boss-stage-name {
  display: block;
  font-size: 11px;
  font-weight: 900;
  color: #ffe285;
  line-height: 1.15;
}

.boss-countdown {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #ffd6de;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-counter-tag {
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(255, 224, 102, 0.22);
  border: 1px solid #ffe066;
  color: #ffe89e;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
}

/* 🚫 王稚元的拆迁封条（第1关专属：需相邻合成撕掉！） */
.cell.sealed-tape {
  box-shadow: inset 0 0 0 2.5px #e53935 !important;
  background: #fbe4e4 !important;
}

.seal-tape-overlay {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -35deg,
    rgba(229, 57, 53, 0.72) 0 6px,
    rgba(255, 235, 59, 0.72) 6px 12px
  );
  opacity: 0.78;
}

.seal-tape-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: #c62828;
  color: #fff;
  border: 1.5px solid #ffe066;
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* 🌿 恶作剧野藤蔓延格（第2关专属：不清理会越长越多！） */
.cell.vine-cell {
  background: linear-gradient(145deg, #2d5a38, #1d3f26) !important;
  border: 2px solid #52b768;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45);
}

.vine-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.vine-box small {
  font-size: 8px;
  font-weight: 900;
  background: rgba(15, 45, 20, 0.85);
  color: #b7f5c4;
  padding: 0 4px;
  border-radius: 4px;
  margin-top: 2px;
}

@media (max-height: 460px) and (min-width: 560px) {
  .boss-strip { display: none; }
}

/* ❄️ 王稚元高阶招式：冰霜锁格 */
.cell.frozen-ice::after {
  content: '❄️冰封';
  position: absolute;
  inset: 2px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 230, 255, 0.72), rgba(114, 198, 255, 0.56));
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(72, 169, 255, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #0b4a7a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.9);
  pointer-events: none;
  z-index: 4;
}
