/* New monster artwork; legacy hook names keep saved games and speech working. */
.monster-avatar{display:block;width:100%;height:auto;aspect-ratio:1;overflow:visible;image-rendering:auto;transform-origin:50% 90%;filter:drop-shadow(0 5px 3px #263c2e18)}
.monster-avatar.horse,.monster-avatar.capy,.monster-avatar.gwen-character,.monster-avatar.subject-avatar{animation:none;transform-origin:center bottom;object-fit:contain;max-width:100%;border-radius:0;background:transparent;border:0;box-shadow:none}
.monster-avatar .monster-bounce{transform-origin:50px 90px;animation:monster-breathe 5.5s ease-in-out infinite}
.monster-mouth{opacity:0;pointer-events:none;transform-box:fill-box;transform-origin:center;transform:scaleY(.04)}
.monster-avatar.mouth-moving .monster-mouth,.mouth-moving>.monster-avatar .monster-mouth,.monster-avatar.talking .monster-mouth{animation:var(--mouth-motion,monster-chatter) var(--mouth-duration,.42s) linear infinite}
.monster-avatar.talking .monster-bounce,.talking>.monster-avatar .monster-bounce{animation:monster-talk .7s ease-in-out infinite}
.monster-avatar .pony-mouth,.monster-avatar .pony-tongue{display:none!important}
.shopkeeper.monster-guide{position:relative;display:block;width:100%;height:auto;aspect-ratio:1;overflow:visible;filter:none;background:none;transform-origin:center bottom}
.shopkeeper.monster-guide .monster-avatar{width:100%;height:auto;max-height:none;display:block;object-fit:contain}
.shopkeeper.monster-guide:before,.shopkeeper.monster-guide:after{display:none}
.shopkeeper.monster-guide.talking{animation:none}
.map-capy-button .shopkeeper.monster-guide{height:auto;max-height:none;width:100%}
.map-pin-icon>.monster-avatar{width:100%;height:100%;max-width:none;object-fit:contain;transform:scale(1.22);filter:drop-shadow(0 2px 2px #23362e22)}
.subject-avatar.monster-avatar{display:block;position:relative;aspect-ratio:1;object-fit:contain;flex-shrink:0;max-height:none}
.subject-art>.monster-avatar,.subject-art .subject-avatar.monster-avatar{width:100%;height:100%;max-height:220px;object-fit:contain}
.subject-button>.monster-avatar,.subject-shortcut>.monster-avatar{width:58px;height:58px}
.monster-avatar.subject-avatar.compact{width:64px;height:64px;max-width:100%;flex-shrink:0}
.world-companion>.monster-avatar{width:100%;height:auto;max-height:none}
.monster-avatar.gwen-character{display:block;position:relative;overflow:visible;aspect-ratio:1}
.gwen-reading>.monster-avatar{width:140px;height:140px;flex-shrink:0;max-width:35%}
.character-credit>.monster-avatar{width:175px;flex-shrink:0;max-width:40%;height:auto}
.monster-reading-cutaway .gwen-cutaway-character{width:min(48%,480px);bottom:4%;left:6%;height:auto}
.monster-reading-cutaway .gwen-cutaway-character>.monster-avatar{width:100%;height:auto;max-height:none}
.monster-reading-cutaway .gwen-cutaway-dialogue{z-index:3}
.monster-companion [data-worn]{filter:drop-shadow(0 1px .3px #45344812)}
.monster-companion.horse{width:100%;height:auto;max-height:none}
.horse-card .monster-companion{width:200px;height:200px;margin:0 auto 12px}
.wardrobe-preview .monster-companion{height:auto;aspect-ratio:1;max-height:270px;width:100%}
.gear-preview .monster-companion{height:auto;aspect-ratio:1}
.wardrobe-preview{background:radial-gradient(ellipse at 50% 70%,#f7f5d9 0,#e3f0db 58%,#cfdfbd 100%)}
.wardrobe-preview .monster-bounce,.gear-preview .monster-bounce{animation:none}
.wardrobe-tabs button{font-size:.8rem}
.monster-treasure{width:100%;height:100%;display:block;image-rendering:auto;overflow:visible;filter:drop-shadow(0 3px 1px #69484016)}
.monster-coin svg{display:block;width:100%;height:100%;overflow:visible;image-rendering:auto}
.monster-wordmark{width:min(720px,96%);max-width:100%;height:auto;aspect-ratio:820/250;filter:drop-shadow(0 5px 0 #5b755749)}
.monster-den.stable-scene{position:relative;width:100%;height:auto;aspect-ratio:3/2;overflow:hidden;border-radius:18px;border:2px solid #9ab387;background:#d6e8ae;isolation:isolate}
.monster-den>.monster-den-background{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;image-rendering:auto;filter:none}
.monster-den-improvements{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none;overflow:visible}
.monster-den .den-improvement{filter:drop-shadow(0 0 1px #ffedab99)}
.monster-den>.monster-den-name{position:absolute;top:5%;left:50%;transform:translateX(-50%);bottom:auto;right:auto;width:max-content;max-width:85%;padding:7px 19px;border:2px solid #bb9a63;border-radius:13px;background:#fff0c9ed;color:#664e36;text-shadow:none;box-shadow:0 3px 0 #84694640;font-size:clamp(.72rem,1.7vw,1rem);font-weight:850;text-align:center;z-index:5;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.monster-den>.monster-den-count{position:absolute;right:12px;bottom:10px;left:auto;top:auto;border:1px solid #cbdbb1;background:#fbf7dbeF;border-radius:9px;padding:5px 10px;color:#526547;font-size:clamp(.58rem,1.25vw,.76rem);font-weight:700;z-index:5;text-shadow:none}
.monster-den>.den-featured-monster.arcade-stable-horse{position:absolute;left:50%;top:auto;bottom:5%;transform:translateX(-50%);width:29%;height:auto;max-height:none;z-index:4;filter:drop-shadow(0 8px 3px #243c3429)}
.monster-den .den-featured-monster>.monster-avatar{width:100%;height:auto;max-height:none}
.monster-den>.den-friend{position:absolute;bottom:23%;width:15%;z-index:3;filter:drop-shadow(0 5px 2px #243c3425)}
.monster-den>.den-friend-0{left:14%}.monster-den>.den-friend-1{right:15%;bottom:24%}
.den-decoration{position:absolute;z-index:4;width:11%;height:auto;aspect-ratio:1}.den-flowers{left:7%;bottom:8%}.den-bunting{right:5%;top:14%;width:18%}.den-lantern{right:10%;bottom:10%;width:8%}
.den-upgrade-celebration{position:absolute;left:50%;top:54%;transform:translate(-50%,-50%);z-index:7;display:flex;align-items:center;gap:14px;padding:12px 19px;background:#fff7d8f5;border:2px solid #d8b96e;border-radius:12px;box-shadow:0 5px 25px #2a522744;max-width:90%;font-size:.9rem;color:#70603b;animation:monster-upgrade .6s ease-out}
.den-upgrade-celebration>span{color:#d2a041;font-size:1.5em}.den-upgrade-celebration strong{text-align:center}
.monster-den-inspection.stable-inspection{overflow:hidden;background:#dfebc3;border-radius:14px}.monster-den-inspection .monster-den{width:100%;min-height:0;min-width:0;transform:none;aspect-ratio:3/2}
.world-card .monster-den{height:auto;aspect-ratio:3/2}.title-world .monster-den{height:100%;width:100%;aspect-ratio:auto;border:0;border-radius:0}
.title-world .monster-den-background{object-fit:cover;object-position:center 38%}.title-world .monster-den-name,.title-world .monster-den-count{display:none}.title-world .monster-den>.den-featured-monster{left:50%;top:40%;bottom:auto;width:27%;transform:translateX(-50%)}
.title-world .monster-den>.den-friend{display:none}.title-logo:has(.monster-wordmark){top:3%;left:15%;width:70%}.title-promise{top:32%}.title-adventure .monster-wordmark{width:100%}
.title-adventure .monster-den-improvements,.title-adventure .den-decoration{opacity:.7}.feeding-stage .monster-companion{max-width:260px;margin:auto}
@keyframes monster-breathe{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-.7px) scale(1.005)}}
@keyframes monster-talk{0%,100%{transform:translateY(0) rotate(-.5deg)}50%{transform:translateY(-1px) rotate(.5deg)}}
@keyframes monster-chatter{0%,100%,42%,72%{opacity:0;transform:scaleY(.04)}12%,28%{opacity:1;transform:scaleY(1)}55%,62%{opacity:1;transform:scaleY(.65)}84%,92%{opacity:1;transform:scaleY(1.15)}}
@keyframes monster-upgrade{from{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
.reduce-motion .monster-avatar,.reduce-motion .monster-bounce,.reduce-motion .monster-mouth,.reduce-motion .den-upgrade-celebration{animation:none!important}.reduce-motion .monster-mouth{display:none}
@media(max-width:640px){.monster-den.stable-scene{aspect-ratio:3/2;min-height:0;height:auto}.monster-den>.monster-den-name{top:4%;padding:5px 10px;font-size:.65rem;max-width:88%;border-width:1px}.monster-den>.monster-den-count{font-size:.54rem;padding:4px 6px;bottom:6px;right:6px}.monster-den>.den-featured-monster{width:31%;bottom:6%}.monster-den>.den-friend{width:16%}.title-world .monster-den{height:100%;aspect-ratio:auto}.title-world .monster-den>.den-featured-monster{width:57%;top:36%;left:50%}.title-logo:has(.monster-wordmark){top:5%;left:4%;width:92%}.title-promise{top:27%;font-size:.77rem}.gwen-reading>.monster-avatar{width:105px;height:105px;max-width:32%}.monster-reading-cutaway .gwen-cutaway-character{width:65%;left:0;bottom:20%}.horse-card .monster-companion{width:190px;height:190px}.den-upgrade-celebration{font-size:.7rem;gap:7px;padding:8px 12px}.wardrobe-tabs button{font-size:.7rem}.monster-den-inspection .monster-den{aspect-ratio:3/2;min-width:0}.character-credit>.monster-avatar{width:140px}.monster-avatar.subject-avatar.compact{width:52px;height:52px}}
@media(orientation:landscape) and (max-height:600px){.title-world .monster-den>.den-featured-monster{width:22%;left:50%;top:38%}.title-logo:has(.monster-wordmark){top:0;left:25%;width:50%}.title-promise{top:31%;font-size:.68rem}.wardrobe-preview .monster-companion{max-height:155px}.monster-reading-cutaway .gwen-cutaway-character{width:33%;left:5%;bottom:0}}
@media(prefers-reduced-motion:reduce){.monster-avatar,.monster-bounce,.monster-mouth,.den-upgrade-celebration{animation:none!important}.monster-mouth{display:none}}

/* Each profile can choose a look without changing the adventure underneath. */
.monster-style-picker{min-width:0;border:0;padding:0;margin:24px 0 26px;color:#244d43}
.monster-style-picker legend{padding:0;font-size:1.08rem;font-weight:850;line-height:1.4}
.monster-style-help,.monster-style-reassurance{font-size:.82rem;line-height:1.55;color:#526d61;margin:8px 0 13px}
.monster-style-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.monster-style-option{display:block;position:relative;min-width:0;cursor:pointer;isolation:isolate}
.monster-style-option>input[type=radio]{position:absolute;z-index:2;top:12px;right:12px;width:19px;height:19px;min-height:0;margin:0;padding:0;accent-color:#244d43;cursor:pointer}
.monster-style-content{display:flex;flex-direction:column;align-items:center;min-height:218px;height:100%;box-sizing:border-box;padding:22px 10px 12px;border:2px solid #d9d2bd;border-bottom-width:4px;border-radius:17px;background:#fffcf3;text-align:center;transition:border-color .15s,background .15s}
.monster-style-preview{display:flex;align-items:flex-end;width:100%;max-width:200px;height:91px;margin:1px 0 7px;pointer-events:none}
.monster-style-preview .monster-avatar{width:33.333%;height:auto;min-width:0;max-width:none;max-height:none;aspect-ratio:1;overflow:visible;filter:drop-shadow(0 3px 2px #244d431a)}
.monster-style-preview .monster-avatar:nth-child(2){transform:scale(1.22);transform-origin:50% 90%;z-index:1}
.monster-style-preview .monster-bounce{animation:none!important}
.monster-style-content>strong{font-size:1.05rem;line-height:1.25;margin:3px 0 6px}
.monster-style-description{font-size:.76rem;line-height:1.45;max-width:22ch;color:#526d61}
.monster-style-selected{margin-top:auto;padding-top:9px;font-size:.7rem;font-weight:850;color:#244d43;visibility:hidden}
.monster-style-option>input:checked+.monster-style-content{border-color:#40735b;background:#edf3df}
.monster-style-option>input:checked+.monster-style-content .monster-style-selected{visibility:visible}
.monster-style-option:hover .monster-style-content{border-color:#789675}
.monster-style-option>input:focus-visible+.monster-style-content{outline:3px solid #b78435;outline-offset:3px}
.monster-style-picker .monster-style-reassurance{margin:11px 0 0;font-size:.75rem}
@media(max-width:400px){.monster-style-choices{gap:9px}.monster-style-content{padding:22px 7px 10px;min-height:210px}.monster-style-preview{height:73px}.monster-style-description{font-size:.73rem}}
@media(prefers-reduced-motion:reduce){.monster-style-content{transition:none}}

@keyframes monster-chatter-soft{0%,100%,47%,76%{opacity:0;transform:scaleY(.04)}14%,31%{opacity:1;transform:scaleY(.82)}57%,65%{opacity:1;transform:scaleY(.56)}86%,93%{opacity:1;transform:scaleY(1)}}
@keyframes monster-chatter-snarl{0%,100%,40%,71%{opacity:0;transform:scaleY(.04)}10%,25%{opacity:1;transform:scaleY(1)}51%,59%{opacity:1;transform:scaleY(.7)}82%,92%{opacity:1;transform:scaleY(.92)}}
