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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #475569;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header h1 i {
    -webkit-text-fill-color: var(--primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: 15px;
    border: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-value.known {
    color: var(--success);
}

.stat-value.learning {
    color: var(--warning);
}

.progress-bar {
    height: 8px;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 30px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard {
    width: 100%;
    max-width: 700px;
    height: 400px;
    cursor: pointer;
    position: relative;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.flashcard-back {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    transform: rotateY(180deg);
}

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

.card-type {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content p {
    font-size: 1.3rem;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 15px;
}

.flip-hint {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-learning {
    background: var(--warning);
    color: white;
}

.btn-learning:hover {
    background: #d97706;
}

.btn-skip {
    background: var(--surface-light);
    color: var(--text);
}

.btn-skip:hover {
    background: var(--border);
}

.btn-know {
    background: var(--success);
    color: white;
}

.btn-know:hover {
    background: #059669;
}

.btn-restart {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-restart:hover {
    opacity: 0.9;
}

.completion-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.completion-screen.hidden {
    display: none;
}

.completion-content {
    text-align: center;
    max-width: 600px;
    padding: 50px;
    background: var(--surface);
    border-radius: 20px;
    border: 2px solid var(--primary);
}

.completion-icon {
    font-size: 5rem;
    color: #fbbf24;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

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

.completion-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.completion-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.completion-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    gap: 20px;
}

.completion-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.completion-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.completion-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .flashcard {
        height: 350px;
    }

    .card-content p {
        font-size: 1.1rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .completion-stats {
        flex-direction: column;
    }

    .completion-content {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .flashcard {
        height: 300px;
    }

    .flashcard-front,
    .flashcard-back {
        padding: 25px;
    }

    .card-content p {
        font-size: 1rem;
    }
}