.hidden {
    display: none;
}

.osterspiel-add p {
    color: white;
    margin-top: 1.5rem;
    text-shadow: 2px 2px 5px black;
    text-align: center;
    display: block;
}

.osterspiel-add p a {
    color: red;
    text-decoration: none;

}

/*
------------------------------------------- highscore ----------------------------------------------------------
 */

/* Highscore Modal Styling */
.highscore-modal-content {
    margin: 1rem 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.highscore-modal-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: #f3f4f6;
    border-radius: 0.5rem;
    border-left: 4px solid #3b82f6;
}

.highscore-modal-mode {
    font-weight: bold;
    color: #1f2937;
}

.highscore-modal-score {
    font-weight: bold;
    color: #3b82f6;
    font-size: 1.2rem;
}

/*
---------------------------------------------------- ladescreen -----------------------------------------
 */

/* Ladebildschirm */
.osterspiel-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease-out;
}

.osterspiel-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: pulse 2s ease-in-out infinite;
}

.loading-logo img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.loading-text {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: white;
    font-weight: bold;
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin: 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
/*
---------------------------------------------------- ladescreen -----------------------------------------
 */

/* Sound Toggle Button */
.osterspiel-sound-toggle {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
}

/* WICHTIG: Hidden state muss explizit sein */
.osterspiel-sound-toggle.hidden {
    display: none !important;
}

.osterspiel-sound-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.osterspiel-sound-toggle:active {
    transform: scale(0.95);
}

.osterspiel-sound-toggle .sound-icon {
    width: 24px;
    height: 24px;
    filter: invert(1);
    pointer-events: none;
}


.points-label {
    font-size: 3rem;
}

.highscore-label {
    font-size: 2rem;
    color: black;
}

.highscore-item {
    font-weight: normal;
    line-height: 1.2;
}

.osterspiel-credits {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    color: white;
    text-shadow: 2px 2px 5px black;
    cursor: pointer;
    z-index: 20;
    text-decoration: none;
}

.osterspiel-credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.osterspiel-credits-content {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.osterspiel-credits-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-left: 6px solid #dc2626;
}

.osterspiel-credits-modal.hidden {
    display: none;
}


.osterspiel-wrapper {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    touch-action: none;
}

.osterspiel-wrapper * {
    box-sizing: border-box;
}

.osterspiel-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.osterspiel-screen-content {
    padding-top: 35vh;
}

#osterspiel-instructions-modal .osterspiel-credits-content {
    max-width: 90%;
    text-align: center;
    padding: 1rem;
}

/* Screen overlay (Start / GameOver) */
.osterspiel-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: rgb(240, 240, 240);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 2rem 1rem;
    gap: 0.5rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    background-image: url('/fileadmin/user_upload/spiel/easter26/game_background_1.png');
    background-repeat: no-repeat;
    /* background-position: center center; */
    background-size: cover;
}

.osterspiel-screen.hidden {
    display: none !important;
}

/* Responsive Titel */
.osterspiel-title {
    font-size: clamp(1.5rem, 6vw, 3.75rem);
    font-weight: bold;
    margin: 0 0 1rem 0;
    color: black;
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-align: center;
    line-height: 1.05;
    max-width: 95%;
    word-break: break-word;
    hyphens: auto;
}

.osterspiel-text {
    font-size: clamp(0.9rem, 3.6vw, 1.5rem);
    color: black;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    padding: 0 1rem;
    max-width: 92%;
    word-break: break-word;
    white-space: normal;
}

/* Responsive Button */
.osterspiel-button {
    display: inline-block;
    font-size: clamp(0.9rem, 3.5vw, 1.5rem);
    padding: clamp(0.5rem, 1.8vw, 1.2rem) clamp(0.9rem, 3vw, 2rem);
    font-weight: bold;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    background-color: #22c55e;
    color: white;
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    transition: transform 0.12s ease;
    touch-action: manipulation;
    max-width: 100%;
    width: auto;
    white-space: normal;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.button-group .osterspiel-button {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.osterspiel-button:hover,
.osterspiel-button:active {
    transform: scale(1.03);
}

/* Finalscore */
#osterspiel-finalscore {
    font-size: clamp(1.5rem, 8vw, 3rem);
    margin: 0.5rem 0 1rem 0;
    max-width: 95%;
    word-break: break-word;
    text-align: center;
    border-left: none;
}

/* HUD */
.osterspiel-hud {
    position: absolute;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 10;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.osterspiel-hud.left { left: 0.5rem; }
.osterspiel-hud.right { right: 0.5rem; }

.osterspiel-logo {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.osterspiel-logo-text {
    font-size: 2rem;
    font-weight: bold;
    color: #dc2626;
    letter-spacing: -2px;
}

.osterspiel-logo img {
    width: 40%;
    height: 40%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

.key-icon {
    height: 4em;
    vertical-align: middle;
    display: inline-block;
}

/* Difficulty select inline */
.osterspiel-difficulty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.difficulty-label {
    font-size: clamp(0.9rem, 3.5vw, 1.5rem);
    color: white;
    white-space: nowrap;
    text-shadow: 2px 2px 5px black;
}

/* Select Box */
.osterspiel-select {
    font-size: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.15);
    background: white;
    color: #111827;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    min-width: 120px;
    max-width: 250px;
    text-align: center;
}

/* IE/Edge Pfeil entfernen */
.osterspiel-select::-ms-expand {
    display: none;
}

#osterspiel-gameover {
    background-image: url('/fileadmin/user_upload/spiel/easter26/game_background_1.png');
    background-repeat: no-repeat;
    /* background-position: center center; */
    background-size: cover;
    justify-content: flex-start;
    padding-top: 30vh;
}

.osterspiel-button.anleitung {
    background-color: darkorange;
    margin-left: 1vh;
}

.osterspiel-hud.legend-timer {
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    padding: 1rem 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-decrement {
    font-size: 0.5em;
    margin-left: 0.5rem;
    opacity: 0.8;
    color: red;
}

/* Gameover: Textfarben weiß */
#osterspiel-gameover .osterspiel-text,
#osterspiel-gameover .osterspiel-title,
#osterspiel-gameover .points-label,
#osterspiel-gameover .difficulty-label {
    color: white;
    text-shadow: 2px 2px 5px black;
}


/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .osterspiel-wrapper { height: 70vh; }
    .osterspiel-hud { font-size: 1.75rem; }
}

/* Smartphone */
@media (max-width: 480px) {

    .osterspiel-screen,
    #osterspiel-gameover {
        background-image: url('/fileadmin/user_upload/spiel/easter26/game_background_2.png');
        background-position: center center;
    }

    .osterspiel-add {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin-top: 0.3rem;
    }

    .osterspiel-add p {
        margin: 0;
        font-size: 0.4rem;
    }

    .highscore-modal-content {
        max-width: 100%;
    }

    .highscore-modal-item {
        padding: 0.5rem;
        font-size: 0.4rem;
    }

    .highscore-modal-score {
        font-size: 0.5rem;
    }

    .button-group {
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0.3rem;
        padding-left: 0.1rem;
        flex-direction: column;
    }

    .button-group .osterspiel-button {
        min-width: 200px;
        max-width: 250px;
        flex: 0;
        align-self: flex-start;
    }

    .timer-decrement {
        font-size: 0.3em;
        margin-left: 0.1rem;
        opacity: 0.8;
        color: red;
    }

    .osterspiel-sound-toggle {
        width: 28px;
        height: 28px;
        bottom: 0.25rem;
        left: 0.1rem;
    }

    .osterspiel-sound-toggle .sound-icon {
        width: 16px;
        height: 16px;
    }

    .points-label {
        font-size: 1rem;
    }

    .highscore-label {
        font-size: 0.5rem;
    }

    .key-icon {
        height: 2em;
        vertical-align: middle;
        display: inline-block;
    }

    .osterspiel-credits {
        font-size: 0.4rem;
        bottom: 0.15rem;
        left: 0.15rem;
    }

    .osterspiel-difficulty {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        width: 100%;
    }

    .difficulty-label {
        font-size: 0.6rem;
        white-space: normal;
        text-align: center;
        width: 100%;
    }

    .osterspiel-select {
        font-size: clamp(0.5rem, 1.5vw, 0.5rem);
        padding: 0.4rem 0.6rem;
        min-width: 200px;
        max-width: 200px;
        width: auto;
        text-align: center;
        background-size: 0.6rem auto;
        margin-left: 0.1vh;
    }

    .osterspiel-wrapper {
        height: 90vh;
        min-height: 500px;
        max-height: 800px;
    }

    .osterspiel-screen {
        padding: 1rem 0.1rem;
        gap: 0.4rem;
        justify-content: center;
        align-items: flex-start;
    }

    .osterspiel-title { font-size: clamp(1.25rem, 8vw, 2rem); margin-bottom: 0.5rem; }
    .osterspiel-text { font-size: clamp(0.8rem, 3.6vw, 1rem); margin-bottom: 0.5rem; }

    .osterspiel-button {
        font-size: clamp(0.5rem, 1.5vw, 0.5rem);
        padding: 0.4rem 1rem;
        margin-top: 0.5rem;
        box-sizing: border-box;
    }

    .osterspiel-hud { font-size: 0.8rem; padding: 0.1rem 0.75rem; margin-top: 0rem; }
    .osterspiel-hud.legend-timer {
        font-size: 2rem;
        padding: 0.5rem 1rem;
        top: 3rem;
        min-width: 250px;
    }
    .osterspiel-logo { width: 38px; height: 38px; bottom: 0.5rem; right: 0.5rem; }
    .osterspiel-logo-text { font-size: 1rem; }
    .osterspiel-title { font-size: 0.8rem; }
    .osterspiel-text { font-size: 0.5rem; }
    #osterspiel-finalscore { font-size: 0.2rem; }

    /*
    Verschiebung der Sachen im endscreen
     */

    #osterspiel-gameover .osterspiel-text {
        margin-bottom: 0.2rem;
    }

    #osterspiel-finalscore {
        margin: 0 0 0.4rem 0;
        line-height: 1;
    }

    #osterspiel-gameover .osterspiel-button {
        margin-top: 0.25rem;
    }

    #osterspiel-highscore-btn {
        margin-bottom: 0.1rem;
    }

    #osterspiel-gameover .osterspiel-difficulty {
        margin-top: 0.4rem;
        gap: 0.1rem;
    }

    #osterspiel-gameover .osterspiel-score {
        width: auto;
        justify-content: center;
        text-align: center;
    }

    .osterspiel-gameover {
        justify-content: center;
        align-items: center;
        padding-top: 35svh;
    }

    #osterspiel-gameover .osterspiel-score,
    #osterspiel-gameover .osterspiel-button,
    #osterspiel-gameover .osterspiel-difficulty {
        align-self: center;
    }

    #osterspiel-finalscore {
        margin-top: 0.5rem;
    }
}

/* Landscape Smartphone */
@media (max-width: 896px) and (orientation: landscape) {
    .osterspiel-wrapper { height: 70vh; }
    .osterspiel-screen { padding: 0.5rem; gap: 0.25rem; }
    .osterspiel-title { font-size: clamp(1rem, 6vw, 1.5rem); margin-bottom: 0.5rem; }
    .osterspiel-text { font-size: clamp(0.7rem, 3.2vw, 0.9rem); margin-bottom: 0.4rem; }
    .osterspiel-button { font-size: 1rem; padding: 0.6rem 1rem; }
    .osterspiel-hud { font-size: 1rem; top: 0.5rem; padding: 0.25rem 0.5rem; }
}

@media (max-width: 400px) {
    .osterspiel-wrapper {
        height: 80vh;
    }
}