@font-face {
    font-family: 'rioGrande';
    src: url('fonts/rioGrande.ttf') format('truetype');
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    background-image: url('img/desert.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
    width: 100vw;
    font-family: 'rioGrande', Arial, Helvetica, sans-serif;
}

h1 {
    font-size: 64px;
    margin: 16px;

}

#game {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 80%;
    height: 60%;
}

canvas {
    background-color: black;
    display: block;
    border-radius: 10px;
    position: relative;
}

#startButton {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    opacity: 0.4;
    width: 24%;
    max-width: 100%;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 45%;
    margin-top: 10px;
}

#fullScreenButton {
    cursor: pointer;
    background-color: rgb(213, 145, 60);
    color: black;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 18px;
}

#volumeButton {
    cursor: pointer;
    background-color: rgb(213, 145, 60);
    color: black;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 18px;
}

#controlButton {
    cursor: pointer;
    background-color: rgb(213, 145, 60);
    color: black;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 18px;
}

#fullScreenButton:hover {
    background-color: rgb(180, 112, 28);
}

#endScreen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: no-repeat center center;
    background-size: 60%;
    background-position: center;
    z-index: 10;
}

#playAgainButton {
    position: absolute;
    bottom: 250px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    background-color: rgb(213, 145, 60);
    color: black;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 600;
}

#playAgainButton:hover {
    background-color: rgb(180, 112, 28);
}

.mobileControls {
    display: none;
}

.privacy-text {
    display: none; 
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    max-height: 80vh; 
    padding: 20px;
    background-color: rgb(180, 112, 28);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 10px;
    overflow-y: auto;
    scrollbar-width: thin; 
    scrollbar-color: rgba(255,255,255,0.5) rgba(0,0,0,0.1); 
}

.privacy-text .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #444;
    cursor: pointer;
    z-index: 1001; 
}

.privacy-btn {
position: relative;
top: 24px;
}

.privacy-text .close-btn:hover {
    color: red;
}

.privacy-text::-webkit-scrollbar {
    width: 10px;
}

.privacy-text::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.privacy-text::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.5);
    border-radius: 6px;
}

  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 200;
  }

  .privacy-text.active,
  .overlay.active {
    display: block; 
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }


  .popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgb(180, 112, 28);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 300px;
    text-align: center;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  }

  .popup h3 {
    margin-top: 0;
  }

  .popup ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
  }

  .popup ul li {
    margin: 5px 0;
    font-size: 16px;
  }

  .popup .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ece4e4;
  }

  .popup .close-btn:hover {
    color: red;
  }

  .popup.active,
  .overlay.active {
    display: block;
  }

@media only screen and (max-width: 720px) {
    canvas {
        width: 100%;
    }

    h1 {
        display: none;
     }

     .message-overlay {
        display: none; 
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8); 
        color: white; 
        z-index: 1000; 
        justify-content: center; 
        align-items: center; 
        flex-direction: column;
    }
    
    .message {
        text-align: center; 
        padding: 20px;
    }


}

@media only screen and (max-height: 480px) {
    canvas {
        height: 100vh;
        border-radius: 0;
    }

    .controls {
     position: absolute;
     bottom: 10px;
    }

    #fullScreenButton {
        display: none;
    }

    #controlButton {
        display: none;
    }

    #volumeButton {
        cursor: pointer;
        background-color: rgb(213, 145, 60);
        color: black;
        border-radius: 50%;
        padding: 16px 16px;
        font-size: 18px;
        position: absolute;
        bottom: 280px;
    }

    .mobileControls {
        width: 90%;
        display: flex;
        font-size: 36px;
        justify-content: space-between;
        position: absolute;
        bottom: 20px;
    }

    #playAgainButton {
        bottom: 50px;
    }

    #endScreen {
        background-size: 90%;
    }

    .arrowRightLeft {
        display: flex;
        gap: 24px;
    }

    .arrowUpAtack  {
        display: flex;
        gap: 24px;
    }

    #leftBtn, #rightBtn,
    #upBtn{
        background-color: rgb(213, 145, 60);
        border-radius: 50%;
    }

    #attackBtn {
        background-color: rgb(213, 145, 60);
        border-radius: 50%;
    }


    html, body {
        height: 100%;
        margin: 0;
        overflow:hidden;
    }
    
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        background-image: url('img/desert.png');
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        font-family: 'rioGrande', Arial, Helvetica, sans-serif;
    }
    
    h1 {
        font-size: 64px;
        margin: 0;
    }
    
    #game {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute; 
        top: 0; 
        left: 0; 
        width: 100vw; 
        height: 100vh; 
        overflow: hidden; 
    }
    
    canvas {
        background-color: black;
        display: block;
        border-radius: 10px;
        width: 100%; 
        height: 100%; 
    }
}