.town-cat[hidden],.town-cat-dialog[hidden]{display:none!important}
.town-cat{position:fixed;inset:0;z-index:10;pointer-events:none}
.town-cat-walker{position:absolute;bottom:max(4px,env(safe-area-inset-bottom));left:12px;width:110px;height:147px;pointer-events:none;animation:town-cat-travel 32s linear infinite}
.town-cat-lifter{position:absolute;inset:0;transition:transform 1.3s cubic-bezier(.42,0,.58,1)}
.town-cat:not([data-ready]) .town-cat-lifter,.town-cat[data-open=true] .town-cat-lifter{transition:none}
.town-cat-button{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:transparent;pointer-events:auto;cursor:pointer}
.town-cat-facing{position:absolute;inset:0;display:block;animation:town-cat-direction 32s steps(1,end) infinite}
.town-cat-sprite{display:block;width:100%;height:100%;background-image:url('/assets/town-guide-cat-scarf-v2.png');background-repeat:no-repeat;background-size:400% 100%;animation:town-cat-steps .8s steps(4,end) infinite;filter:drop-shadow(1px 3px 2px #0008)}
.town-cat-hint{position:absolute;z-index:1;top:2px;left:50%;transform:translateX(-50%);white-space:nowrap;padding:4px 8px;border:1px solid #b98738;border-radius:3px;background:#fff0cb;color:#64231d;box-shadow:0 2px 4px #0006;font-size:11px;font-weight:800;line-height:1.3}
.town-cat-dialog{position:absolute;bottom:calc(100% - 12px);width:min(260px,calc(100vw - 24px));max-height:calc(100dvh - 155px);overflow:visible;padding:17px 18px 15px;background:#fff0ce;color:#182d39;border:2px solid #b98b43;box-shadow:0 5px 16px #0007;pointer-events:auto}
.town-cat-dialog:after{content:'';position:absolute;top:100%;left:var(--tail-x,50%);width:15px;height:15px;background:#fff0ce;border-right:2px solid #b98b43;border-bottom:2px solid #b98b43;transform:translate(-50%,-8px) rotate(45deg)}
.town-cat-dialog p{margin:0 22px 12px 0;font-size:14px;line-height:1.6;font-weight:800}
.town-cat-close{position:absolute;right:5px;top:3px;width:40px;height:40px;padding:0;border:0;background:transparent;color:#673b24;font-size:24px;line-height:1}
.town-cat-link{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:8px 12px;background:#9d231f;color:#fff2d4;font-size:13px;font-weight:800;text-decoration:none}
.town-cat-link:hover{background:#761c19}.town-cat-button:focus-visible{outline:3px solid #f4c66b;outline-offset:0;border-radius:8px}.town-cat-button:active .town-cat-facing{filter:brightness(1.08)}
.town-cat-walker:hover,.town-cat-walker:focus-within,.town-cat[data-open=true] .town-cat-walker,.town-cat-walker:hover .town-cat-facing,.town-cat-walker:focus-within .town-cat-facing,.town-cat[data-open=true] .town-cat-facing,.town-cat-walker:hover .town-cat-sprite,.town-cat-walker:focus-within .town-cat-sprite,.town-cat[data-open=true] .town-cat-sprite{animation-play-state:paused}
body:has(.video-dialog[open]) .town-cat{visibility:hidden}
body:has(.video-dialog[open]) .town-cat-walker,body:has(.video-dialog[open]) .town-cat-facing,body:has(.video-dialog[open]) .town-cat-sprite{animation-play-state:paused}
.site-footer{flex-wrap:wrap;gap:8px 24px;padding-block:18px}
.cat-credit{flex-basis:100%;text-align:center;line-height:1.6;opacity:.75}
@keyframes town-cat-travel{0%,5%{transform:translateX(0)}45%,50%{transform:translateX(calc(100vw - 134px))}95%,100%{transform:translateX(0)}}
@keyframes town-cat-direction{0%{transform:scaleX(1)}50%{transform:scaleX(-1)}}
@keyframes town-cat-steps{to{background-position:133.3333% 0}}
@media(max-width:720px){.town-cat-walker{width:86px;height:115px}.town-cat-hint{top:0;font-size:10px;padding:3px 6px}.town-cat-dialog{max-height:calc(100dvh - 125px)}@keyframes town-cat-travel{0%,5%{transform:translateX(0)}45%,50%{transform:translateX(calc(100vw - 110px))}95%,100%{transform:translateX(0)}}}
@media(prefers-reduced-motion:reduce){.town-cat-walker,.town-cat-facing,.town-cat-sprite{animation:none!important}.town-cat-lifter{transition:none}}

/* Keep the original cat outside the scarf area in each walking frame. */
@supports (clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%)){
  .town-cat-sprite{position:relative;background-image:none;animation:none}
  .town-cat-sprite::before,.town-cat-sprite::after{content:'';position:absolute;inset:0;background-repeat:no-repeat;background-size:400% 100%;animation:town-cat-steps .8s steps(4,end) infinite}
  .town-cat-sprite::before{background-image:url('/assets/town-guide-cat-walk-v1.png');clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,30% 40%,30% 70%,91% 70%,91% 40%,30% 40%,0 0)}
  .town-cat-sprite::after{background-image:url('/assets/town-guide-cat-scarf-v2.png');clip-path:inset(40% 9% 30% 30%)}
  .town-cat-walker:hover .town-cat-sprite::before,.town-cat-walker:hover .town-cat-sprite::after,.town-cat-walker:focus-within .town-cat-sprite::before,.town-cat-walker:focus-within .town-cat-sprite::after,.town-cat[data-open=true] .town-cat-sprite::before,.town-cat[data-open=true] .town-cat-sprite::after,body:has(.video-dialog[open]) .town-cat-sprite::before,body:has(.video-dialog[open]) .town-cat-sprite::after{animation-play-state:paused}
  @media(prefers-reduced-motion:reduce){.town-cat-sprite::before,.town-cat-sprite::after{animation:none!important}}
}
