@charset "UTF-8";
:root {
  color-scheme: light;
  --milk: #fff9ee;
  --paper: #fffdf6;
  --wall: #f5efdf;
  --warm-gray: #ece6db;
  --floor: #e5d7be;
  --yellow: #f1c74e;
  --yellow-soft: #f8e8aa;
  --ink: #433d34;
  --line: #655b4b;
  --muted: #857a68;
  --border: #d7cdbd;
  --green: #9aab7c;
  --blue: #b7c9ce;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--warm-gray); }
body { margin: 0; min-width: 300px; color: var(--ink); font-size: 14px; line-height: 1.55; }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button, a, input { touch-action: manipulation; }
button { border: 0; }
button:disabled { cursor: default; opacity: .45; }
button:not(:disabled):active { transform: scale(.96); }
button:focus-visible, a:focus-visible { outline: 3px solid #b29239; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible { outline: 2px solid #b29239; outline-offset: 2px; }
svg { display: block; width: 24px; height: 24px; flex-shrink: 0; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
h1, h2, h3, p { margin: 0; }
a { color: var(--line); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.muted { color: var(--muted); }
.app-shell {
  width: 100%; max-width: 480px; min-height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; background: var(--milk); overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 24px 13px; }
.identity { min-width: 0; }
.identity h1 { font-size: 25px; line-height: 1.25; font-weight: 650; letter-spacing: .035em; overflow-wrap: anywhere; }
.identity p { margin-top: 6px; font-size: 12px; color: var(--muted); }
.top-actions { display: flex; flex-shrink: 0; gap: 3px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 44px; border-radius: 50%; background: transparent; color: var(--line); transition: background .16s, transform .1s; }
.icon-btn:hover { background: var(--warm-gray); }
.icon-btn.selected { background: var(--yellow-soft); }
.icon-btn svg { width: 23px; height: 23px; }
.status-panel { padding: 0 24px 18px; }
.status-line { font-size: 13px; color: var(--line); min-height: 21px; margin-bottom: 12px; }
.needs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { min-width: 0; }
.metric-label { display: flex; align-items: baseline; justify-content: space-between; gap: 3px; margin-bottom: 5px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.metric-label span + span { font-size: 9px; color: #9a8d79; }
.metric-bar { height: 4px; overflow: hidden; border-radius: 10px; background: #e7dfcf; }
.metric-bar i { display: block; height: 100%; border-radius: inherit; background: #d9b957; transition: width .45s ease; }
.metric[data-metric="mood"] .metric-bar i, .metric[data-metric="cleanliness"] .metric-bar i { background: var(--green); }
.metric[data-metric="energy"] .metric-bar i { background: #a9bdc1; }
.metric.low .metric-bar i { background: #ce9d72; }
.scene-root { flex: 1; min-width: 0; position: relative; }
.room { height: clamp(340px, 46dvh, 430px); min-height: 340px; position: relative; overflow: hidden; background: var(--wall); isolation: isolate; }
.room-wall { position: absolute; inset: 0 0 34%; border-top: 1px solid #ece3d2; background: var(--wall); }
.room-wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: #ddd2bc; border-top: 1px solid #d2c4ad; }
.room-window { position: absolute; top: 29px; left: 15%; width: 88px; height: 102px; border: 6px solid #e2d3b6; border-radius: 42px 42px 4px 4px; background: #dae5d5; z-index: 1; }
.room-window::before { content: ""; position: absolute; left: 50%; top: 0; width: 4px; height: 100%; background: #e2d3b6; transform: translateX(-50%); }
.room-window::after { content: ""; position: absolute; left: -13px; right: -13px; bottom: -11px; height: 6px; border-radius: 3px; background: #cfb997; }
.wall-picture { position: absolute; right: 17%; top: 49px; width: 45px; height: 52px; border: 5px solid #d5c3a3; border-radius: 3px; background: #fff9e8; transform: rotate(3deg); }
.wall-picture::before { content: ""; position: absolute; top: 12px; left: 13px; width: 12px; height: 14px; border: 1.5px solid #b6b686; border-radius: 50% 50% 30% 30%; background: #d7d7a6; }
.wall-picture::after { content: ""; position: absolute; top: 20px; left: 9px; width: 17px; height: 11px; border-bottom: 1.5px solid #b6b686; border-radius: 50%; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: var(--floor); border-top: 1px solid #d5c5aa; }
.floor::before { content: ""; position: absolute; left: 7%; top: -64px; width: 59px; height: 67px; border: 1px solid #bba783; border-radius: 5px 5px 2px 2px; background: #d0bc96; box-shadow: inset 0 -22px #c7b089; }
.floor::after { content: ""; position: absolute; right: 5%; top: -10px; width: 79px; height: 51px; border: 2px solid #c5b796; border-radius: 10px 10px 3px 3px; background: #eee5ce; box-shadow: inset 0 14px #fbf5e6; }
.rug { position: absolute; bottom: 9%; left: 50%; width: 235px; height: 82px; transform: translateX(-50%); border-radius: 50%; background: #f6edd9; border: 2px solid #e4d7bb; z-index: 1; }
.rug::after { content: ""; position: absolute; inset: 8px 14px; border: 1px solid #e7dabe; border-radius: inherit; }
.room-caption { position: absolute; z-index: 6; left: 18px; right: 18px; bottom: 9px; font-size: 11px; color: #8f8069; text-align: center; pointer-events: none; }
.pet-anchor { position: absolute; z-index: 3; width: 240px; height: 270px; left: 50%; bottom: 16%; transform: translateX(-50%); display: grid; place-items: end center; }
.pet-anchor::after { content: ""; position: absolute; z-index: -1; bottom: 14px; width: 135px; height: 17px; border-radius: 50%; background: rgba(94, 79, 46, .12); }
.pet-target { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; background: transparent; border-radius: 46%; outline-offset: -12px; cursor: pointer; touch-action: pan-y; }
.pet-visual { width: 100%; position: relative; transform-origin: 50% 83%; animation: breathe 3.7s ease-in-out infinite; pointer-events: none; }
.pet-image { width: 100%; height: 270px; object-fit: contain; }
.pet-anchor[data-stage="baby"] .pet-visual, .pet-visual.baby { transform: scale(.82); }
.pet-anchor[data-stage="child"] .pet-visual, .pet-visual.child { transform: scale(.92); }
.pet-target.happy .pet-visual, .pet-target.is-happy .pet-visual, .pet-visual.bounce { animation: pet-hop .65s ease; }
.pet-target.eating .pet-visual, .pet-target.is-eating .pet-visual { animation: munch .25s ease-in-out 4; }
.pet-target.playing .pet-visual, .pet-target.is-playing .pet-visual { animation: pet-hop .65s ease 2; }
.pet-target.sleeping .pet-visual { animation: breathe 5.2s ease-in-out infinite; }
.room[data-mode="sleep"] { background: #dddccf; }
.room[data-mode="sleep"] .room-wall { background: #ddded4; }
.room[data-mode="sleep"] .room-window { background: #b4c5c6; border-color: #c5c2ae; }
.room[data-mode="sleep"] .floor { background: #d5cdb7; }
.room.is-dark::after, .room.lights-off::after { content: ""; position: absolute; inset: 0; z-index: 9; background: rgba(65, 69, 72, .25); pointer-events: none; }
.bubble { position: absolute; z-index: 7; top: 12px; left: 50%; transform: translateX(-50%); max-width: 220px; padding: 8px 14px; border: 1px solid #d7cdb9; border-radius: 18px; background: var(--paper); color: #665a45; font-size: 12px; line-height: 1.5; text-align: center; white-space: normal; }
.bubble::after { content: ""; position: absolute; left: calc(50% - 4px); bottom: -5px; width: 8px; height: 8px; background: var(--paper); border-right: 1px solid #d7cdb9; border-bottom: 1px solid #d7cdb9; transform: rotate(45deg); }
.room > .bubble { top: 131px; }
.pet-anchor .bubble { top: -5px; }
.pet-spark, .bath-bubble { position: absolute; pointer-events: none; z-index: 8; }
.pet-spark { font-size: 18px; color: #e8b934; animation: sparkle .65s ease both; }
.bath-bubble { width: 25px; height: 25px; border: 1px solid #c6d9dc; border-radius: 50%; background: rgba(255, 255, 255, .78); animation: bubble-rise .75s ease forwards; }
.play-ball { position: absolute; z-index: 5; bottom: 11%; width: 34px; height: 34px; border: 2px solid #b8a779; border-radius: 50%; background: #e7ce81; animation: ball-roll .7s ease both; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: #fff6d6; border: 1px solid #d8c78e; font-size: 28px; transform: translate(-50%, -50%); }
.drag-ghost svg { width: 32px; height: 32px; }
.tool-tray { padding: 13px 20px 14px; min-height: 109px; background: #fbf5e8; border-bottom: 1px solid #e9dfce; }
.room > .tool-tray { position: absolute; bottom: 0; left: 0; right: 0; z-index: 10; }
.instruction { color: var(--muted); font-size: 11px; text-align: center; margin-bottom: 10px; }
.tool-items { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tool-item { position: relative; min-width: 66px; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-direction: column; padding: 7px 9px; border: 1px solid transparent; border-radius: 12px; background: transparent; font-size: 10px; color: #796b56; touch-action: none; transition: background .16s, transform .1s; }
.tool-item svg { width: 27px; height: 27px; }
.tool-item .tool-art, .tool-item .emoji, .tool-item > span:first-child { font-size: 22px; line-height: 1; }
.tool-item.selected { background: #f9eab4; border-color: #dfcd8b; }
.tool-item.dragging { opacity: .5; }
.step-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.music-volume-control { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 14px auto; font-size: 14px; }
.music-volume-control input { flex: 1; min-width: 90px; accent-color: #b79b48; }
.music-volume-control output { min-width: 3ch; color: #80725c; }
.care-nav { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 15px 9px; gap: 6px; background: var(--milk); border-top: 1px solid #e8decf; }
.care-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 66px; gap: 5px; padding: 8px 5px; color: #82725b; background: transparent; border-radius: 14px; transition: background .16s, transform .1s; }
.care-nav button:hover { background: #f8edda; }
.care-nav button.selected, .care-nav button[aria-current="page"], .care-nav button.active { background: #f9eab7; color: #665022; }
.care-nav button.selected::after, .care-nav button.active::after { content: ""; position: absolute; bottom: 2px; width: 16px; height: 2px; border-radius: 2px; background: #ba9337; }
.care-icon svg { width: 27px; height: 27px; }
.care-label { font-size: 11px; letter-spacing: .08em; }
.primary-btn, .secondary-btn, .quiet-btn, .pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 11px 18px; border-radius: 12px; line-height: 1.4; font-size: 13px; transition: background .16s, transform .1s; }
.primary-btn { background: var(--yellow); color: #604d22; font-weight: 600; border: 1px solid #ddbd55; }
.primary-btn:hover { background: #eac043; }
.secondary-btn { background: #f4ede0; border: 1px solid var(--border); }
.secondary-btn:hover { background: #eae1d1; }
.quiet-btn { background: transparent; color: var(--muted); padding: 9px 11px; font-size: 12px; }
.quiet-btn:hover { background: #f1e9db; }
.pill-btn { min-height: 35px; padding: 7px 13px; border-radius: 20px; background: #efe6d3; font-size: 11px; border: 1px solid #e0d4bd; }
.primary-btn svg, .secondary-btn svg, .quiet-btn svg, .pill-btn svg { width: 17px; height: 17px; }
.page-scene { padding: 17px 24px 28px; min-height: 470px; background: var(--milk); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.page-header h2, .scene-heading { font-size: 19px; font-weight: 600; letter-spacing: .02em; }
.page-header p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.page-header .quiet-btn { flex-shrink: 0; }
.adoption-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 6px; padding: 28px 0 25px; margin-bottom: 17px; border-bottom: 1px solid #e2d5ba; background: #f6efdf; border-radius: 64% 64% 0 0 / 12% 12% 0 0; }
.candidate-card { position: relative; min-width: 0; display: flex; align-items: center; flex-direction: column; padding: 3px 2px 12px; background: transparent; border-radius: 18px; text-align: center; }
.candidate-card::before { content: ""; position: absolute; z-index: 0; width: 68px; height: 25px; top: 90px; border-radius: 50%; background: #e5d9bc; border: 1px solid #d8c8a6; }
.candidate-card.selected::before { background: #efd887; border-color: #ceb159; }
.candidate-card.selected::after { content: ""; position: absolute; bottom: 0; height: 3px; width: 22px; border-radius: 3px; background: #c7a54a; }
.candidate-card .mini-pet { z-index: 1; height: 114px; width: 106px; object-fit: contain; }
.candidate-card strong { margin-top: 3px; font-size: 12px; font-weight: 550; }
.candidate-card p, .candidate-card small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
.adoption-form { padding: 3px 0; }
.adoption-form label { display: block; font-size: 12px; margin-bottom: 8px; color: var(--line); }
input[type="text"], input:not([type]), textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fffdf6; padding: 12px 13px; min-height: 46px; }
input::placeholder { color: #aea18b; }
.adoption-form .primary-btn { width: 100%; margin-top: 12px; }
.adoption-form p, .adoption-note { margin-top: 10px; color: var(--muted); font-size: 11px; }
.map-board { position: relative; min-height: 337px; border-radius: 80px; background: #eeeede; overflow: hidden; margin-top: 12px; border: 1px solid #e4e1ce; }
.map-board::before { content: ""; position: absolute; left: 17%; top: 20%; width: 63%; height: 57%; border: 17px solid #fff6e1; border-radius: 50% 30% 48% 28%; transform: rotate(-15deg); }
.map-board::after { content: ""; position: absolute; left: 7%; top: 11%; width: 35px; height: 54px; border-radius: 50%; background: #c6d1a8; box-shadow: 219px 187px #c6d1a8, 10px 203px #c6d1a8; }
.map-node { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; width: 116px; min-height: 98px; padding: 8px; background: transparent; border-radius: 24px; color: #726744; font-size: 12px; }
.map-node svg { width: 54px; height: 54px; padding: 7px; stroke-width: 1.4; background: #fff8e8; border: 1px solid #d8cfb4; border-radius: 17px; margin-bottom: 8px; }
.map-node:nth-child(1) { left: 11%; top: 48%; }
.map-node:nth-child(2) { right: 9%; top: 15%; }
.map-node:nth-child(3) { right: 8%; bottom: 8%; opacity: .6; }
.map-node.selected svg { background: #f5e3a9; }
.garden-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 7px; padding-top: 17px; }
.companion-card { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0 1px 10px; border-radius: 13px; background: transparent; text-align: center; }
.companion-card:hover { background: #f5edde; }
.companion-card .mini-pet { width: 115px; height: 127px; object-fit: contain; }
.companion-card .zodiac-sprite { width: 102px; height: 114px; margin: 7px 0 6px; }
.companion-card strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.companion-card small, .companion-card p { margin-top: 4px; font-size: 10px; color: var(--muted); }
.mini-pet { flex-shrink: 0; }
.zodiac-sprite { display: block; position: relative; overflow: hidden; flex-shrink: 0; width: 190px; height: 220px; background-image: url("assets/zodiac-atlas.png"); background-repeat: no-repeat; background-color: #fffdf6; border-radius: 26%; }
.zodiac-sprite img { position: absolute; max-width: none; }
.empty-state { padding: 45px 18px; text-align: center; color: var(--muted); }
.empty-state svg { width: 55px; height: 55px; color: #b9aa89; margin: 0 auto 15px; }
.empty-state h3 { color: var(--line); font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.empty-state p { font-size: 12px; line-height: 1.9; }
.empty-state .primary-btn { margin-top: 20px; }
.demo-strip { padding: 12px 22px 14px; border-top: 1px dashed #ddd1ba; background: #f5efdf; color: #8a7d64; font-size: 10px; }
.demo-strip summary { cursor: pointer; padding: 3px 0; font-size: 11px; }
.demo-strip p { margin: 6px 0 9px; line-height: 1.7; }
.demo-strip button { min-height: 30px; padding: 5px 9px; background: #e9dfcb; border-radius: 8px; font-size: 10px; margin: 3px 3px 3px 0; }
.demo-strip .demo-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(60, 52, 38, .22); padding: 20px 12px 0; }
.sheet { position: relative; width: 100%; max-width: 456px; max-height: 85dvh; overflow-y: auto; background: var(--paper); border: 1px solid #ded4bf; border-bottom: 0; border-radius: 24px 24px 0 0; padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px)); animation: sheet-enter .22s ease both; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
.sheet-head h2, .sheet-head h3 { font-size: 20px; font-weight: 600; }
.sheet-head .icon-btn { width: 30px; height: 30px; margin: -4px -7px 0 0; }
.sheet-body { font-size: 13px; line-height: 1.85; }
.sheet-body p + p { margin-top: 12px; }
.sheet-body input { margin: 10px 0; }
.sheet-body label { display: block; }
.sheet-body .mini-pet { width: 150px; height: 170px; margin: 0 auto 12px; }
.sheet-body .zodiac-sprite { margin: 0 auto 14px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 21px; }
.sheet-actions > button { flex: 1; }
.sheet-actions .quiet-btn { flex-basis: 100%; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #ebe1ce; }
.settings-row input[type="checkbox"] { accent-color: #c5a240; width: 18px; height: 18px; }
.share-card { margin: 16px 0; padding: 22px 20px; border: 1px solid var(--border); border-radius: 17px; background: var(--milk); text-align: center; }
.share-card canvas, .share-card img { max-width: 100%; height: auto; margin: 0 auto; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); max-width: min(320px, calc(100vw - 40px)); padding: 9px 17px; border-radius: 20px; background: #6a604d; color: #fffaf0; font-size: 12px; text-align: center; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; pointer-events: none; }
.toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.018 1.006; } }
@keyframes pet-hop { 0%, 100% { translate: 0 0; scale: 1; } 30% { translate: 0 -15px; scale: .98 1.02; } 60% { translate: 0 0; scale: 1.04 .96; } }
@keyframes munch { 0%, 100% { scale: 1; } 50% { scale: 1.025 .98; } }
@keyframes sparkle { from { opacity: 0; translate: 0 4px; } 30% { opacity: 1; } to { opacity: 0; translate: 0 -25px; } }
@keyframes bubble-rise { from { opacity: .85; scale: .8; } to { opacity: 0; translate: 0 -20px; scale: 1.2; } }
@keyframes ball-roll { 0% { left: 25%; rotate: 0deg; } 50% { bottom: 16%; } 100% { left: 72%; rotate: 240deg; } }
@keyframes sheet-enter { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 600px) {
  body { padding: 28px 0; }
  .app-shell { min-height: 800px; border: 1px solid #ddd3c0; border-radius: 28px; }
  .topbar { padding-top: 25px; }
  .room { height: 410px; }
  .modal-backdrop { align-items: center; padding: 30px; }
  .sheet { border-bottom: 1px solid #ded4bf; border-radius: 24px; max-height: 85dvh; }
}
@media (max-width: 350px) {
  .topbar { padding-left: 17px; padding-right: 17px; }
  .status-panel { padding-left: 17px; padding-right: 17px; }
  .top-actions { gap: 0; }
  .icon-btn { width: 36px; }
  .needs-grid { gap: 10px; }
  .page-scene { padding-left: 17px; padding-right: 17px; }
  .pet-anchor { width: 218px; }
  .room-window { left: 12%; }
  .wall-picture { right: 14%; }
  .tool-tray { padding-left: 12px; padding-right: 12px; }
  .care-nav { padding-left: 9px; padding-right: 9px; }
}
@media (max-height: 700px) and (max-width: 599px) {
  .topbar { padding-top: 17px; padding-bottom: 11px; }
  .status-panel { padding-bottom: 14px; }
  .room { height: 325px; min-height: 325px; }
  .pet-anchor { height: 242px; width: 216px; bottom: 13%; }
  .pet-image { height: 242px; }
  .room > .bubble { top: 116px; }
  .care-nav { padding-top: 6px; padding-bottom: 5px; }
  .care-nav button { min-height: 59px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Match the shared scene DOM and keep controls comfortable on touch screens. */
.metric { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 4px; }
.metric-label { display: block; margin: 0; }
.metric-value { font-size: 10px; color: var(--muted); }
.metric-bar { display: block; grid-column: 1 / -1; margin-top: 6px; height: 4px; }
.icon-btn, .sheet-head .icon-btn { width: 44px; min-width: 44px; height: 44px; }
.primary-btn, .secondary-btn, .pill-btn, .quiet-btn, .demo-strip button { min-height: 44px; }
.mini-pet .pet-image { height: 100%; }
.page-header { flex-wrap: wrap; }
.page-header h2 { flex: 1; }
.page-header > p { width: 100%; }
.pet-visual.stage-baby { transform: scale(.72, .64); }
.pet-visual.stage-young { transform: scale(.84, .82); }
.pet-visual.stage-grown { transform: scale(.94, .96); }
.pet-visual.stage-mature { transform: scale(1, 1.08); }
.pet-visual[data-expression] { transition: transform .8s ease; }
.pet-visual.animate-happy, .pet-visual.animate-play, .pet-visual.animate-grow { animation: pet-hop .65s ease 1; }
.pet-visual.animate-eat { animation: munch .25s ease-in-out 4; }
.pet-visual.sleeping { animation: breathe 5.2s ease-in-out infinite; }
.room[data-mode='bath'] .pet-target { touch-action: none; }
.room > .bath-bubble { left: 40%; top: 56%; width: auto; height: auto; animation: none; color: #96b2b8; font-size: 28px; background: transparent; border: 0; }
.room-caption { display: flex; justify-content: center; gap: 12px; }
.room > .bubble { top: 22px; }
.pet-anchor { bottom: 12%; }
.pet-anchor::after { bottom: 36px; }
.map-coming { position: absolute; bottom: 14px; left: 14px; right: 14px; text-align: center; }
canvas.share-card { display: block; width: 100%; height: auto; padding: 0; }
.sheet-body .mini-pet:has(.zodiac-sprite) { height: auto; }
.candidate-active { animation: candidate-hop 3.2s ease-in-out infinite; }
.candidate-curious { animation: candidate-peek 5s ease-in-out infinite; }
.candidate-relaxed { animation: breathe 6s ease-in-out infinite; }
.candidate-affectionate { animation: candidate-peek 7s ease-in-out infinite; }
@keyframes candidate-hop { 0%, 76%, 100% { translate: 0 0; } 84% { translate: 0 -7px; } 92% { translate: 0 -3px; } }
@keyframes candidate-peek { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -3deg; } 88% { rotate: 3deg; } }
@media (max-width: 350px) { .topbar { gap: 8px; } .identity h1 { font-size: 22px; } .top-actions { gap: 0; } }

/* v2 sprites share a visible silhouette and baseline, measured without editing PNGs.
   Percentages derive from expression-regions.json (alpha >= 32). */
.room .pet-visual { height: 100%; }
.pet-visual[data-expression] { transform-origin: 50% 92%; }
.pet-visual[data-expression] .pet-image {
  position: absolute; width: var(--sprite-width); height: var(--sprite-height);
  left: var(--sprite-left); bottom: 8%; object-fit: fill;
  transform: translateY(var(--sprite-baseline)); max-width: none;
}
.pet-visual[data-expression="neutral"] { --sprite-width: 105.47511%; --sprite-height: 88.64807%; --sprite-left: -2.20814%; --sprite-baseline: 8.14815%; }
.pet-visual[data-expression="hungry"] { --sprite-width: 107.41935%; --sprite-height: 89.24541%; --sprite-left: -3.41935%; --sprite-baseline: 8.31960%; animation: need-sway 5.4s ease-in-out infinite; }
.pet-visual[data-expression="lonely"] { --sprite-width: 101.96532%; --sprite-height: 90.47876%; --sprite-left: -.64971%; --sprite-baseline: 8.80062%; animation: need-sway 7s ease-in-out infinite; }
.pet-visual[data-expression="happy-response"] { --sprite-width: 94.14807%; --sprite-height: 85.87311%; --sprite-left: 2.96350%; --sprite-baseline: 9.72887%; }
.pet-visual[data-expression="curious"] { --sprite-width: 97.18837%; --sprite-height: 89.19665%; --sprite-left: 1.83208%; --sprite-baseline: 6.45933%; }
.pet-visual[data-expression="affectionate"] { --sprite-width: 93.08041%; --sprite-height: 86.74669%; --sprite-left: 3.90515%; --sprite-baseline: 4.30622%; }
.pet-visual[data-expression="drowsy"] { --sprite-width: 94.64151%; --sprite-height: 87.36885%; --sprite-left: 2.98113%; --sprite-baseline: 7.97448%; animation: sleepy-nod 6.5s ease-in-out infinite; }
.pet-visual[data-expression="asleep"] { --sprite-width: 98.03257%; --sprite-height: 90.13953%; --sprite-left: 1.10098%; --sprite-baseline: 9.01116%; }
.pet-visual.animate-mouth { animation: mouth-ready .45s ease 1; }
.pet-visual.animate-munch { animation: munch .22s ease-in-out 2; }
.pet-visual.animate-happy, .pet-visual.animate-grow { animation: pet-hop .65s ease 1; }
.pet-visual.animate-look { animation: curious-look .6s ease 1; }
.pet-visual.animate-lean { animation: gentle-lean 1.6s ease 1; }
.pet-visual.animate-slow { animation: sleepy-nod 6.5s ease-in-out infinite; }
.pet-visual.animate-bath { animation: bath-shrink 1.6s ease 1; }
.pet-visual.animate-play { animation: toy-chase .85s ease 1; }
.pet-visual.animate-wake { animation: waking-stretch 1.5s ease 1; }
.pet-visual.animate-hatch { animation: hatch-wiggle 1.1s ease 1; }
.pet-visual.sleeping, .pet-visual[data-expression="asleep"], .pet-visual.animate-sleep { animation: breathe 5.6s ease-in-out infinite; }
.pet-visual.sleeping.animate-lean { animation: sleeping-pat 1.6s ease 1; }
.pet-visual.sleeping.animate-sleep-touch { animation: sleeping-pat .9s ease 1; }
.room .pet-anchor::after { bottom: 8%; }
.room .pet-spark { top: 20%; right: 18%; }
.demo-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-strip #clock-label { flex: 1; min-width: 0; line-height: 1.6; overflow-wrap: anywhere; }
.demo-strip > button { flex: 0 0 auto; white-space: nowrap; margin: 0; }
.companion-character { display: flex; align-items: flex-end; justify-content: center; padding: 0; background: transparent; border-radius: 45%; min-width: 44px; min-height: 44px; }
@keyframes need-sway { 0%, 72%, 100% { rotate: 0deg; } 82% { rotate: -1deg; } 92% { rotate: 1deg; } }
@keyframes sleepy-nod { 0%, 64%, 100% { rotate: 0deg; scale: 1; } 78% { rotate: 1deg; scale: 1.007 .993; } }
@keyframes mouth-ready { 0%, 100% { scale: 1; } 50% { scale: .985 1.015; translate: 0 -2px; } }
@keyframes curious-look { 0%, 100% { rotate: 0deg; } 45% { rotate: -3deg; } }
@keyframes gentle-lean { 0%, 100% { rotate: 0deg; translate: 0 0; } 40%, 65% { rotate: 3deg; translate: 4px 0; } }
@keyframes bath-shrink { 0%, 100% { scale: 1; } 30% { scale: 1.015 .985; } 65% { scale: .99 1.01; } }
@keyframes toy-chase { 0%, 100% { translate: 0 0; rotate: 0deg; } 35% { translate: 7px -7px; rotate: 3deg; } 70% { translate: -3px 0; rotate: -2deg; } }
@keyframes waking-stretch { 0%, 100% { scale: 1; rotate: 0deg; } 35% { scale: .975 1.025; } 65% { rotate: -2deg; } }
@keyframes hatch-wiggle { 0%, 100% { rotate: 0deg; } 20%, 60% { rotate: -4deg; } 40%, 80% { rotate: 4deg; } }
@keyframes sleeping-pat { 0%, 100% { scale: 1; } 45% { scale: 1.006 .995; } }

/* Approved material set: source PNGs stay intact; backgrounds retain their ratio. */
.art-sprite { display: block; flex-shrink: 0; aspect-ratio: 1; background-repeat: no-repeat; background-position: var(--art-x) var(--art-y); }
.art-prop { background-image: url('assets/textured-v1/props-atlas-v2.png'); background-size: 300% 400%; width: 60px; height: 60px; }
.art-icon { background-image: url('assets/textured-v1/buttons-atlas.png'); background-size: 400% 200%; width: 44px; height: 44px; }
.textured-room { container-type: size; height: auto; aspect-ratio: 1122 / 1402; background: #aec5ad; }
.room-backdrop { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 65%; pointer-events: none; }
.room-title { position: absolute; top: 15px; left: 13px; z-index: 6; padding: 6px 12px; border: 1px solid #fff9e3; border-radius: 16px; background: #fff9e8eb; color: #3d6148; font-size: 12px; font-weight: 600; }
.room-clock { position: absolute; top: 15px; right: 13px; z-index: 6; padding: 6px 12px; border: 1px solid #fff5d6; border-radius: 16px; background: #fff9eceb; color: #3d6148; font-size: 12px; font-variant-numeric: tabular-nums; }
.textured-room[data-time-of-day="night"] .room-clock { background: #385867; color: #fff7df; border-color: #758f9a; }
.textured-room .pet-anchor, .textured-room .bed-quilt, .textured-room > .bath-bubble, .textured-room .scene-object, .textured-room .scene-hotspot {
  --render-height: max(100cqh, calc(100cqw * 1402 / 1122));
  --render-width: max(100cqw, calc(100cqh * 1122 / 1402));
  --foot-left: calc(var(--pet-foot-x, .5) * var(--render-width) + (100cqw - var(--render-width)) * .5);
  --foot-top: calc(var(--pet-foot-y, .72) * var(--render-height) + (100cqh - var(--render-height)) * .65);
}
.textured-room .pet-anchor {
  --frame-width: clamp(205px, 61.5cqw, 240px);
  width: var(--frame-width); height: calc(var(--frame-width) * 1.125);
  left: var(--foot-left); top: var(--foot-top); bottom: auto;
  transform: translate(-50%, -92%);
}
.textured-room .pet-anchor::after { left: 50%; width: 55%; height: 5%; bottom: 8%; transform: translateX(-50%); background: #392e1940; filter: blur(3px); }
.textured-room[data-scene="feed"] .pet-anchor { clip-path: inset(0 0 11%); }
.textured-room[data-scene="feed"] .pet-anchor::after { display: none; }
.textured-room[data-time-of-day="night"] .pet-image { filter: brightness(.86) saturate(.9); }
.textured-room[data-time-of-day="night"] .art-prop, .textured-room[data-time-of-day="night"] .object-image { filter: brightness(.9) saturate(.9); }
.textured-room.is-dark::after { display: none; }
/* Light-off dims the complete room artwork, pet and original quilt together.
   Interface controls remain readable, and the shade never captures touches. */
.textured-room.lights-off::after { display: block; z-index: 5; background: rgba(7, 13, 28, .72); }
.textured-room > .bubble { top: 77px; box-shadow: 0 3px 9px #65543012; }
.textured-room .room-caption { left: 50%; right: auto; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; padding: 4px 11px; border-radius: 15px; background: #fff9e7e0; color: #4f654d; font-size: 10px; gap: 10px; white-space: nowrap; }
.textured-room[data-scene="sleep"][data-sleep-resting="true"] .pet-anchor { --bed-frame-width: clamp(120px, 34cqw, 148px); --frame-width: var(--bed-frame-width); }
.textured-room[data-scene="sleep"][data-sleep-resting="true"] .pet-anchor::after { display: none; }
.bed-rest-pose { width: 100%; height: 100%; rotate: 30deg; transform-origin: 50% 92%; pointer-events: none; }
.bed-rest-pose .pet-visual.stage-baby { transform: scale(.82); }
.bed-rest-pose .pet-visual.stage-young { transform: scale(.92); }
.bed-rest-pose .pet-visual.stage-grown, .bed-rest-pose .pet-visual.stage-mature { transform: scale(1); }
/* Occlude the body with the quilt already painted in the same bedroom PNG.
   Match cover projection exactly, including responsive cropping and day/night. */
.bed-quilt { position: absolute; z-index: 4; width: var(--render-width); height: var(--render-height); max-width: none; left: calc((100cqw - var(--render-width)) * .5); top: calc((100cqh - var(--render-height)) * .65); pointer-events: none; clip-path: polygon(68.8% 39.2%, 71.6% 36.8%, 76.4% 35.3%, 82.9% 34.3%, 90.9% 34%, 100% 34.7%, 100% 100%, 64.8% 100%, 64.8% 51%); }
.bedroom-curtains { --render-height: max(100cqh, calc(100cqw * 1402 / 1122)); --render-width: max(100cqw, calc(100cqh * 1122 / 1402)); position: absolute; z-index: 1; width: var(--render-width); height: var(--render-height); left: calc((100cqw - var(--render-width)) * .5); top: calc((100cqh - var(--render-height)) * .65); pointer-events: none; }
.curtain-panel { position: absolute; top: 3.6%; height: 32%; width: 20.3%; opacity: 0; transform: scaleX(.06); transition: transform .65s ease, opacity .3s ease; border-radius: 4px 4px 10px 10px; background: repeating-linear-gradient(90deg, #a9462d 0%, #da6845 10%, #f39362 20%, #c85a38 30%, #a84930 40%); box-shadow: inset 0 2px 3px #ffb78c80, inset 0 -4px 4px #843f283b, 3px 4px 6px #47332040; }
.curtain-left { left: 4.2%; transform-origin: left center; }
.curtain-right { left: 24.4%; transform-origin: right center; }
.curtain-panel::before { content: ''; position: absolute; inset: 8% 5%; opacity: .45; background-image: radial-gradient(ellipse at 45% 34%, #ffe2a3 0 12%, transparent 15%), radial-gradient(ellipse at 66% 47%, #ffe2a3 0 10%, transparent 13%), radial-gradient(ellipse at 37% 59%, #ffe2a3 0 9%, transparent 12%); background-size: 38px 58px; }
.curtains-closed .curtain-panel { opacity: 1; transform: scaleX(1); }
.textured-room[data-time-of-day="day"].curtains-closed .room-backdrop, .textured-room[data-time-of-day="day"].curtains-closed .bed-quilt { filter: brightness(.72) saturate(.9); transition: filter .65s ease; }
.textured-room[data-time-of-day="day"].curtains-closed .pet-image { filter: brightness(.85) saturate(.95); }
.window-hotspot { z-index: 2; }
.textured-room > .bath-bubble { left: 50%; top: calc(var(--foot-top) - 12cqh); transform: translateX(-50%); z-index: 5; color: #f8ffff; text-shadow: 0 1px 4px #537c7880; }
.textured-room .play-ball {
  z-index: 2;
  --render-height: max(100cqh, calc(100cqw * 1402 / 1122));
  --render-width: max(100cqw, calc(100cqh * 1122 / 1402));
  width: 56px; height: 56px;
  left: calc(var(--object-x, .5) * var(--render-width) + (100cqw - var(--render-width)) * .5);
  top: calc(var(--object-y, .675) * var(--render-height) + (100cqh - var(--render-height)) * .65);
  bottom: auto; transform: translate(-50%, -100%); border: 0; background: transparent; animation: none;
}
.play-ball > .art-prop { width: 100%; height: 100%; }
.play-ball.thrown { animation: material-toss .85s ease-out forwards; }
.tool-item .tool-art { display: block; width: 60px; height: 60px; }
.tool-art > .art-prop, .tool-art > .art-icon { width: 100%; height: 100%; }
.tool-item.selected { border-color: #bcba8c; background: #f4f5dc; }
.drag-ghost { width: 66px; height: 66px; }
.drag-ghost > .art-prop, .drag-ghost > .art-icon { width: 100%; height: 100%; }
.drag-ghost:has(> .art-prop, > .art-icon, > .object-image) { border: 0; background: transparent; filter: drop-shadow(0 3px 3px #483b2540); }
.drag-ghost > .object-image { width: 100%; height: 100%; object-fit: contain; }
.top-actions .art-icon { width: 42px; height: 42px; }
.quiet-btn .art-icon, .map-node .art-icon { width: 26px; height: 26px; }
.map-node .art-icon { width: 58px; height: 58px; }
.care-nav { background: #fffaf0; }
.care-nav .care-icon, .care-nav .care-icon .art-icon { width: 60px; height: 60px; }
.care-nav button { gap: 0; padding: 3px 4px 5px; }
.care-nav button[aria-current="page"] { background: #edf3da; color: #285c42; }
.care-nav button:hover { background: #f0f4e1; }
@keyframes material-toss { 0% { translate: -18px -30px; rotate: -12deg; } 45% { translate: -6px -18px; rotate: 4deg; } 100% { translate: 0 0; rotate: 0deg; } }

/* Care objects use the same source-image coordinates as the room artwork. */
.scene-object, .scene-hotspot {
  --object-width: max(44px, calc(var(--object-size, .17) * var(--render-width)));
  --object-left: calc(var(--object-x) * var(--render-width) + (100cqw - var(--render-width)) * .5);
  --object-top: calc(var(--object-y) * var(--render-height) + (100cqh - var(--render-height)) * .65);
  position: absolute; z-index: 5; width: var(--object-width); height: var(--object-width);
  left: clamp(calc(var(--object-width) * .5 + 4px), var(--object-left), calc(100cqw - var(--object-width) * .5 - 4px));
  top: var(--object-top); padding: 0; background: transparent; border: 0;
  transform: translate(-50%, -100%); touch-action: none;
}
.scene-object > .art-prop, .scene-object > .object-image { width: 100%; height: 100%; object-fit: contain; }
.scene-object:not(.scene-hotspot) { filter: drop-shadow(0 3px 2px #403a2826); }
.scene-object:disabled { opacity: 1; }
.scene-object[aria-pressed="true"] { cursor: grabbing; }
.scene-object.dragging { opacity: .4; }
.scene-object:not(:disabled):active { transform: translate(-50%, -100%); scale: .96; }
.scene-hotspot { transform: translate(-50%, -50%); border-radius: 35%; }
.scene-hotspot:not(:disabled):active { transform: translate(-50%, -50%); scale: 1; }
.bed-hotspot { z-index: 2; }
.scene-hotspot:focus-visible { outline-offset: 1px; background: #fff9e822; }
.scene-hint { position: absolute; z-index: 6; left: 13px; right: 13px; bottom: 40px; pointer-events: none; text-align: center; color: #314f3a; font-size: 11px; text-shadow: 0 1px 3px #fffce9, 0 0 6px #fffce9; }
.room-actions { position: absolute; z-index: 6; left: 13px; top: 65px; display: flex; gap: 6px; flex-direction: column; }
.scene-control { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 5px 9px; border-radius: 16px; font-size: 11px; color: #3d6148; background: #fff9e8e0; }
.scene-control svg { width: 17px; height: 17px; }
.sleep-return { position: absolute; z-index: 6; left: 50%; bottom: 80px; transform: translateX(-50%); }
.sleep-return:not(:disabled):active { transform: translateX(-50%); scale: .96; }
.rug-target { opacity: 0; border-radius: 50%; pointer-events: none; }

/* Visible milestones and body proportions carry the original growth design. */
.growth-journey { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 11px; color: #9c917b; }
.growth-journey > span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #d9d0b8; vertical-align: 1px; }
.growth-journey > span[aria-current="step"] { color: #4b714a; font-weight: 700; }
.growth-journey > span[aria-current="step"]::before { background: #9eb06b; box-shadow: 0 0 0 3px #e9edcf; }
.growth-journey > i { font-style: normal; color: #c1b89f; }
.growth-journey > strong { margin-left: auto; color: #867348; font-size: 10px; font-weight: 500; }
.soap-prop { filter: drop-shadow(0 3px 2px #3c55454d) !important; }
.soap-prop[aria-pressed="true"] { filter: drop-shadow(0 0 5px #eaf9c9) !important; }
.sleep-recovery { margin: 8px 0 0; color: #637d6a; font-size: 10px; line-height: 1.5; }
.metric.is-recovering .metric-value::after { content: ' ↑'; color: #648d73; }
.metric.is-recovering .metric-bar i { background: linear-gradient(100deg, #a9bdc1 15%, #dcece1 45%, #91b5a0 70%); background-size: 220% 100%; animation: energy-recover 2.8s linear infinite; }
@keyframes energy-recover { to { background-position: -220% 0; } }
.pet-visual > .bath-foam { position: absolute; left: 14%; top: 53%; width: 72%; height: 30%; z-index: 2; transform: none; border: 0; border-radius: 0; background: none; animation: none; pointer-events: none; filter: drop-shadow(0 2px 2px #7eacba40); }
.foam-puff { position: absolute; left: var(--foam-x); top: var(--foam-y); width: var(--foam-size); aspect-ratio: 1; transform: translate(-50%, -50%); border: 1px solid #effcffe6; border-radius: 48%; background: radial-gradient(circle at 30% 25%, #fff 5%, #f4fcff 43%, #dceef2 78%, #c8e2e7 100%); box-shadow: inset -2px -2px 4px #8fc4d32b, inset 2px 2px 3px #fff; animation: foam-wobble 2.1s ease-in-out infinite; animation-delay: var(--foam-delay); }
.foam-puff::after { content: ''; position: absolute; width: 27%; height: 14%; left: 20%; top: 17%; border-radius: 50%; background: #fff; rotate: -30deg; }
.pet-visual > .bath-foam[data-rinsing="true"] { animation: foam-rinse 1.4s ease-out forwards; }
@keyframes foam-wobble { 0%, 100% { translate: 0 0; scale: 1; } 50% { translate: 0 -2px; scale: 1.04 .97; } }
@keyframes foam-rinse { to { translate: 0 24px; opacity: 0; scale: .85; } }

/* A small pantry economy: food lives on the table, and is earned on the map. */
.food-art { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.food-object > .food-stock { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); white-space: nowrap; font-size: 9px; font-weight: 500; color: #514b38; text-shadow: 0 1px 2px #fffdf7, 0 0 4px #fffdf7; }
.food-stock b { display: inline-block; min-width: 19px; padding: 0 3px; border-radius: 7px; color: #4b6b45; background: #fff9dfed; font-size: 10px; font-variant-numeric: tabular-nums; }
.food-object.out-of-stock > .art-prop, .food-object.out-of-stock > .food-art { opacity: .24; filter: saturate(.25); }
.food-object.out-of-stock .food-stock { color: #827a67; }
.textured-room[data-scene="feed"] .scene-hint { bottom: 32px; }
.drag-ghost > .food-art { width: 100%; height: 100%; }
.drag-ghost:has(> .food-art) { background: transparent; border: 0; }
.food-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 22px 12px; gap: 18px 8px; border-radius: 38px; }
.food-map .map-node:nth-child(n) { position: relative; inset: auto; width: auto; min-width: 0; min-height: 135px; opacity: 1; }
.food-map .map-node > .food-art { width: 82px; height: 82px; padding: 0; border: 0; border-radius: 0; background: none; margin-bottom: 0; }
.food-map .map-food { background: #fff9e6a6; box-shadow: 0 3px 0 #d8dcbe; }
.map-node small { font-size: 10px; color: #7b8163; margin-top: 3px; }
.food-game { padding: 12px 16px 22px; background: radial-gradient(ellipse at 50% 0, #fff4d6, #faf6e9 65%); }
.food-game-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #8b805c; font-size: 10px; letter-spacing: .04em; }
.food-game-heading .quiet-btn { padding: 8px 4px; }
.food-game > h2 { text-align: center; font-size: 24px; font-weight: 650; color: #5f704d; margin: 5px 0 2px; letter-spacing: .12em; }
.food-game-intro { text-align: center; font-size: 11px; color: #9a8763; margin-bottom: 18px; }
.food-round-stats { display: flex; justify-content: space-between; gap: 8px; padding: 0 8px 11px; font-size: 11px; color: #8b7c59; }
.food-round-stats b { font-size: 22px; color: #5c7955; font-weight: 650; font-variant-numeric: tabular-nums; margin: 0 2px; }
.match-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 9px; border: 1px solid #c4cfb1; border-radius: 22px; background: #dbe3c8; box-shadow: 0 5px 0 #b4c2a0, inset 0 2px 3px #f6faef; touch-action: none; }
.match-tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 2px; border-radius: 12px; border: 1px solid #fffaf1; background: #fff7e4; box-shadow: 0 2px 0 #aeb99970; transition: transform .16s ease, background .16s; touch-action: none; }
.match-tile > .art-prop, .match-tile > .food-art { width: 100%; height: 100%; }
.match-tile.tile-berry { background: #ffebe3; }
.match-tile.tile-banana { background: #fff2c5; }
.match-tile.tile-carrot { background: #eff1d7; }
.match-tile.tile-milk { background: #eff8ef; }
.match-tile.tile-rice { background: #f4f5f0; }
.match-tile.tile-bread { background: #fcead2; }
.match-tile:disabled { opacity: 1; cursor: default; }
.match-tile.is-selected { background: #f5d974; box-shadow: inset 0 0 0 2px #c6a143, 0 2px 0 #aa9859; transform: translateY(-2px); }
.match-tile.is-hint { outline: 2px solid #c49630; outline-offset: -2px; animation: food-hint 1s ease-in-out infinite; }
.match-tile.is-clearing { animation: food-collect .36s ease forwards; }
.food-match-message { min-height: 36px; margin: 14px 0 2px; padding: 0 5px; color: #628159; font-size: 11px; text-align: center; }
.food-game-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.food-game-controls > span { font-size: 10px; color: #928167; }
.food-game-controls .secondary-btn, .food-game-controls .primary-btn { padding: 8px 14px; font-size: 11px; }
.food-game-controls .primary-btn:disabled { background: #e6e2d3; color: #948b76; box-shadow: none; cursor: default; }
.food-unlock-note { margin: 10px 0 0; text-align: center; color: #8e7a5a; font-size: 10px; font-variant-numeric: tabular-nums; }
.food-map [data-food-status] { color: #55714d; font-weight: 600; }
.food-map [data-food-cooldown] { font-size: 9px; color: #98855f; }
.food-harvest { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 3px; margin-top: 19px; padding-top: 10px; border-top: 1px dashed #dacdaf; }
.harvest-item { display: flex; align-items: center; flex-direction: column; min-width: 0; color: #9c927c; font-size: 9px; }
.harvest-item > .food-art, .harvest-item > .art-prop { width: 37px; height: 37px; opacity: .6; }
.harvest-item.has-food > .food-art, .harvest-item.has-food > .art-prop { opacity: 1; }
.harvest-item > span:not(.art-prop) { white-space: nowrap; }
.harvest-item strong { font-size: 12px; color: #69905a; }
.food-save-note { font-size: 9px; color: #9c917a; text-align: center; margin-top: 13px; }
@keyframes food-collect { 35% { transform: scale(1.13); filter: brightness(1.15); } to { transform: scale(.25); opacity: 0; } }
@keyframes food-hint { 50% { transform: translateY(-2px); } }
@media (max-width: 350px) {
  .food-game { padding-left: 10px; padding-right: 10px; }
  .match-board { padding: 6px; gap: 4px; border-radius: 17px; }
  .match-tile { border-radius: 9px; }
  .food-game-controls > span { max-width: 160px; }
  .food-game-heading > span { font-size: 9px; }
  .harvest-item { font-size: 8px; }
}

/* Ball and blocks move independently while the pet keeps its grounded anchor. */
.textured-room[data-play-kind] .pet-anchor { translate: var(--pet-play-x, 0px) var(--pet-play-y, 0px); transition: translate .10s linear; }
.textured-room[data-play-kind] .pet-visual { animation: none; rotate: var(--play-lean, 0deg); scale: 1; translate: 0 0; }
.textured-room[data-play-kind="ball"] > .bubble { visibility: hidden; }
.textured-room[data-play-kind="ball"] .scene-object[data-item="ball"], .textured-room[data-play-kind="blocks"] .scene-object[data-item="blocks"] { visibility: hidden; }
.play-activity { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.activity-ball { position: absolute; width: 52px; height: 52px; padding: 0; background: transparent; border-radius: 50%; transform: translate(-50%, -100%); pointer-events: auto; filter: drop-shadow(0 4px 3px #3e402c30); transition: left .10s linear, top .10s linear; }
.activity-ball > .art-prop { width: 100%; height: 100%; }
.activity-ball:not(:disabled):active { transform: translate(-50%, -100%); }
.ball-contact { position: absolute; color: #fffad2; font-size: 28px; text-shadow: 0 1px 3px #997544; transform: translate(-50%, -50%); }
.block-build { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; background: transparent; overflow: visible; pointer-events: auto; }
.block-build:not(:disabled):active { transform: none; }
.build-block { --block-color: #88c7a6; --block-dark: #609c87; --block-light: #b4dfc2; position: absolute; display: block; width: 36px; height: 29px; transform: translate(-50%, -100%); filter: drop-shadow(0 3px 2px #30463236); pointer-events: auto; transition: left .10s linear, top .10s linear, rotate .10s linear; }
.build-block[data-block-index="1"] { --block-color: #ee9d91; --block-dark: #ca766f; --block-light: #ffc5b5; width: 33px; }
.build-block[data-block-index="2"] { --block-color: #efc76b; --block-dark: #c19a46; --block-light: #ffe29b; width: 29px; }
.block-front { position: absolute; inset: 0; border-radius: 4px; background: repeating-linear-gradient(8deg, transparent 0 7px, #ffffff0c 8px 9px), linear-gradient(115deg, var(--block-light), var(--block-color) 42%, var(--block-dark)); box-shadow: inset 1px 1px 2px #fff7, inset -1px -2px 2px #69503325; }
.build-block::before { content: ''; position: absolute; z-index: 1; left: 3px; right: -3px; top: -6px; height: 8px; transform: skewX(-35deg); border-radius: 3px 4px 1px 1px; background: linear-gradient(90deg, var(--block-light), var(--block-color)); }
.build-block::after { content: ''; position: absolute; right: -6px; top: -3px; width: 7px; height: 28px; transform: skewY(-42deg); border-radius: 0 3px 3px 0; background: linear-gradient(90deg, var(--block-dark), var(--block-color)); }
.textured-room[data-time-of-day="night"] .build-block { filter: brightness(.85) saturate(.9) drop-shadow(0 3px 2px #101c2540); }

/* Shared release presentation */
.release-version { color: #807461; font-size: 11px; }
.game-rules p { margin: 0 0 10px; }
.share-url { width: 100%; padding: 10px; border: 1px solid #ded6c5; border-radius: 10px; background: #fffaf0; color: #655b4b; }
