html,
body {
    height: 100%;
    margin: 0;
}

* {
    font-family: "Indie Flower", serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center; 
    font-family: "Indie Flower", serif;
    font-weight: 400;
    font-style: normal;
    background-color: black;
}

canvas {
    bottom: 0;
    width: 50vw;
    /* 50% of the viewport width */
    height: calc(100vh - 1px);
    /* 100% of the viewport height */
    border: 1px solid black;
}

#score {
    background-color: white;
    width: 70px;
    text-align: center;
    font-weight: 800;
    font-size: 25px;
    position: fixed;
    top: 10px;
    left: calc(25% + 10px);
}

#background {
    position: fixed;
    width: 50%;
    height: 100vh;
    left: 25%;
    top: 0;
    background-image: url('backround.png');
    background-size: cover;
    background-position: center;
    /*Needed to position the other elements*/
}

#topImage {
    /* Added for top image */
    position: absolute;
    top: 20px;
    /* Adjust as needed */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    /* Adjust as needed */
}

h1 {
    position: fixed;
    left: calc(50% - 100px);
    top: 45%;
}

#platform {
    /* Added for the platform */
    width: 200px;
    height: 50px;
    background-image: url('https://quizizzdoodle.pages.dev/platform.png');
    /* Replace with your platform image URL */
    background-size: cover;
    position: absolute;
    bottom: 120px;
    left: 20%;
    transform: translateX(-50%);
}

#character {
    width: 150px;
    height: 156px;
    background-image: url('https://quizizzdoodle.pages.dev/doodle normal.png');
    background-size: contain;
    position: absolute;
    bottom: 350px;
    /* Adjusted to be above the platform */
    left: calc(20% - 80px);
    animation: bounce 0.5s;
    animation-direction: alternate;
    animation-timing-function: cubic-bezier(.5, 0.05, 1, .5);
    animation-iteration-count: infinite;
}

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

    to {
        transform: translate3d(0, 200px, 0);
    }
}

#playButton {
    position: absolute;
    top: 60%;
    /*Adjusted position*/
    left: calc(50% - 50px);
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    font-size: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    animation: moveUpAndDown 2s ease-in-out infinite;
}

.menu {
    position: fixed;
    top: 5px;
    right: calc(25% + 5px);
    height: 50px;
    width: 50px;
    background-color: green;
    color: lightgreen;
    border: solid black 3px;
    border-radius: 10px;
    font-size: 25px;
    text-align: center;
}

#menu, #gameover {
    font-family: "Indie Flower", serif;
    font-weight: 400;
    position: fixed;
    top: 50px;
    right: 35%;
    height: calc(100% - 150px);
    width: 30%;
    background-color: green;
    color: lightgreen;
    border: solid black 3px;
    border-radius: 10px;
    font-size: 25px;
    text-align: center;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    justify-content: flex-end; /* Push buttons to the bottom */
    align-items: center; /* Center buttons horizontally */
}

#menu > button:not(.exitbutton) {
    font-family: "Indie Flower", serif;
    font-weight: 900;
    font-size: 20px;
    border-radius: 10px;
    border: solid black 1px;
    background-color: #4CAF50;
    height: 40px;
    width: 80%;
    margin-bottom: 20px;
}

#menu > h3, p {
    margin-block-start: 0;
    margin-block-end: 0;
}

#menu > p {
    margin-bottom: auto;
}

#menu > h3 {
    margin-top: 50px;
}

.exitbutton {
    font-family: "Indie Flower", serif;
    border-radius: 15px;
    border: solid black 1px;
    background-color: #afa34c;
    width: 30px; /* Adjust the width as needed */
    height: 30px; /* Adjust the height as needed */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; /* Optional */
    font-weight: 900;
    position: absolute;
    right: -10px;
    top: -10px;
}


.leaderboard {
    position: fixed;
    top: 60px;
    right: calc(25% + 5px);
    height: 50px;
    width: 50px;
    background-color: green;
    color: lightgreen;
    border: solid black 3px;
    border-radius: 10px;
    font-size: 25px;
    text-align: center;
}

#leaderboard {
    font-family: "Indie Flower", serif;
    font-weight: 400;
    position: fixed;
    top: 50px;
    right: 35%;
    height: calc(100% - 150px);
    width: 30%;
    background-color: green;
    color: lightgreen;
    border: solid black 3px;
    border-radius: 10px;
    font-size: 25px;
    text-align: center;
    display: flex;
    flex-direction: column; /* Keep the flex container in column layout */
    justify-content: flex-end; /* Push the buttons to the bottom */
    align-items: center; /* Center the buttons horizontally */
}

#leaderboard > div > button:not(.exitbutton, #customusernamebtn) {
    font-family: "Indie Flower", serif;
    font-weight: 900;
    font-size: 20px;
    border-radius: 10px;
    border: solid black 1px;
    background-color: #4CAF50;
    height: 40px;
    width: auto; /* Allow the width to adjust based on the content */
    margin-right: 10px; /* Adds space between buttons */
    margin-bottom: 30px;
}

#leaderboard > div {
    display: flex; /* Use flexbox to display the buttons horizontally */
    justify-content: flex-start; /* Align buttons to the left side */
    gap: 10px; /* Add space between buttons */
}

#leaderboard > h3 {
    position: relative;
    font-size: 20px;
    margin: 0;
}

.useronleaderboard {
    background-color: #205921;
}

#localscores, #globalscores, #settings {
    background-color: #318333;
    border-top-left-radius: 255px 5px;
    border-top-right-radius: 5px 225px;
    border-bottom-right-radius: 225px 5px;
    border-bottom-left-radius:5px 255px;
    border: solid 2px #41403E;
    width: 80%;
    margin-bottom: 10px;
    height: 60%;
    overflow: auto;
}

ol {
    list-style: none; /* Remove the default numbers */
    padding-left: 0; /* Adjust padding to align content */
}

ol > li {
    position: relative; /* Needed for ::before positioning */
}

ol > li::before {
    content: counter(list-item) "."; /* Display the number */
    counter-increment: 1; /* Increment the number automatically */
    position: absolute; /* Position it independently */
    left: 0; /* Align to the left */
    top: 0; /* Align with the text */
    background-color: green; /* Add background color */
    color: #afa34c; /* Change the number color */
    font-weight: bold; /* Make it bold */
    padding: 0 8px; /* Add padding around the number */
    border-radius: 100px; /* Rounded corners */
    border: solid black 2px;
    margin-left: 20px;
}

ol > li:nth-child(1)::before {
    background-color: gold; /* Background for the first item */
    color: white; /* Text color for the first item */
}

ol > li:nth-child(2)::before {
    background-color: gray; /* Background for the second item */
    color: white; /* Text color for the second item */
}

ol > li:nth-child(3)::before {
    background-color: #CD7F32; /* Background for the third item */
    color: white; /* Text color for the third item */
}

#customusername {
    font-family: "Indie Flower", serif;
    font-weight: 900;
    font-size: 15px;
    padding: 5px 5px 5px 20px;
    outline: none;
    border-radius: 10px;
    border: solid black 1px;
    background-color: #4CAF50;
    height: 40px;
    width: 80%; /* Allow the width to adjust based on the content */
    margin-top: 30px;
}

#customusername::placeholder {
    color: rgb(62, 62, 62);
}

#customusernamebtn {
    background-color: #afa34c;
    width: 80%;
    margin-top: 20px;
    border: none;
    border-radius: 10px;
}

select {
    width: 80%;
    height: 30px;
    background-color: #4CAF50;
    border: solid black 1px;
    border-radius: 10px;
}

select * {
    width: 80%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 15px;
}

/* Track */
::-webkit-scrollbar-track {
    background: #afa34c;
}

/* Handle */
::-webkit-scrollbar-thumb {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: #7c7436;
    border: 2.5px solid transparent; /* Create a border */
    background-clip: padding-box; /* Only apply background to padding */
}

@keyframes moveUpAndDown {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }

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