/* 手机端版式修正（2026-11-18 晚）
   1) 门口卡片在窄屏会向右溢出/切边 —— 让卡片按可用宽度居中
   2) 屋子原来用“铺满裁切”，手机上只看到中间一块，挂钟和书架都被切掉 ——
      手机端把舞台高度设成房间本身的比例（1280x800 = 62.5vw），整间屋子完整可见 */

@media (max-width: 900px) {
  /* ---- 门口 ---- */
  #root .gate {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  #root .gate-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  #root .gate-bless { max-width: 100%; }
  #root .gate-input-row { width: 100%; }
  #root .gate-input { width: 100%; max-width: none; }

  /* ---- 屋子：整屋可见，不再左右裁切 ---- */
  #root .room-stage {
    flex: 0 0 auto;
    height: min(62.5vw, 60dvh);
  }
  #root .room-stage:after { height: 44px; }

  /* ---- 右上角的入口：原来固定在 top:10px，正好压在右墙的软木板（照片墙）上，
         整屋显示后软木板就在 x1004-1204,y96-254 那块，被挡得严严实实。
         现在挪到屋子下面那片空白里，跟房间高度同步，压不到任何物件 ---- */
  .life-hud {
    top: calc(min(62.5vw, 60dvh) + 8px);
    right: 10px;
  }
}

/* 特别矮的屏幕（横屏/小屏），门口别把顶部切掉 */
@media (max-width: 900px) and (max-height: 700px) {
  #root .gate { place-items: start center; padding: 14px 16px 20px; }
}

/* 房间下方：把地板颜色接着往下延伸一小段再渐隐，
   手机整屋缩小后下半屏不至于像块死黑 */
@media (max-width: 900px) {
  #root .room-stage:after { display: none; }
  #root .bubble-layer {
    background: linear-gradient(180deg,
      rgb(124, 89, 80) 0px,
      rgb(113, 81, 75) 36px,
      rgb(96, 69, 68) 72px,
      rgb(72, 52, 58) 110px,
      rgb(48, 35, 46) 152px,
      rgb(28, 20, 32) 198px,
      rgb(15, 11, 21) 244px,
      rgb(11, 8, 19) 300px);
  }
}
