* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: white;
    font-size: 1.5em;
    opacity: 0.8;
    animation: fall linear infinite;
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 8s; animation-delay: 4s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 14s; animation-delay: 1s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 11s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 9s; animation-delay: 5s; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 13s; animation-delay: 0s; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 10s; animation-delay: 2s; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 12s; animation-delay: 4s; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 11s; animation-delay: 1s; }

@keyframes fall {
    0% {
        top: -10%;
        opacity: 0.8;
    }
    100% {
        top: 100%;
        opacity: 0.3;
    }
}

.container {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 10;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #c41e3a;
    text-align: center;
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.intro {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
}

.intro p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.info-box {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe8b3 100%);
    border-left: 4px solid #ffa500;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(255, 165, 0, 0.2);
}

.info-box h3 {
    color: #d97706;
    font-size: 1.2em;
    margin-bottom: 12px;
    text-align: center;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    color: #555;
    margin-bottom: 10px;
    padding-left: 5px;
    line-height: 1.6;
}

.info-box li:last-child {
    margin-bottom: 0;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

#nameInput {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

#nameInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#submitBtn {
    padding: 15px;
    background: linear-gradient(135deg, #c41e3a 0%, #a71729 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

#submitBtn:active {
    transform: translateY(0);
}

.result {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 15px;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.result h2 {
    color: white;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.wichtel-name {
    font-size: 2em;
    font-weight: bold;
    color: white;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.message {
    color: white;
    font-size: 1.1em;
    margin-top: 15px;
}

.error {
    margin-top: 20px;
    padding: 20px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    text-align: center;
    animation: shake 0.5s ease-in;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error p {
    margin: 0;
}

.show-names-btn {
    padding: 12px 20px;
    background: white;
    color: #f44336;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-names-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

.modal-info {
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.names-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.names-list li {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 12px 15px;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border-left: 3px solid #667eea;
}

.names-list li:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.ai-note {
    margin-top: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.ai-note p {
    margin: 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .wichtel-name {
        font-size: 1.5em;
    }

    .result h2 {
        font-size: 1.2em;
    }

    .snowflake {
        font-size: 1.2em;
    }

    .info-box {
        padding: 15px;
    }

    .info-box h3 {
        font-size: 1.1em;
    }

    .info-box li {
        font-size: 0.9em;
    }

    .names-list {
        grid-template-columns: 1fr;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .ai-note p {
        font-size: 0.8em;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.3em;
    }

    .intro p {
        font-size: 0.9em;
    }

    #nameInput, #submitBtn {
        font-size: 14px;
    }

    .show-names-btn {
        font-size: 14px;
        padding: 10px 15px;
    }

    .ai-note {
        padding: 12px 15px;
    }

    .ai-note p {
        font-size: 0.75em;
    }
}
