/* Main App Container & Layout */
#app-container {
    background: #eff6ff; /* Helles, freundliches Pastellblau */
    padding: 20px 16px 16px 16px;
    border-radius: 24px;
    box-shadow: 0 8px 40px 0 rgba(0, 0, 0, 0.1); /* Subtiler Schatten */
    width: 100%;
    max-width: 440px;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid #dee2e6; /* Heller Rand */
    position: relative;
    overflow: hidden; /* Um überstehende animierte Elemente zu clippen */
    z-index: 1;
    animation: subtlePulse 8s infinite alternate ease-in-out; /* Subtile Puls-Animation */
}

/* Futuristic, mysterious spy/detective deco */
#app-container:before, #app-container:after {
    content: "";
    position: absolute;
    border-radius: 40px 160px 70px 175px/70px 120px 61px 100px;
    filter: blur(28px) contrast(1.18);
    opacity: 0.2; /* Etwas dezenter */
    pointer-events: none;
    z-index: 1;
    animation: subtlePulse 8s infinite alternate ease-in-out; /* Subtile Puls-Animation */
}
#app-container:before {
    left: -75px;
    top: -90px;
    width: 210px;
    height: 140px;
    background: linear-gradient(112deg, rgba(0, 123, 255, 0.2) 40%, rgba(0, 123, 255, 0.1) 100%); /* Sanfter blauer Akzent */
}
#app-container:after {
    right: -50px;
    bottom: -90px;
    width: 170px;
    height: 130px;
    background: linear-gradient(-135deg, rgba(253, 126, 20, 0.15) 16%, rgba(0, 123, 255, 0.2) 90%); /* Orange-Blau-Akzent */
    animation-delay: -4s; /* Versetzte Animation für den zweiten Blob */
}

/* Screens Layout */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    padding: 15px 15px 20px 15px;
    width: 100%;
    background-color: transparent; /* Transparenter Hintergrund, da app-container schon weiß ist */
    position: absolute;
    isolation: isolate;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.35s ease-out, transform 0.35s cubic-bezier(0.45, 0.05, 0.55, 0.95), visibility 0.35s step-end;
    will-change: transform, opacity;
    transform: translateX(100%);
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
    z-index: 10;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s step-start;
    display: flex;
}

/* Animation Classes for Screen Transitions - This is the crucial fix */
.screen.slide-out-left,
.screen.slide-in-right,
.screen.screenFadeIn,
.screen.screenFadeInSimple,
.screen.screenFadeOutSimple {
    transition: none !important; /* Prevents conflict between default and specific animations */
}

.screen.slide-out-left {
    animation: slideOutToLeft 0.25s ease-out forwards;
    z-index: 5; 
}

.screen.slide-in-right {
    /* The animation itself */
    animation: slideInFromRight 0.25s ease-out forwards;
    /* And the z-index to ensure it's on top */
    z-index: 10;
}

.screen.screenFadeIn, .screen.screenFadeInSimple {
    animation: screenFadeInFramesSimple 0.25s ease-in-out forwards;
    z-index: 10;
}

.screen.screenFadeOutSimple {
    animation: screenFadeOutFramesSimple 0.25s ease-in-out forwards;
    z-index: 5;
}

/* Neue Klasse für Screens, die scrollbar sein sollen, wenn der Inhalt überläuft */
.screen-with-scroll {
    overflow-y: auto;
    /* Optional: Etwas Padding am unteren Rand, damit der Inhalt nicht am Rand klebt */
    padding-bottom: 70px; 
}

/* Neutral pass screen - spy blackout style */
.neutral-screen {
    background: linear-gradient(109deg, #f8f9fa 84%, #e9ecef 135%); /* Heller Verlauf */
    color: #212529; /* Dunkler Text */
    border-radius: 20px;
    box-shadow: 0 10px 53px rgba(0,0,0,0.1); /* Weicherer Schatten */
    min-height: 32vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20; /* Muss über allen anderen Screens liegen */
}

.neutral-screen h2 {
    color: #0056b3; /* Dunkelblau */
    font-size: 1.38em;
    font-family: 'JetBrains Mono', 'Roboto', monospace;
    letter-spacing: 0.05em;
    animation: fadeInText 0.6s ease-out 0.2s both;
}
.neutral-screen p {
    color: #495057; /* Dunkelgrau */
    font-size: 1.05em;
    margin-top: 13px;
    letter-spacing: 0.02em;
    animation: fadeInText 0.6s ease-out 0.4s both;
}

@media (max-width: 540px) {
    #app-container {
        border-radius: 0;
        min-height: 100vh;
        padding: 25px 0 0 0;
        box-shadow: none;
        border: none;
    }
    #role-display-container {
        max-width: 99vw;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff; /* Weißer Hintergrund */
    color: #212529; /* Dunkler Text */
    padding: 20px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1); /* Weicherer Schatten */
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex; /* Flexbox für Zentrierung */
    justify-content: center;
    align-items: center;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-msg {
    max-width: 900px; /* Maximale Breite für den Inhalt */
    text-align: center;
}

.cookie-msg span {
    display: block;
    margin-bottom: 15px;
    font-size: 0.95em;
    line-height: 1.6;
}

.cookie-msg a {
    color: #007bff; /* Blau für den Link */
    text-decoration: underline;
}

#btn-accept-cookies {
    background: #28a745; /* Grüner Akzeptieren-Button */
    color: #ffffff; /* Weißer Text */
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

#btn-accept-cookies:hover {
    background: #218838; /* Dunkleres Grün */
    transform: scale(1.05);
}

/* Spezifische Layout-Regel für den Player Setup Screen */
#screen-player-setup {
    justify-content: flex-start;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- Parent screen styling for scrollable lists --- */
.screen-with-scrollable-list {
    justify-content: flex-start; /* Verhindert das Zentrieren und lässt die Liste wachsen */
}

/* Container für untere Aktionsbuttons */
.bottom-action-container {
    padding-top: 15px;
    margin-top: auto; /* Pushes the container to the bottom */
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-management-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
} 