/* 纸片客厅 · 默认托斯卡纳；AB 主题用 .home.theme-* 切换（风格包不互删） */

.home {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #2c211c;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* —— AB：饥荒墨线（assets/living/styles/dont_starve_ink） —— */
.home.theme-dont_starve_ink {
  background: #1c1712;
}
.home.theme-dont_starve_ink .face {
  border-color: #120e0b;
  box-shadow: 3.5px 4px 0 rgba(8, 6, 4, 0.35);
}
.home.theme-dont_starve_ink .face.fill { background: #d8cbb0; }
.home.theme-dont_starve_ink .face.wood { background: #8a6f4b; }
.home.theme-dont_starve_ink .face.accent { background: #7a3e32; }
.home.theme-dont_starve_ink .face.accent-deep { background: #9a5a3c; }
.home.theme-dont_starve_ink .face.glass { background: #6a7e86; }
.home.theme-dont_starve_ink .face.apron { background: #5c4632; }
.home.theme-dont_starve_ink .wall .face.fill { background: #c4b896; }
.home.theme-dont_starve_ink .floor .face { background: #5f4c34; }
.home.theme-dont_starve_ink .stage {
  background: #3a3228;
  border-color: #120e0b;
}
.home.theme-dont_starve_ink .panel-face {
  background: #d2c4a4 !important;
}
.home.theme-dont_starve_ink .panel-chip {
  background: #b9a57e;
  border-color: #120e0b;
}
.home.theme-dont_starve_ink .panel-btn {
  border-color: #120e0b;
}
.home.theme-dont_starve_ink .panel-btn:nth-child(1) { background: #6b3a2e; }
.home.theme-dont_starve_ink .panel-btn:nth-child(2) { background: #3f5a5e; }
.home.theme-dont_starve_ink .panel-btn:nth-child(3) { background: #5a4a32; }
.home.theme-dont_starve_ink .stage-ink {
  background:
    radial-gradient(ellipse at 50% 42%, transparent 38%, rgba(8, 6, 4, 0.55) 100%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 1.5px,
      rgba(8, 6, 4, 0.03) 1.5px,
      rgba(8, 6, 4, 0.03) 2px
    );
}

/* —— AB：托斯卡纳 —— */
.home.theme-tuscan_villa {
  background: #2c211c;
}

/* —— AB：吉卜力（柔水彩乡居） —— */
.home.theme-studio_ghibli {
  background: #2f3d3c;
}
.home.theme-studio_ghibli .face {
  border-width: 2px;
  border-color: #4a3f36;
  box-shadow: 2.5px 3px 0 rgba(60, 50, 40, 0.2);
  border-radius: 4px;
}
.home.theme-studio_ghibli .face.fill { background: #f7f0e6; }
.home.theme-studio_ghibli .face.wood { background: #8b6a4a; }
.home.theme-studio_ghibli .face.accent { background: #e08a6a; }
.home.theme-studio_ghibli .face.accent-deep { background: #c46e52; }
.home.theme-studio_ghibli .face.glass { background: #8ec8e0; }
.home.theme-studio_ghibli .face.apron { background: #5e4632; }
.home.theme-studio_ghibli .wall .face.fill { background: #f2ebe0; }
.home.theme-studio_ghibli .floor .face {
  background: #c9a882;
  border-color: #8b6a4a;
}
.home.theme-studio_ghibli .stage {
  background: #3d524e;
  border-color: #4a3f36;
}
.home.theme-studio_ghibli .panel-face {
  background: #efe6d6 !important;
}
.home.theme-studio_ghibli .panel-chip {
  background: #e8dcc8;
  border-color: #4a3f36;
}
.home.theme-studio_ghibli .panel-btn {
  border-color: #4a3f36;
}
.home.theme-studio_ghibli .panel-btn:nth-child(1) { background: #e08a6a; }
.home.theme-studio_ghibli .panel-btn:nth-child(2) { background: #6a9e7a; }
.home.theme-studio_ghibli .panel-btn:nth-child(3) { background: #8b6a4a; }
.home.theme-studio_ghibli .stage-ink {
  background:
    radial-gradient(ellipse at 50% 38%, transparent 42%, rgba(47, 61, 60, 0.28) 100%);
}
.home.theme-studio_ghibli .is-sprite .prop-img {
  filter: drop-shadow(1px 1.5px 0 rgba(60, 50, 40, 0.22));
}
.home.theme-studio_ghibli .wallpaper-pattern {
  opacity: 0.28;
}

/* —— AB：星露谷物语（像素暖色农舍） —— */
.home.theme-stardew_valley {
  background: #1e2a1c;
}
.home.theme-stardew_valley .face {
  border-width: 2.5px;
  border-color: #3b2a1a;
  box-shadow: 2px 2.5px 0 rgba(40, 30, 16, 0.35);
  border-radius: 0;
  clip-path: none !important;
  filter: none !important;
}
.home.theme-stardew_valley .face.fill { background: #f5e6c8; }
.home.theme-stardew_valley .face.wood { background: #8b5a32; }
.home.theme-stardew_valley .face.accent { background: #d4783c; }
.home.theme-stardew_valley .face.accent-deep { background: #b85a28; }
.home.theme-stardew_valley .face.glass { background: #7ab0d0; }
.home.theme-stardew_valley .face.apron { background: #6a4220; }
.home.theme-stardew_valley .wall .face.fill { background: #f0e0b8; }
.home.theme-stardew_valley .floor .face {
  background: #d8c898;
  border-color: #8b7350;
}
.home.theme-stardew_valley .lime-brick {
  border-radius: 0;
  border-width: 1px;
  border-color: #9a8460;
  background: #e6d8a8;
  image-rendering: pixelated;
}
.home.theme-stardew_valley .lime-row:nth-child(even) .lime-brick:nth-child(odd),
.home.theme-stardew_valley .lime-row:nth-child(odd) .lime-brick:nth-child(even) {
  background: #d4c48c;
}
.home.theme-stardew_valley .stage {
  background: #3a4a28;
  border-color: #3b2a1a;
  border-radius: 0;
  box-shadow: 3px 4px 0 rgba(40, 30, 16, 0.4);
}
.home.theme-stardew_valley .panel-face {
  background: #efe0b0 !important;
  border-radius: 0;
  clip-path: none !important;
  filter: none !important;
}
.home.theme-stardew_valley .panel-chip,
.home.theme-stardew_valley .panel-btn {
  border-radius: 0;
  clip-path: none !important;
  filter: none !important;
  border-color: #3b2a1a;
}
.home.theme-stardew_valley .panel-chip { background: #e0c878; }
.home.theme-stardew_valley .panel-btn:nth-child(1) { background: #c45a32; }
.home.theme-stardew_valley .panel-btn:nth-child(2) { background: #5a8a3c; }
.home.theme-stardew_valley .panel-btn:nth-child(3) { background: #8b5a32; }
.home.theme-stardew_valley .hatch,
.home.theme-stardew_valley .hatch-dense {
  opacity: 0.04;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(59, 42, 26, 0.25) 2px,
      rgba(59, 42, 26, 0.25) 2.5px
    );
}
.home.theme-stardew_valley .stage-ink {
  background:
    radial-gradient(ellipse at 50% 40%, transparent 48%, rgba(80, 120, 40, 0.12) 100%);
}
.home.theme-stardew_valley .is-sprite .prop-img {
  image-rendering: pixelated;
  filter: drop-shadow(1.5px 2px 0 rgba(40, 30, 16, 0.35));
}
.home.theme-stardew_valley .cat-live canvas,
.home.theme-stardew_valley .cat-perch canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.shade {
  display: none;
}

.face {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 3px solid #5a3a28;
  box-shadow: 3px 3.5px 0 rgba(74, 42, 28, 0.28);
  box-sizing: border-box;
}

/* 托斯卡纳色板：灰泥、橄榄木、赤陶、鼠尾草 */
.face.fill { background: #f0e0c4; }
.face.wood { background: #8b5e3c; }
.face.accent { background: #c45c38; }
.face.accent-deep { background: #a86b48; }
.face.glass { background: #7a9aad; }
.face.apron { background: #6a4a32; }

.wall .face,
.floor .face {
  box-shadow: none;
  clip-path: none;
}

.wall .face.fill {
  overflow: hidden;
  background: #ebdab8;
}

.wallpaper-tile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

.wallpaper-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.wall.has-wallpaper .wallpaper-pattern {
  display: none;
}

/* 星露谷：极淡疏点兜底 */
.home.theme-stardew_valley .wallpaper-pattern {
  opacity: 1;
  background-color: #f0e0b8;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(90, 120, 70, 0.08) 0 0.75px, transparent 1px);
  background-size: 28px 28px;
  image-rendering: pixelated;
}

.home.theme-stardew_valley .wall.has-wallpaper .wallpaper-tile {
  image-rendering: pixelated;
  opacity: 0.4;
}

.home.theme-tuscan_villa .wallpaper-pattern {
  opacity: 1;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 14px,
      rgba(139, 94, 60, 0.06) 14px,
      rgba(139, 94, 60, 0.06) 15px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 18px,
      rgba(196, 92, 56, 0.05) 18px,
      rgba(196, 92, 56, 0.05) 19px
    );
}

.face.round,
.shade.round { border-radius: 50%; }

.face.bowl-shape,
.shade.bowl-shape { border-radius: 50%; }

.face.pill,
.shade.pill {
  border-radius: 72% 78% 68% 80% / 78% 68% 82% 70%;
}

/* 轻灰泥肌理（少用硬剖面线） */
.hatch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.08;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 3.5px,
      rgba(90, 58, 40, 0.35) 3.5px,
      rgba(90, 58, 40, 0.35) 4px
    );
}

.hatch-dense {
  opacity: 0.1;
  background:
    repeating-linear-gradient(
      -22deg,
      transparent 0,
      transparent 3px,
      rgba(90, 58, 40, 0.3) 3px,
      rgba(90, 58, 40, 0.3) 3.5px
    ),
    repeating-linear-gradient(
      24deg,
      transparent 0,
      transparent 5.5px,
      rgba(196, 92, 56, 0.12) 5.5px,
      rgba(196, 92, 56, 0.12) 6px
    );
}

.hatch-faint {
  opacity: 0.1;
  z-index: 0;
}

/* 手撕墨边 */
.sofa-back .face,
.sofa-front .face,
.wardrobe-body .face,
.fireplace-body .face,
.table-front .face,
.box-body .face,
.window .face,
.bed-front .face,
.bowl-front .face {
  border-width: 3px;
  border-color: #5a3a28;
  box-shadow: none;
  filter: drop-shadow(2.5px 3px 0 rgba(74, 42, 28, 0.28));
  clip-path: polygon(
    0% 8%, 6% 0%, 12% 7%, 19% 0%, 27% 8%, 34% 1%, 42% 7%, 50% 0%, 58% 8%, 66% 1%, 74% 7%, 82% 0%, 90% 7%, 97% 0%, 100% 6%,
    100% 14%, 90% 22%, 100% 32%, 88% 42%, 100% 52%, 90% 62%, 100% 72%, 88% 82%, 100% 92%, 94% 100%,
    84% 92%, 74% 100%, 64% 90%, 54% 100%, 44% 92%, 34% 100%, 24% 90%, 14% 100%, 4% 92%, 0% 100%,
    8% 86%, 0% 76%, 9% 66%, 0% 56%, 8% 46%, 0% 36%, 9% 26%, 0% 16%, 8% 6%
  );
}

.panel-face {
  background: #f2e4c8 !important;
  box-shadow: none;
  filter: drop-shadow(3px 3.5px 0 rgba(74, 42, 28, 0.32));
  clip-path: polygon(
    0% 4%, 3% 0%, 9% 3%, 15% 0%, 22% 4%, 29% 1%, 37% 3%, 45% 0%, 53% 4%, 61% 1%, 70% 3%, 78% 0%, 86% 3%, 93% 0%, 100% 3%,
    100% 10%, 97% 18%, 100% 27%, 96% 36%, 100% 45%, 97% 54%, 100% 63%, 96% 72%, 100% 81%, 97% 90%, 100% 100%,
    92% 97%, 84% 100%, 75% 96%, 66% 100%, 57% 97%, 48% 100%, 39% 96%, 30% 100%, 21% 97%, 12% 100%, 4% 96%, 0% 100%,
    3% 90%, 0% 81%, 4% 72%, 0% 63%, 3% 54%, 0% 45%, 4% 36%, 0% 27%, 3% 18%, 0% 9%
  );
}

.sofa-arm .face,
.sofa-seat .face,
.wardrobe-top .face,
.fireplace-mantel .face,
.table-top .face,
.table-leg .face,
.stool-leg .face,
.box-lid .face,
.windowsill .face,
.baseboard .face,
.curtain .face,
.bed-back .face {
  border-width: 3px;
  border-color: #5a3a28;
  box-shadow: none;
  filter: drop-shadow(2px 2.5px 0 rgba(74, 42, 28, 0.24));
  clip-path: polygon(
    0% 5%, 7% 0%, 14% 8%, 22% 0%, 30% 7%, 38% 0%, 46% 8%, 54% 1%, 62% 7%, 70% 0%, 78% 8%, 86% 1%, 94% 6%, 100% 0%,
    94% 12%, 100% 24%, 88% 36%, 100% 48%, 90% 60%, 100% 72%, 88% 84%, 100% 96%, 100% 100%,
    86% 93%, 74% 100%, 62% 91%, 50% 100%, 38% 92%, 26% 100%, 14% 91%, 4% 100%, 0% 94%,
    7% 82%, 0% 70%, 8% 58%, 0% 46%, 7% 34%, 0% 22%, 8% 10%, 0% 2%
  );
}

.panel-chip,
.panel-btn {
  box-shadow: none;
  filter: drop-shadow(2px 2.5px 0 rgba(74, 42, 28, 0.28));
  clip-path: polygon(
    0% 2%, 4% 0%, 11% 4%, 18% 0%, 26% 3%, 34% 0%, 42% 4%, 50% 1%, 58% 3%, 66% 0%, 74% 4%, 82% 1%, 90% 3%, 97% 0%, 100% 4%,
    98% 12%, 100% 22%, 96% 32%, 100% 42%, 97% 52%, 100% 62%, 95% 72%, 100% 82%, 97% 92%, 100% 100%,
    90% 98%, 80% 100%, 70% 96%, 60% 100%, 50% 97%, 40% 100%, 30% 96%, 20% 100%, 10% 97%, 0% 100%,
    2% 88%, 0% 76%, 4% 64%, 0% 52%, 3% 40%, 0% 28%, 4% 16%, 0% 6%
  );
}

/* —— 正方形场景框 —— */
.stage-wrap {
  flex-shrink: 0;
  padding: 10px 14px 0;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #4a3428;
  border: 4px solid #5a3a28;
  box-shadow: 5px 6px 0 rgba(74, 42, 28, 0.45);
  box-sizing: border-box;
}

.room {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.room-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.prop-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.is-sprite {
  background: transparent;
}

/* 贴图自带墨影，关掉 CSS 脚底阴影，避免叠双影 */
.is-sprite .foot-shadow {
  display: none;
}

.is-sprite .prop-img {
  filter: drop-shadow(1.5px 2px 0 rgba(74, 42, 28, 0.22));
  top: auto;
  bottom: 0;
  left: 50%;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
}


/* 暗角 + 轻微颗粒，营造饥荒夜灯气氛 */
.stage-ink {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 42%, rgba(196, 140, 72, 0.22) 100%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(90, 58, 40, 0.025) 2px,
      rgba(90, 58, 40, 0.025) 2.5px
    );
}

/* —— 下方面板（旧羊皮纸） —— */
.panel {
  flex: 1;
  min-height: 0;
  padding: 14px 14px 0;
  display: flex;
  flex-direction: column;
}

.panel-card {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 110px;
}

.panel-face {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 13px;
  height: auto;
  min-height: 110px;
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-title {
  font-size: 14px;
  font-weight: 800;
  color: #1a1410;
  flex: 1;
  min-width: 0;
  letter-spacing: 0.04em;
}

.panel-chip {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #1a1410;
  background: #d4b896;
  border: 2.5px solid #5a3a28;
}

.panel-note {
  position: relative;
  z-index: 1;
  font-size: 12px;
  line-height: 1.45;
  color: #2a2218;
  min-height: 34px;
}

.panel-note.muted {
  opacity: 0.58;
}

.panel-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  margin-top: auto;
}

.panel-btn {
  flex: 1;
  text-align: center;
  padding: 9px 5px;
  font-size: 13px;
  font-weight: 800;
  color: #f0e6d2;
  background: #c45c38;
  border: 2.5px solid #5a3a28;
}

.panel-btn:nth-child(2) { background: #6a7a42; color: #e8efe8; }
.panel-btn:nth-child(3) { background: #8b5e3c; color: #f0e6d2; }

.foot-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 7px;
  background: #0a0806;
  opacity: 0.35;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.foot-shadow-sm {
  left: 24%;
  right: 24%;
  height: 7px;
  bottom: -1.5px;
}

/* —— 墙 / 地（正方形内） —— */
.wall {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 2%;
  height: 62%;
  z-index: 0;
}

.floor {
  position: absolute;
  left: 1%;
  right: 1%;
  bottom: 2%;
  height: 32%;
  z-index: 0;
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
}

.floor .face {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px 4% 6px;
  background: #a86b48;
  overflow: hidden;
}

.floor-planks {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  flex: 1;
  width: 100%;
}

.home.theme-dont_starve_ink .floor-planks {
  display: flex;
}

.home.theme-dont_starve_ink .floor-limestone {
  display: none;
}

.home.theme-dont_starve_ink .floor .face {
  background: #5f4c34;
}

.plank {
  height: 2.5px;
  background: #5a3a28;
  opacity: 0.35;
  flex-shrink: 0;
  border-radius: 1px;
}

.floor .plank:nth-child(1) { width: 78%; opacity: 0.14; }
.floor .plank:nth-child(2) { width: 86%; opacity: 0.17; }
.floor .plank:nth-child(3) { width: 92%; opacity: 0.2; }
.floor .plank:nth-child(4) { width: 96%; opacity: 0.23; }
.floor .plank:nth-child(5) { width: 100%; opacity: 0.26; }

/* 托斯卡纳默认：莱姆石砖地面 */
.home.theme-tuscan_villa .floor .face,
.home:not(.theme-dont_starve_ink) .floor .face {
  background: #cfc3a6;
  border-color: #8a7355;
}

.floor-limestone {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  flex: 1;
  gap: 2.5px;
  width: 100%;
  padding: 1px 0;
  box-sizing: border-box;
}

.home.theme-dont_starve_ink .floor-limestone {
  display: none !important;
}

.lime-row {
  display: flex;
  flex-direction: row;
  gap: 2.5px;
  height: 16%;
  min-height: 9px;
}

.lime-row.offset {
  margin-left: -6%;
  width: 112%;
}

.lime-brick {
  flex: 1 1 18%;
  height: 100%;
  border-radius: 2px;
  background:
    linear-gradient(160deg, rgba(255, 248, 230, 0.35), transparent 55%),
    linear-gradient(20deg, #e6d7b8, #d2c19a 55%, #c8b48a);
  border: 1.5px solid #a89472;
  box-sizing: border-box;
}

.lime-brick.half {
  flex: 0.55 1 10%;
}

.lime-row:nth-child(2) .lime-brick:nth-child(2),
.lime-row:nth-child(4) .lime-brick:nth-child(3) {
  background:
    linear-gradient(150deg, rgba(255, 248, 230, 0.28), transparent 50%),
    linear-gradient(25deg, #dfd0b0, #cbb892 60%, #bfa87c);
}

.lime-row:nth-child(3) .lime-brick:nth-child(1),
.lime-row:nth-child(5) .lime-brick:nth-child(4) {
  background:
    linear-gradient(170deg, rgba(255, 250, 235, 0.3), transparent 48%),
    linear-gradient(15deg, #ebe0c6, #d8c8a4 58%, #ccba92);
}

.baseboard {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 33%;
  height: 7px;
  z-index: 2;
}

.baseboard .face {
  border-radius: 2px;
  background: #4a3a28;
}

/* —— 挂画：窗左侧墙面 —— */
.painting {
  position: absolute;
  left: 10%;
  top: 10%;
  width: 16%;
  height: 18%;
  z-index: 2;
  transform: rotate(-2deg);
}

.painting-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  background: #8b5a32;
}

.painting-canvas {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(160deg, #7ab0d0 0 38%, #5a8a3c 38% 62%, #d8c898 62% 100%);
  border: 1.5px solid #3b2a1a;
}

.home.theme-stardew_valley .painting.is-sprite .prop-img {
  image-rendering: pixelated;
  filter: drop-shadow(1px 1.5px 0 rgba(40, 30, 16, 0.35));
}

/* —— 绿植：窗侧吊盆 + 沙发旁落地 —— */
.plant-pot {
  position: absolute;
  right: 34%;
  top: 14%;
  width: 11%;
  height: 16%;
  z-index: 3;
}

.plant-tall {
  position: absolute;
  left: 1%;
  bottom: 28%;
  width: 12%;
  height: 28%;
  z-index: 5;
}

.plant-tall.is-sprite .prop-img,
.plant-pot.is-sprite .prop-img {
  object-fit: contain;
  object-position: bottom center;
}

.home.theme-stardew_valley .plant-tall.is-sprite .prop-img,
.home.theme-stardew_valley .plant-pot.is-sprite .prop-img {
  image-rendering: pixelated;
}

.plant-hang-cord {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 22%;
  margin-left: -0.5px;
  background: #5a3a28;
  opacity: 0.7;
}

.plant-leaves {
  position: absolute;
  left: 10%;
  right: 10%;
  background: #5a8a3c;
  border: 2px solid #3b2a1a;
  border-radius: 50% 50% 42% 42%;
  box-shadow: 1.5px 1.5px 0 rgba(40, 30, 16, 0.25);
}

.plant-leaves-sm {
  top: 18%;
  height: 48%;
}

.plant-leaves-lg {
  top: 0;
  height: 62%;
  left: 6%;
  right: 6%;
  border-radius: 46% 46% 38% 38%;
}

.plant-pot-body {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 34%;
}

.plant-pot-body .face {
  border-radius: 2px 2px 5px 5px;
  background: #b85a28;
}

.plant-pot-floor {
  left: 18%;
  right: 18%;
  height: 28%;
}

/* —— 窗 —— */
.window {
  position: absolute;
  right: 22%;
  top: 8%;
  width: 20%;
  height: 26%;
  z-index: 2;
  transform: rotate(1deg);
}

.window .face {
  display: flex;
  gap: 4px;
  padding: 5px 4px;
}

.pane {
  flex: 1;
  height: 100%;
  background: #4a5c62;
  border: 2.5px solid #5a3a28;
  box-sizing: border-box;
  box-shadow: inset 0 0 8px rgba(74, 42, 28, 0.35);
}

.curtain {
  position: absolute;
  top: 6%;
  width: 4.5%;
  height: 32%;
  z-index: 3;
}

.curtain .face {
  border-radius: 6px 6px 14px 14px;
}

.curtain-l {
  right: 49%;
  transform: rotate(-5deg);
}

.curtain-r {
  right: 16%;
  transform: rotate(5deg);
}

.windowsill {
  position: absolute;
  right: 18%;
  top: 32%;
  width: 32%;
  height: 3.2%;
  z-index: 3;
}

.windowsill .face {
  border-radius: 4px;
}

/* —— 衣柜：靠右贴墙，底边落在踢脚线 —— */
.wardrobe {
  position: absolute;
  right: 2%;
  bottom: 28%;
  width: 20%;
  height: 26%;
  z-index: 4;
  overflow: visible;
}

/* 开/关门贴图：底边右对齐 */
.wardrobe.is-sprite .prop-img {
  left: auto;
  right: 0;
  transform: none;
  object-position: bottom right;
}

.wardrobe-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10%;
  z-index: 2;
}

.wardrobe-top .face {
  border-radius: 5px 5px 1px 1px;
  background: #7a5a3a;
}

.wardrobe-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 8%;
  bottom: 0;
  z-index: 1;
}

.wardrobe-body .face {
  border-radius: 2px 2px 5px 5px;
  background: #cfc3a6;
}

.wardrobe-door-seam {
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 2px;
  margin-left: -1px;
  background: #5a3a28;
  opacity: 0.55;
}

.wardrobe-handle {
  position: absolute;
  top: 42%;
  width: 10%;
  height: 12%;
  background: #5a3a28;
  border-radius: 50%;
}

.wardrobe-handle-l { left: 32%; }
.wardrobe-handle-r { right: 32%; }

.wardrobe-interior {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 14%;
  bottom: 8%;
  z-index: 0;
  background: #1a1410;
  border: 2.5px solid #5a3a28;
  border-radius: 3px;
  pointer-events: none;
}

.wardrobe-door-open {
  position: absolute;
  left: -38%;
  top: 8%;
  width: 42%;
  bottom: 0;
  z-index: 3;
  transform: skewY(-1.5deg);
  transform-origin: right center;
  pointer-events: none;
}

.wardrobe-door-open .face {
  border-radius: 5px 2px 2px 5px;
  background: #bca888;
}

.wardrobe.is-open:not(.is-sprite) .wardrobe-body {
  opacity: 0.2;
}

.wardrobe.is-open:not(.is-sprite) .wardrobe-handle,
.wardrobe.is-open:not(.is-sprite) .wardrobe-door-seam {
  display: none;
}

/* —— 沙发：靠后墙（贴踢脚线；贴图偏高背扶手椅） —— */
.sofa {
  position: absolute;
  left: 6%;
  bottom: 22%;
  width: 20%;
  height: 26%;
  z-index: 4;
}

.sofa-back {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 0;
  height: 58%;
  z-index: 2;
}

.sofa-back .face {
  border-radius: 11px 11px 2px 2px;
}

.sofa-seat {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 48%;
  height: 12%;
  z-index: 3;
}

.sofa-seat .face {
  border-radius: 5px;
}

.sofa-front {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 0;
  height: 40%;
  z-index: 2;
}

.sofa-front .face {
  border-radius: 3px 3px 7px 7px;
}

.sofa-arm {
  position: absolute;
  bottom: 0;
  width: 14%;
  height: 78%;
  z-index: 4;
}

.sofa-arm .face {
  border-radius: 9px 9px 5px 5px;
}

.sofa-arm-l { left: 0; }
.sofa-arm-r { right: 0; }

/* —— 壁炉 —— */
.fireplace {
  position: absolute;
  left: 38%;
  bottom: 28%;
  width: 20%;
  height: 26%;
  z-index: 2;
  overflow: visible;
}

.fireplace-mantel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12%;
  z-index: 2;
}

.fireplace-mantel .face {
  border-radius: 4px 4px 1px 1px;
  background: #8b5e3c;
}

.fireplace-body {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 10%;
  bottom: 0;
  z-index: 1;
}

.fireplace-body .face {
  border-radius: 2px 2px 5px 5px;
  background: #a86b48;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10% 12% 12%;
  box-sizing: border-box;
}

.fireplace-mouth {
  width: 100%;
  height: 62%;
  border: 2.5px solid #5a3a28;
  border-radius: 3px 3px 2px 2px;
  background: #1a1410;
  position: relative;
  overflow: hidden;
}

.fireplace-glow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 8%;
  height: 42%;
  border-radius: 0;
  background: #d04820;
  opacity: 0.55;
  box-shadow:
    0 -4px 0 0 #f08828,
    -4px -4px 0 0 #ffd858,
    4px -4px 0 0 #ffd858,
    -8px 0 0 0 #943018,
    8px 0 0 0 #943018;
  animation: fire-glow-flicker 1.2s steps(4) infinite;
  image-rendering: pixelated;
}

.fireplace-glow.is-lit {
  opacity: 0.95;
  height: 58%;
  background: #f08828;
  box-shadow:
    0 -4px 0 0 #ffd858,
    -4px -8px 0 0 #fff8b0,
    4px -8px 0 0 #fff8b0,
    -8px -4px 0 0 #f08828,
    8px -4px 0 0 #f08828,
    0 -8px 0 0 #ffe878;
  animation: fire-glow-flicker-lit 0.9s steps(4) infinite;
}

/* 贴图模式：canvas 像素火焰叠在炉口 */
.fireplace-flames {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 7%;
  height: 21%;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border-radius: 0 0 4px 4px;
}

.fireplace:not(.is-sprite) .fireplace-flames {
  display: none;
}

.fire-glow-layer {
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: 0;
  height: 108%;
  background: radial-gradient(
    ellipse 68% 62% at 50% 92%,
    rgba(255, 120, 40, 0.5) 0%,
    rgba(255, 72, 24, 0.18) 40%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.fire-pixel-canvas {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: transparent;
}

@keyframes fire-glow-flicker {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 0.65; transform: scaleY(1.06); }
}

@keyframes fire-glow-flicker-lit {
  0%, 100% { opacity: 0.88; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.08); }
}
/* —— 茶几：沙发前 —— */
.table {
  position: absolute;
  left: 16%;
  bottom: 7%;
  width: 20%;
  height: 26%;
  z-index: 5;
}

.table-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14%;
  z-index: 3;
}

.table-top .face { border-radius: 4px; }

.table-front {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 12%;
  height: 22%;
  z-index: 2;
}

.table-front .face { border-radius: 3px; }

.table-leg {
  position: absolute;
  bottom: 0;
  width: 16%;
  height: 66%;
  z-index: 1;
}

.table-leg .face { border-radius: 4px; }
.table-leg-l { left: 12%; }
.table-leg-r { right: 12%; }

/* —— 凳 —— */
.stool {
  position: absolute;
  left: 42%;
  bottom: 4%;
  width: 20%;
  height: 26%;
  z-index: 6;
}

.stool-seat {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 16%;
  z-index: 2;
}

.stool-leg {
  position: absolute;
  left: 50%;
  top: 14%;
  width: 28%;
  height: 82%;
  margin-left: -14%;
  z-index: 1;
}

.stool-leg .face { border-radius: 5px; }

/* —— 猫窝 —— */
.cat-bed {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: 20%;
  height: 26%;
  z-index: 5;
}

.bed-back {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 28%;
  z-index: 1;
}

.bed-back .face { border-radius: 50% 50% 12% 12%; }

.bed-inner {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 16%;
  height: 24%;
  z-index: 2;
}

.bed-inner .face {
  border-radius: 58% 48% 52% 46%;
  box-shadow: 2px 2.5px 0 rgba(74, 42, 28, 0.28);
  border-width: 2.5px;
}

.bed-front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  z-index: 3;
}

.bed-front .face { border-radius: 14% 14% 48% 48%; }

/* —— 地毯 —— */
.rug {
  position: absolute;
  left: 38%;
  bottom: 2%;
  width: 20%;
  height: 26%;
  z-index: 3;
}

/* —— 食盆 —— */
.bowls {
  position: absolute;
  right: 14%;
  bottom: 4%;
  width: 20%;
  height: 26%;
  display: flex;
  gap: 8%;
  z-index: 6;
}

.bowl {
  position: relative;
  width: 46%;
  height: 100%;
  align-self: flex-end;
}

.bowl-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28%;
  z-index: 2;
}

.bowl-top .face { border-radius: 50%; }

.bowl-front {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 72%;
  z-index: 1;
}

.bowl-front .face { border-radius: 8% 8% 48% 48%; }

/* —— 纸箱 —— */
.paper-box {
  position: absolute;
  left: 0%;
  bottom: 6%;
  width: 20%;
  height: 26%;
  z-index: 7;
  transform: rotate(-2.5deg);
  transform-origin: 50% 100%;
}

.box-lid {
  position: relative;
  width: 88%;
  height: 11px;
  margin: 0 6%;
}

.box-lid .face { border-radius: 4px 4px 0 0; }

.box-body {
  position: relative;
  width: 100%;
  height: 35px;
}

.box-body .face { border-radius: 0 0 6px 6px; }

.box-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: #1a1410;
  letter-spacing: 0.1em;
  opacity: 0.78;
}

.paper-box.is-open .box-lid {
  transform: translateY(-5px) rotate(-10deg);
  transform-origin: left center;
}

.collar-tag {
  position: absolute;
  right: 20%;
  bottom: 36%;
  z-index: 12;
  width: 22%;
  height: 6%;
}

.collar-tag .face {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #1a1410;
}

.cat-perch {
  position: absolute;
  /* 家具内固定猫框；远近大小随家具 scale，猫 canvas 不再乘景深 */
  width: 18%;
  height: 16%;
  transform-origin: 50% 88%;
  /* 换位近乎闪现，略留一帧位移感 */
  transition: left 0.06s linear, right 0.06s linear, bottom 0.06s linear, transform 0.06s linear;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  overflow: visible;
  z-index: 8;
}

.spot-windowsill { right: 22%; left: auto; bottom: 68%; }
.spot-sofa { left: 12%; bottom: 38%; }
.spot-fireplace { left: 40%; bottom: 58%; }
.spot-wardrobe_inside { right: 4%; left: auto; bottom: 40%; }
.spot-wardrobe { right: 3%; left: auto; bottom: 60%; }
.spot-table { left: 18%; bottom: 20%; }
.spot-stool { left: 38%; bottom: 18%; }
.spot-cat_bed { left: 50%; bottom: 20%; }
.spot-box { left: 2%; bottom: 10%; }

/* 躲藏：尾巴从门缝 / 箱口探出 */
.cat-perch.is-tail-only.spot-wardrobe_inside {
  right: 5%;
  bottom: 26%;
  width: 14%;
  height: 12%;
}
.cat-perch.is-tail-only.spot-box {
  left: 3%;
  bottom: 7%;
  width: 14%;
  height: 12%;
}
.spot-rug { left: 42%; bottom: 6%; }
.spot-bowl { right: 18%; left: auto; bottom: 10%; }

.dock {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  z-index: 40;
}

.dock-secret {
  display: block;
  width: 24px;
  height: 24px;
}

.toast {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 60px;
  z-index: 35;
  min-height: 40px;
}

.toast .face {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1410;
  height: auto;
  min-height: 40px;
}
