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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #a0a0b0;
    margin-bottom: 2rem;
}

.mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: #a0a0b0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateY(-2px);
    color: #667eea;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid transparent;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.mode-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.control-btn-reset {
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.control-btn-reset:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
}

.progress {
    font-size: 1.2rem;
    color: #a0a0b0;
    font-weight: 600;
}

.flashcard-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.flashcard {
    width: 100%;
    max-width: 600px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.card-front {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.card-back {
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.15) 0%, rgba(240, 147, 251, 0.15) 100%);
    border: 2px solid rgba(240, 147, 251, 0.3);
    transform: rotateY(180deg);
}

.card-content {
    text-align: center;
    width: 100%;
}

.language-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #667eea;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.card-front .language-label {
    color: #f093fb;
}

.phrase-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.pronunciation {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #a0a0b0;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.flip-hint {
    font-size: 0.9rem;
    color: #808090;
    margin-top: 2rem;
}

.navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.nav-btn:disabled:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: none;
}

.nav-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.nav-btn-primary:hover {
    background: linear-gradient(135deg, #7688f0 0%, #8557b2 100%);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.back-link {
    color: #808090;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #667eea;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    header {
        margin-bottom: 2rem;
    }
    
    .mode-selector {
        flex-direction: column;
        width: 100%;
    }
    
    .mode-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .flashcard {
        height: 350px;
    }
    
    .card-face {
        padding: 2rem 1.5rem;
    }
    
    .phrase-text {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }
    
    .navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .controls {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .control-btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .control-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .progress {
        font-size: 1rem;
        flex-basis: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 0.5rem;
    }
}
