:root {
  --ui: 1;
  --cream: #FFF7EC; --ink: #3B2F4A; --muted: #8C7F99;
  --coral: #FF6F91; --coral-dark: #E04E73; --mint: #4FCFA6; --mint-dark: #1E8A5E;
  --gold: #FFC940; --gold-dark: #B57A00; --sky: #7EC8FF; --sky-dark: #2F7FD1; --grape: #A98BFF; --grape-dark: #6B4FD1;
  --shadow: 0 4px 0 #F3DCCB, 0 12px 26px rgba(120,80,60,.16);
  --sticker-border: 4px solid #fff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--cream); color: var(--ink); font-weight: 700;
  overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.title { font-family: "ZCOOL KuaiLe", "Noto Sans SC", -apple-system, "PingFang SC", sans-serif; font-weight: 400; letter-spacing: .5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 600; }
.err { color: #C62828; min-height: 1.4em; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
img { -webkit-user-drag: none; }

.sticker { background: #fff; border: var(--sticker-border); border-radius: 24px; box-shadow: var(--shadow); }
.screen { position: fixed; inset: 0; }
.login-bg { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; padding: 20px; background: linear-gradient(160deg, #FFE3F1, #E3F2FF); }
.login-card { width: min(440px, 100%); text-align: center; padding: 28px; }
.login-pet { width: 150px; height: 150px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; }
h1.title { margin: 0 0 4px; font-size: 40px; }
h2.title { margin: 0 0 12px; font-size: 30px; }
.big-input { width: 100%; margin: 16px 0; padding: 14px; font-size: 32px; letter-spacing: 8px; text-align: center; border: 3px solid #F3E0E8; border-radius: 18px; outline: none; text-transform: uppercase; }
.big-input:focus { border-color: var(--coral); }
.name-input { letter-spacing: 2px; font-size: 26px; text-transform: none; }
.btn { padding: 12px 22px; border-radius: 999px; font-size: 18px; transition: transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.95); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--coral-dark); font-family: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif; font-weight: 400; letter-spacing: 1px; }
.btn-primary:disabled { background: #E7DBE2; box-shadow: 0 5px 0 #CFC1CA; }
.btn-big { width: 100%; padding: 16px; font-size: 24px; }
.btn-ghost { color: var(--muted); margin-top: 12px; }
.btn-secondary { background: #EEF0FF; color: #4A56B8; box-shadow: 0 4px 0 #CDD3F5; }
.btn-wish { background: #FFF3CD; color: #8A5A00; box-shadow: 0 4px 0 #F0DCA0; }
.kid-list { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 12px 0; }
.kid-card { width: 124px; padding: 16px 8px; border-radius: 22px; background: #FFF7FB; border: 3px solid #F6DFE9; }
.kid-card:active { transform: scale(.95); }
.kid-card .av { width: 84px; height: 84px; margin: 0 auto; }
.kid-card .av img { width: 100%; height: 100%; object-fit: contain; }
.kid-card .nm { margin-top: 8px; font-size: 20px; }

/* ---- 舞台（PixiJS） ---- */
.stage-host { position: absolute; inset: 0; touch-action: none; }
.stage-host canvas { display: block; width: 100%; height: 100%; }
/* ---- 房间（横向滑动） ---- */
.rooms { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
.room { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; background-size: cover; background-position: center bottom; }
.room.locked { filter: saturate(.5) brightness(.75); }
.room-lock { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; z-index: 3; }
.room-lock .sticker { padding: 18px 26px; display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.room-lock .big { font-size: 28px; }
.furn { position: absolute; transform: translate(-50%, -100%); touch-action: none; cursor: grab; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); }
.furn img { width: 100%; height: auto; display: block; pointer-events: none; }
.furn.dragging { filter: drop-shadow(0 16px 18px rgba(0,0,0,.25)); z-index: 3; transform: translate(-50%, -100%) scale(1.06); }
.furn.wiggle { animation: shake .5s ease-in-out 1; }

.pet-wrap { position: absolute; left: 50%; bottom: 13%; width: min(60vh, 70vw); aspect-ratio: 800 / 960; transform: translateX(-50%); pointer-events: none; }
.pet-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 16px rgba(120,80,60,.22)); pointer-events: auto; cursor: pointer; }
.pet-svg .pet-body { animation: bob 2.8s ease-in-out infinite; transform-origin: 400px 960px; }
.pet-svg.mood-starving .pet-body { animation: breathe 3.6s ease-in-out infinite; }
.pet-svg.eating .pet-body { animation: chew .25s ease-in-out 5; }
.pet-svg.jump .pet-body { animation: jump .7s ease-out 2; }
.pet-svg.wiggle .pet-body { animation: shake .5s ease-in-out 1; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }
@keyframes breathe { 0%,100% { transform: scale(1) } 50% { transform: scale(1.015) } }
@keyframes chew { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.95) translateY(10px) } }
@keyframes jump { 0%,100% { transform: translateY(0) } 40% { transform: translateY(-70px) scaleY(1.05) } 60% { transform: translateY(-55px) } }
@keyframes shake { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-4deg) } 75% { transform: rotate(4deg) } }

.bubble { position: absolute; left: 0; top: 0; max-width: 320px; min-width: 120px; z-index: 3; background: #fff; border: var(--sticker-border); border-radius: 22px 22px 22px 6px; padding: 10px 16px; font-size: 20px; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 2; white-space: nowrap; }
.bubble.show { opacity: 1; }
.bubble.sad { background: #EEF1FA; color: #5B6480; }

.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.fly { position: absolute; width: 72px; height: 72px; transition: transform .7s cubic-bezier(.3,.8,.4,1), opacity .2s .6s; z-index: 5; }
.fly img { width: 100%; height: 100%; object-fit: contain; }
.heart { position: absolute; width: 34px; animation: heartUp 1.2s ease-out forwards; }
@keyframes heartUp { 0% { transform: translateY(0) scale(.6); opacity: 1 } 100% { transform: translateY(-130px) scale(1.3); opacity: 0 } }
.coin-drop { position: absolute; width: 40px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { 0% { transform: translateY(-80px) rotate(0); opacity: 1 } 100% { transform: translateY(110vh) rotate(360deg); opacity: .7 } }

/* ---- HUD ---- */
.hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 14px) 18px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; z-index: 4; }
.hud > * { pointer-events: auto; }
.hud-pet { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; min-width: 300px; max-width: 320px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.hud-pet:active { transform: scale(.98); }
.hud-avatar { width: 64px; height: 64px; object-fit: contain; }
.hud-pet-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pet-name-row { display: flex; align-items: center; gap: 8px; }
.pet-name { font-size: 26px; line-height: 1; }
.mood-tag { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #DDF6EC; color: var(--mint-dark); }
.mood-tag.normal { background: #EEF0FF; color: #4A56B8; }
.mood-tag.hungry { background: #FFF1D6; color: var(--gold-dark); }
.mood-tag.starving { background: #FFE1E1; color: #C62828; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-icon { width: 28px; height: 28px; object-fit: contain; }
.bar { flex: 1; height: 16px; border-radius: 999px; background: #F3E7EC; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4FCFA6, #8BE3A8); transition: width .6s; }
.bar-fill.low { background: linear-gradient(90deg, #FFB347, #FFD166); }
.bar-fill.critical { background: linear-gradient(90deg, #FF6B6B, #FF9A9A); }
.bar-num { font-size: 20px; min-width: 34px; text-align: right; }
.hud-right { display: flex; align-items: center; gap: 10px; }
.coins { display: flex; align-items: center; gap: 8px; padding: 6px 18px 6px 8px; font-size: 30px; line-height: 1; }
.coin-img { width: 44px; height: 44px; }
.coins.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.15) } }
.avatar-btn { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #FFE3F1; padding: 0; overflow: hidden; }
.avatar-btn img { width: 100%; height: 100%; object-fit: contain; }

.room-dots { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 20px); transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.room-dot { padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.75); color: var(--muted); font-size: 14px; }
.room-dot.active { background: var(--ink); color: #fff; }
.room-dot.locked { opacity: .7; }
.room-arrow { display: none !important; position: absolute; top: 46%; width: 56px; height: 56px; border-radius: 50%; border: var(--sticker-border); background: rgba(255,255,255,.8); box-shadow: var(--shadow); font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center; z-index: 3; color: var(--ink); }
.room-arrow.left { left: 16px; } .room-arrow.right { right: 16px; }

.wish-chip { position: absolute; left: 18px; top: calc(env(safe-area-inset-top) + 120px); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; background: #FFFBEA; z-index: 3; cursor: pointer; }
.wish-chip img { width: 48px; height: 48px; object-fit: contain; }
.wish-chip .wt { font-size: 14px; color: #8A5A00; }
.wish-chip .bar { width: 130px; height: 10px; margin-top: 4px; background: #F3E7D0; }
.wish-chip .bar-fill { background: linear-gradient(90deg, #FFC940, #FFB347); }
.wish-chip small { color: var(--muted); font-size: 12px; }

/* ---- 底部按钮 ---- */
.dock { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); display: flex; gap: 12px; z-index: 4; }
.dock-btn { width: 104px; height: 100px; border-radius: 28px; border: var(--sticker-border); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 20px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); transition: transform .1s; }
.dock-btn:active { transform: scale(.94); }
.dock-btn img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.12)); }
.dock-btn.feed { background: #FFB36B; } .dock-btn.shop { background: #FF8FB1; } .dock-btn.wardrobe { background: #7FD8A4; } .dock-btn.history { background: #B9A1FF; }

/* ---- 居中弹窗 ---- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(59,47,74,.45); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-card { width: min(1080px, 100%); height: min(720px, 92vh); background: var(--cream); border: 6px solid #fff; border-radius: 32px; box-shadow: 0 30px 70px rgba(40,20,40,.35); display: flex; flex-direction: column; overflow: hidden; animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.modal-card.small { width: min(820px, 100%); height: min(600px, 88vh); }
@keyframes pop { from { transform: scale(.7); opacity: 0 } }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px 12px 24px; border-bottom: 3px solid #F6E6D5; }
.modal-icon { width: 52px; height: 52px; object-fit: contain; }
.modal-head h2 { margin: 0; font-size: 34px; line-height: 1; }
.modal-head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.coin-pill { display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; border-radius: 999px; background: #fff; border: 3px solid #FFE8A3; font-size: 24px; line-height: 1; }
.coin-pill img { width: 32px; height: 32px; }
.close-btn { width: 52px; height: 52px; border-radius: 50%; padding: 0; }
.close-btn img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.12)); }
.modal-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }

.cats { width: 118px; padding: 12px 10px; border-right: 3px solid #F6E6D5; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.cat { height: 76px; border-radius: 22px; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 16px; }
.cat img { width: 32px; height: 32px; object-fit: contain; }
.cat.active { background: #fff; border-color: #fff; box-shadow: 0 4px 0 #F3DCCB; color: var(--coral-dark); }
.grid-wrap { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.grid-wrap::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; padding: 10px 10px 4px 0; }
.item-card { position: relative; height: 142px; border-radius: 22px; border: 4px solid #fff; background: #fff; box-shadow: 0 4px 0 #F3DCCB; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .1s; }
.item-card:active { transform: scale(.96); }
.item-card.selected { border-color: var(--coral); background: #FFF0F4; }
.item-card.equipped { border-color: var(--mint); background: #F0FBF4; }
.item-card.locked { opacity: .75; }
.item-card.ghost { border: 4px dashed #E9D8C6; background: #FFFBF4; box-shadow: none; color: var(--gold-dark); gap: 8px; }
.preview { width: 66px; height: 66px; display: flex; align-items: center; justify-content: center; }
.preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview.scene { width: 108px; height: 68px; border-radius: 14px; overflow: hidden; }
.preview.scene img { width: 100%; height: 100%; object-fit: cover; }
.item-name { font-size: 15px; }
.item-price { font-size: 17px; color: var(--gold-dark); line-height: 1; }
.item-price.ok { color: var(--mint-dark); }
.item-price.own { color: var(--muted); }
.badge { position: absolute; top: -9px; right: -9px; padding: 3px 8px; border-radius: 999px; font-size: 11px; line-height: 1.3; background: var(--coral); color: #fff; border: 3px solid #fff; box-shadow: 0 2px 0 #F3DCCB; z-index: 1; }
.badge.qty { background: var(--ink); } .badge.own { background: #DDF6EC; color: var(--mint-dark); } .badge.wish { background: var(--gold); color: #5A3B00; } .badge.eq { background: var(--mint); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 18px; }

.detail { width: 270px; padding: 16px 18px; border-left: 3px solid #F6E6D5; background: #FFFDF8; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-y: auto; }
.detail .preview { width: 200px; height: 200px; border-radius: 28px; background: #fff; border: 4px solid #fff; box-shadow: 0 4px 0 #F3DCCB; }
.detail .preview.scene { width: 230px; height: 144px; }
.detail h3 { margin: 4px 0 0; font-size: 28px; line-height: 1; }
.detail p { margin: 0; text-align: center; font-size: 15px; }
.detail .price-big { display: flex; align-items: center; gap: 8px; font-size: 32px; line-height: 1; }
.detail .price-big img { width: 34px; height: 34px; }
.detail .spacer { flex: 1; }
.detail .btn { width: 100%; }
.detail .btn-big { font-size: 24px; padding: 14px; }
.detail-empty { color: var(--muted); text-align: center; margin-top: 60px; font-size: 16px; }

.feed-head { display: flex; align-items: center; gap: 12px; padding: 12px 24px 0; }
.feed-head .bar { height: 18px; }
.hist { list-style: none; margin: 0; padding: 0 24px; width: 100%; }
.hist li { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; border-bottom: 2px solid #F3E9EE; font-size: 17px; }
.hist .d { color: var(--muted); font-size: 13px; font-weight: 600; }
.hist .plus { color: var(--mint-dark); font-size: 22px; } .hist .minus { color: #C62828; font-size: 22px; }

/* ---- 金币到账 ---- */
.grant { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(59,47,74,.5); overflow: hidden; }
.grant-card { position: relative; z-index: 2; background: var(--cream); border: 6px solid #fff; border-radius: 36px; padding: 28px 34px 26px; width: min(520px, 92vw); text-align: center; box-shadow: 0 30px 70px rgba(40,20,40,.4); animation: pop .4s cubic-bezier(.2,1.4,.4,1); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.grant-envelope { width: 120px; height: 120px; object-fit: contain; animation: bob 1.6s ease-in-out infinite; }
.grant-card h2 { margin: 0; font-size: 36px; }
.grant-list { width: 100%; max-height: 30vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.grant-list div { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-radius: 16px; box-shadow: 0 3px 0 #F3DCCB; font-size: 17px; }
.grant-list b { color: var(--gold-dark); font-size: 24px; font-family: "ZCOOL KuaiLe", sans-serif; font-weight: 400; }
.grant-total { display: flex; align-items: center; gap: 10px; font-size: 48px; line-height: 1; color: var(--coral-dark); margin: 6px 0; }
.grant-total img { width: 48px; height: 48px; }

.toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 40; background: rgba(59,47,74,.92); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 18px; animation: pop .25s ease-out; }

@media (max-width: 700px) {
  .hud-pet { min-width: 0; } .hud-avatar { display: none; } .pet-name { font-size: 20px; }
  .dock { gap: 8px; } .dock-btn { width: 84px; height: 84px; font-size: 15px; } .dock-btn img { width: 40px; height: 40px; }
  .cats { width: 92px; } .cat { height: 70px; font-size: 13px; } .cat img { width: 28px; height: 28px; }
  .detail { display: none; } .modal-card { border-radius: 24px; } .modal-head h2 { font-size: 26px; }
  .pet-wrap { bottom: 15%; } .room-dots { top: calc(env(safe-area-inset-top) + 110px); }
}

/* ---- 小图标 ---- */
.ic { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.ic-lg { width: 30px; height: 30px; }
.room-dot img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.room-lock .big img { width: 36px; height: 36px; vertical-align: -8px; margin-right: 6px; }
.hist .hi { width: 30px; height: 30px; object-fit: contain; margin-right: 8px; vertical-align: middle; }

/* ---- 状态面板 ---- */
.status { display: flex; gap: 20px; padding: 18px 22px; width: 100%; overflow: hidden; }
.status-left { width: 300px; flex: 0 0 300px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.status-left .big-pet { width: 220px; height: 220px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(120,80,60,.2)); }
.status-left .pet-name { font-size: 32px; }
.status-left .bar { flex: none; width: 100%; height: 18px; }
.status-left .kv { display: flex; justify-content: space-between; width: 100%; font-size: 15px; color: var(--muted); }
.status-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: none; }
.status-right::-webkit-scrollbar { display: none; }
.status-right h3 { margin: 0; font-size: 22px; }
.equip-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: #fff; border: 3px solid #fff; box-shadow: 0 3px 0 #F3DCCB; }
.equip-row .preview { width: 56px; height: 56px; }
.equip-row .eq-name { flex: 1; font-size: 17px; }
.equip-row .eq-slot { font-size: 13px; color: var(--muted); }
.equip-row .btn { padding: 8px 14px; font-size: 15px; }
.equip-row.empty-slot { border-style: dashed; border-color: #E9D8C6; background: #FFFBF4; box-shadow: none; color: var(--muted); }

.bar-fill.happy { background: linear-gradient(90deg, #FF8FB1, #FFB6C9); }
.bar-fill.happy.low { background: linear-gradient(90deg, #C9B6E8, #D9CCF0); }
.hud-pet-body { gap: 4px; }
.float-up { position: absolute; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 26px; color: #E04E73; text-shadow: 0 2px 0 #fff; animation: heartUp 1.1s ease-out forwards; pointer-events: none; display: flex; align-items: center; gap: 4px; }
.float-up img { width: 26px; height: 26px; }

.bars { display: grid; grid-template-columns: 1fr; gap: 3px; }
.bars .bar-row { gap: 6px; }
.bars .bar-icon { width: 24px; height: 24px; }
.bars .bar { height: 11px; }
.bars .bar-num { font-size: 16px; min-width: 28px; }
.bar-fill.clean { background: linear-gradient(90deg, #7EC8FF, #B3E0FF); }
.bar-fill.clean.low { background: linear-gradient(90deg, #B9A48A, #D2C2AE); }
.bar-fill.energy { background: linear-gradient(90deg, #FFC940, #FFE08A); }
.bar-fill.energy.low { background: linear-gradient(90deg, #A98BFF, #C9B8FF); }
.dock-btn.bath { background: #7EC8FF; } .dock-btn.sleep { background: #8E7CFF; } .dock-btn.adventure { background: #FFB36B; }
.dock-btn.shop { background: #FF8FB1; } .dock-btn.feed { background: #FF9F6B; }
.night { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 72%, rgba(18,14,60,.62), rgba(8,6,30,.9)); z-index: 2; pointer-events: none; transition: opacity .6s; }
.away-card { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 3; padding: 18px 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 300px; }
.away-card img { width: 120px; height: 120px; object-fit: contain; }
.away-card .big { font-size: 26px; }
.away-card .count { font-size: 40px; line-height: 1; color: var(--coral-dark); }
.reward { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 24px 24px; width: 100%; text-align: center; }
.reward .preview { width: 150px; height: 150px; }
.reward .story { background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 3px 0 #F3DCCB; font-size: 17px; max-width: 520px; }
.reward .coins { display: flex; align-items: center; gap: 8px; font-size: 36px; color: var(--gold-dark); }
.reward .coins img { width: 40px; height: 40px; }
.care { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 24px 24px; width: 100%; text-align: center; }
.care .big-pet { width: 200px; height: 200px; object-fit: contain; }
.care .needs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.care .need { padding: 6px 14px; border-radius: 999px; background: #DDF6EC; color: var(--mint-dark); font-size: 15px; }
.care .need.bad { background: #FFE1E1; color: #C62828; }
.souvenirs { display: flex; flex-wrap: wrap; gap: 10px; }
.souvenirs .sv { width: 84px; text-align: center; font-size: 12px; color: var(--muted); }
.souvenirs .sv .preview { width: 64px; height: 64px; margin: 0 auto; }
.souvenirs .sv.none .preview img { filter: grayscale(1) opacity(.25); }
@media (max-width: 700px) { .hud-pet { min-width: 0; } .bars { grid-template-columns: 1fr; } .dock-btn { width: 60px; height: 64px; font-size: 12px; } .dock-btn img { width: 30px; height: 30px; } }

/* 睡觉时：除"起床"外全部禁用 */
body.asleep .dock-btn:not(.sleep), body.asleep #hudPetCard, body.asleep #wishChip, body.asleep .room-dot, body.asleep #avatarBtn { pointer-events: none; opacity: .45; filter: saturate(.4); }
body.asleep .dock-btn.sleep { box-shadow: 0 0 0 4px #FFE08A, var(--shadow); }

/* ---- 手机：整体缩放 ---- */
.hud, .dock, .room-dots, .wish-chip, .away-card, .room-lock, .bubble, .toast { zoom: var(--ui); }
.modal-card, .grant-card { zoom: var(--ui); }
.login-card { zoom: var(--ui); }
@media (max-width: 700px) {
  .hud-pet { min-width: 300px; } .bars { grid-template-columns: 1fr; }
  .dock-btn { width: 104px; height: 100px; font-size: 20px; } .dock-btn img { width: 58px; height: 58px; }
  .cats { width: 118px; } .cat { height: 76px; font-size: 16px; } .cat img { width: 32px; height: 32px; }
  .detail { display: flex; } .modal-card { border-radius: 32px; } .modal-head h2 { font-size: 34px; }
  .pet-wrap { bottom: 13%; } .room-dots { top: calc(env(safe-area-inset-top) + 20px); }
}
.portrait-tip { display: none; }
body.portrait .portrait-tip { display: flex; position: fixed; inset: 0; z-index: 100; background: #FFF7EC; align-items: center; justify-content: center; flex-direction: column; gap: 14px; text-align: center; padding: 30px; }
body.portrait .portrait-tip img { width: 160px; height: 160px; object-fit: contain; animation: rotateHint 2.4s ease-in-out infinite; }
@keyframes rotateHint { 0%,100% { transform: rotate(0) } 50% { transform: rotate(-90deg) } }
