/* Playful layer: peeking cat + hero play zone (see inc/play.php). */

/* ---------- Peeking cat ---------- */
.bs-cat { position: fixed; left: 18px; bottom: 0; z-index: 80; width: 120px; height: 96px; pointer-events: none; }
.bs-cat[hidden] { display: none; }
.bs-cat__body { position: absolute; left: 0; bottom: 0; width: 120px; height: 96px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; transform: translateY(40px); transition: transform 0.45s cubic-bezier(.3, 1.5, .5, 1); -webkit-tap-highlight-color: transparent; }
.bs-cat__body:focus-visible { outline: 3px solid var(--bs-color-ink); outline-offset: 2px; border-radius: 50% 50% 0 0; }
.bs-cat.is-in .bs-cat__body { transform: translateY(12px); } /* More of the buddy shows, so the browser's link preview never hides its face. */
.bs-cat.is-curious .bs-cat__body, .bs-cat__body:hover { transform: translateY(0); }
.bs-cat.is-happy .bs-cat__body { animation: bs-cat-jump 0.55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes bs-cat-jump { 0% { transform: translateY(12px); } 35% { transform: translateY(-18px) rotate(-4deg); } 60% { transform: translateY(2px) rotate(3deg); } 100% { transform: translateY(0); } }
.bs-cat svg { display: block; overflow: visible; }
.bs-cat__face, .bs-cat__ear, .bs-cat__paw ellipse { fill: var(--bs-color-ink); }
.bs-cat__ear-in { fill: var(--bs-color-coral-strong); opacity: 0.85; }
.bs-cat__eye-white { fill: var(--bs-color-lime); }
.bs-cat__pupil { fill: var(--bs-color-ink); transition: transform 0.08s linear; }
.bs-cat__nose { fill: var(--bs-color-accent); }
.bs-cat__mouth, .bs-cat__whisk { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; opacity: 0.8; }
.bs-cat__whisk { opacity: 0.45; }
.bs-cat__toe { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: 0.4; }
.bs-cat__blush { fill: var(--bs-color-accent); opacity: 0; transition: opacity 0.3s ease; }
.bs-cat.is-happy .bs-cat__blush, .bs-cat__body:hover .bs-cat__blush { opacity: 0.55; }
.bs-cat__ear { transform-box: fill-box; transform-origin: 50% 100%; animation: bs-cat-ear 6s ease-in-out infinite; }
.bs-cat__ear--r { animation-delay: 3.1s; }
@keyframes bs-cat-ear { 0%, 92%, 100% { transform: none; } 95% { transform: rotate(-12deg); } }
.bs-cat__eye { transform-box: fill-box; transform-origin: 50% 50%; animation: bs-cat-blink 5s infinite; }
@keyframes bs-cat-blink { 0%, 95%, 100% { transform: none; } 97% { transform: scaleY(0.1); } }
.bs-cat__paw--r { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.25s ease; }
.bs-cat.is-alert .bs-cat__paw--r { transform: translate(6px, -34px) rotate(-18deg); }
.bs-cat.is-swat .bs-cat__paw--r { animation: bs-cat-swat 0.5s ease; }
@keyframes bs-cat-swat { 0% { transform: translate(6px, -34px) rotate(-18deg); } 50% { transform: translate(18px, -44px) rotate(-40deg); } 100% { transform: translate(6px, -34px) rotate(-18deg); } }
.bs-cat__heart { position: absolute; left: 52px; top: -26px; color: var(--bs-color-coral-strong); font-size: 22px; opacity: 0; pointer-events: none; }
.bs-cat.is-happy .bs-cat__heart { animation: bs-cat-heart 0.7s ease-out; }
@keyframes bs-cat-heart { 0% { opacity: 0; transform: translateY(10px) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) scale(1.2); } }
.bs-cat__bubble { position: absolute; left: 70px; bottom: 108px; width: max-content; max-width: 220px; margin: 0; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #fff; color: var(--bs-color-ink); box-shadow: 0 12px 30px color-mix(in srgb, var(--bs-color-ink) 18%, transparent); font-size: 14px; font-weight: 700; line-height: 1.35; opacity: 0; transform: translateY(6px) scale(0.96); transform-origin: 0 100%; transition: opacity 0.2s ease, transform 0.2s ease; }
.bs-cat__bubble.is-on { opacity: 1; transform: none; }
.bs-cat__hide { position: absolute; left: 100px; bottom: 70px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--bs-color-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--bs-color-ink) 20%, transparent); font-size: 15px; line-height: 1; cursor: pointer; pointer-events: auto; opacity: 0; transition: opacity 0.2s ease; }
.bs-cat:hover .bs-cat__hide, .bs-cat:focus-within .bs-cat__hide, .bs-cat.is-curious .bs-cat__hide { opacity: 1; }
@media (hover: none) { .bs-cat__hide { opacity: 0.85; } }
@media (max-width: 640px) {
	.bs-cat { left: 8px; transform: scale(0.72); transform-origin: 0 100%; }
}
html.bs-drawer-open .bs-cat { display: none; }

/* ---------- Hero play zone ---------- */
.bs-play-layer { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; border-radius: inherit; }
.bs-pawprint { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: var(--bs-color-ink); opacity: 0.22; animation: bs-paw-fade 1.1s ease-out forwards; }
.bs-pawprint svg { display: block; width: 100%; height: 100%; }
@keyframes bs-paw-fade { 0% { opacity: 0; transform: var(--r) scale(0.6); } 20% { opacity: 0.32; transform: var(--r) scale(1); } 100% { opacity: 0; transform: var(--r) scale(1); } }
@media (prefers-reduced-motion: reduce) {
	.bs-cat__ear, .bs-cat__eye { animation: none; }
	.bs-cat__body { transition: none; }
	.bs-play-layer { display: none; }
}

/* ---------- Buddy choice: dog or cat ---------- */
.bs-pet { display: none; }
.bs-cat[data-pet="cat"] .bs-pet--cat, .bs-cat[data-pet="dog"] .bs-pet--dog { display: block; }
.bs-dog__face { fill: #C98B4F; }
.bs-dog__ear { fill: #7A4B26; }
.bs-dog__patch { fill: #A8703B; }
.bs-dog__muzzle { fill: #FFF1DE; }
.bs-dog__eye-white { fill: #fff; }
.bs-dog__nose { fill: var(--bs-color-ink); }
.bs-dog__mouth { fill: none; stroke: var(--bs-color-ink); stroke-width: 1.8; stroke-linecap: round; }
.bs-dog__tongue { fill: var(--bs-color-coral-strong); transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); transition: transform 0.25s ease; }
.bs-cat[data-pet="dog"].is-alert .bs-dog__tongue, .bs-cat[data-pet="dog"].is-happy .bs-dog__tongue, .bs-cat[data-pet="dog"] .bs-cat__body:hover .bs-dog__tongue { transform: none; }
.bs-dog__paw ellipse { fill: #C98B4F; }
.bs-cat[data-pet="dog"] .bs-cat__pupil { fill: var(--bs-color-ink); }

.bs-petpick { position: fixed; left: 16px; bottom: 16px; z-index: 81; width: min(320px, calc(100vw - 32px)); padding: 20px; border-radius: var(--bs-r-md, 20px); background: #fff; color: var(--bs-color-ink); box-shadow: 0 24px 60px color-mix(in srgb, var(--bs-color-ink) 22%, transparent); animation: bs-pick-in 0.35s cubic-bezier(.3, 1.3, .5, 1) both; }
.bs-petpick[hidden] { display: none; }
@keyframes bs-pick-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
.bs-petpick__t { margin: 0 28px 4px 0; font-family: var(--bs-font-heading); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.bs-petpick__s { margin: 0 0 14px; font-size: 14px; color: var(--bs-color-muted); }
.bs-petpick__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bs-petpick__opts button { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border: 1.5px solid var(--bs-color-border); border-radius: var(--bs-r-sm, 14px); background: #fff; color: var(--bs-color-ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; }
.bs-petpick__opts button span { font-size: 28px; line-height: 1; }
.bs-petpick__opts button:hover { border-color: var(--bs-color-ink); background: var(--bs-color-lime); transform: translateY(-2px); }
.bs-petpick__none { display: block; margin: 12px auto 0; padding: 4px; border: 0; background: none; color: var(--bs-color-muted); font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bs-petpick__x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--bs-color-surface); color: var(--bs-color-ink); font-size: 18px; line-height: 1; cursor: pointer; }
.bs-pettab { position: fixed; left: 14px; bottom: 14px; z-index: 80; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: #fff; color: var(--bs-color-ink); box-shadow: 0 8px 22px color-mix(in srgb, var(--bs-color-ink) 18%, transparent); cursor: pointer; transition: transform 0.2s ease, background-color 0.15s ease; }
.bs-pettab[hidden] { display: none; }
.bs-pettab:hover { transform: translateY(-2px) rotate(-10deg); background: var(--bs-color-lime); }
html.bs-drawer-open .bs-petpick, html.bs-drawer-open .bs-pettab { display: none; }

/* Only the chosen buddy is drawn (the generic ".bs-cat svg" rule above must not show both). */
.bs-cat svg.bs-pet { display: none; }
.bs-cat[data-pet="cat"] svg.bs-pet--cat, .bs-cat[data-pet="dog"] svg.bs-pet--dog { display: block; }
