* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #1e3a5f;
    color: white;
    padding: 10px 16px;
    gap: 8px;
}
.brand {
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
}
.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
}
.nav a:hover { color: white; }
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}
.logout {
    color: #fca5a5;
    text-decoration: none;
}
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.stat {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.stat .num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a5f;
}
.stat .label {
    font-size: 0.85rem;
    color: #6b7280;
}
.btn {
    display: inline-block;
    background: #1e3a5f;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #16304e; }
.btn.secondary {
    background: #e5e7eb;
    color: #1f2937;
}
.btn.correct { background: #16a34a; }
.btn.wrong { background: #dc2626; }
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
}
.error {
    color: #dc2626;
    margin-bottom: 10px;
}
.flashcard {
    text-align: center;
    padding: 40px 20px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}
.flashcard .german {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a5f;
}
.flashcard .example {
    margin-top: 10px;
    color: #6b7280;
    font-style: italic;
}
.flashcard .translation {
    margin-top: 14px;
    font-size: 1.3rem;
    color: #16a34a;
    display: none;
}
.flashcard.flipped .translation { display: block; }
.flashcard.flipped .hint { display: none; }
.hint {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-top: 10px;
}
.list-item {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
}
.badge {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 999px;
}
.question-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}
.option-label {
    display: block;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}
.option-label.correct-answer { background: #dcfce7; border-color: #16a34a; }
.option-label.wrong-answer { background: #fee2e2; border-color: #dc2626; }
.explanation {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}
.category-title {
    margin-top: 24px;
    margin-bottom: 8px;
    color: #1e3a5f;
}
.qa-pair {
    background: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.qa-pair .q-de { font-weight: 600; }
.qa-pair .q-ru { color: #6b7280; font-size: 0.9rem; }
.qa-pair .sample {
    margin-top: 8px;
    color: #16a34a;
    font-size: 0.9rem;
    display: none;
}
audio { width: 100%; margin: 10px 0; }
pre.template {
    background: #f3f4f6;
    padding: 14px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: inherit;
}
