body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #e0e0e0;
    font-size: 120%;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.house-container {
    position: relative;
    width: 75%;
    height: 0;
    padding-bottom: 55%;
    background: url('Nimetön malli.png') no-repeat center center;
    background-size: contain;
}

.window {
    position: absolute;
    width: 15%;
    height: 20%;
    background-color: rgba(255, 255, 255, 0);
    pointer-events: all;
    cursor: pointer;
}

/* Ikkunoiden sijainti */
#window1 { top: 12.5%; left: 6%; }
#window2 { top: 12.5%; left: 29%; }
#window3 { top: 12.5%; left: 52%; }
#window4 { top: 12.5%; left: 75%; }
#window5 { bottom: 15%; left: 6%; }
#window6 { bottom: 15%; left: 29%; }
#window7 { bottom: 15%; left: 52%; }
#window8 { bottom: 15%; left: 75%; }

.text {
    padding: 1%;
}

/* KESKITYTTY KYSELYALUE */
.popup {
    display: flex;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(90, 117, 192, 0);
    padding: 20px;
    border-radius: 10px;
    z-index: 3;
}

/* KYSYMYS */
#perse {
    display: none;
    font-size: 20px;
    color: black;
    margin-bottom: 20px;
    background-color: rgb(168, 236, 212);
    border-radius: 90px;
    text-align: center;
    padding: 15px 25px;
}

/* VASTAUSVAIHTOEHDOT */
.p {
    display: none;
    margin: 8px;
    padding: 10px;
    border-radius: 100px;
    cursor: pointer;
    width: 120px;
    text-align: center;
    font-size: 20px;
    background-color: rgb(168, 236, 212);
}

/* Vihreä fakta-efekti */
.popup2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 255, 0);
    pointer-events: none;
    border-radius: 100px;
}

/* Punainen väärin-efekti */
.popup3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(255, 0, 0);
    pointer-events: none;
    z-index: 0;
    border-radius: 100px;
}

/* Kiinteät napit */
.fixed-buttons1 {
    position: fixed;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.fixed-buttons1 input {
    width: 70px;
    height: auto;
    cursor: pointer;
}

#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.button-container {
    background-color: rgba(100, 204, 164);
    padding: 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-width: 250px;
}

#title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

#startButton {
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    width: 200px;
    background-color: rgb(168, 236, 212);
    color: rgb(0, 0, 0);
}

.fixed-buttons {
    position: fixed;
    top: 75px;
    left: 15px;
    display: flex;
    gap: 10px;
    z-index: 998;
}

.fixed-buttons input {
    width: 50px;
    height: 50px;
    cursor: pointer;
}

#fullscreenButton,
#musicButton {
    background-color: transparent;
}

#musicButton {
    margin-top: 10px;
}


#popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgb(100, 204, 164);
    color: rgb(0, 0, 0);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 500;
}

#popup button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: rgba(168, 236, 212, 0.8);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#popup button:hover {
    background-color: rgba(168, 236, 212);
}

#finalScore {
    font-size: 20px;
    margin-top: 10px;
}

/* RESPONSIVE MEDIA */
@media (max-width: 800px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .house-container {
        width: 90%;
        padding-bottom: 70%;
    }

    .window {
        width: 20%;
        height: 25%;
    }

    #perse {
        width: 50px;
        font-size: 1px;  /* Smaller font size for mobile */
        padding: 8px;  /* Adjust padding for smaller screens */
        background-color: red;
    }

    /* Smaller width and font size for answers */
    .p {
        width: 40px;  /* Smaller width */
        font-size: 10px;  /* Smaller font size for mobile */
        padding: 8px;  /* Adjust padding for smaller screens */
    }
}

#animalFact {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgb(100, 204, 164);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    width: 300px;
    z-index: 100;
}

/* RESPONSIVE: pienennä faktaruutu mobiilissa */
@media (max-width: 600px) {
    #animalFact {
        font-size: 5px;
        width: 220px;
        padding: 15px;
    }
}

.factPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgb(100, 204, 164);
    color: rgb(0, 0, 0);
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;    
    display: none;  /* Piilotetaan aluksi */
    z-index: 9999;  /* Varmistaa, että popup näkyy muiden elementtien päällä */
}
