
:root {
    --container-width: 90%;
    --container-max-width: 600px;
    --input-font-size: 1rem;
    --button-font-size: 0.9rem;
    --typed-font-size: 2.5rem;
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --background-color: rgba(34, 40, 49, 0.9);
    --text-color: #ffffff;
    --text-contrast: #ffffff;
    --transition-speed: 0.3s;
}


body {
    font-family: 'Roboto', sans-serif;
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(5px);
    color: var(--text-contrast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: background-image 1s ease;
    animation: gradientAnimation 10s ease infinite;
}


.container {
    background: linear-gradient(145deg, rgba(34, 40, 49, 0.6), rgba(34, 40, 49, 0.7)), 
                linear-gradient(145deg, rgba(128, 128, 128, 0.2), rgba(192, 192, 192, 0.2));
    border-radius: 20px;
    padding: 5%;
    width: var(--container-width);
    max-width: var(--container-max-width);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-clip: padding-box;
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.9), 0 0 0 3px rgba(255, 255, 255, 0.2);
}


#typed-output {
    font-family: 'Lilita One', cursive;
    font-size: var(--typed-font-size);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    color: var(--text-color);
    height: 5.7rem;
    overflow: hidden;
}


.name-fields {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

input[type="text"] {
    width: calc(50% - 5px);
    padding: 12px;
    margin: 0;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    font-size: var(--input-font-size);
    transition: all var(--transition-speed) ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="text"]:hover,
input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}


.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    border: none;
    color: #FFFFFF;
    padding: 14px 28px;
    border-radius: 30px;
    transition: all var(--transition-speed) ease;
    font-size: var(--button-font-size);
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

#addBtn { background: linear-gradient(135deg, #2ecc71, #27ae60); }
#generateBtn { background: linear-gradient(135deg, #3498db, #2980b9); }
#newEntryBtn { background: linear-gradient(135deg, #e74c3c, #c0392b); }

#addBtn:hover { background: linear-gradient(135deg, #27ae60, #2ecc71); }
#generateBtn:hover { background: linear-gradient(135deg, #2980b9, #3498db); }
#newEntryBtn:hover { background: linear-gradient(135deg, #c0392b, #e74c3c); }

#newEntryBtn {
    display: none;
}

#newEntryBtn.show {
    display: inline-block;
    animation: slideInFromBottom 0.5s ease-out;
}


#result {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.team-container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    padding: 20px;
    width: calc(50% - 15px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    filter: blur(0);
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.team-container:hover, .team-container.revealed {
    filter: blur(0);
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(60px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.3),
        0 20px 50px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.team-container:before {
    content: "";
    position: absolute;
    top: -35%;
    left: -50%;
    width: 75%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(231, 229, 229, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.team-container:hover:before {
    left: 100%;
}

.team-container .team-item {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.team-container:hover .team-item,
.team-container.revealed .team-item {
    opacity: 1;
}

.team-item {
    padding: 10px;
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    position: relative;
    z-index: 1;
    transform: translateZ(30px);
    transition: all 0.3s ease;
    animation: subtlePulse 2s ease-in-out infinite;
}

.team-red { background: linear-gradient(135deg, #ff4d4d, #ff1a1a); }
.team-green { background: linear-gradient(135deg, #28a745, #1e7e34); }
.team-blue { background: linear-gradient(135deg, #007bff, #0056b3); }
.team-yellow { background: linear-gradient(135deg, #ffc107, #e0a800); }
.team-purple { background: linear-gradient(135deg, #6f42c1, #5a32a3); }


footer {
    margin-top: 60px;
    text-align: center;
}

.footer-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.footer-button:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: all 0.5s;
}

.footer-button:hover:before {
    left: 100%;
}

.footer-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.footer-button img {
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.footer-button:hover img {
    transform: rotate(360deg);
}

.footer-text {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
    padding: 5px 0;
    background-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.footer-text:hover {
    transform: scale(1.1);
}


.hidden {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.loading-bar {
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--secondary-color) 0%, 
        var(--primary-color) 50%, 
        var(--accent-color) 100%);
    transition: width 0.4s ease;
    margin-top: 10px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5), 
        transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 150%;
    }
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.hint-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.team-container:hover .hint-text {
    opacity: 0;
}


@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideInFromBottom {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes subtlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes pulseGrow {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}


@media (max-width: 768px) {
    :root {
        --container-width: 95%;
        --container-max-width: 100%;
        --input-font-size: 0.9rem;
        --button-font-size: 0.8rem;
        --typed-font-size: 2rem;
    }
    
    .team-container {
        width: 100%;
    }
}

@media (max-width: 480px) {
    input[type="text"] {
        width: 100%;
    }
    
    .container {
        padding: 20px;
    }
    #typed-output {
        height: auto;
        min-height: 3em; /* Passen Sie dies an die Länge Ihrer Texte an */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    #typed-output span {
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
}