/* Global Reset and Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    /* Prevent selection */
    cursor: none;
    /* Hide default cursor */
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic Pro", sans-serif;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Background */
#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bg_farm.svg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    /* Semi-transparent overlay for readability */
    transition: opacity 0.5s;
}

.hidden {
    display: none !important;
}

.title-text {
    font-size: 5rem;
    color: #d35400;
    text-shadow: 3px 3px 0 #fff;
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

.instruct {
    font-size: 2rem;
    color: #333;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: bold;
}

/* Hover Buttons (Dwell Click) */
.hover-btn {
    position: relative;
    width: 200px;
    height: 200px;
    background: #f1c40f;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 10px 0 #e67e22;
    transition: transform 0.1s;
}

.hover-btn span {
    z-index: 2;
}

/* Loading Ring for Dwell Interaction */
.progress-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 10px solid transparent;
    border-top-color: #2ecc71;
    transform: rotate(0deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.hover-btn.active .progress-ring {
    opacity: 1;
    animation: spin 1.5s linear forwards;
    /* 1.5s to activate */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {

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

    50% {
        transform: translateY(-20px);
    }
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    font-size: 2rem;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    display: flex;
    gap: 3rem;
}

/* Chicken Layer */
#chicken-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Below HUD, above BG */
    overflow: hidden;
}

.chicken {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('assets/chicken.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.1s;
    /* Smooth visual turn */
}

.chicken.captured {
    transform: scale(1.5) rotate(360deg);
    opacity: 0;
    transition: all 0.3s;
}

/* Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    background-image: url('assets/hand_cursor.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    /* Let events pass through */
    z-index: 100;
    margin-left: -50px;
    /* Center hotspot */
    margin-top: -50px;
}