/* ===== Pulley Animation Overlay ===== */
.pulley-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: #ffffff;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    padding-top: env(safe-area-inset-top);
}

.pulley-overlay.completed {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.pulley-system {
    position: absolute;
    top: 0;
    right: 60px;
}

.pulley-wheel {
    display: block;
}

/* Full-screen SVG for ropes */
.ropes-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.rope {
    fill: none;
    stroke: #A0622E;
    stroke-width: 5;
    stroke-linecap: round;
}

.rope-outline {
    fill: none;
    stroke: #5C3310;
    stroke-width: 8;
    stroke-linecap: round;
}

/* Content banner (center - goes UP) */
.content-banner {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 160px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #4B3CE0;
    border-radius: 12px;
    padding: 12px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: top 0.05s linear;
    will-change: top;
}

.banner-header {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #4B3CE0;
    margin-bottom: 4px;
}

.banner-tagline {
    font-size: 10px;
    color: #666;
    margin-bottom: 12px;
}

.banner-line {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 6px;
}

.banner-line.short {
    width: 60%;
}

.mascot-container {
    position: absolute;
    right: 35px;
    cursor: grab;
    transition: top 0.05s linear;
    will-change: top;
    -webkit-tap-highlight-color: transparent;
}

.mascot-container:active {
    cursor: grabbing;
}

.mascot-container.dragging {
    cursor: grabbing;
}

.mascot {
    animation: mascotBob 2s ease-in-out infinite;
    transition: transform 0.1s ease-out;
}

@keyframes mascotBob {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(0deg);
    }
}

.mascot-container.dragging .mascot {
    animation: none;
}

.drag-hint {
    position: absolute;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #4B3CE0;
    font-size: 0.85rem;
    font-weight: 600;
    animation: hintPulse 1.5s ease-in-out infinite;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.drag-arrow {
    font-size: 1.6rem;
    animation: arrowBounce 0.8s ease-in-out infinite;
    color: #4B3CE0;
}

@keyframes arrowBounce {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

@keyframes hintPulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.mascot-container:hover .mascot {
    transform: scale(1.08);
    transition: transform 0.2s ease;
}

.main-content-wrapper {
    transform: translateY(100vh);
    transition: transform 0.05s linear;
    will-change: transform;
}

.main-content-wrapper.revealed {
    transform: translateY(0) !important;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.pulley-active {
    overflow: hidden;
}

/* Pulley animation responsive */
@media (max-width: 768px) {
    .pulley-system {
        right: 20px;
    }

    .pulley-wheel {
        width: 70px;
        height: 63px;
    }

    .content-banner {
        width: 100px;
        height: 130px;
        padding: 10px;
    }

    .banner-header {
        font-size: 12px;
    }

    .banner-tagline {
        font-size: 9px;
        margin-bottom: 8px;
    }

    .banner-line {
        height: 6px;
        margin-bottom: 5px;
    }

    .mascot-container {
        right: 5px;
    }

    .mascot-container svg {
        width: 80px;
        height: 100px;
    }

    .drag-hint {
        right: 0;
        font-size: 0.75rem;
    }

    .drag-arrow {
        font-size: 1.3rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mascot,
    .drag-arrow,
    .drag-hint {
        animation: none;
    }

    .rope {
        animation: none;
    }

    .pulley-overlay.completed {
        transition: opacity 0.1s ease-out;
    }

    .main-content-wrapper.revealed {
        transition: transform 0.1s ease;
    }
}
