/* All seven pets use the same 256px canvas: line x=253, paws at y=170/207.
   Clip only the moving face, never the fixed frame. No background-colour mask. */
.study-pet-peek {
    position: fixed;
    right: 0;
    bottom: 30px;
    display: block;
    width: 113px;
    height: 113px;
    padding: 0;
    overflow: visible;
    isolation: isolate;
    border: 0;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(-3px 5px 6px rgba(24, 37, 62, .2));
}
.study-pet-peek[hidden] { display: none !important; }
.study-pet-peek-window {
    position: absolute;
    inset: 0 2px 0 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}
.study-pet-peek img {
    position: absolute;
    left: 0;
    top: 0;
    width: 113px;
    height: 113px;
    max-width: none;
    object-fit: contain;
    pointer-events: none;
}
.study-pet-peek-character {
    transform: translateX(0);
    will-change: transform;
    animation: study-pet-peek-character 7s ease-in-out infinite;
}
.study-pet-peek-frame {
    z-index: 3;
    transform: none;
}
.study-pet-peek::after { content: none; }
.study-pet-peek::before {
    content: "까꿍!";
    position: absolute;
    z-index: 4;
    top: -10px;
    right: 18px;
    color: #fff8e8;
    font-family: "Arial Rounded MT Bold", "Pretendard", "Noto Sans KR", sans-serif;
    font-size: 15px;
    font-weight: 1000;
    letter-spacing: -1px;
    line-height: 1.2;
    white-space: nowrap;
    text-shadow: -1px -1px 0 #b94f1f, 1px -1px 0 #b94f1f,
        -1px 1px 0 #b94f1f, 1px 1px 0 #b94f1f, 0 2px 0 #8c3515;
    opacity: 0;
    transform: rotate(-7deg);
    animation: study-pet-peek-caption 7s ease-in-out infinite;
    pointer-events: none;
}
.study-pet-peek:hover .study-pet-peek-character,
.study-pet-peek:focus-visible .study-pet-peek-character {
    animation: none;
    transform: translateX(0);
}
.study-pet-peek:hover::before,
.study-pet-peek:focus-visible::before {
    animation: none;
    opacity: 1;
}
.study-pet-peek:focus-visible {
    outline: 2px solid #2b64d9;
    outline-offset: 3px;
    border-radius: 12px;
}
@keyframes study-pet-peek-character {
    0%, 15%, 95%, 100% { transform: translateX(76px); }
    28%, 75% { transform: translateX(0); }
}
@keyframes study-pet-peek-caption {
    0%, 20%, 88%, 100% { opacity: 0; }
    28%, 75% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .study-pet-peek-character { animation: none; transform: translateX(0); }
    .study-pet-peek::before { animation: none; opacity: 1; }
}
