/* Keep a single, meaningful frame around the dedicated character background.
   The motion chooser is collapsed in the top left. */
#heroDetails .detail-portrait{
 display:grid!important;grid-template-columns:minmax(0,1fr)!important;
 grid-template-rows:minmax(0,1fr) auto!important;
 gap:5px!important;padding:0!important;background:none!important;
 border:0!important;overflow:hidden!important;
}
#heroDetails .detail-preview-frame{
 position:relative;min-width:0;min-height:0;width:100%;height:100%;
 box-sizing:border-box;display:grid;place-items:center;overflow:hidden;
 background:linear-gradient(#173c3a20,#173c3a88),var(--art-town) center/cover no-repeat;
 border:1px solid #b99b64;border-radius:5px;
}
#heroDetails .detail-preview-frame #detailImage{
 grid-area:1/1;width:100%;height:100%;min-width:0;min-height:0;
 max-width:100%;max-height:100%;object-fit:contain;padding:4px;
 box-sizing:border-box;transform:none;
}
#heroDetails #detailImageFallback{grid-area:1/1}
#heroDetails #detailFavorite{
 position:absolute;right:7px;top:7px;z-index:5;display:grid;place-items:center;
 width:clamp(28px,4.5vmin,42px);height:clamp(28px,4.5vmin,42px);
 min-height:0;padding:0!important;border:1px solid #d8b87c!important;border-radius:50%!important;
 background:#213b3bdc!important;color:#fff2db;font-size:clamp(20px,3.5vmin,28px);line-height:1;
 box-shadow:none!important;cursor:pointer;
}
#heroDetails #detailFavorite[aria-pressed=true]{color:#ff9ab1}
#heroDetails #detailFavorite[hidden]{display:none!important}
#heroDetails #detailFavorite:focus-visible{outline:2px solid #ffe8a1;outline-offset:2px}
#heroDetails #detailTabs .detail-tab{position:relative}
#heroDetails #detailTabs .detail-tab.is-favorite::after{
 content:'♥'!important;position:absolute;top:3px;right:4px;color:#ff9ab1;
 font-size:12px;line-height:1;text-shadow:0 1px 2px #23342e;
 pointer-events:none;
}
/* v0.9.12j13: collapsed motion chooser; no permanent bottom row.
   Its overlay does not resize the preview or add another decorative frame. */
#heroDetails .detail-portrait{grid-template-rows:minmax(0,1fr)!important;gap:0!important}
#heroDetails #detailMotionToggle{
 position:absolute;left:7px;top:7px;z-index:6;
 display:flex;align-items:center;justify-content:center;
 min-width:0;min-height:28px;height:clamp(28px,4.5vmin,42px);
 padding:0 9px!important;border:1px solid #d8b87c!important;border-radius:4px!important;
 background:#213b3b!important;color:#fff2db;
 font-size:clamp(11px,1.05vw,15px);white-space:nowrap;box-shadow:none!important;
}
#heroDetails #detailMotionToggle::before,#heroDetails #detailMotionToggle::after{content:none!important}
#heroDetails #detailMotionToggle[aria-expanded=true]{background:#48635b!important}
#heroDetails #detailMotionMenu{
 position:absolute;z-index:7;top:calc(14px + clamp(28px,4.5vmin,42px));left:7px;
 width:min(240px,calc(100% - 14px));box-sizing:border-box;
 padding:5px;background:#213b3b;border:1px solid #d8b87c;border-radius:4px;
 box-shadow:0 4px 10px #10262480;
}
#heroDetails #detailMotionMenu[hidden]{display:none!important}
#heroDetails #detailMotionMenu #detailMotions{
 display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
 gap:4px;padding:0;margin:0;min-width:0;width:100%;
}
#heroDetails #detailMotionMenu #detailMotions button{
 width:100%;min-width:0;min-height:28px;height:clamp(28px,5vh,38px);
 padding:2px 3px!important;white-space:nowrap;
 font-size:clamp(10px,1.05vw,14px);line-height:1.2;
 color:#fff3d9;background:#31534c!important;border:1px solid #77928a!important;
 border-radius:3px!important;box-shadow:none!important;text-shadow:none!important;
}
#heroDetails #detailMotionMenu #detailMotions button::before,
#heroDetails #detailMotionMenu #detailMotions button::after{content:none!important}
#heroDetails #detailMotionMenu #detailMotions button[aria-pressed=true]{
 background:#f4dfaa!important;color:#49361e;border-color:#cda565!important;
}
#heroDetails #detailMotionToggle:focus-visible,
#heroDetails #detailMotionMenu button:focus-visible{outline:2px solid #ffe8a1;outline-offset:1px}
@media(max-height:450px){
 #heroDetails #detailFavorite{top:4px;right:4px}
 #heroDetails #detailMotionToggle{top:4px;left:4px}
 #heroDetails #detailMotionMenu{top:36px;left:4px;width:min(220px,calc(100% - 8px))}
}
/* Title decorations do not intercept controls or appear during loading. */
#entry .title-companion{position:absolute;bottom:9%;width:clamp(90px,23vw,340px);height:49%;pointer-events:none;z-index:0;display:flex;align-items:flex-end;justify-content:center}
#entry .title-companion-left{left:1%}
#entry .title-companion-right{right:1%}
#entry .title-companion img{width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 5px 3px #152b3455);transform:scaleX(1);transform-origin:center bottom}
/* 原画は右向き。左は原画、右は反転し、中央を向く。
   向きと上下動を別要素に分け、反転がアニメーションで上書きされないようにする。 */
#entry .title-companion-right img{transform:scaleX(-1)}
#entry[data-title-motion] .title-companion{animation:zpTitleFloat 3.6s ease-in-out infinite}
#entry[data-title-motion] .title-companion-right{animation-delay:-1.7s}
#entry[data-title-motion] .title-companion.title-greeting{animation:zpTitleGreeting .85s ease-in-out both;animation-delay:0s}
#entry.intro .title-companion,#entry .title-companion[hidden],#entry .title-companion img:not([src]){display:none!important}
@keyframes zpTitleFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes zpTitleGreeting{0%,100%{transform:translateY(0)}24%{transform:translateY(-8px)}50%{transform:translateY(0)}71%{transform:translateY(-4px)}}
@media(max-height:600px){#entry .title-companion{height:44%;bottom:26%;width:22vw}}
@media(max-width:650px){#entry .title-companion{height:37%;bottom:39%;width:20vw}}
@media(prefers-reduced-motion:reduce){#entry .title-companion{animation:none!important}}
