/* ========================================
   🎨 MAGISCHES LERNPORTAL - DESIGN SYSTEM
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&family=Fredoka:wght@400;600;700&display=swap');

:root {
    /* 🎨 Primäre Farben - Magisch & Kindgerecht */
    --color-primary: #7c3aed;          /* Lila */
    --color-primary-light: #a78bfa;
    --color-primary-dark: #5b21b6;
    --color-secondary: #ec4899;        /* Pink */
    --color-accent: #fbbf24;           /* Gold */
    
    /* 🌈 Spiel-Farben */
    --color-success: #10b981;          /* Grün */
    --color-info: #3b82f6;             /* Blau */
    --color-warning: #f59e0b;          /* Orange */
    --color-error: #ef4444;            /* Rot */
    
    /* 🎭 Hintergründe */
    --bg-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-gradient-magic: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    /* 📏 Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* 🔤 Typography */
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Poppins', sans-serif;
    
    /* 🎭 Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.5);
    
    /* 🎯 Animation Timings */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ========================================
   🌟 GLOBALE STYLES
   ======================================== */

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

body {
    font-family: var(--font-body);
    background: var(--bg-gradient-magic);
    background-attachment: fixed;
    min-height: 100vh;
    color: #1f2937;
    overflow-x: hidden;
}

/* Animierter Sternenhimmel im Hintergrund */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-size: 200px 200px;
    animation: stars-float 60s linear infinite;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

@keyframes stars-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
}

/* ========================================
   🎴 GAME CARDS - Die Magie beginnt hier!
   ======================================== */

.game-card {
    position: relative;
    z-index: 10;
    transition: all var(--transition-normal);
    cursor: pointer;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* Hover-Effekt mit Glow */
.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.8);
    z-index: 100; /* Beim Hover über Lerni-Fox */
}

/* Glitzer-Effekt beim Hover */
.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all var(--transition-slow);
    opacity: 0;
}

.game-card:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Pulsierender Schatten für NEU-Badge */
.game-card .badge-new {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
        transform: scale(1.05);
    }
}

/* ========================================
   ⭐ STERNE & BELOHNUNGEN
   ======================================== */

.star-bounce {
    animation: star-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes star-bounce {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.star-glow {
    animation: star-glow 2s ease-in-out infinite;
}

@keyframes star-glow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(251, 191, 36, 1));
    }
}

/* Konfetti-Explosion bei Erfolg */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    animation: confetti-fall 3s linear;
    pointer-events: none;
    z-index: 9999;
}

/* ========================================
   🦊 LERNI DER FUCHS - Charakter-Animationen
   ======================================== */

.lerni-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.lerni-character {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: float 3s ease-in-out infinite;
}

.lerni-character:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Schwebende Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Lerni spricht */
.lerni-speech-bubble {
    position: absolute;
    bottom: 140px;
    right: 0;
    background: white;
    padding: var(--space-md);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    max-width: 200px;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-normal);
}

.lerni-speech-bubble.active {
    opacity: 1;
    transform: scale(1);
}

.lerni-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* ========================================
   🎯 BUTTONS - Magische Interaktionen
   ======================================== */

.btn-magic {
    position: relative;
    font-family: var(--font-display);
    font-weight: 700;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

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

.btn-magic:active {
    transform: scale(0.95);
}

/* Button-Varianten */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* ========================================
   🎮 GAME INTERFACE ELEMENTS
   ======================================== */

.game-header {
    background: white;
    border-radius: 25px;
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.progress-bar-magical {
    height: 30px;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 100%);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill-magical {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 50px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill-magical::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ========================================
   🎤 MIKROFON & LISTENING ANIMATIONS
   ======================================== */

.mic-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    position: relative;
}

.mic-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.mic-button.listening {
    animation: mic-pulse 1.5s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 6px 30px rgba(239, 68, 68, 0.8);
    }
}

.listening-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    animation: ring-expand 2s ease-out infinite;
}

@keyframes ring-expand {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ========================================
   ✨ WORD HIGHLIGHTING - Magische Wörter
   ======================================== */

.word {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-xs);
    border-radius: 10px;
    background: #f3f4f6;
    transition: all var(--transition-normal);
    font-size: 1.5rem;
    font-weight: 600;
}

.word-active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    transform: scale(1.2);
    box-shadow: var(--shadow-md), 0 0 20px rgba(251, 191, 36, 0.6);
    animation: word-glow 0.8s ease-in-out;
}

@keyframes word-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.word-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   🎉 CELEBRATION EFFECTS
   ======================================== */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.8) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
    animation: celebration-flash 0.5s ease-out;
}

@keyframes celebration-flash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Emoji Rain */
.emoji-rain {
    position: fixed;
    font-size: 2rem;
    animation: emoji-fall 3s linear;
    pointer-events: none;
    z-index: 9999;
}

@keyframes emoji-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ========================================
   📱 RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .lerni-container {
        bottom: 10px;
        right: 10px;
    }
    
    .lerni-character {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .game-card {
        padding: var(--space-lg) !important;
    }
    
    .word {
        font-size: 1.25rem;
    }
}

/* ========================================
   🎨 UTILITY CLASSES
   ======================================== */

.text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

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

.fade-in {
    animation: fade-in 0.5s ease-in;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
