/* 小伙伴的样式：贴纸墙上的那张卡、它的动作、领养、换装、长大的那一刻。在 index.html 里排在 styles.css 后面 */
/* ================= 小伙伴（贴纸墙页最上面）：一句话 + 它的小屋 + 一行数 ================= */
.pet-card { padding: 18px 16px 16px; }
.pet-h { display: flex; align-items: center; gap: 8px 12px; min-height: 36px; }
/* 一行：名字（就是这张卡的标题，点它改名）+ 它长到哪一步（灰色小字，不是按钮），换装、布置、本领三个入口在小屋下面（.care-bar）。
   今天吃了几份只在下面那句话里说一次 */
/* 小屋的声音开关（pet/sound.js）：标题旁边一个小喇叭，关着的时候淡一点 */
.pet-sound { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.pet-sound:active { transform: scale(.92); }
.pet-sound.off { opacity: .55; }
@media (hover: hover) { .pet-sound:hover { background: var(--soft); color: var(--accent); } }
.pet-who { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; }
.pet-name { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; border: 0; background: none; padding: 4px 0; color: var(--ink); font: inherit; font-size: 17px; font-weight: 900; cursor: pointer; }
.pet-name i { font-style: normal; font-size: 12px; color: var(--muted); opacity: .75; }
.pet-stg { flex: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.pet-edit { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; font-size: 13.5px; font-weight: 800; padding: 5px 15px; min-height: 34px; }
.pet-rename { flex: 1; display: flex; gap: 8px; max-width: 320px; }
.pet-rename input { flex: 1; min-width: 0; }
.pet-scene { display: block; width: 100%; max-width: 400px; height: auto; margin: 6px auto 2px; overflow: visible; }
.pet-floor { fill: var(--soft); }
.pet-lid { fill: var(--line); }
.pet-glass { fill: var(--bg); stroke: var(--line); stroke-width: 3; }
.pet-today { font-size: 12px; font-weight: 900; fill: var(--accent); }
.pet-say { text-align: center; font-size: 16px; font-weight: 900; margin-top: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.pet-say small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.pet-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pet-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pet-legend svg { width: 30px; height: 20px; overflow: visible; }
.pet-legend b { color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; font-size: 1.15em; font-weight: 900; }
.pet-card .pet-say { margin-top: 10px; }
.pet-card .pet-legend { font-size: 13.5px; }
/* 它的小屋（pet/room.js）：圆角的一幅画，竖着的手机上是竖的、其余是横的。整幅画等比缩放 */
/* 宽屏（电脑、横着的大平板）：屋子铺满卡片的宽度，不在两边留空。只按屏幕的高度收一收——屋子连同上面那句话、下面的本领要能一屏看全
   （950 : 340 是横的屋子的宽高比；370 是屋子以外那些东西大约占的高度） */
.pet-room { --m: 1; display: block; width: 100%; max-width: max(1100px, calc((100vh - 370px) * 950 / 340)); height: auto; margin: 12px auto 10px; border-radius: 24px; overflow: hidden; }
/* 竖的：最宽 430（再宽就一屏装不下了），居中；手机上往卡片两边各多占 12，画能大一点 */
.pet-room.room-tall { width: min(430px, calc(100% + 24px)); max-width: none; margin-left: max(-12px, calc((100% - 430px) / 2)); margin-right: 0; border-radius: 20px; }
/* 画缩小了，字不能跟着小到看不清：屏幕越窄 --m 越大，屋里的字在屏幕上始终有 11 像素左右（小字 10）
   竖的：画宽 = 屏幕宽 − 40，画里一格 = 画宽 / 360；横的：画宽 ≈ 屏幕宽 − 66～90，一格 = 画宽 / 950（加了门口那一段以后）。
   横的最多放大到 1.5：再大，身高尺左边的字就要压到门口的信箱了 */
@media (max-width: 395px) { .room-tall { --m: 1.06; } }
@media (max-width: 372px) { .room-tall { --m: 1.13; } }
@media (max-width: 350px) { .room-tall { --m: 1.21; } }
@media (max-width: 335px) { .room-tall { --m: 1.3; } }
@media (max-width: 1060px) { .room-wide { --m: 1.05; } }
@media (max-width: 980px) { .room-wide { --m: 1.12; } }
@media (max-width: 910px) { .room-wide { --m: 1.2; } }
@media (max-width: 850px) { .room-wide { --m: 1.3; } }
@media (max-width: 795px) { .room-wide { --m: 1.4; } }
@media (max-width: 735px) { .room-wide { --m: 1.5; } }
.pet-room .pet-today { font-size: calc(12px * var(--m)); }
.room-wall { fill: var(--bg); }
.room-floor { fill: var(--soft); }
.room-skirt { fill: var(--card); }   /* 踢脚线 */
.pet-glass-empty { fill: none; stroke-dasharray: 5 4; }
.room-cap { font-size: calc(11px * var(--m)); font-weight: 700; fill: var(--muted); }
.room-name { font-size: calc(11px * var(--m)); font-weight: 800; fill: var(--ink); }
.room-name.dim { fill: var(--muted); }
.room-sub { font-size: calc(10px * var(--m)); font-weight: 600; fill: var(--muted); }
/* 身高尺上的四道：长到的是实线，还没长到的是虚线；现在这一道有一条虚线连到它头顶 */
.room-mark { stroke: var(--line); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 5; }
.room-mark.ok { stroke: var(--accent); stroke-dasharray: none; }
.room-reach { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .7; }
/* 还没得到的小东西：灰色的影子 + 虚线圈；下一样多一圈会呼吸的虚线 */
.room-ghost { fill: none; stroke: var(--line); stroke-width: 1.6; stroke-dasharray: 4 4; }
.room-lock { filter: grayscale(1); opacity: .34; }
.room-next { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 4 4; animation: pet-glow 1.4s ease-in-out infinite; }
.room-string { fill: none; stroke: #b9b2cc; stroke-width: 1.6; }
/* 今天新放进去的几份：从罐口掉下来，落到底弹一下 */
.pet-drop { animation: pet-drop .62s cubic-bezier(.5, 0, .8, .5) backwards; }
@keyframes pet-drop { from { transform: translateY(-96px); opacity: 0; } 20% { opacity: 1; } 68% { transform: translateY(0); } 82% { transform: translateY(-6px); } to { transform: translateY(0); } }
/* 装满的那一罐：先在大罐子的位置（一样大），停一下，再缩小飞到架子的空位上 */
.room-fly { transform-box: fill-box; transform-origin: 50% 50%; animation: room-fly 1.3s cubic-bezier(.5, 0, .3, 1) backwards; }
@keyframes room-fly { from, 28% { transform: translate(var(--dx), var(--dy)) scale(4.2); } 90% { transform: scale(1.12); } to { transform: none; } }
.room-flag { font-size: 8.5px; font-weight: 900; fill: #2e2a3a; font-family: Nunito, ui-rounded, sans-serif; }
.room-flag.small { font-size: 7px; font-weight: 800; }
/* 打瞌睡：三个 z 轮流亮 */
.pet-zzz text { animation: pet-zzz 2.4s ease-in-out infinite; }
.pet-zzz text:nth-child(2) { animation-delay: .4s; } .pet-zzz text:nth-child(3) { animation-delay: .8s; }
@keyframes pet-zzz { 0%, 100% { opacity: .25; } 40% { opacity: .9; } }
/* 它的本领（pet/skills.js）：套在它外面的两层，表演的时候动这两层；表演中先把连到头顶的虚线和“等你哦”藏起来 */
.room-pet-turn { transform-box: fill-box; transform-origin: 50% 55%; }
.room-reach, .room-bubble { transition: opacity .2s; }
.room-busy .room-reach, .room-busy .room-bubble { opacity: 0; }
.room-out .room-reach { opacity: 0; }   /* 它不在身高尺旁边（跑到她点的地方了、在等信、晚上在小窝旁）：那条线对不上，藏起来 */
/* 它自己过日子（pet/life.js）：坐着、趴着歇的时候（.room-rest）那条线和气泡也对不上；头跟着她的手指转（pet/live.js 的 petLook 改的是 style，这里给个过渡） */
.room-rest .room-reach, .room-rest .room-bubble { opacity: 0; }
.pet-live .pet-head { transition: transform .22s ease-out; }
.room-pet-shade.on-mat { opacity: 0; }
.room-busy .room-pet-shade.on-mat, .room-out .room-pet-shade.on-mat { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pet-live .pet-head { transition: none; } }
.pet-skills { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin: 2px 0 10px; }
.pet-skills-h { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.pet-skill { border: 0; background: var(--soft); color: var(--accent); border-radius: 99px; font-size: 13.5px; font-weight: 800; padding: 6px 15px; min-height: 36px; }
.pet-skill:active { transform: scale(.96); }
.pet-skill.lock { background: none; border: 1.5px dashed var(--line); color: var(--muted); opacity: .8; }
.pet-skill small { margin-left: 6px; font-size: 11px; font-weight: 600; }
.pet-skill.more { background: none; color: var(--muted); padding: 6px 8px; }
.pet-skills.left { justify-content: flex-start; margin: 0; }
.skill-sheet h3 { justify-content: center; margin-bottom: 2px; }
/* 本领里要动的摆设（pet/skills.js）：转起来、晃起来都绕着自己的中间 */
[class^="deco-"] { transform-box: fill-box; transform-origin: 50% 100%; }
.deco-lights.on circle { animation-duration: .24s; }
/* 屋里能点的东西：摆着的小东西、它空出来的位置、架子上的罐子、大罐子 */
.room-tap { cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.room-tap:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.room-hit { fill: transparent; }
.room-home { fill: var(--card); opacity: .45; }   /* 戴走了的那样东西原来的位置：淡淡的一小块 */
@media (hover: hover) { .room-tap:hover .room-hit { fill: var(--card); opacity: .7; } .room-tap:hover .room-home { opacity: 1; } }
.room-jar { transform-box: fill-box; transform-origin: 50% 100%; }
.room-jar.pet-do-shake { animation: room-shake .55s ease-in-out; }
@keyframes room-shake { 15% { transform: rotate(-4deg); } 38% { transform: rotate(4deg); } 60% { transform: rotate(-2.5deg); } 80% { transform: rotate(1.5deg); } }
/* “布置小屋”：上面一幅小的屋子（只是看，不能点），下面三组可以选的 */
.room-preview { pointer-events: none; margin: 0 auto; border-radius: 16px; }
.deco-sheet h3 { justify-content: center; margin-bottom: 2px; }
.deco-tip { margin: 0 0 10px; text-align: center; font-size: 13px; color: var(--muted); }
.deco-tip b { color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; font-size: 15px; }
.deco-view { position: sticky; top: -4px; z-index: 1; margin: 0 -4px 6px; padding: 4px; background: var(--card); border-radius: 18px; }
.deco-h { margin: 14px 0 8px; font-size: 13.5px; font-weight: 800; color: var(--muted); }
.deco-ok { margin-top: 16px; }
/* 门口那一角（pet/corner.js）：信箱上没拆的数、存钱罐牌子上的星星数 */
.room-badge { font-size: calc(10.5px * var(--m)); font-weight: 900; fill: #fff; font-family: Nunito, ui-rounded, sans-serif; }
.room-bal { font-size: calc(11.5px * var(--m)); font-weight: 900; fill: #2e2a3a; font-family: Nunito, ui-rounded, sans-serif; }
/* 点开贴纸手册：一页一个月，只贴得到的 */
.album-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px 6px; min-height: 96px; padding: 14px 10px; border-radius: 18px; background: var(--bg); }
.album-st { position: relative; text-align: center; }
.album-st span { display: block; font-size: 34px; line-height: 1.15; }
.album-st small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.album-st i { position: absolute; top: -4px; right: 2px; font-style: normal; font-size: 10.5px; font-weight: 900; color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 0 5px; }
.album-back { display: block; margin: 10px auto 0; }
/* 点开存钱罐：原来的那张卡片，在面板里不要再套一层卡片的边 */
.bank-sheet .card { box-shadow: none; border: 0; padding: 0; margin: 0; background: none; }
/* 点开架子上的一罐 */
.jar-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jar-nav h3 { margin: 0; flex: 1; text-align: center; justify-content: center; }
.jar-go { min-width: 40px; font-size: 20px; line-height: 1; }
.jar-range { margin: 4px 0 12px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.jar-days { margin-bottom: 14px; }
.jar-day { padding: 8px 0; border-top: 1px dashed var(--line); }
.jar-day b { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.jar-day p { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.jar-day p svg { flex: none; width: 30px; height: 20px; margin-top: 1px; overflow: visible; }
.jar-day p span { min-width: 0; }
.pet-wag { transform-box: fill-box; transform-origin: 0% 100%; animation: pet-wag .38s ease-in-out infinite alternate; }
@keyframes pet-wag { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
.pet-bob { animation: pet-bob 1.1s ease-in-out infinite alternate; }
@keyframes pet-bob { to { transform: translateY(-3px); } }
.pet-glow { opacity: .75; animation: pet-glow 1.4s ease-in-out infinite; }
@keyframes pet-glow { 50% { opacity: .25; } }
/* 平时也是活的：轻轻呼吸、隔几秒眨眼、尾巴慢慢晃、“…”一个个跳 */
.pet-breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: pet-breathe 2.8s ease-in-out infinite alternate; }
@keyframes pet-breathe { to { transform: scale(1.012, 1.028); } }
.pet-blink { transform-box: fill-box; transform-origin: center; animation: pet-blink 4.6s infinite; }
@keyframes pet-blink { 0%, 93%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(.08); } }
.pet-sway { transform-box: fill-box; transform-origin: 0% 100%; animation: pet-sway 2.2s ease-in-out infinite alternate; }
@keyframes pet-sway { from { transform: rotate(-4deg); } to { transform: rotate(7deg); } }
.pet-dot { animation: pet-dot 1.4s ease-in-out infinite; }
@keyframes pet-dot { 0%, 45%, 100% { transform: translateY(0); } 22% { transform: translateY(-3px); } }
/* 拿到 ★：真的一下一下跳。蹲一下 → 弹起来 → 落地压一压 → 歇一会儿；影子跟着变小（静止的样子是停在半空，所以地面 = 往下 12） */
.pet-jump, .pet-act { transform-box: fill-box; transform-origin: 50% 100%; }
.pet-jump { animation: pet-jump 2.6s infinite; }
@keyframes pet-jump {
  0%, 58%, 100% { transform: translateY(12px); animation-timing-function: ease-in-out; }
  7% { transform: translateY(12px) scale(1.07, .9); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  24% { transform: translateY(-8px) scale(.96, 1.05); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  41% { transform: translateY(12px) scale(1.09, .88); animation-timing-function: ease-out; }
  49% { transform: translateY(12px) scale(.98, 1.03); }
}
.pet-shadow { transform-box: fill-box; transform-origin: center; animation: pet-shadow 2.6s infinite; }
@keyframes pet-shadow { 0%, 7%, 41%, 100% { transform: scale(1.25); opacity: .16; } 24% { transform: scale(.8); opacity: .08; } }
.pet-whoosh { animation: pet-whoosh 2.6s infinite; }
@keyframes pet-whoosh { 0%, 9%, 40%, 100% { opacity: 0; } 16%, 28% { opacity: 1; } }
/* 点它 / 随机小动作：JS 给整只加一次性的 .pet-do-*，各管一层 */
.pet-live { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pet-head { transform-box: fill-box; transform-origin: 50% 85%; }
.pet-ears { transform-box: fill-box; transform-origin: 50% 100%; }
.pet-ears-floppy { transform-origin: 50% 0%; }
.pet-do-hop .pet-act { animation: pet-hop .7s; }
@keyframes pet-hop {
  16% { transform: scale(1.07, .91); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  46% { transform: translateY(-14px) scale(.96, 1.05); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  76% { transform: scale(1.08, .9); }
  90% { transform: scale(.98, 1.03); }
}
.pet-do-pat .pet-act { animation: pet-pat .6s ease-out; }
@keyframes pet-pat { 30% { transform: scale(1.07, .91); } 65% { transform: scale(.98, 1.03); } }
.pet-do-pat .pet-blink { animation: pet-squint .7s; }
@keyframes pet-squint { 0%, 100% { transform: scaleY(1); } 18%, 72% { transform: scaleY(.12); } }
.pet-do-wiggle .pet-act { animation: pet-wiggle .9s ease-in-out; }
@keyframes pet-wiggle { 15% { transform: rotate(-5deg); } 38% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
.pet-do-stretch .pet-act { animation: pet-stretch 1.7s ease-in-out; }
@keyframes pet-stretch { 22% { transform: scale(1.06, .93); } 50%, 70% { transform: scale(.95, 1.08); } }
.pet-do-look .pet-head { animation: pet-look 1.7s ease-in-out; }
@keyframes pet-look { 15%, 38% { transform: translateX(-4px) rotate(-4deg); } 58%, 82% { transform: translateX(4px) rotate(4deg); } }
.pet-do-tilt .pet-head { animation: pet-tilt 1.6s ease-in-out; }
@keyframes pet-tilt { 22%, 72% { transform: rotate(11deg); } }
.pet-do-ears .pet-ears { animation: pet-ears .7s ease-in-out; }
@keyframes pet-ears { 18% { transform: scale(1.04, .84); } 38% { transform: scale(1, 1.05); } 58% { transform: scale(1.03, .9); } 78% { transform: scale(1, 1.02); } }
.pet-puff { fill: #ff8fb0; stroke: #fff; stroke-width: 1.2; opacity: .95; animation: pet-puff .9s ease-out forwards; }
@keyframes pet-puff { from { transform: translateY(8px) scale(.3); opacity: 0; } 30% { transform: translateY(-4px) scale(1); opacity: 1; } to { transform: translateY(-26px) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pet-wag, .pet-bob, .pet-glow, .pet-breathe, .pet-blink, .pet-sway, .pet-dot { animation: none; } }
@media (prefers-reduced-motion: reduce) { .pet-jump, .pet-shadow, .pet-whoosh, .pet-puff, .room-next, .room-jar.pet-do-shake, .pet-drop, .room-fly, .pet-zzz text, .pet-live .pet-act, .pet-live .pet-head, .pet-live .pet-ears, .pet-live .pet-blink { animation: none !important; } }
/* 宽屏：名字和那句话排在同一行（名字在左，那句话紧跟着，小字接在后面），不再单独占两行；屋子和下面的东西各占一整行 */
@media (min-width: 600px) {
  .pet-name { font-size: 19px; }
  .pet-card:has(> .pet-room) { display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px; }
  .pet-card:has(> .pet-room) > * { flex: 0 0 100%; }
  .pet-card:has(> .pet-room) > .pet-h { flex: 0 0 auto; }
  .pet-card:has(> .pet-room) > .pet-say { flex: 1 1 0; min-width: 0; margin-top: 0; text-align: left; font-size: 16.5px; }
  .pet-card .pet-say small { display: inline; margin-left: 12px; font-size: 13.5px; }
  .pet-card:has(> .pet-room) > .pet-room { margin-top: 8px; }
}
/* 领养 */
.pet-adopt { text-align: center; }
.pet-adopt h3 { margin-bottom: 2px; }
.pet-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 420px; margin: 14px auto 0; }
.pet-pick { flex: 0 0 calc((100% - 20px) / 3); min-width: 0; border: 2px solid var(--line); border-radius: 22px; padding: 10px 4px; font-size: 14px; font-weight: 800; background: var(--card); color: var(--ink); }
.pet-pick svg { display: block; width: 84px; max-width: 100%; height: 84px; margin: 0 auto 4px; overflow: visible; }
.pet-pick.on { border-color: var(--accent); background: var(--soft); }
.pet-name-field { display: block; max-width: 420px; margin: 16px auto 0; text-align: left; font-size: 13.5px; font-weight: 800; }
.pet-name-field input { display: block; width: 100%; margin-top: 6px; }
.pet-go { width: 100%; max-width: 420px; margin: 14px auto 10px; display: block; }
.pet-go.dim { opacity: .5; }
/* 换装 */
/*   标题、它的样子、“好啦”固定，只有小东西那块滚动。手机上下排；≥640 宽（平板、电脑、横过来的手机）左右排 */
.sheet.pet-ward { display: flex; flex-direction: column; overflow: hidden; text-align: center; }
.sheet-mask.still, .sheet-mask.still .sheet { animation: none; }
.pet-ward h3 { margin-bottom: 2px; justify-content: center; }
.pw-head, .pw-foot { flex: none; }
.pw-foot { padding-top: 12px; }
.pw-foot .btn { display: block; margin-bottom: 0; }
.pw-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-stage { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pet-ward-view { display: block; width: auto; height: clamp(104px, 22vh, 176px); max-width: 100%; margin: 6px auto 4px; overflow: visible; }
.pw-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin: 0 -6px; padding: 8px 6px 4px; }
.pet-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
@media (min-width: 640px) {
  .sheet.pet-ward { max-width: min(820px, calc(100vw - 32px)); padding: 24px 26px; }
  .pw-body { flex-direction: row; gap: 22px; margin-top: 12px; }
  .pw-stage { flex: 0 0 36%; border-radius: 22px; background: var(--soft); padding: 14px; }
  .pet-ward-view { width: auto; height: auto; max-width: min(100%, 250px); max-height: calc(100vh - 290px); max-height: calc(100dvh - 290px); margin: 0; }
  .pet-swap-link { margin-top: 12px; }
  .pet-items { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .pw-foot .btn { max-width: 320px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 640px) and (min-height: 620px) { .pw-body { min-height: 380px; } }
.pet-item { position: relative; border: 2px solid var(--line); border-radius: 18px; padding: 8px 2px 7px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 800; }
.pet-item svg { display: block; width: 44px; height: 44px; margin: 0 auto 2px; overflow: visible; }
.pet-item span { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pet-item i { position: absolute; top: -7px; right: -4px; font-style: normal; font-size: 10.5px; font-weight: 800; background: var(--accent-2); color: #fff; border-radius: 99px; padding: 1px 7px; }
.pet-item.on { border-color: var(--accent); background: var(--soft); }
.pet-item.on span { color: var(--accent); font-weight: 800; }
.pet-item.lock { opacity: .5; }
.pet-item.lock svg { filter: grayscale(1); }
.pet-swap-link { flex: none; margin: 2px auto 0; padding: 5px 14px; min-height: 30px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pet-ward .pet-picks { margin-top: 0; }
/* 长大了 */
.pet-grow .celebrate-box { padding: 18px 22px 20px; }
.pet-grow .celebrate-sub b { color: var(--accent); }
.pet-grow-why { position: relative; margin: 10px 0 16px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.pet-grow-why b { color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; font-size: 16px; }
.pet-grow .btn { position: relative; width: 100%; }

/* 迈腿：它走、跑的时候（pet/skills.js 给屋子加 .room-walk），两只脚一上一下；冲刺的时候更快 */
.room-walk .room-pet .pet-foot { animation: pet-step .42s ease-in-out infinite; }
.room-walk .room-pet .pet-foot-r { animation-delay: -.21s; }
.room-walk.room-dash .room-pet .pet-foot { animation-duration: .22s; }
.room-walk.room-dash .room-pet .pet-foot-r { animation-delay: -.11s; }
@keyframes pet-step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .room-walk .room-pet .pet-foot { animation: none; } }

/* 深色主题（夜空、银河、调色盘的深色）：外面是夜里，屋里亮着灯。
   屋里的木头、摆设、小伙伴都是固定的浅色画的；墙、地板、罐子的玻璃、字却跟着主题色走——深色主题下就成了黑墙黑罐子配亮地板，对不上。
   所以在屋子这一幅画里把主题色换回一套浅色的（只在 .pet-room 里生效，卡片和页面别的地方照旧是深色）；
   强调色还是这个主题的，只是调深一点，在浅色的墙上才看得清。“布置小屋”里的小样也是屋里的东西，一起换。 */
[data-theme="galaxy"], [data-theme="night"], [data-theme="custom"][data-cc="dark"] { --accent-0: var(--accent); }
:is([data-theme="galaxy"], [data-theme="night"], [data-theme="custom"][data-cc="dark"]) :is(.pet-room, .deco-sheet svg) {
  --accent: color-mix(in srgb, var(--accent-0) 70%, #4a3878);
  --card: #fffdfb; --bg: color-mix(in srgb, var(--accent-0) 8%, #f5f1fa); --soft: color-mix(in srgb, var(--accent-0) 16%, #f4eff9);
  --line: #dcd4ea; --ink: #2e2a3a; --muted: #8a84a3; --accent-ink: #ffffff;
}

/* ================= 照顾它：换装、布置、本领（pet/care.js） ================= */
/* 小屋下面的一行：三个一样大的入口 */
.care-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 520px; margin: 12px auto 4px; }
.care-btn { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 800; box-shadow: var(--shadow); }
.care-btn span { font-size: 17px; }
@media (hover: hover) { .care-btn:hover { border-color: var(--accent); color: var(--accent); } }
.pet-card .pet-skills { margin-top: 8px; }
/* 三块面板用同一个壳。和后面的页面分开：遮罩深一点、后面虚掉，面板自己有一圈边和影子（深色主题下面板和页面差不多一个颜色，全靠这一圈） */
.sheet-mask:has(.care-sheet) { background: rgba(14, 11, 30, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet.care-sheet { border: 1.5px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .38); padding-top: 0; text-align: left; }
@media (min-width: 768px) { .sheet.care-sheet { max-width: min(720px, calc(100vw - 32px)); padding-left: 26px; padding-right: 26px; } }
/* 顶上的三个标签：一直在，往下滑内容的时候钉在最上面 */
.care-tabs { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 0 -20px 12px; padding: 14px 16px 12px 20px; background: var(--card); border-bottom: 1.5px solid var(--line); border-radius: 26px 26px 0 0; }
@media (min-width: 768px) { .care-tabs { margin-left: -26px; margin-right: -26px; padding-left: 26px; padding-right: 20px; } }
.care-seg { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg); }
.care-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 14.5px; font-weight: 800; }
.care-tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 6px rgba(0, 0, 0, .12); }
.care-x { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 15px; font-weight: 900; }
.care-sheet .deco-tip { margin: 0 0 12px; }
/* 一组一块：浅底托着，标题是这一块的名字，后面小字写有了几样 */
.care-group { margin: 0 0 12px; padding: 12px 12px 14px; border-radius: 18px; background: var(--bg); }
.care-group .deco-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 900; color: var(--ink); }
.care-group .deco-h small { font-size: 12px; font-weight: 700; color: var(--muted); }
.care-more { margin: 10px 0 0; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 12px; font-size: 12.5px; color: var(--muted); }
.care-group .pet-skills + .care-more { margin-top: 10px; } .care-group .deco-h + .care-more { margin-top: 0; }
.care-group .pet-skills { margin: 0; justify-content: flex-start; }
/* 用着 / 戴着 / 摆着的：实色的边，右上角打一个勾；还没得到的更淡 */
.care-sheet .pet-item.on::after { content: '✓'; position: absolute; top: -7px; left: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 900; line-height: 20px; text-align: center; }
.care-sheet .pet-item.lock { opacity: .42; border-style: dashed; }
.care-sheet .deco-view { top: 66px; }
.care-sheet .deco-ok { margin-top: 4px; }
.sheet.care-sheet.pet-ward { padding-top: 0; }
.pet-ward .care-tabs { position: static; }
/* 深色主题：小东西的图标是按浅色底画的（眼镜是深色的），给图标垫一块浅底才看得见 */
:is([data-theme="galaxy"], [data-theme="night"], [data-theme="custom"][data-cc="dark"]) .pet-ward .pet-item svg { background: #f4eff9; border-radius: 12px; }
/* 扔球（pet/ball.js）：球可以拖。手指按在球上拖的时候页面不跟着滚；拿起来的时候大一点点 */
/*   屋子是一幅画，里面的字不该能被选中：鼠标在屋里按住一拖（拖球、或者只是手滑），不会刷出一片蓝 */
.pet-room { -webkit-user-select: none; user-select: none; }
/*   display: block 不改变画出来的样子，但少了它手机上拖不动：SVG 里的 <g> 默认算“行内”，Chrome 对行内的东西不认 touch-action，
     手指一拖开它就当成“滚页面”，把这次拖动取消掉（球刚离手就掉了；鼠标没有这回事，所以电脑上看不出来） */
.pet-card .deco-ball { display: block; touch-action: none; cursor: grab; }
@media (hover: hover) { .pet-card .deco-ball:hover { filter: drop-shadow(0 2px 3px rgba(46, 42, 58, .35)); } }   /* 鼠标移上去：球浮起来一点，看得出能拿 */
.pet-card .deco-ball.held { cursor: grabbing; }
