/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
}

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

/* --- Telas --- */
#start-screen, #win-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 20px 30px;
    border-radius: 20px;
    border: 5px solid #ffb347;
    max-width: 90%;
}

#start-screen h1, #win-screen h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

#start-screen p, #win-screen p {
    font-size: 1.2em;
    margin-bottom: 20px;
    max-width: 500px;
}

#start-screen .host-intro {
    width: 150px;
    height: auto;
    margin-bottom: 15px;
}

#start-button, #play-again-button {
    padding: 15px 30px;
    font-size: 1.5em;
    border-radius: 15px;
    border: none;
    background-color: #5cb85c;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}
#start-button:hover, #play-again-button:hover {
    background-color: #4cae4c;
}

#game-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* --- Elementos do Jogo --- */
#status-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
}

#animals-container {
    flex-grow: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.animal-wrapper {
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 5px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    animation: float 4s ease-in-out infinite;
}

.animal-wrapper:nth-child(2) {
    animation-delay: -2s;
}

.animal-wrapper img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    pointer-events: none; /* Clicks passam para o wrapper */
}

.animal-wrapper.active {
    transform: scale(1.1);
    border-color: #ffdd57;
    background-color: rgba(255, 221, 87, 0.5);
    animation: none;
}

#host-capybara {
    position: absolute;
    bottom: 2%;
    left: 2%;
    width: 120px;
    height: auto;
    z-index: 10;
}

#waiting-area {
    width: 100%;
    background-color: rgba(210, 180, 140, 0.8);
    border-top: 4px solid #8B4513;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 15px;
    min-height: 130px;
}

#waiting-area h2 {
    position: absolute;
    top: -30px;
    left: 10px;
    font-size: 1em;
    color: #5d4037;
    background-color: #D2B48C;
    padding: 2px 8px;
    border-radius: 5px 5px 0 0;
    border: 2px solid #8B4513;
    border-bottom: none;
}

.animal {
    width: 80px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    transition: transform 0.2s ease-in-out;
    touch-action: none; /* Previne o scroll em touch devices */
}

.animal.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    opacity: 0.7;
    z-index: 1000;
}

.animal.in-onsen {
    position: absolute;
    cursor: default;
    animation: float 4s ease-in-out infinite;
    z-index: 5;
}

.animal.has-yuzu .yuzu {
    display: block;
}

#yuzu-basket {
    position: absolute;
    bottom: 25%;
    right: 20px;
    background-color: rgba(139, 69, 19, 0.7);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    gap: 5px;
}

.yuzu {
    width: 40px;
    height: 40px;
    cursor: grab;
    position: relative; /* Para o drag clone */
}

.yuzu.dragging {
     cursor: grabbing;
     opacity: 0.5;
}

.yuzu-on-head {
    position: absolute;
    top: -10px;
    left: 20px;
    width: 30px;
    height: 30px;
    z-index: 6;
    display: none; /* Escondido por padrão */
    pointer-events: none; /* Não interfere com outros cliques */
}

.heart {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('heart.png');
    background-size: contain;
    animation: fade-out-up 1s forwards;
    pointer-events: none;
}

#win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 5px solid #ffb347;
    z-index: 2000;
}
#win-message h2 {
    color: #d9534f;
    font-size: 2em;
    margin-bottom: 10px;
}
#play-again-button {
    padding: 10px 20px;
    font-size: 1.2em;
    border-radius: 10px;
    border: none;
    background-color: #5cb85c;
    color: white;
    cursor: pointer;
    margin-top: 15px;
}

/* Animações */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes fade-out-up {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Responsividade */
@media (max-width: 800px) {
    #start-screen h1, #win-screen h2 { font-size: 1.8em; }
    #start-screen p, #win-screen p { font-size: 1em; }
    #start-button, #play-again-button { font-size: 1.2em; padding: 12px 25px; }

    #animals-container {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }
    .animal-wrapper {
        width: 120px;
        height: 120px;
    }
    #status-display {
        font-size: 1.1em;
        padding: 10px 15px;
    }
    #host-capybara {
        width: 90px;
    }
}

@media (max-width: 400px) {
    .animal-wrapper {
        width: 100px;
        height: 100px;
    }
    #host-capybara {
        width: 70px;
    }
}