/* ============================================================
   Tab1 此刻·家 - 像素房间（可动可交互 + 背景可增删改）
   ============================================================ */

/* tab1：背景铺满全屏，气泡浮在底部覆盖层（不再分两块）。
   保留 .tab-panel 的 position:absolute; inset:0，不要改成 relative，否则高度会塌陷 */
#tab1.tab-panel.active {
  --care-h: 124px;   /* 气泡条高度，JS 会按实际测量值覆盖 */
}

.tab1-room {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f0dcc0 0%, #d8b890 100%);
  transition: filter 0.6s ease;
}

/* ---------- 背景堆叠：多张底图，只有 active 显示 ---------- */
.tab1-bg-stack {
  position: absolute;
  inset: 0;
}
.tab1-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 0.8s ease;
  image-rendering: pixelated;
}
.tab1-bg.active {
  opacity: 1;
}

/* ---------- 远景：尘埃 ---------- */

.dust-motes { position: absolute; inset: 0; pointer-events: none; transition: opacity 1s ease; }

/* 关爱值控制房间柔光（放在家具层之下，不影响家具颜色实心感） */
.room-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 240, 200, 0.30) 0%, transparent 70%);
  pointer-events: none;
  transition: all 1s ease;
  z-index: 1;
}

/* ---------- 中层：家具组件 ---------- */
/* 底部收到「气泡条高度」之上，家具只分布在气泡之上区域，不会钻到气泡下面 */
.room-furniture {
  position: absolute;
  inset: 0 0 var(--care-h, 124px) 0;
}

/* 前景层（小我小人）同样只占据气泡条之上区域 */
.tab1-room .layer-front {
  inset: 0 0 var(--care-h, 124px) 0;
}

.room-item {
  position: absolute;
  width: var(--ri-w, 56px);
  height: var(--ri-h, 56px);
  margin-left: calc(var(--ri-w, 56px) / -2);   /* 水平居中于锚点 */
  margin-bottom: -4px;                          /* 底部微沉，贴地 */
  cursor: pointer;          /* 普通模式：点击交互 */
  touch-action: none;
  transition: filter 0.2s ease;
  opacity: 1 !important;
}

/* 视觉层：承载缩放/翻转/倾斜/3D 转向变换。
   标签(.ri-label)是 .ri-visual 的兄弟节点，不在此变换内，始终统一大小；
   选中控制条(.room-item-bar)是 .room-item 的子节点，同样不随家具变换缩放，
   而是作为独立面板贴合在家具选择框上方，随家具一起被拖动 */
.room-item .ri-visual {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;  /* 让徽章能在 3D 空间里反向旋转，抵消转向 */
  /* 两套旋转并存：
     1) --ri-tilt：2D 平面小角度左右倾斜（rotate，范围 ±20°）
     2) --ri-rot：Y 轴 3D 转向/侧身（rotateY，范围 ±75°）
     perspective 内联保证单元素也有透视景深，无需父级 perspective。
     scale / scaleX(flip) 仍绕底部中心，家具始终"坐"在地上不漂移 */
  transform: perspective(500px) rotate(var(--ri-tilt, 0deg)) rotateY(var(--ri-rot, 0deg)) scale(var(--ri-scale, 1)) scaleX(var(--ri-flip, 1));
  transform-origin: center bottom;
  backface-visibility: hidden;  /* 超出 ±90° 不显示镜像背面 */
  transition: transform 0.15s ease;
  opacity: 1 !important;
}

.room-item .ri-sprite {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  image-rendering: pixelated;
  transition: transform 0.15s ease;
  opacity: 1 !important;
  isolation: isolate;
}
.room-item .ri-sprite img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 1 !important;
}

.room-item .ri-shadow {
  display: none;
}

.room-item .ri-label {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: bold;
  color: rgba(90, 70, 50, 0.85);
  background: rgba(255, 252, 245, 0.75);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--c-line);
  white-space: nowrap;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* 远景层家具：更小更暗，有距离感（不透明，不透背景，无阴影） */
.room-item[data-depth="far"] {
  filter: brightness(0.86) saturate(0.88);
}
.room-item[data-depth="near"] {
  filter: brightness(1.04);
}

/* 有交互动作的家具：轻呼吸提示 */
.room-item.has-action .ri-sprite {
  animation: ri-breathe 3.2s ease-in-out infinite;
}
@keyframes ri-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-3px) scale(1.04); }
}

/* 点击物件：轻轻弹一下 */
.room-item.clicked .ri-sprite {
  animation: ri-bounce 0.32s ease;
}
@keyframes ri-bounce {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-7px) scale(1.08) rotate(-3deg); }
  70%  { transform: translateY(1px) scale(0.97); }
  100% { transform: translateY(0) scale(1); }
}

/* 移除时缩小的动画 */
.room-item.removing .ri-visual {
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform: scale(0.3);
  opacity: 0;
}

/* 拖动中的家具：放大 + 提亮（无阴影） */
.room-item.dragging {
  cursor: grabbing;
  z-index: 999 !important;
  filter: brightness(1.12);
}
.room-item.dragging .ri-sprite { transform: scale(1.12); }

/* 普通模式悬浮显示名字 */
.room-item:hover .ri-label { opacity: 1; }

/* ---------- 编辑模式 ---------- */
body.room-editing .room-item {
  cursor: move;             /* 布置模式：拖动移动 */
}
body.room-editing .room-item.dragging { cursor: grabbing; }
body.room-editing .room-item .ri-label { opacity: 1; }

.room-item.selected .ri-visual {
  outline: 3px dashed #d4a574;
  outline-offset: 4px;
  border-radius: 10px;
}
/* 选中家具整体提到最上层，保证贴合它的控制条不被别的家具遮挡 */
.room-item.selected {
  z-index: 900 !important;
}

/* ---------- 布置工具 ---------- */
.room-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  min-width: 40px;
  height: 36px;
  padding: 0 12px;
  border: var(--pixel-border);
  border-radius: 12px;
  background: var(--c-card-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: bold;
  color: var(--c-text);
  cursor: pointer;
  box-shadow: 0 4px 10px var(--c-shadow);
  transition: all 0.2s ease;
}

/* 总金币标签 */
.room-coin {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: bold;
  color: #8a6a30;
  background: rgba(255, 252, 245, 0.8);
  border: 2.5px solid var(--c-line);
  border-radius: 999px;
  padding: 7px 10px;
  box-shadow: 0 3px 8px var(--c-shadow);
  pointer-events: none;
}
.room-edit-btn:active { transform: scale(0.9); }
body.room-editing .room-edit-btn {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 4px 0 #b08550;
}

.room-edit-bar {
  position: absolute;
  left: 50%;
  bottom: calc(var(--care-h, 124px) + 12px);  /* 抬到气泡条之上 */
  transform: translateX(-50%);
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(50, 38, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: calc(100% - 16px);
  animation: bar-slide-up 0.25s ease;
}
/* 关键：hidden 属性必须生效，编辑栏只在布置模式出现 */
.room-edit-bar[hidden] { display: none; }
@keyframes bar-slide-up {
  from { transform: translateX(-50%) translateY(12px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes bar-slide-down {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to   { transform: translateX(-50%) translateY(14px); opacity: 0; }
}
/* 退出编辑模式：编辑栏平滑收起 */
.room-edit-bar.closing { animation: bar-slide-down 0.2s ease forwards; }

.room-edit-hint {
  color: rgba(255, 243, 224, 0.75);
  font-size: 10px;
  white-space: nowrap;
  margin-right: 2px;
}

.room-edit-act {
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: bold;
  color: #5a4a3a;
  background: #f5e8d4;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.room-edit-act:active { transform: scale(0.92); }
.room-edit-act:disabled { opacity: 0.4; cursor: not-allowed; }
.room-edit-act.primary { background: var(--c-accent); color: #fff; }
.room-edit-act.danger { background: #c86a6a; color: #fff; }

/* ---------- 小我（默认站定第 0 帧，完成对应任务才播对应动作连帧动画） ----------
   两个独立 sprite 层叠在一起：
     - .xiaowo-drinking  → 喝水待机帧 + 喝水动作（默认显示层）
     - .xiaowo-celebrate → 庆祝待机帧 + 庆祝动作（默认隐藏，.is-celebrating 时显示并播放）
   两容器共享 90×148，喝水帧原始 155×254 → 90×148；庆祝帧原始 111×254 → 65×148，身高严格一致。

   Skill §2.1 严格禁用：❌百分比 background-position ❌steps(N)+百分比 ❌多 layer opacity crossfade。
   Skill §2.2 唯一推荐写法：精确像素偏移 + 6 段式关键帧硬切，每个值都写死，不用 calc/var。
   这样绝不会出现"6 个小人轮番出现 / 左右瞬移"的错觉。 */
.xiaowo {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 90px;
  height: 148px;                    /* 155:254 → 90:148，比例匹配，不变形 */
  margin-left: -45px;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: pixelated;        /* Skill §2.2：像素风必须有 */
  /* 给 JS 模板读默认值用（Skill §3：getComputedStyle 读）*/
  --xd-frame-dur: 220ms;  /* 喝水单帧时长 */
  --xc-frame-dur: 160ms;  /* 庆祝单帧时长（动作稍快）*/
  --xd-loops: 2;
  --xc-loops: 2;
  --frame-count: 6;
}

/* ============== 喝水层（默认显示）：单帧显示 90×148，帧步 90px ============== */
.xiaowo-drinking {
  position: absolute;
  inset: 0;
  background-image: url('../assets/pixel/xiaowo-drinking.png?v=4');
  background-size: 540px 100%;       /* 90×6 = 540（Skill §2.2：calc(单帧×帧数)100%，写死像素） */
  background-repeat: no-repeat;
  background-position: 0 0;          /* 默认第 0 帧（举杯静止） */
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(60, 35, 20, 0.3));
  z-index: 2;
  opacity: 1;
  transition: opacity 0.12s ease;
}
.xiaowo.is-celebrating .xiaowo-drinking { opacity: 0; }   /* 切庆祝时喝水层淡出（非 crossfade） */

/* ============== 庆祝层（默认隐藏）：1:1 完全复制喝水层结构 ==============
   ★ 关键修复（解决"看起来没变"的旧缓存问题）：庆祝 sprite 文件名改为全新名
     xiaowo-celebrate-match-water.png（= xiaowo-celebrate.png 930×254 的硬拷贝）
     —— 浏览器对 background-image 经常无视 ?v=xx 查询串，直接按文件名命中强缓存，
     所以必须改物理文件名才能强制重新下载，避免用户永远看到 678×254 旧版本。
   单帧 canvas 强制 155×254（与喝水帧完全同尺寸），最终 sheet 930×254（喝水也是 930×254）
   → 显示帧 90×148，background-size=540px，keyframes 偏移和喝水 xd-play 一字不差。
   抠图 Skill §1.1「连边全清」：透明占比 71.6%，浅灰/深灰/网格背景全清。 */
.xiaowo-celebrate {
  position: absolute;
  inset: 0;
  background-image: url('../assets/pixel/xiaowo-celebrate-v4.png?v=1');
  background-size: 540px 100%;       /* 90×6 = 540（和喝水完全一致） */
  background-repeat: no-repeat;
  background-position: 0 0;          /* 默认第 0 帧：和喝水完全一致 */
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(60, 35, 20, 0.3));
  z-index: 3;
  opacity: 0;                        /* 默认隐藏 */
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.xiaowo.is-celebrating .xiaowo-celebrate { opacity: 1; }   /* 切到庆祝层 */

/* ---------- 喝水动作：.xiaowo.is-drinking 时触发 ----------
   Skill §2.2：6 段硬切 keyframes，时间占比 16.667% 一帧，背景偏移写死 -n×90px。 */
.xiaowo.is-drinking .xiaowo-drinking {
  animation: xd-play calc(var(--xd-frame-dur) * var(--frame-count)) var(--xd-loops);
}

@keyframes xd-play {
  0%,          16.666%  { background-position:    0     0; }   /* 帧 0 */
  16.667%,     33.333%  { background-position:  -90px   0; }   /* 帧 1 */
  33.334%,     50%      { background-position: -180px   0; }   /* 帧 2 */
  50.001%,     66.666%  { background-position: -270px   0; }   /* 帧 3 */
  66.667%,     83.333%  { background-position: -360px   0; }   /* 帧 4 */
  83.334%,     100%     { background-position: -450px   0; }   /* 帧 5 */
}

/* ---------- 庆祝动作：.xiaowo.is-celebrating 时触发 ----------
   1:1 完全复制喝水动作（喝水当时跑通的那一套，一字不差）。
   因为庆祝 sprite 也变成了 930×254（单帧 155×254 → 90×148 显示），
   所以和喝水共用同一节奏、同一帧步 -90px、同一 6 段切法。 */
.xiaowo.is-celebrating .xiaowo-celebrate {
  animation: xc-play calc(var(--xc-frame-dur) * var(--frame-count)) var(--xc-loops);
  animation-timing-function: step-end; /* 强制硬切，禁止帧间插值 */
}

@keyframes xc-play {
  0%,          16.666%  { background-position:    0     0; }   /* 帧 0 */
  16.667%,     33.333%  { background-position:  -90px   0; }   /* 帧 1 */
  33.334%,     50%      { background-position: -180px   0; }   /* 帧 2 */
  50.001%,     66.666%  { background-position: -270px   0; }   /* 帧 3 */
  66.667%,     83.333%  { background-position: -360px   0; }   /* 帧 4 */
  83.334%,     100%     { background-position: -450px   0; }   /* 帧 5 */
}

/* 暂停动画（编辑/弹窗压栈时定住） */
.xiaowo.paused .xiaowo-drinking,
.xiaowo.paused .xiaowo-celebrate { animation-play-state: paused; }

.xiaowo-shadow {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;                   /* 随小人放大从 48→62（≈ ×1.29） */
  height: 15px;                  /* 从 11→15（≈ ×1.36，略加椭圆高度更自然） */
  background: radial-gradient(ellipse, rgba(60, 40, 20, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* 完成自我照顾任务后：小我开心地跳一下。
   动画加在父 .xiaowo 上（transform 作用于整体），
   与 .xiaowo-drinking 的 background-position 步进互不冲突。 */
.xiaowo.mood-happy {
  animation: xw-jump 0.6s ease;
}
@keyframes xw-jump {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-16px); }
  55%  { transform: translateY(0); }
  75%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.xiaowo:hover .xiaowo-drinking {
  transform: scale(1.08);
}

/* 点击提示气泡 */
.xiaowo-click-hint {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  font-weight: bold;
  color: #7a5a3a;
  background: rgba(255, 252, 245, 0.85);
  border: 1.5px solid var(--c-line);
  border-radius: 999px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  animation: hint-float 2.8s ease-in-out infinite;
}
.xiaowo:hover .xiaowo-click-hint { opacity: 1; }
@keyframes hint-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}

/* ============================================================
   自我照顾常驻表单 - 浮层气泡网格（在房间最底部，不遮挡）
   ============================================================ */
.tab1-care {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;                    /* 紧贴屏幕底部，浮在背景之上 */
  z-index: 60;                  /* 高于房间内所有层，确保压在最底不被遮挡 */
  max-height: none;
  min-height: auto;
  background: rgba(255, 252, 245, 0.12);  /* 极淡，几乎透明 */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 8px 16px 2px;
  display: flex;
  flex-direction: column;
  container-type: inline-size;  /* 让内部 100cqw 正确解析为本面板宽度 */
  pointer-events: none;         /* 点击穿透到背景，仅气泡/文字可点 */
}

.tab1-care > * {
  pointer-events: auto;
}

.care-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.care-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--c-text);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(255, 252, 245, 0.8);
}

.care-meta {
  display: flex;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
}

.care-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--c-text-soft);
  background: rgba(255, 255, 255, 0.45);
  padding: 4px 8px;
  border-radius: var(--r-pill);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.care-meta-item b { color: var(--c-accent); }

/* 气泡网格容器 - 固定只显示一行3个，可滚动 */
.care-options {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 气泡边长 = 可用宽度 / 3，封顶 76px（避免桌面端过高） */
  --row: min(calc((100cqw - 28px) / 3), 76px);
  grid-auto-rows: var(--row);
  gap: 10px;
  padding: 2px 4px 0;
  align-content: start;          /* 第一行立即可见，下滑看更多 */
  /* 精确锁高为刚好一行气泡 + 上 padding(2px) */
  height: calc(var(--row) + 2px);
  max-height: none;
  min-height: 0;
  flex-shrink: 0;
  /* 隐藏滚动条但保留滚动功能 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.care-options::-webkit-scrollbar {
  display: none;
}

/* 单个气泡 - 更透明 */
.care-bubble {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 10px rgba(120, 90, 60, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  overflow: hidden;
}

.care-bubble:active {
  transform: scale(0.94);
}

.care-bubble .bubble-emoji {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.care-bubble .bubble-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--c-text);
  text-align: center;
  padding: 0 4px;
  line-height: 1.2;
}

/* 长按进度环 */
.bubble-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(
    from 0deg,
    var(--c-accent) calc(var(--progress, 0) * 1%),
    transparent calc(var(--progress, 0) * 1%)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.care-bubble.longpressing .bubble-ring {
  opacity: 1;
}

/* 完成时的对勾覆盖 */
.bubble-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  background: rgba(136, 184, 160, 0.9);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}

.care-bubble.checking .bubble-check {
  opacity: 1;
  transform: scale(1);
}

/* 已完成状态 */
.care-bubble.done {
  background: rgba(184, 216, 200, 0.45);
  border-color: rgba(136, 184, 160, 0.55);
}
.care-bubble.done .bubble-emoji {
  filter: grayscale(50%) opacity(0.6);
  transform: scale(0.9);
}
.care-bubble.done .bubble-label {
  color: #5a8068;
}

/* 已跳过 */
.care-bubble.skipped {
  opacity: 0.45;
}
.care-bubble.skipped .bubble-label {
  text-decoration: line-through;
  color: #9a9a9a;
}

/* 置顶标记 */
.care-bubble.pinned::after {
  content: '\1F4CC';
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 10px;
  opacity: 0.8;
}

/* 模式小标签 */
.care-bubble .bubble-mode {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255,255,255,0.55);
  color: var(--c-text-soft);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* 添加按钮气泡 */
.care-bubble.add-btn {
  background: rgba(255, 255, 255, 0.22);
  border-style: dashed;
  border-color: rgba(200, 180, 150, 0.45);
}
.care-bubble.add-btn .bubble-emoji {
  font-size: 22px;
  filter: none;
  color: var(--c-text-soft);
}
.care-bubble.add-btn .bubble-label {
  color: var(--c-text-soft);
  font-size: 11px;
}

/* 像素图标（meta 心形 / 金币） */
.pix-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: inline-block;
}
.pix-icon.pix-heart { fill: #d4758a; }
.pix-icon.pix-coin { fill: #d9a441; }

/* ---------- 选中家具：尺寸 / 旋转 控制条 ----------
   作为 .room-item 的子元素贴在家具选择框上方：家具被拖动时，
   控制条跟着一起移动，不会停在原地挡住别的家具 */
.room-item-bar {
  position: absolute;
  bottom: calc(100% + 10px);       /* 紧贴选择框上方 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: min(86vw, 320px);     /* 面板不超屏，必要时自动换行 */
  background: rgba(50, 38, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 7px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: default;
  white-space: nowrap;
}
.room-item-bar[hidden] { display: none; }
/* 拖动家具时禁掉面板点击，避免拖动过程中误触按钮 */
.room-item.dragging .room-item-bar { pointer-events: none; }

.rib-group { display: flex; align-items: center; gap: 6px; }
.rib-label {
  color: rgba(255, 243, 224, 0.85);
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
.rib-val {
  color: #ffd9a0;
  font-family: var(--font-pixel);
  font-size: 10px;
  min-width: 36px;
  text-align: center;
}
.rib-btn {
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  background: #f5e8d4;
  color: #5a4a3a;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.rib-btn:active { transform: scale(0.9); }
.rib-sep { width: 1px; height: 22px; background: rgba(255, 243, 224, 0.25); }
/* 「放回家具库」按钮：醒目但不刺眼 */
.rib-return {
  width: auto;
  padding: 0 10px;
  background: #c86a6a;
  color: #fff;
  font-size: 12px;
}
