/*Propperties*/

:root {
    --spacing-20: 20px;
}

header {
    width : 100vw;
}
/* Utility classes */
/* Utility class for centering elements */
.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

html{
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    align-content: center;
    height: 100vh; /* Sorgt dafür, dass der Body die volle Höhe des Viewports einnimmt */
    margin: 0; /* Entfernt den Standard-Margin */
    padding: 0;
    background-color: #1e1e1e;
    overflow-x: hidden;

}

#logo {
    /*padding-top: 20px;*/
    /*padding-bottom: 20px;*/
    padding: var(--spacing-20) var(--spacing-20);
    width: 15rem;
}

h3 {
    color: whitesmoke;
}

.explanation {
    color: whitesmoke;
    width: 100%;
    max-width: 800px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: justify;
}

#startContainer {
    text-align: center;
    margin: 20px;
}

#playerName {
    margin-right: 10px;
}

.gamecontainer {
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: 800px;
    padding: 20px;
    max-height: 350px;
}

.mobile-view {
    width: 100%;
}
/*.gamecontainer.mobile-view {
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
}*/

.gamecontainer.mobile-view {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}


.gameAndScore {
    display: flex;
    flex-direction: column;
    text-align: center;

    align-content: center;
    align-items: center;
    justify-content: center;
    justify-items: center;
}


/*-----------------------------Game------------------------------*/


#game {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 350px;
    border: 1px solid black;
    overflow: hidden;
    background-image: url('img/imgHenry/backgroundlight.jpg');
    background-size: cover;
    background-position: center bottom; /* Zentriert das Bild */
}

#game.mobile-view {
    width: 100vw;
    height: 100vh;
    max-height: 350px;
}



@media (max-width:  781px) {
/*    #game.mobile-view {
        width: 100vw; !* Setzt die Breite auf 100% des Viewports *!
        height: 100vh; !* Setzt die Höhe auf 100% der Viewport-Höhe *!
        position: relative;
        max-height: 100vh;
        max-width: 781px;
        padding-bottom: 10px;
    }*/
    #game.mobile-view {
        width: 100%;
        height: calc(100svh + 40px); /* svh = safe viewport height, fallback mit -1px */
        max-height: 350px;           /* damit es auf kleinen Screens nicht overflowt */
    }
}
@media (orientation: portrait) {
    #game.mobile-view {
        max-height: 400px;
    }
    .explanation h1 {
        padding-top: 40px;
    }
}

/*        #controlContainer{
            display: flex;
            flex-direction: column;
        }*/

#score {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: start;
    justify-items: start;
    color: #47dabc;
    padding-left: 300px;
    font-size: 20px;
}

@media (max-width: 781px) {

    .explanation{
        max-width: 90%;
    }
    #logo {
        max-width:90%;
    }
}

#ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2000px;
    height: 26px;
    background: linear-gradient(to bottom, rgba(135, 145, 120, 2%) 0%, rgb(135, 145, 120) 30%); /* Erstellt den Fade-Out-Effekt */
    /*animation: moveGround 2s linear infinite;*/
}


.obstacle {
    position: absolute;
    bottom: 20px;
    width: 20px;
    height: 50px;
    background-color: #bb4d16; /* Grundfarbe der Mauer */
    background-image: linear-gradient(rgba(0, 0, 0, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.25) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.2) 1px, transparent 1px);
    background-size: 20px 10px, 20px 10px, 10px 5px, 10px 5px; /* Größe der "Ziegel" und Fugen */
    background-position: 0 0, 0 0, 5px 10px, 10px 5px; /* Positionierung für überlappende Effekte */
}


#horse {
    position: absolute;
    bottom: 20px;
    left: 150px;
    width: 50px;
    height: 50px;
    background-image: url('img/imgHenry/HenrySit.png');
    background-size: cover;
}


#gameover {
    display: none; /* Anfangs versteckt */
    position: absolute; /* Ermöglicht die Positionierung innerhalb des Spielfelds */
    /*top: 50%; !* Zentriert das Bild vertikal innerhalb des Spielfelds *!
    left: 50%; !* Zentriert das Bild horizontal innerhalb des Spielfelds *!
    transform: translate(-50%, -50%); !* Stellt sicher, dass das Bild genau in der Mitte positioniert ist *!*/
    z-index: 10; /* Stellt sicher, dass das Bild über anderen Elementen im Spiel liegt */
    max-width: 80%; /* Begrenzt die Größe des Bildes, um es innerhalb des Spielfelds zu halten */
    max-height: 80%;
}

.jump {
    animation: jump 0.5s ease-out;
}

@keyframes moveGround {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-1000px);
    }
}

@keyframes jump {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-100px);
    }
    100% {
        transform: translateY(0);
    }
}

#playerName {
    height: 30px;
    width: 240px;
    font-size: 20px;
    background-color: rgba(255, 255, 255, 60%)
}

#fullscreenButton {
    position: absolute;
    bottom: 240px;
    right: 20px;
    border-radius: 50%; /* Rundes Design */
    width: 90px;
    height: 90px;
    font-size: 16px;
    background-color: #20748d;
    color: white;
    border: none;
    display: block; /* wenn none standardmässig versteckt evt mit mediascreen arbeiten?*/

    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}


#startButton {
    position: absolute;
    bottom: 130px;
    right: 20px;
    border-radius: 50%; /* Rundes Design */
    width: 90px;
    height: 90px;
    font-size: 16px;
    background-color: #3f208d;
    color: white;
    border: none;
    display: block;

    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#startButton:disabled {
    background-color: grey; /* Graue Hintergrundfarbe, wenn deaktiviert */
    cursor: not-allowed;    /* Zeigt an, dass der Button nicht anklickbar ist */
}


#jumpButton {
    position: absolute;
    bottom: 20px;
    right: 20px;
    border-radius: 50%; /* Rundes Design */
    width: 90px;
    height: 90px;
    font-size: 16px;
    background-color: #009879;
    color: white;
    border: none;
    display: block;

    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#rainbowButton {
    position: absolute;
    bottom: 20px;
    left: 20px;
    border-radius: 50%; /* Rundes Design */
    width: 90px;
    height: 90px;
    font-size: 16px;
    background-color: #933b6a;
    color: white;
    border: none;
    display: block;

    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}
#rainbowButton:disabled {
    background-color: grey; /* Graue Hintergrundfarbe, wenn deaktiviert */
    cursor: not-allowed;    /* Zeigt an, dass der Button nicht anklickbar ist */
}

#GhostModeIconTransparent{
    position: absolute;
    bottom: 260px;
    left: 20px;
    width: 80px;
    height: 80px;
    font-size: 16px;
    border: none;
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#UnicornModeIconTransparent{
    position: absolute;
    bottom: 260px;
    left: 100px;
    width: 80px;
    height: 80px;
    font-size: 16px;
    border: none;
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#GhostModeIcon{
    position: absolute;
    bottom: 260px;
    left: 20px;
    width: 80px;
    height: 80px;
    font-size: 16px;
    border: none;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#GhostModeIconSmall {
    position: relative;
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 10px; /* Add space between the icon and the text */
}

#UnicornModeIconSmall {
    position: relative;
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 10px; /* Add space between the icon and the text */
}

#UnicornModeIcon{
    position: absolute;
    bottom: 260px;
    left: 100px;
    width: 80px;
    height: 80px;
    font-size: 16px;
    border: none;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100000;
}

.rainbow {
    position: absolute;
    width: 60px;
    height: 15px;
    background: linear-gradient(to bottom, red, orange, yellow, green, blue, indigo, violet);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
    z-index: 100;
    /*animation: wiggle 0.3s infinite;*/
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}



/*-----------------------------Leaderboard------------------------------*/
.leaderboard {
    width: 100%;
    max-width: 800px;
}

table {
    width: 100%;
    max-width: 1000px;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

th {
    max-width: 33%;
    background-color: #009879;
    color: white;
    text-align: left;
}

th, td {
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 15px;
    border-bottom: 1px solid #939393;
    white-space: nowrap;
    text-align: left;
}

th:nth-child(1), td:nth-child(1) { /* Für die erste Spalte */
    width: 20%;
}

th:nth-child(2), td:nth-child(2) { /* Für die zweite Spalte */
    width: 50%;
}

th:nth-child(3), td:nth-child(3) { /* Für die dritte Spalte */
    width: 30%;
}


tr:nth-of-type(even) {
    background-color: #549a8b;
}

tr:nth-of-type(odd) {
    background-color: #8ac2b6;
}

tr:hover {
    background-color: #47dabc;
}

tr:last-of-type {
    border-bottom: 2px solid #009879;
}

.leaderboard td {
    max-width: 800px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-player {
    color: #1e1e1e;
    font-weight: bold;

    background-color: #63f6d9 !important;
}


footer{
    color: whitesmoke;
    max-width: 800px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: justify;
}

@media (max-width: 768px) {

    header {
        justify-content: space-between;
        width: 90vw;
    }
    td:nth-child(2) {
        max-width: 90px; /* oder was du brauchst */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

}
