/*
 * Gestaltung: modern und leicht – Violett-Indigo-Verlauf als Markenfarbe, Koralle als Akzent,
 * weiche Hintergrund-Glows, Glas-Navigation, große Radien und mehrstufige weiche Schatten.
 */
:root {
    --brand: #6d5efc;
    --brand-strong: #5a49f0;
    --brand-2: #ff7a8a;
    --brand-gradient: linear-gradient(135deg, #7b61ff 0%, #a35cff 50%, #ff7a8a 100%);
    --brand-soft: #efedff;
    --accent: #ff7a59;
    --success: #10b981;
    --success-soft: #e7f8f1;
    --error: #f43f5e;
    --error-soft: #ffeef1;
    --productive: #ff7a8a;

    --bg: #f6f6fb;
    --surface: #ffffff;
    --surface-2: #f2f2f8;
    --text: #15151f;
    --muted: #6b6b80;
    --border: rgba(20, 20, 50, .08);
    --border-strong: rgba(20, 20, 50, .14);
    --glow-1: rgba(123, 97, 255, .16);
    --glow-2: rgba(255, 122, 138, .12);
    --shadow-sm: 0 1px 2px rgba(20, 20, 50, .05);
    --shadow: 0 1px 2px rgba(20, 20, 50, .04), 0 8px 24px -8px rgba(40, 30, 110, .12);
    --shadow-lg: 0 2px 4px rgba(20, 20, 50, .04), 0 24px 48px -16px rgba(40, 30, 110, .22);

    --radius-lg: 24px;
    --radius: 18px;
    --radius-sm: 12px;
    --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #8b7dff;
        --brand-strong: #a093ff;
        --brand-soft: rgba(139, 125, 255, .14);
        --success: #34d399;
        --success-soft: rgba(52, 211, 153, .12);
        --error: #fb7185;
        --error-soft: rgba(251, 113, 133, .12);

        --bg: #0b0b12;
        --surface: #14141e;
        --surface-2: #1c1c28;
        --text: #f2f2f7;
        --muted: #9a9ab0;
        --border: rgba(255, 255, 255, .07);
        --border-strong: rgba(255, 255, 255, .13);
        --glow-1: rgba(123, 97, 255, .22);
        --glow-2: rgba(255, 122, 138, .10);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .7);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(60rem 30rem at 15% -10%, var(--glow-1), transparent 60%),
    radial-gradient(50rem 28rem at 100% 0%, var(--glow-2), transparent 60%);
    background-repeat: no-repeat;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2 {
    margin: 0;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
}

h1 {
    font-size: 1.9rem;
}

h2 {
    font-size: 1.15rem;
    letter-spacing: -.015em;
}

p {
    margin: 0;
}

a {
    color: var(--brand);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: .85rem;
}

.center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

[hidden] {
    display: none !important;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 16px 56px;
    flex: 1;
}

.stack > * + * {
    margin-top: 14px;
}

.stack-lg > * + * {
    margin-top: 20px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
}

.logo-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(123, 97, 255, .35));
}

.nav-links {
    display: flex;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    padding: 6px 12px;
    border-radius: 999px;
    transition: color .15s, background-color .15s;
}

.nav-links a .icon {
    width: 16px;
    height: 16px;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.active {
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 520px) {
    .brand span, .nav-links a[aria-label] span {
        display: none;
    }
}

.site-version {
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    opacity: .75;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: .78rem;
    padding: 20px 16px 28px;
    max-width: 560px;
    margin: 0 auto;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.link-muted {
    color: var(--muted);
    font-size: .875rem;
    text-decoration: none;
}

.link-muted:hover {
    color: var(--brand);
}

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
}

.alert.error {
    background: var(--error-soft);
    color: var(--error);
}

.badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
}

.badge.retry {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    margin-right: 6px;
}

/* ---------- Buttons ---------- */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: inherit;
    font-weight: 600;
    letter-spacing: -.005em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background-color .15s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn:focus-visible, .option:focus-visible, .choice:focus-within, .speak:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.btn.block {
    display: flex;
    width: 100%;
}

.btn.primary {
    --btn-fg: #fff;
    border-color: transparent;
    background: var(--brand-gradient);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px -6px rgba(123, 97, 255, .55);
}

.btn.primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 28px -8px rgba(123, 97, 255, .65);
}

.btn.secondary {
    --btn-fg: var(--brand);
    --btn-bg: var(--brand-soft);
    border-color: transparent;
    box-shadow: none;
}

.btn.light {
    --btn-bg: #fff;
    --btn-fg: #2b1f7a;
    border-color: transparent;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35);
}

.btn.danger {
    --btn-fg: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #ff5a7a, #f43f5e);
    box-shadow: 0 8px 20px -6px rgba(244, 63, 94, .5);
}

.btn.ghost {
    --btn-bg: transparent;
    --btn-fg: var(--muted);
    border-color: transparent;
    box-shadow: none;
}

.btn.ghost:hover {
    --btn-fg: var(--text);
    --btn-bg: var(--surface-2);
    transform: none;
    box-shadow: none;
}

.speak, .mic {
    display: inline-grid;
    place-items: center;
    border: none;
    background: var(--brand-soft);
    color: var(--brand);
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    transition: transform .15s, background-color .15s;
    flex-shrink: 0;
}

.speak:hover, .mic:hover {
    transform: scale(1.06);
}

.speak .icon, .mic .icon {
    width: 20px;
    height: 20px;
}

.speak.small {
    width: 28px;
    height: 28px;
    background: transparent;
}

.speak.small .icon {
    width: 16px;
    height: 16px;
}

.speak.playing {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 20%, transparent);
}

.speak.big {
    width: 116px;
    height: 116px;
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 16px 40px -12px rgba(123, 97, 255, .6);
}

.speak.big .icon {
    width: 44px;
    height: 44px;
}

.speak.slow {
    width: 64px;
    height: 64px;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.speak.slow .icon {
    width: 26px;
    height: 26px;
}

/* ---------- Formulare ---------- */

input:not([type=radio]):not([type=checkbox]), select, textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.field {
    display: grid;
    gap: 6px;
    font-weight: 500;
    font-size: .925rem;
}

.toggle {
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.toggle input {
    appearance: none;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background-color .2s;
    flex-shrink: 0;
}

.toggle input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.toggle input:checked {
    background: var(--brand);
}

.toggle input:checked::after {
    transform: translateX(18px);
}

.inline-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.inline-form input {
    text-transform: uppercase;
    letter-spacing: .1em;
}

details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--brand);
}

.recover {
    margin-top: 28px;
}

.recover .small {
    margin-top: 8px;
}

/* ---------- Onboarding ---------- */

.hero {
    text-align: center;
    margin: 20px 0 36px;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 2.75rem);
    letter-spacing: -.035em;
}

.hero p {
    margin: 14px auto 0;
    max-width: 30em;
    font-size: 1.05rem;
}

.mascot {
    display: inline-block;
    margin-bottom: 18px;
}

.mascot .logo-mark {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 12px 24px rgba(123, 97, 255, .45));
}

.mascot-icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: var(--brand-soft);
    color: var(--brand);
    margin: 0 auto;
}

.mascot-icon .icon {
    width: 34px;
    height: 34px;
}

section > h2 {
    margin-bottom: 12px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.choice-grid.four {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 540px) {
    .choice-grid.four {
        grid-template-columns: repeat(4, 1fr);
    }
}

.choice-list {
    display: grid;
    gap: 8px;
}

.choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.choice:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.choice.row {
    flex-direction: row;
    text-align: left;
    gap: 14px;
    padding: 12px 14px;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice:has(input:checked) {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow);
}

.choice-icon {
    font-size: 2.2rem;
}

.choice-title {
    display: block;
    font-weight: 600;
}

.choice-sub {
    display: block;
    color: var(--muted);
    font-size: .85rem;
}

.level-badge {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface-2);
    font-weight: 700;
    font-size: .95rem;
    color: var(--muted);
    flex-shrink: 0;
}

.level-badge.current, .choice:has(input:checked) .level-badge {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(123, 97, 255, .6);
}

/* ---------- Dashboard ---------- */

.hero-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: var(--shadow-lg), 0 20px 50px -20px rgba(123, 97, 255, .6);
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: auto -20% -60% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%);
    pointer-events: none;
}

.hero-text {
    position: relative;
    display: grid;
    gap: 8px;
    justify-items: start;
}

.hero-text h1 {
    font-size: 1.6rem;
}

.kicker {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .8;
}

.hero-sub {
    opacity: .9;
}

.dot-sep {
    margin: 0 4px;
    opacity: .6;
}

.hero-text .btn {
    margin-top: 10px;
}

.ring {
    --p: 0;
    position: relative;
    width: 116px;
    height: 116px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0);
    display: grid;
    place-items: center;
}

.ring-inner {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    text-align: center;
    background: color-mix(in srgb, #5b3fd6 70%, transparent);
    backdrop-filter: blur(6px);
    line-height: 1.1;
}

.ring-inner strong {
    font-size: 1.7rem;
    letter-spacing: -.03em;
}

.ring-inner span {
    font-size: .75rem;
    opacity: .85;
}

@media (max-width: 480px) {
    .hero-card {
        flex-direction: column-reverse;
        align-items: flex-start;
        padding: 22px;
    }

    .ring {
        width: 92px;
        height: 92px;
    }

    .ring-inner {
        width: 72px;
        height: 72px;
    }

    .ring-inner strong {
        font-size: 1.3rem;
    }
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: .8rem;
    color: var(--muted);
}

.stat strong {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1.2;
    margin-top: 6px;
}

.stat-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
}

.stat-icon .icon {
    width: 18px;
    height: 18px;
}

.stat-icon.calendar {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}

.stat-icon.star {
    background: color-mix(in srgb, #f5b400 18%, transparent);
    color: #e0a100;
}

.stat-icon.target {
    background: var(--brand-soft);
    color: var(--brand);
}

.progress {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
    flex: 1;
}

.progress.slim {
    display: block;
    height: 6px;
    margin-top: 8px;
}

.progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-gradient);
    transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.goal-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-weight: 500;
}

.level-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 4px;
}

.level-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    margin: 0 -10px;
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    transition: background-color .15s;
}

.level-list a:hover {
    background: var(--surface-2);
}

.level-body {
    flex: 1;
}

.level-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.level-name {
    font-weight: 600;
}

/* ---------- Wortliste ---------- */

.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    max-width: 100%;
    overflow-x: auto;
}

.tabs a, .tabs label {
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.tabs a.active, .tabs label.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.dot.receptive, .bar.receptive span {
    background: var(--brand);
}

.dot.productive, .bar.productive span {
    background: var(--productive);
}

.word-list {
    list-style: none;
    padding: 6px;
    margin: 14px 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.word-list li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.word-list li:hover {
    background: var(--surface-2);
}

.word-list li.unseen .word-main {
    opacity: .6;
}

.word-list .topic-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.word-main {
    flex: 1;
    min-width: 0;
}

.word-main > div:first-child {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.strength {
    display: grid;
    gap: 5px;
    width: 72px;
}

.bar {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

/* ---------- Einstellungen ---------- */

.code-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.recovery-code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: .1em;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
}

.danger-zone h2 {
    color: var(--error);
}

/* ---------- Lektion ---------- */

.lesson-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
}

.close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--muted);
    transition: background-color .15s, color .15s;
}

.close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.lesson-points {
    font-weight: 600;
    font-size: .85rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #f5b400 16%, transparent);
    color: #c58b00;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .lesson-points {
        color: #ffcf4d;
    }
}

.answer-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exercise {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px 28px;
}

.eyebrow {
    display: flex;
    align-items: center;
    font-size: .95rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 14px;
}

.eyebrow.new {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    font-size: .85rem;
}

.prompt-row, .lemma-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.prompt {
    font-size: clamp(2rem, 7vw, 2.6rem);
    letter-spacing: -.035em;
}

.listen {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 20px 0 36px;
}

.word-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px 24px;
    text-align: center;
}

.word-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--brand-gradient);
}

.word-card .topic-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--surface-2);
    font-size: 2rem;
}

.word-card .lemma-row {
    justify-content: center;
    margin: 14px 0 0;
}

.lemma {
    font-size: clamp(2.2rem, 8vw, 3rem);
    letter-spacing: -.04em;
}

.ipa {
    color: var(--muted);
    margin-top: 2px;
}

.translation {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-top: 16px;
}

.pos {
    color: var(--muted);
    font-size: .8rem;
    margin-top: 2px;
}

.example {
    margin-top: 22px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    text-align: left;
    font-size: .95rem;
}

.example p:first-child {
    display: flex;
    align-items: center;
    gap: 4px;
}

.options {
    display: grid;
    gap: 10px;
}

@media (min-width: 560px) {
    .options {
        grid-template-columns: 1fr 1fr;
    }
}

.option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    min-height: 62px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.option:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 45%, transparent);
    box-shadow: var(--shadow-lg);
}

.option:disabled {
    cursor: default;
    opacity: .5;
    box-shadow: none;
}

.option kbd {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--surface-2);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
}

.option.correct {
    opacity: 1;
    border-color: var(--success);
    background: var(--success-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
}

.option.correct kbd {
    background: var(--success);
    color: #fff;
}

.option.wrong {
    opacity: 1;
    border-color: var(--error);
    background: var(--error-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 18%, transparent);
}

.option.wrong kbd {
    background: var(--error);
    color: #fff;
}

.text-answer {
    position: relative;
}

.text-answer textarea {
    font-size: 1.2rem;
    min-height: 124px;
    resize: none;
    padding: 16px 64px 16px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.text-answer .mic {
    position: absolute;
    right: 12px;
    bottom: 12px;
}

.mic.listening {
    color: #fff;
    background: var(--error);
    animation: listening 1.2s ease-out infinite;
}

@keyframes listening {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--error) 50%, transparent);
    }
    100% {
        box-shadow: 0 0 0 14px transparent;
    }
}

.lesson-footer {
    position: sticky;
    bottom: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.footer-actions {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 12px;
}

.footer-actions .btn.primary, .footer-actions .btn.danger {
    min-width: 160px;
}

/* Feedback als schwebendes Panel */
.lesson-footer.feedback {
    animation: slide-up .3s cubic-bezier(.2, .9, .3, 1.1);
}

.feedback-body {
    max-width: 640px;
    margin: 0 auto 14px;
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    background: color-mix(in srgb, var(--success-soft) 92%, var(--surface));
    box-shadow: var(--shadow-lg);
}

.is-wrong .feedback-body {
    border-color: color-mix(in srgb, var(--error) 30%, transparent);
    background: color-mix(in srgb, var(--error-soft) 92%, var(--surface));
}

.feedback-body h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    color: var(--success);
}

.is-wrong .feedback-body h2 {
    color: var(--error);
}

.feedback-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
}

.is-wrong .feedback-icon {
    background: var(--error);
}

.feedback-icon .icon {
    width: 17px;
    height: 17px;
    stroke-width: 3;
}

.feedback-body .points {
    margin-left: auto;
    font-size: .8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #f5b400 18%, transparent);
    color: #c58b00;
}

.feedback-body .example {
    margin-top: 4px;
    background: var(--surface);
}

.feedback-word {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.feedback-word .muted {
    font-weight: 400;
}

@keyframes slide-up {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
}

.finished-body {
    flex: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 48px 16px;
    text-align: center;
    display: grid;
    gap: 24px;
    align-content: center;
}

.finished-body h1 {
    font-size: 2.2rem;
}

.finished-body .stat {
    align-items: center;
}

.trophy {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin: 0 auto;
    border-radius: 32px;
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 20px 48px -12px rgba(123, 97, 255, .6);
    animation: pop .6s cubic-bezier(.2, 1.4, .4, 1);
}

.trophy .icon {
    width: 52px;
    height: 52px;
}

@keyframes pop {
    from {
        transform: scale(.4) rotate(-12deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Feinschliff Formulare ---------- */

.card.stack > h2:not(:first-child) {
    margin-top: 28px;
}

select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8aa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    cursor: pointer;
}

/* ---------- Hilfe ---------- */

.help p {
    line-height: 1.6;
}

.help-figure {
    margin: 0;
}

.help-curve {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 6px;
}

.help-curve .axis {
    stroke: var(--border-strong);
    stroke-width: 1.5;
}

.help-curve .target {
    stroke: var(--success);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
}

.help-curve .forget {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.5;
    stroke-dasharray: 3 4;
    opacity: .6;
}

.help-curve .memory {
    fill: none;
    stroke: var(--brand);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.help-curve .review {
    fill: var(--surface);
    stroke: var(--brand-2);
    stroke-width: 2.5;
}

.help-curve .label {
    fill: var(--muted);
    font-size: 10px;
}

.help-curve .label.faint {
    opacity: .75;
}

.help-terms {
    margin: 0;
    display: grid;
    gap: 14px;
}

.help-terms dt {
    font-weight: 600;
}

.help-terms dd {
    margin: 2px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.help-ratings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.help-ratings li {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 12px;
    align-items: baseline;
    line-height: 1.5;
}

.help-ratings .badge {
    justify-self: start;
    font-size: .78rem;
}

.badge.wrong {
    background: var(--error-soft);
    color: var(--error);
}

.badge.hard {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
}

.badge.good {
    background: var(--success-soft);
    color: var(--success);
}

.badge.easy {
    background: var(--brand-soft);
    color: var(--brand);
}

@media (max-width: 480px) {
    .help-ratings li {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.help-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: 14px;
}

.help-steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 12px;
    line-height: 1.5;
}

.help-steps li::before {
    content: counter(step);
    grid-row: span 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    background: var(--brand-gradient);
}

.help-list {
    margin: 0;
    padding-left: 1.2em;
    display: grid;
    gap: 10px;
    line-height: 1.55;
}

/* ---------- Admin ---------- */

.container.wide, .topbar-inner.wide {
    max-width: 1100px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar input[type=search] {
    flex: 1;
    min-width: 200px;
}

.filter-bar select {
    width: auto;
}

.table-wrap {
    padding: 0;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.admin-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: var(--surface-2);
}

.admin-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-table td.missing {
    color: var(--error);
}

.admin .stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.admin a.stat {
    color: inherit;
    text-decoration: none;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.facts {
    margin: 0;
    display: grid;
    gap: 12px 24px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.facts dt {
    color: var(--muted);
    font-size: .8rem;
}

.facts dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

/* Thymeleaf setzt das CSRF-Feld als erstes Kind ins Formular – die Überschrift bleibt trotzdem oben */
.card.stack > input[type=hidden] + h2 {
    margin-top: 0;
}

/* ---------- Übertragung per QR-Code ---------- */

.qr-frame {
    width: min(260px, 100%);
    margin: 0 auto;
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.qr-frame svg {
    display: block;
    width: 100%;
    height: auto;
}

.transfer-link {
    display: block;
    margin-top: 8px;
    font-size: .8rem;
    overflow-wrap: anywhere;
    color: var(--muted);
}

.transfer-qr > .btn {
    align-self: center;
}

.transfer-qr {
    display: flex;
    flex-direction: column;
}

/* ---------- KI-Assistent (MCP) ---------- */

.token,
.snippet {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .85rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    overflow-wrap: anywhere;
}

.snippet {
    margin: 0;
    white-space: pre-wrap;
}

.token-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.token-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.token-list li > div {
    display: flex;
    flex-direction: column;
}

.chat-demo {
    display: grid;
    gap: 10px;
}

.chat-demo .bubble {
    margin: 0;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
}

.chat-demo .you {
    justify-self: end;
    color: #fff;
    background: var(--brand-gradient);
    border-bottom-right-radius: 4px;
}

.chat-demo .ai {
    justify-self: start;
    background: var(--surface-2);
    border-bottom-left-radius: 4px;
}


/* ---------- Wortliste: Filter und Details ---------- */

.tabs input, .chips input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tabs label:has(input:focus-visible), .chip:has(input:focus-visible) {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
}

.chip .count {
    font-size: .75rem;
    font-weight: 600;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--surface-2);
}

.chip.active {
    color: #fff;
    border-color: transparent;
    background: var(--brand-gradient);
}

.chip.active .count {
    background: rgba(255, 255, 255, .25);
}

/* ganze Zeile klickbar, Vorlese-Knopf bleibt bedienbar */
.word-link {
    color: inherit;
    text-decoration: none;
}

.word-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.word-list .speak {
    position: relative;
    z-index: 1;
}

.word-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.word-badges:empty {
    display: none;
}

.back-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.word-head {
    display: flex;
    gap: 14px;
    align-items: center;
}

.word-head .topic-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--surface-2);
    font-size: 1.7rem;
    flex-shrink: 0;
}

.word-head h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.word-head p {
    margin: 2px 0 0;
}

.word-detail .translations {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}

.word-detail .example {
    margin: 0;
    padding: 10px 14px;
    border-left: 3px solid var(--brand);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.word-detail .example p {
    margin: 0;
}

.direction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.direction-grid h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.recall {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.recall strong {
    font-size: 1.8rem;
    white-space: nowrap;
}

.memory-stats {
    margin: 0;
    display: grid;
    gap: 8px;
}

.memory-stats div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.memory-stats dt {
    color: var(--muted);
}

.memory-stats dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.answer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.answer-list li {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.answer-list .given {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ---------- Werbung für das Lernen im Chat (MCP) ---------- */

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
}

.feature-pill .icon {
    width: 16px;
    height: 16px;
}

.feature-pill:hover {
    border-color: var(--brand);
}

.ai-promo {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    align-items: center;
    margin-top: 28px;
    scroll-margin-top: 90px;
}

.ai-promo::before {
    content: "";
    position: absolute;
    inset: -40% -30% auto auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-1), transparent 65%);
    pointer-events: none;
}

.ai-promo:not(:has(.chat-demo)) {
    grid-template-columns: 1fr;
}

.ai-promo-text {
    position: relative;
    display: grid;
    gap: 12px;
    justify-items: start;
}

.ai-promo-text h2 {
    margin: 0;
}

.ai-promo-text p {
    margin: 0;
    line-height: 1.55;
}

.ai-promo-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 10px 24px -10px rgba(123, 97, 255, .7);
}

.ai-promo-icon .icon {
    width: 22px;
    height: 22px;
}

.ai-promo-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.ai-promo-points li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.45;
}

.ai-promo-points .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--success);
}

.ai-promo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.ai-promo .chat-demo {
    position: relative;
    font-size: .9rem;
}

@media (max-width: 640px) {
    .ai-promo {
        grid-template-columns: 1fr;
    }
}

/* ---------- Hilfebereich: Übersicht und Unternavigation ---------- */

.help-nav {
    align-self: flex-start;
}

.help-topics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.help-topic {
    display: grid;
    align-content: start;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.help-topic:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.help-topic .muted {
    line-height: 1.5;
}

.help-topic-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #fff;
    background: var(--brand-gradient);
}

.help-topic-icon .icon {
    width: 22px;
    height: 22px;
}

.help-topic-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: var(--brand);
    font-weight: 600;
}

.help-topic-more .icon {
    width: 16px;
    height: 16px;
}

.community-stats .flags {
    font-size: 1.1rem;
    line-height: 1;
}

.community-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
}

/* ---------- Upload mit Fortschritt (Admin, Audio-ZIP) ---------- */

.upload-status .progress {
    display: block;
}

.upload-status .progress-fill {
    width: 0;
    transition: width .2s linear;
}

/* Verarbeitung auf dem Server: Dauer unbekannt, der Balken läuft durch */
.progress.indeterminate .progress-fill {
    width: 40% !important;
    animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(250%);
    }
}

.upload-status.failed p {
    color: var(--error);
}

.upload-status.failed .progress-fill {
    background: var(--error);
}

@media (prefers-reduced-motion: reduce) {
    .progress.indeterminate .progress-fill {
        animation: none;
        width: 100% !important;
        opacity: .5;
    }
}
