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

body, html {
    min-height: 100vh;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    background: linear-gradient(135deg, #ff0000 0%, #ff8800 14%, #ffff00 28%, #00cc00 42%, #0066ff 57%, #4400cc 71%, #8800ff 85%, #ff0000 100%);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
    overflow-x: hidden;
}

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

/* Floating background bubbles */
.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -80px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: floatUp linear infinite;
}

.bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 10s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 25px; height: 25px; left: 25%; animation-duration: 14s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 55px; height: 55px; left: 45%; animation-duration: 11s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 35px; height: 35px; left: 65%; animation-duration: 13s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 20px; height: 20px; left: 80%; animation-duration: 9s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 45px; height: 45px; left: 35%; animation-duration: 15s; animation-delay: 5s; }
.bubble:nth-child(7) { width: 30px; height: 30px; left: 55%; animation-duration: 12s; animation-delay: 6s; }
.bubble:nth-child(8) { width: 50px; height: 50px; left: 90%; animation-duration: 10s; animation-delay: 2s; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.7; }
    50% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(720deg) scale(0.3); opacity: 0; }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

h1 {
    font-family: 'Baloo 2', 'Comic Neue', cursive;
    font-size: 3em;
    font-weight: 800;
    text-align: center;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3),
        3px 3px 0 rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    animation: titleBounce 2s ease-in-out infinite;
    user-select: none;
}

@keyframes titleBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.card-label {
    font-family: 'Baloo 2', cursive;
    font-size: 1.1em;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-label .icon {
    font-size: 1.3em;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 16px;
    border: 3px solid #e0d4f5;
    border-radius: 16px;
    font-family: 'Comic Neue', cursive;
    font-size: 1.15em;
    line-height: 1.6;
    color: #333;
    background: #faf8ff;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.25), 0 0 20px rgba(167, 139, 250, 0.15);
}

textarea::placeholder {
    color: #b8a9d4;
}

#output {
    font-size: 1.15em;
    line-height: 1.6;
    color: #1a1a2e;
    min-height: 60px;
    padding: 16px;
    background: linear-gradient(135deg, #faf8ff 0%, #f0e6ff 100%);
    border-radius: 16px;
    border: 3px dashed #d4bfff;
    word-wrap: break-word;
    transition: all 0.3s ease;
    position: relative;
}

#output:empty::before {
    content: '✨ Hier erscheint die Übersetzung...';
    color: #b8a9d4;
    font-style: italic;
}

/* Character counter */
.char-count {
    text-align: right;
    font-size: 0.85em;
    color: #a78bfa;
    margin-top: 6px;
    font-weight: 700;
}

/* Fun sparkle particles on output */
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.footer {
    text-align: center;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
}

/* Mobile tweaks */
@media (max-width: 500px) {
    h1 { font-size: 1.6em; margin-bottom: 4px; }
    .subtitle { font-size: 0.9em; margin-bottom: 10px; }
    .container { padding: 8px 8px 20px; }
    .card { padding: 10px; border-radius: 14px; margin-bottom: 10px; }
    .card-label { font-size: 0.95em; margin-bottom: 6px; }
    textarea { font-size: 0.95em; height: 70px; padding: 10px; border-radius: 10px; }
    #output { font-size: 0.95em; min-height: 40px; padding: 10px; border-radius: 10px; }
    .char-count { display: none; }
    .footer { display: none; }
}
