body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    font-family: 'Arial', rounded-mplus-1c-regular, sans-serif;
}

#game-container {
    width: 100%;
    height: 100%;
    background: url('assets/room_bg.png') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 40px;
    cursor: pointer;
    z-index: 100;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    /* Match other games style if possible, but emoji is fine for now */
    background: rgba(255, 255, 255, 0.5);
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
}

#game-area {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#box-zone {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#box-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.box-shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: scale(1.1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-5deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }

    75% {
        transform: scale(1.1) rotate(-5deg);
    }

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

#toys-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    /* Let clicks pass through to toys */
}

.toy {
    position: absolute;
    font-size: 80px;
    /* For emojis */
    cursor: grab;
    user-select: none;
    pointer-events: auto;
    transition: transform 0.1s;
    filter: drop-shadow(4px 4px 6px rgba(0, 0, 0, 0.3));
    /* If using images, remove font-size and set width */
}

.toy:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.toy.captured {
    transition: all 0.5s ease-in;
    transform: scale(0.1) rotate(360deg);
    opacity: 0;
}

/* Win Overlay */
#win-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s;
}

.hidden {
    display: none !important;
}

.win-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 5px solid #FFD700;
}

.win-content h1 {
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    color: #ff6b6b;
    margin: 0 0 20px 0;
    font-size: 3em;
}

.stars {
    font-size: 50px;
    margin-bottom: 20px;
    animation: bounce 1s infinite alternate;
}

button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Comic Sans MS', sans-serif;
    box-shadow: 0 4px #2E7D32;
}

button:active {
    box-shadow: 0 1px #2E7D32;
    transform: translateY(3px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

/* Star particle effect */
.particle {
    position: absolute;
    pointer-events: none;
    font-size: 30px;
    animation: popAndFade 0.8s forwards;
}

@keyframes popAndFade {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

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