* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.page {
    position: relative;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

#page1 {
    background: url(../images/bg-page1.webp) no-repeat center center;
    background-size: cover;
    height: 100%;
    width: 100%;
}

#page2 {
    background: url(../images/bg-page2.webp) no-repeat center center;
    background-size: cover;
    height: 100%;
    width: 100%;
}

.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
}

.overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn {
    margin: 30px;
    padding: 16px 32px;
    font-size: 18px;
    border: none;
    border-radius: 12px;
    background-color: orange;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.music-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: rgba(0, 47, 189, 1);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.stick {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 10px;
    height: 100px;
    transform: translateX(-50%) rotate(0deg);
    transform-origin: bottom center;
    transition: transform 0.2s ease;
    z-index: 10;
}

.canRope {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100px;
    background: url(../images/pg2-rope.webp) no-repeat center top;
    background-size: contain;
    z-index: 8;
}

.jarTrack {
    display: flex;
    width: max-content;
    animation: scrollJars 6s linear infinite;
}

@keyframes scrollJars {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.jar {
    flex-shrink: 0;
    margin: 0 10px;
    height: 150px;
    width: auto;
    animation: floatJar 2s ease-in-out infinite;
}

.jar.shake {
    animation: jarShake 0.3s ease;
}

@keyframes jarShake {

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

    25% {
        transform: translateY(-5px) rotate(-2deg);
    }

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

    75% {
        transform: translateY(-5px);
    }
}

.character {
    position: absolute;
    bottom: 19%;
    left: 46%;
    transform: translateX(-50%);
    width: 26%;
    z-index: 9;
}

@media (min-width: 768px) {
    .container {
        width: 400px;
        max-height: 809px;
        height: 100%;
        margin: 0 auto;
    }

    .jar {
        height: 150px !important;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(2deg);
    }

    50% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

.animate-pop-up {
    opacity: 0;
    transform: scale(0.8);
    animation: popUp 0.6s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 0.9s;
}

.delay-4 {
    animation-delay: 1.2s;
}

@keyframes popUp {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-shake {
    animation: shake 1s infinite;
}

.shake {
    animation: shake 0.4s ease;
}

#resultText {
    margin: 10px auto 20px auto;
    font-size: 12px;
    color: white;
    text-align: center;
    text-shadow: 1px 1px 3px black;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 15px;
    display: none;
}

@keyframes zoomBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.zoom-loop {
    animation: zoomBounce 1.2s ease-in-out infinite;
}

#successOverlay button.btn:hover {
    background: #ff9900;
    transform: scale(1.05);
}

@keyframes popBroken {
    0% {
        transform: scale(1) rotate(0);
    }

    30% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.jar.broken {
    animation: popBroken 0.6s ease-out;
}