:root {
    --primary: #39E079;
    --primary-dark: #2ab860;
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    --surface: #ffffff;
    --text-main: #102a43;
    --text-muted: #627d98;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius-xl: 24px;
    --radius-md: 12px;
}


* { box-sizing: border-box;-webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/*Layout & Container*/
.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow-y: auto;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1000px;
}

/* Header */
.header {
    padding: 10px 0;
    background: transparent;
    flex: 0 0 auto; /* WICHTIG: Header darf nicht schrumpfen */
    width: 100%;

}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}
.header-content-game {
    display: flex;
    align-items: center;
    justify-content: right;
    min-height: 70px;
}

/* Logo */
.header-logo {
    height: 55px;
    width: auto;
    mix-blend-mode: multiply; /* Lässt weißen Hintergrund transparent wirken */
    display: block;
}

.close-btn {

    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: var(--bg-gradient);
}

.close-btn:hover { transform: scale(1.05); }

.header-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}
h1.header-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-shadow: none;
}
.level {
    padding-bottom: 50px;

}

/* Main Stage */
.main-content-index {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    text-align: center;
}
.main-content-game {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;

}
.main-content-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    text-align: center;
}


.game-stage-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.game-stack {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;


}

/* Hochformat */
.game-stage {
    position: relative; /* <--- WICHTIG: Das macht ihn zum Anker */
    height: 40vh;
    width: 100%;

    aspect-ratio: 4 / 5;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: transparent;
}
.stage-img {

    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: transparent;

}
#main-img {
    max-height: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    background: transparent;
    overflow: hidden;
}






/* UI Elemente */
.narrow-content {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* Progress Bar */
.progress-container { margin-bottom: 10px; }
.progress-info {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.progress-bar-bg {
    height: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary-dark);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 99px;
}

/* Buttons */
.button-row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: white;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
}





#aiBtn { color: var(--primary); border-bottom: 4px solid; }
#aiBtn:hover { background: #eff6ff; border-color: var(--primary); }

#humanBtn { color: var(--primary); border-bottom: 4px solid; }
#humanBtn:hover { background: #f0fdf4; border-color: var(--primary); }

#startBtn, #replayBtn {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(57, 224, 121, 0.4);
    width: 100%;
    font-size: 1.2rem;
}
#startBtn:hover, #replayBtn:hover {
    background: var(--primary-dark);
}

/* Start & Result Page Styling  */
.circle-logo {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--primary);
}
.circle-logo img { width: 100%; height: 100%; object-fit: cover; }

.trophy {font-size: 6rem; margin-bottom: 10px;}

#scoreText {font-size: 1.3rem; font-weight: 600; color: var(--text-main)}

h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--text-main);text-shadow: 3px 3px var(--text-muted); }
p { font-size: 1.1rem; line-height: 1.6; color: var(--text-muted); }

/* Footer */
.footer {
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.social-links { display: flex; justify-content: center; gap: 60px; }
.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}
.social-item span.fa { font-size: 1.5rem; margin-bottom: 5px; color: var(--primary); }
.social-item:hover { color: var(--primary); }

.feedback {
    position: absolute; /* Schwebt über allem */
    top: 50%;           /* Schiebt die Oberkante in die Mitte */
    left: 50%;          /* Schiebt die linke Kante in die Mitte */
    transform: translate(-50%, -50%); /* Korrigiert die eigene Größe zurück -> Exakte Mitte */

    z-index: 20;        /* Sicherstellen, dass es ganz oben liegt */
    pointer-events: none; /* Klicks gehen durch */

    /* Aussehen */
    font-size: 8rem;
    font-weight: 800;
    opacity: 0;         /* Startet unsichtbar */
    transition: opacity 0.2s;
}

/* Diese Klassen lässt du so (für die Farben) */
.feedback.show { opacity: 1; }
.feedback.correct { color: #2ecc71; text-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.feedback.wrong { color: #e74c3c; text-shadow: 0 5px 15px rgba(0,0,0,0.3); }





/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    padding: 4px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--primary);
    background: rgba(0,0,0,0.03);
}

.lang-btn.active {
    color: var(--text-main);
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.05);
}

/* Desktop */
@media (min-width: 850px) {
    .game-stack {
        max-width: 900px; /* Desktop Breite */
    }

    .game-stage {
        aspect-ratio: 16 / 9;
        border-width: 8px;
    }
    .stage-img {
        background-size: contain;

    }
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    }
    #main-img {
        max-height: 100%;
        max-width: 100%;
        height: auto;
        border-radius: var(--radius-xl);
        background: transparent;
        overflow: hidden;
    }

}

@media (max-height: 500px) and (orientation: landscape) {
    .header { display: none; }
    .game-stage {
        height: 70vh;
        width: auto;
        aspect-ratio: 16 / 9;
        margin: 5px auto;
    }
}