/* Preserve the pre-redesign site. Only the retained worlds and corner console
   are styled here; hero, cards, typography, navigation and page layout stay put. */
.pet-card-visual,.codex-runtime-surface{container-type:size;position:relative}
.game-world{image-rendering:pixelated}
:root[data-theme=dark] .game-world{filter:brightness(.82) saturate(.9)}
.gallery-pet{position:absolute;left:50%;bottom:calc(50% - max(17.1875cqw,30.5556cqh));transform:translateX(-50%);margin:0}
.codex-pet-anchor{position:absolute;left:50%;bottom:calc(50% - max(17.1875cqw,30.5556cqh));width:auto;transform:translateX(-50%)}
.gallery-pet,.codex-preview-pet{translate:0 calc(var(--pet-empty-bottom,0) * 100%)!important}
.codex-runtime-surface :is(.world-cloud,.world-ripples,.world-glints,.world-beams){animation-play-state:running}

/* Native-size pet; no page-added rotation, throwing or bouncing. */
.roaming-pet{width:112px;height:121px;will-change:auto}.roaming-pet.is-dragging{will-change:transform}
.pet-handle{align-items:center}.pet-body{width:100%;will-change:auto;transform:none;rotate:none!important}
.playground-pet{width:100%;height:auto;filter:none}.pet-ground{bottom:6%;opacity:.07;left:33%;right:33%;height:4px}
.pet-drag-hint{position:absolute;top:calc(100% + 3px);left:50%;transform:translateX(-50%);font-size:12px;white-space:nowrap;background:var(--paper);color:var(--muted);border:1px solid var(--line);padding:3px 6px;border-radius:4px;opacity:0;pointer-events:none}
.roaming-pet:hover .pet-drag-hint,.roaming-pet:focus-within .pet-drag-hint{opacity:1}.is-dragging .pet-drag-hint{opacity:0!important}
.pet-launcher{display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0;border-radius:50%;background:var(--paper);color:var(--ink);box-shadow:0 3px 14px #0000000d}
.pet-launcher:hover{translate:none;background:var(--surface-hover)}.pet-launcher>.brand-mark{transform:scale(.8);pointer-events:none}
.pet-launcher[aria-expanded=true]{background:var(--surface);color:var(--ink)}

/* One quiet strip. Chat, the other six moves, and settings are opt-in drawers. */
.pet-chat{inset:auto;width:208px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:8px;border-radius:12px;overflow:auto;overscroll-behavior:contain;box-shadow:0 6px 24px #0002;animation:companion-console-enter 140ms ease-out}
.pet-chat[data-side=left]{transform-origin:right bottom}.pet-chat[data-side=right]{transform-origin:left bottom}
.pet-chat[data-side=above]{transform-origin:center bottom}.pet-chat[data-side=below]{transform-origin:center top}
.pet-chat header{display:flex;align-items:center;gap:2px;margin:0 0 4px}
.customize-pet{display:flex;align-items:center;gap:5px;min-width:0;margin-right:auto;padding:0 5px;min-height:28px;border-radius:5px;text-align:left}
.chat-pet-name{font:600 21px/1.1 var(--display);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.pet-chat header .icon-button{flex-shrink:0;width:28px;height:28px;min-height:28px;margin:0;border-radius:6px}
.pet-chat header .icon-button:hover,.customize-pet[aria-expanded=true]{background:var(--surface-hover)}
.pet-chat header .ap-icon{width:14px;height:14px}.customize-pet>.ap-icon{width:11px;height:11px;color:var(--muted);transition:transform 140ms ease}.customize-pet[aria-expanded=true]>.ap-icon{transform:rotate(90deg)}
.companion-quick{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px}
.companion-quick button{display:grid;place-items:center;height:36px;min-width:0;border-radius:7px;background:var(--surface)}
.companion-quick .ap-icon{width:20px;height:20px}
.companion-states{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.companion-states button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:4px 2px;font-size:14px;white-space:nowrap;background:var(--surface);border:1px solid transparent;border-radius:6px}
.companion-states .ap-icon{width:15px;height:15px}
.pet-chat button[aria-pressed=true],.companion-quick button[aria-expanded=true]{background:var(--button);color:var(--on-button)}
.companion-quick button:hover,.companion-states button:hover{background:var(--surface-hover);color:var(--ink)}
.companion-quick button:active,.companion-states button:active{transform:scale(.95)}
.pet-chat button:focus-visible{outline-offset:1px}
.pet-chat .pet-chat-form{margin-top:8px;padding:2px;border-radius:7px}.pet-chat .pet-chat-form input{font-size:16px;padding:4px;line-height:1.25}
.pet-chat .pet-chat-form button{min-width:30px;min-height:32px;border-radius:5px}.pet-chat-form button .ap-icon{width:16px;height:16px}
.pet-chat .hide-pet{display:flex;align-items:center;gap:4px;font-size:14px;min-height:32px;padding:4px}
.pet-chat .pet-reply.sr-only{padding:0;min-height:0}
.companion-settings{margin-top:8px;border-top:1px solid var(--line);padding-top:4px}
.companion-settings .pet-picker-label{display:block;font-size:13px;padding:4px 0;min-height:40px;border-top:0}
.companion-settings select{display:block;width:100%;max-width:100%;font-size:16px;padding:4px 20px 4px 6px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink)}
.companion-toolbar{display:flex;gap:10px;align-items:center;padding:8px 0 2px}
.companion-toolbar label{font-size:14px;flex:1}.companion-size-output{float:right;color:var(--muted)}
.companion-size{display:block;width:100%;height:24px;margin:2px 0 0;accent-color:var(--accent)}
.companion-settings-actions{display:flex;align-items:center;justify-content:space-between;gap:4px}
.companion-reset{display:flex;align-items:center;gap:4px;font-size:14px;min-height:32px;padding:4px}.companion-settings-actions svg{width:14px;height:14px}
.companion-note{font-size:12px;color:var(--muted);line-height:1.3;margin:6px 2px 2px}
.companion-autoplay-label{display:flex;align-items:center;gap:7px;font-size:14px;min-height:32px;cursor:pointer}
.companion-autoplay{width:15px;height:15px;margin:0;accent-color:var(--accent)}
@keyframes companion-console-enter{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
@media(pointer:coarse){.pet-chat{width:238px}.companion-quick button{height:44px}.pet-chat header .icon-button,.customize-pet{min-height:36px}.companion-states button{min-height:44px}}
@media(prefers-reduced-motion:reduce){.game-world *{animation:none!important}.pet-chat{animation:none}.companion-quick button:active,.companion-states button:active{transform:none}}
