/* Child-friendly, colorful design - Tier-Geräusche Theme */
body {
    margin: 0;
    padding: 20px;
    font-family: 'Comic Sans MS', 'Segoe UI Emoji', system-ui, sans-serif;
    text-align: center;
    background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 50%, #55efc4 100%);
    background-attachment: fixed;
    color: #2d3748;
    min-height: 100vh;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Game header with back button */
.game-header {
    width: 100%;
    max-width: 900px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 1rem;
    gap: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Fun header styling */
h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #fff;
    text-shadow:
        2px 2px 0px #0984e3,
        4px 4px 0px #74b9ff,
        6px 6px 10px rgba(0,0,0,0.3);
    font-weight: bold;
    letter-spacing: 1px;
    animation: bounce 2s ease-in-out infinite;
    line-height: 1.2;
    flex: 1;
    text-align: center;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.game-description p {
    margin: 0;
    font-size: 1.2rem;
    color: #1a202c;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.95);
    padding: 15px 30px;
    border-radius: 25px;
    display: inline-block;
    backdrop-filter: blur(10px);
    line-height: 1.4;
    border: 3px solid #0984e3;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.3);
}

/* Game container */
.game-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    margin: 20px auto;
    max-width: 900px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.2),
        0 0 0 5px rgba(255,255,255,0.8),
        0 0 0 10px #0984e3;
    border: 3px solid #fff;
}

/* Score Display */
.score-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(135deg, #74b9ff, #a29bfe);
    padding: 15px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 3px solid white;
}

.score-label {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-right: 10px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* Sound Player */
.sound-player {
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.play-btn {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: white;
    border: none;
    padding: 25px 50px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 4px solid white;
}

.play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 184, 148, 0.5);
}

.play-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.play-btn.playing {
    background: linear-gradient(135deg, #fab1a0, #e17055);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.play-icon {
    font-size: 2rem;
    animation: spin 2s linear infinite;
    animation-play-state: paused;
}

.play-btn.playing .play-icon {
    animation-play-state: running;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Sound Wave Animation */
.sound-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 60px;
}

.sound-wave.hidden {
    display: none;
}

.wave-bar {
    width: 8px;
    background: linear-gradient(135deg, #74b9ff, #a29bfe);
    border-radius: 4px;
    animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 60px;
    }
}

/* Animal Choices */
.animal-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 30px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.animal-btn {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border: 4px solid white;
    border-radius: 20px;
    padding: 20px;
    font-size: 4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.animal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.animal-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.animal-btn:hover::before {
    width: 300px;
    height: 300px;
}

.animal-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.animal-btn.correct {
    background: linear-gradient(135deg, #55efc4, #00b894);
    animation: correctShake 0.5s ease;
    border-color: #00b894;
}

.animal-btn.wrong {
    background: linear-gradient(135deg, #ff7675, #d63031);
    animation: wrongShake 0.5s ease;
    border-color: #d63031;
}

.animal-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes correctShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Feedback */
.feedback {
    margin: 20px 0;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.feedback.hidden {
    display: none;
}

.feedback-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.feedback-icon {
    font-size: 2.5rem;
}

.feedback.correct {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.feedback.wrong {
    background: linear-gradient(135deg, #ff7675, #d63031);
    color: white;
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4);
}

/* Next Button */
.next-btn {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
    border: 4px solid white;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    margin-top: 20px;
}

.next-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

.next-btn.hidden {
    display: none;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over.hidden {
    display: none;
}

.game-over-content {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    border: 5px solid white;
    max-width: 500px;
}

.game-over-content h2 {
    font-size: 3rem;
    color: #2d3436;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.final-score {
    font-size: 1.5rem;
    color: #2d3436;
    font-weight: bold;
    margin: 20px 0;
}

.final-score span {
    font-size: 2.5rem;
    color: #0984e3;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.game-over-emoji {
    font-size: 5rem;
    margin: 20px 0;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

.restart-btn {
    background: linear-gradient(135deg, #00b894, #55efc4);
    color: white;
    border: 4px solid white;
    padding: 20px 40px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    margin-top: 20px;
}

.restart-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .game-container {
        padding: 20px;
    }

    .animal-choices {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }

    .animal-btn {
        font-size: 3rem;
        padding: 15px;
    }

    .play-btn {
        padding: 20px 35px;
        font-size: 1.2rem;
    }

    .game-over-content {
        padding: 30px;
        margin: 20px;
    }

    .game-over-content h2 {
        font-size: 2rem;
    }
}

.hidden {
    display: none;
}
