/* 米咖 · 房子场景（陪伴网站 + 桌面悬浮窗共用）
   零成本方案：先用 CSS 画出房间占位，正式背景图后续补到 scenes/<id>.jpg，
   两端会自动优先使用 image 字段。 */

.mika-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #17131d;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}
.mika-scene.on { opacity: 1; }
.mika-scene .ms-bg,
.mika-scene .ms-fx { position: absolute; inset: 0; }
.mika-scene .ms-fx { transition: background .9s ease, opacity .9s ease; }
.mika-scene .ms-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: 50% 100%;
  background-repeat: no-repeat;
}
.mika-scene.has-image .ms-bg { display: none; }

/* ---------- 客厅 ---------- */
.mika-scene .ms-bg[data-preset="living-room"] {
  background:
    radial-gradient(34% 22% at 90% 30%, rgba(255, 214, 154, .55), rgba(255, 214, 154, 0) 72%),
    radial-gradient(46% 24% at 46% 94%, rgba(255, 184, 146, .30), rgba(255, 184, 146, 0) 74%),
    linear-gradient(180deg, #5c4856 0%, #493a48 55%, #3a2e3c 55.4%, #332838 100%);
}
.mika-scene .ms-bg[data-preset="living-room"]::before {
  content: "";
  position: absolute; right: 9%; top: 9%; width: 29%; height: 38%;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(52, 43, 55, .9) 48%, rgba(52, 43, 55, .9) 52%, transparent 52%),
    linear-gradient(180deg, transparent 47%, rgba(52, 43, 55, .9) 47%, rgba(52, 43, 55, .9) 53%, transparent 53%),
    linear-gradient(180deg, #9db1d2 0%, #cbb2bf 46%, #f2c79b 74%, #8f6e73 100%);
  box-shadow: 0 0 0 4px rgba(72, 58, 72, .95), 0 0 52px rgba(255, 214, 154, .42);
}
.mika-scene .ms-bg[data-preset="living-room"]::after {
  content: "";
  position: absolute; left: 5%; bottom: 7%; width: 62%; height: 27%;
  border-radius: 20px 20px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #855a66 0%, #6f4b58 58%, #573c49 100%);
  box-shadow: 0 18px 26px rgba(0, 0, 0, .38), inset 0 2px 0 rgba(255, 255, 255, .2);
}

/* ---------- 厨房 ---------- */
.mika-scene .ms-bg[data-preset="kitchen"] {
  background:
    radial-gradient(52% 34% at 76% 18%, rgba(255, 236, 196, .28), rgba(255, 236, 196, 0) 70%),
    linear-gradient(180deg, #66605a 0%, #514a46 52%, #3a3432 52.4%, #2e2927 100%);
}
.mika-scene .ms-bg[data-preset="kitchen"]::before {
  content: "";
  position: absolute; left: 6%; right: 6%; top: 12%; height: 30%;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(32, 28, 27, .55) 0 2px, transparent 2px 24%),
    linear-gradient(180deg, #8a7c6d 0%, #6f6258 100%);
  box-shadow: inset 0 -6px 0 rgba(30, 26, 25, .5);
}
.mika-scene .ms-bg[data-preset="kitchen"]::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 22%; height: 12%;
  background: linear-gradient(180deg, #a89a88 0%, #7d7265 100%);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .28);
}
.mika-scene .ms-bg[data-preset="kitchen"] .ms-detail {
  position: absolute; left: 20%; bottom: 34%; width: 22%; height: 10%;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #d9d2c6 0%, #9a938a 100%);
  box-shadow: 0 -10px 16px rgba(255, 220, 170, .18);
}

/* ---------- 阳台 ---------- */
.mika-scene .ms-bg[data-preset="balcony"] {
  background:
    radial-gradient(70% 50% at 70% 22%, rgba(255, 168, 132, .30), rgba(255, 168, 132, 0) 72%),
    linear-gradient(180deg, #3b3350 0%, #6c4f66 42%, #a8737a 58%, #3a2f3e 58.4%, #2a2331 100%);
}
.mika-scene .ms-bg[data-preset="balcony"]::before {
  content: "";
  position: absolute; left: 8%; right: 8%; top: 8%; height: 40%;
  border-radius: 10px;
  background:
    radial-gradient(20% 5% at 28% 68%, rgba(255, 224, 180, .9), rgba(255, 224, 180, 0) 100%),
    radial-gradient(30% 7% at 68% 76%, rgba(255, 210, 160, .7), rgba(255, 210, 160, 0) 100%),
    linear-gradient(180deg, #2c3350 0%, #4b4468 48%, #b5797e 100%);
  box-shadow: 0 0 0 4px rgba(44, 38, 54, .85), inset 0 0 40px rgba(255, 190, 150, .18);
}
.mika-scene .ms-bg[data-preset="balcony"]::after {
  content: "";
  position: absolute; left: 6%; right: 6%; bottom: 10%; height: 24%;
  background:
    repeating-linear-gradient(90deg, rgba(28, 24, 34, .9) 0 3px, transparent 3px 9%),
    linear-gradient(180deg, rgba(60, 52, 68, .95) 0 10%, transparent 10%);
}

/* ---------- 卧室 ---------- */
.mika-scene .ms-bg[data-preset="bedroom"] {
  background:
    radial-gradient(46% 30% at 82% 30%, rgba(255, 196, 140, .30), rgba(255, 196, 140, 0) 72%),
    linear-gradient(180deg, #43364a 0%, #352b3c 56%, #2a2231 56.4%, #221b28 100%);
}
.mika-scene .ms-bg[data-preset="bedroom"]::before {
  content: "";
  position: absolute; right: 10%; top: 10%; width: 26%; height: 32%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(80, 62, 84, .9) 0 12%, transparent 12% 88%, rgba(80, 62, 84, .9) 88%),
    linear-gradient(180deg, #5d6f93 0%, #8f7e9a 52%, #d3a184 100%);
  box-shadow: 0 0 0 4px rgba(52, 42, 58, .9), 0 0 34px rgba(255, 196, 140, .2);
}
.mika-scene .ms-bg[data-preset="bedroom"]::after {
  content: "";
  position: absolute; left: 4%; bottom: 6%; width: 66%; height: 30%;
  border-radius: 24px 24px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #7c5f72 0%, #634b60 58%, #4c394b 100%);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .38);
}

/* ---------- 主题场景（数字商品，购买解锁；先用 CSS 占位，正式图补到 scenes/<id>.jpg） ---------- */
.mika-scene .ms-bg[data-preset="seaside"] {
  background:
    radial-gradient(60% 30% at 72% 24%, rgba(255, 236, 200, .34), rgba(255, 236, 200, 0) 72%),
    linear-gradient(180deg, #6f93b8 0%, #9db9cd 46%, #d9c3ae 52%, #7d6a63 52.4%, #5d4f4b 100%);
}
.mika-scene .ms-bg[data-preset="seaside"]::before {
  content: "";
  position: absolute; left: 54%; top: 8%; width: 40%; height: 40%;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 56%, rgba(255, 255, 255, .42) 56.5%, rgba(255, 255, 255, .12) 60%, transparent 61%),
    linear-gradient(180deg, #87a9c9 0%, #c6d6dc 54%, #6f98ad 55%, #4e7488 100%);
  box-shadow: 0 0 0 5px rgba(92, 74, 66, .9), 0 0 46px rgba(255, 232, 196, .3);
}
.mika-scene .ms-bg[data-preset="seaside"]::after {
  content: "";
  position: absolute; left: 6%; bottom: 8%; width: 42%; height: 24%;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #c9b6a2 0%, #a08a78 60%, #7d6a5c 100%);
  box-shadow: 0 16px 26px rgba(0, 0, 0, .34);
}

.mika-scene .ms-bg[data-preset="snow"] {
  background:
    radial-gradient(50% 34% at 20% 76%, rgba(255, 186, 120, .26), rgba(255, 186, 120, 0) 70%),
    linear-gradient(180deg, #2b3450 0%, #3b4766 50%, #5b4b55 54%, #40333c 100%);
}
.mika-scene .ms-bg[data-preset="snow"]::before {
  content: "";
  position: absolute; right: 10%; top: 10%; width: 32%; height: 36%;
  border-radius: 8px;
  background:
    radial-gradient(2px 2px at 20% 24%, rgba(255, 255, 255, .9), transparent 100%),
    radial-gradient(2px 2px at 62% 18%, rgba(255, 255, 255, .8), transparent 100%),
    radial-gradient(2px 2px at 42% 52%, rgba(255, 255, 255, .75), transparent 100%),
    radial-gradient(2px 2px at 76% 62%, rgba(255, 255, 255, .7), transparent 100%),
    radial-gradient(3px 3px at 30% 74%, rgba(255, 255, 255, .85), transparent 100%),
    linear-gradient(180deg, #26334f 0%, #4a5b7d 100%);
  box-shadow: 0 0 0 5px rgba(54, 44, 52, .92), 0 0 40px rgba(190, 214, 255, .24);
}
.mika-scene .ms-bg[data-preset="snow"]::after {
  content: "";
  position: absolute; left: 8%; bottom: 10%; width: 30%; height: 22%;
  border-radius: 14px;
  background:
    radial-gradient(60% 70% at 50% 80%, rgba(255, 176, 96, .85), rgba(255, 176, 96, 0) 72%),
    linear-gradient(180deg, #5a4238 0%, #42302b 100%);
  box-shadow: 0 0 46px rgba(255, 160, 86, .34);
}

.mika-scene .ms-bg[data-preset="sakura"] {
  background:
    radial-gradient(46% 30% at 74% 18%, rgba(255, 226, 236, .42), rgba(255, 226, 236, 0) 72%),
    linear-gradient(180deg, #8f7d94 0%, #b79dad 48%, #6f5f6c 54%, #514552 100%);
}
.mika-scene .ms-bg[data-preset="sakura"]::before {
  content: "";
  position: absolute; right: 8%; top: 4%; width: 42%; height: 44%;
  border-radius: 50% 46% 40% 44%;
  background:
    radial-gradient(26% 22% at 30% 30%, rgba(255, 210, 226, .95), rgba(255, 210, 226, 0) 100%),
    radial-gradient(30% 24% at 66% 24%, rgba(255, 190, 214, .9), rgba(255, 190, 214, 0) 100%),
    radial-gradient(32% 26% at 52% 58%, rgba(255, 200, 220, .85), rgba(255, 200, 220, 0) 100%),
    radial-gradient(24% 20% at 22% 64%, rgba(255, 214, 230, .8), rgba(255, 214, 230, 0) 100%);
  filter: blur(1px);
}
.mika-scene .ms-bg[data-preset="sakura"]::after {
  content: "";
  position: absolute; left: 10%; bottom: 9%; width: 36%; height: 18%;
  border-radius: 12px;
  background: linear-gradient(180deg, #b9a08f 0%, #8a7163 100%);
  box-shadow: 0 14px 24px rgba(0, 0, 0, .32);
}

.mika-scene .ms-bg[data-preset="ancient"] {
  background:
    radial-gradient(44% 30% at 78% 22%, rgba(255, 210, 150, .28), rgba(255, 210, 150, 0) 72%),
    linear-gradient(180deg, #4a3b33 0%, #5c4a3e 50%, #3f3229 54%, #2e241e 100%);
}
.mika-scene .ms-bg[data-preset="ancient"]::before {
  content: "";
  position: absolute; right: 9%; top: 10%; width: 32%; height: 34%;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(58, 42, 32, .92) 0 3px, transparent 3px 22%),
    repeating-linear-gradient(180deg, rgba(58, 42, 32, .92) 0 3px, transparent 3px 26%),
    linear-gradient(180deg, #7b6a56 0%, #5c4c3d 100%);
  box-shadow: 0 0 0 5px rgba(48, 36, 28, .95), 0 0 36px rgba(255, 200, 140, .22);
}
.mika-scene .ms-bg[data-preset="ancient"]::after {
  content: "";
  position: absolute; left: 8%; bottom: 10%; width: 40%; height: 20%;
  border-radius: 8px;
  background: linear-gradient(180deg, #6d5743 0%, #4e3d2f 100%);
  box-shadow: 0 14px 24px rgba(0, 0, 0, .36);
}

/* ---------- 时间氛围（全部 CSS，零成本） ---------- */
.mika-scene .ms-fx[data-slot="morning"] {
  background: linear-gradient(180deg, rgba(255, 206, 146, .20) 0%, rgba(255, 176, 128, .06) 55%, rgba(90, 60, 64, .10) 100%);
}
.mika-scene .ms-fx[data-slot="day"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06) 0%, rgba(190, 210, 255, .03) 100%);
}
.mika-scene .ms-fx[data-slot="dusk"] {
  background: linear-gradient(180deg, rgba(255, 148, 110, .22) 0%, rgba(196, 104, 132, .12) 60%, rgba(54, 36, 58, .14) 100%);
}
.mika-scene .ms-fx[data-slot="night"] {
  background:
    radial-gradient(46% 32% at 88% 32%, rgba(255, 206, 146, .30), rgba(255, 206, 146, 0) 72%),
    linear-gradient(180deg, rgba(28, 36, 72, .30) 0%, rgba(22, 24, 52, .26) 60%, rgba(14, 12, 28, .38) 100%);
}

/* ---------- 可点击热点（仅网站启用） ---------- */
.mika-scene .ms-hotspots { position: absolute; inset: 0; pointer-events: none; }
.ms-hotspot {
  position: absolute;
  padding: 0;
  border: 1px dashed transparent;
  border-radius: 12px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.ms-hotspot::before {
  content: "";
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 230, 200, .85);
  box-shadow: 0 0 10px rgba(255, 210, 160, .9);
  opacity: .55;
  transition: opacity .18s, transform .18s;
}
.ms-hotspot::after {
  content: attr(data-name);
  position: absolute; left: 50%; bottom: 4px;
  transform: translate(-50%, 100%);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  color: #fff;
  background: rgba(0, 0, 0, .58);
  border: 1px solid rgba(255, 255, 255, .18);
  opacity: 0;
  transition: opacity .18s;
}
.ms-hotspot:hover {
  border-color: rgba(255, 214, 180, .6);
  background: rgba(255, 214, 180, .10);
  box-shadow: inset 0 0 26px rgba(255, 190, 130, .22);
}
.ms-hotspot:hover::before { opacity: 1; transform: scale(1.5); }
.ms-hotspot:hover::after { opacity: 1; }
.mika-scene.hotspots-off .ms-hotspot { display: none; }

/* ---------- 场景切换（网站用） ---------- */
.scene-switch { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.scene-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, .12));
  background: rgba(255, 255, 255, .04);
  color: var(--dim, #9a9aa8);
  font-size: 12px;
  transition: .18s;
}
.scene-chip:hover { color: #fff; border-color: rgba(255, 255, 255, .26); }
.scene-chip.on {
  color: #fff;
  border-color: rgba(255, 107, 157, .55);
  background: rgba(255, 107, 157, .16);
}
.scene-chip.locked { opacity: .48; cursor: not-allowed; }
.scene-chip.locked::after { content: " 🔒"; font-size: 10px; }
.scene-tip {
  min-height: 18px;
  font-size: 11.5px;
  color: var(--gold, #FFB86B);
}
