/* =====================================================================
   Vokabeltrainer – modernes Design: Glas-Karten, Farbverläufe, Animationen.
   Hell/Dunkel folgt dem System. Bewegung wird bei "weniger Bewegung" abgeschaltet.
   ===================================================================== */

:root {
    --bg1: #f4f5fb;
    --bg2: #edf2f8;
    --text: #1a1d2e;
    --muted: #5d6279;
    --glass: rgba(255, 255, 255, 0.62);
    --glass-strong: rgba(255, 255, 255, 0.86);
    --glass-hover: rgba(255, 255, 255, 0.82);
    --line: rgba(80, 92, 150, 0.18);
    --field: rgba(255, 255, 255, 0.7);
    --shadow: 0 12px 30px -16px rgba(50, 62, 120, 0.28);
    --shadow-lg: 0 22px 54px -26px rgba(50, 62, 120, 0.36);

    --brand-1: #4450b5;
    --brand-2: #5160c2;
    --brand-3: #5f6ccc;
    --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
    --accent: #3f4cae;       /* Text/Links */
    --accent-soft: rgba(80, 96, 190, 0.12);
    --on-brand: #ffffff;

    --ok: #1b7a5a;   --ok-soft: rgba(40, 150, 110, 0.14);
    --warn: #8f5d12; --warn-soft: rgba(210, 150, 40, 0.16);
    --bad: #b02a43;  --bad-soft: rgba(210, 70, 90, 0.12);
    --info: #1f6a96; --info-soft: rgba(50, 140, 190, 0.13);

    --orb-1: rgba(90, 106, 210, 0.2);
    --orb-2: rgba(80, 160, 205, 0.16);
    --orb-3: rgba(130, 120, 200, 0.12);

    --radius: 20px;
    --radius-sm: 14px;
    --tabbar-h: 66px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg1: #0c0e1a;
        --bg2: #121729;
        --text: #e9eaf5;
        --muted: #a0a5c2;
        --glass: rgba(30, 34, 58, 0.56);
        --glass-strong: rgba(34, 39, 66, 0.84);
        --glass-hover: rgba(46, 52, 86, 0.72);
        --line: rgba(255, 255, 255, 0.12);
        --field: rgba(12, 14, 30, 0.55);
        --shadow: 0 16px 38px -18px rgba(0, 0, 0, 0.8);
        --shadow-lg: 0 28px 70px -26px rgba(0, 0, 0, 0.9);

        --accent: #a9b4ec;
        --accent-soft: rgba(130, 145, 225, 0.16);

        --ok: #72c9a0;   --ok-soft: rgba(114, 201, 160, 0.14);
        --warn: #deb25c; --warn-soft: rgba(222, 178, 92, 0.14);
        --bad: #ee8896;  --bad-soft: rgba(238, 136, 150, 0.14);
        --info: #86c4e6; --info-soft: rgba(134, 196, 230, 0.13);

        --orb-1: rgba(80, 96, 200, 0.28);
        --orb-2: rgba(60, 140, 190, 0.2);
        --orb-3: rgba(110, 100, 190, 0.16);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 12% -10%, var(--orb-1), transparent 60%),
        radial-gradient(900px 600px at 100% 10%, var(--orb-2), transparent 55%),
        radial-gradient(900px 700px at 40% 110%, var(--orb-3), transparent 55%),
        linear-gradient(160deg, var(--bg1), var(--bg2));
    background-attachment: fixed;
}

/* sanft schwebende Farbkugeln im Hintergrund */
body::before, body::after {
    content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: 0.4;
}
body::before { width: 46vmax; height: 46vmax; left: -14vmax; top: 28vh; background: var(--orb-1); animation: drift 26s ease-in-out infinite alternate; }
body::after  { width: 38vmax; height: 38vmax; right: -12vmax; bottom: -8vmax; background: var(--orb-2); animation: drift 32s ease-in-out infinite alternate-reverse; }

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(6vmax, -5vmax, 0) scale(1.15); }
}

h1 {
    font-size: clamp(1.6rem, 5vw, 2rem); margin: 0.3rem 0 1rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1:focus { outline: none; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.7rem; letter-spacing: -0.01em; }
.panel h2 { margin-top: 0; }
p { margin: 0.4rem 0 0.8rem; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.hidden-input { display: none; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(env(safe-area-inset-top) + 6px) 18px 6px;
    background: var(--glass); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
.topbar .brand {
    flex: 1; min-width: 0; padding: 8px 0; white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; text-decoration: none;
    background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.whoami {
    color: var(--muted); font-size: 0.85rem; text-decoration: none; max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.2s;
}
.whoami:hover { color: var(--text); }
@media (max-width: 440px) { .whoami { display: none; } }

.content {
    flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
    padding: 20px 16px calc(var(--tabbar-h) + 48px + env(safe-area-inset-bottom));
}
/* Seiten gleiten beim Wechsel sanft ein */
.content > * { animation: rise 0.5s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
.content > *:nth-child(n+5) { animation-delay: 0.16s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* schwebende Tab-Leiste */
.tabbar {
    position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(560px, calc(100% - 24px)); height: var(--tabbar-h);
    display: flex; gap: 4px; padding: 6px;
    background: var(--glass-strong); border: 1px solid var(--line); border-radius: 26px;
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
}
.tab {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    border-radius: 20px; font-size: 0.72rem; font-weight: 600; text-decoration: none; color: var(--muted);
    transition: color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.tab .ico { font-size: 1.25rem; line-height: 1; filter: grayscale(0.6); transition: transform 0.3s var(--ease), filter 0.25s; }
.tab:hover { color: var(--text); }
.tab:active { transform: scale(0.94); }
.tab.active { color: var(--text); background: var(--accent-soft); }
.tab.active .ico { filter: none; transform: translateY(-1px) scale(1.12); }
.tab.active::after {
    content: ""; position: absolute; bottom: 4px; width: 18px; height: 3px; border-radius: 3px; background: var(--brand-grad);
}

/* ---------- Bausteine ---------- */
.panel {
    position: relative; margin: 0 0 16px; padding: 18px;
    background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
}
.panel.daily { border-color: transparent;
    background:
        linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
        var(--brand-grad) border-box;
}

.btn {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 8px 18px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--glass); color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s, filter 0.25s;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn:hover { background: var(--glass-hover); transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
    color: var(--on-brand); border-color: transparent; background: var(--brand-grad);
    box-shadow: 0 10px 24px -8px rgba(60, 72, 160, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.primary:hover { filter: brightness(1.08) saturate(1.1); box-shadow: 0 14px 30px -8px rgba(60, 72, 160, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.26); }
/* Glanz, der über den Knopf wischt */
.btn.primary::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transition: transform 0.7s var(--ease);
}
.btn.primary:hover::after { transform: translateX(120%); }

.btn.ghost { background: transparent; border-style: dashed; border-color: var(--line); color: var(--accent); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: 0.9rem; border-radius: 12px; }
.btn.big { min-height: 54px; font-size: 1.05rem; border-radius: 16px; }
.btn.wide { width: 100%; }

.btn:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--accent); outline-offset: 2px;
}

.icon-btn {
    border: 0; background: transparent; color: inherit; font-size: 1.1rem;
    width: 40px; height: 40px; border-radius: 12px; cursor: pointer; flex: none;
    transition: background 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); transform: scale(1.08); }
.icon-btn:active { transform: scale(0.94); }

.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.actions.row { flex-direction: row; flex-wrap: wrap; }
.actions.row .btn { flex: 1 1 auto; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 0.8rem; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.hint { font-size: 0.8rem; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .row2 { grid-template-columns: 1fr; } }

input, select, textarea {
    width: 100%; min-height: 46px; padding: 9px 14px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--text); font: inherit;
    transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
}
input::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, select:hover { border-color: var(--accent-soft); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand-2); }
.search { margin-bottom: 10px; }

.notice {
    margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--info-soft); border: 1px solid transparent; animation: pop 0.35s var(--ease);
}
.notice.error { background: var(--bad-soft); border-color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok); }

@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
    background: var(--accent-soft); color: var(--accent);
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pills { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.flag { color: var(--warn); font-weight: 700; }

.back { display: inline-block; margin-bottom: 4px; text-decoration: none; font-weight: 700; transition: transform 0.2s var(--ease); }
.back:hover { transform: translateX(-3px); }
.title-row { display: flex; align-items: center; gap: 6px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 10px; }

.spinner {
    display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em;
    border: 2px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-line { display: flex; gap: 10px; align-items: center; }

/* ---------- Startseite ---------- */
.hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
    padding: 20px; margin-bottom: 18px; border-radius: var(--radius); color: #fff; text-decoration: none;
    background: linear-gradient(120deg, #3b46a8, #4a58bb, #5a6ccb, #3b46a8); background-size: 300% 300%;
    animation: rise 0.5s var(--ease) both, gradient-shift 12s ease infinite;
    box-shadow: 0 18px 40px -16px rgba(60, 72, 160, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.26);
    transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.hero::before {
    content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
}
.hero::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
    transition: transform 0.9s var(--ease);
}
.hero:hover { transform: translateY(-3px) scale(1.005); box-shadow: 0 26px 50px -16px rgba(60, 72, 160, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.26); }
.hero:hover::after { transform: translateX(120%); }
.hero strong { font-size: 1.1rem; }
.hero .muted { display: block; color: rgba(255, 255, 255, 0.85); font-size: 0.9rem; }
.hero-ico { font-size: 2.2rem; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); animation: bob 3.2s ease-in-out infinite; }

@keyframes gradient-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.list-item {
    display: flex; align-items: center; gap: 14px; padding: 16px 18px;
    background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
    color: inherit; text-decoration: none; box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.list-item:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--glass-hover); box-shadow: var(--shadow-lg); }
.list-item:active { transform: translateY(-1px) scale(0.995); }
.list-title { font-weight: 700; overflow-wrap: anywhere; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
    padding: 14px 8px; text-align: center; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform 0.25s var(--ease);
}
.stat:hover { transform: translateY(-2px); }
.stat strong {
    display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em;
    background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 330px) { .mode-grid { grid-template-columns: 1fr; } }

/* ---------- Scannen ---------- */
.capture { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.thumb {
    position: relative; margin: 0; width: 100px; overflow: hidden; background: var(--glass-strong);
    border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: pop 0.4s var(--ease);
    transition: transform 0.25s var(--ease);
}
.thumb:hover { transform: translateY(-3px) rotate(-1deg); }
.thumb img { display: block; width: 100%; height: 124px; object-fit: cover; }
.thumb figcaption { padding: 4px; text-align: center; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.thumb.done { border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), var(--shadow); }
.thumb.err { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft), var(--shadow); }
.thumb-remove {
    position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0, 0, 0, 0.55); color: #fff; transition: transform 0.2s var(--ease), background 0.2s;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.thumb-remove:hover { background: var(--bad); transform: scale(1.12); }

/* ---------- Prüfen / Listen ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; }
.check input { width: 18px; height: 18px; }

.entries { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.entry {
    background: var(--glass); border: 1px solid var(--line); border-left-width: 4px; border-left-color: var(--brand-2);
    border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform 0.2s var(--ease), box-shadow 0.25s, opacity 0.2s;
}
.entry:hover { transform: translateX(2px); }
.entry.check-me { border-left-color: var(--warn); box-shadow: 0 0 0 1px var(--warn-soft), var(--shadow); }
.entry.off { opacity: 0.45; }
.entry-main { display: flex; align-items: center; gap: 8px; }
.keep { flex: none; }
.entry-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.entry-fields.wide { grid-template-columns: 1fr; }
@media (max-width: 520px) { .entry-fields { grid-template-columns: 1fr; } }
.entry-fields input { min-height: 40px; padding: 4px 12px; }
.entry-fields .term { font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0 30px; }
.entry-extra { display: grid; gap: 8px; margin: 10px 0 2px 30px; animation: rise 0.3s var(--ease); }
.entry-extra input { min-height: 40px; padding: 4px 12px; }
.row-actions { display: flex; gap: 8px; margin-top: 8px; }

.entries.compact .entry { padding: 0; border-left-width: 1px; overflow: hidden; }
.entries.compact .entry > .entry-fields, .entries.compact .entry > .row-actions { padding: 12px; }
.entry-view {
    display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
    background: transparent; border: 0; color: inherit; font: inherit; padding: 12px 14px; cursor: pointer;
    transition: background 0.2s;
}
.entry-view:hover { background: var(--accent-soft); }
.entry-view .term-text { display: block; font-weight: 700; }
.entry-view .trans-text { display: block; }
.entry-view .example-text { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--line); }
.dot.new { background: var(--info); box-shadow: 0 0 6px var(--info); }
.dot.due { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.dot.learning { background: var(--muted); }
.dot.mastered { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

.sticky-actions {
    position: sticky; bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
    margin-top: 16px; padding: 10px 0 0; display: flex; flex-direction: column; gap: 8px; z-index: 5;
}
.danger-zone { margin-top: 20px; }
ul.plain { margin: 0; padding-left: 1.2rem; }

/* ---------- Lernen ---------- */
.learn-head { display: flex; justify-content: space-between; align-items: center; }
.progress { height: 10px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 6px 0 18px; }
.progress span {
    position: relative; display: block; height: 100%; border-radius: 99px; background: var(--brand-grad);
    box-shadow: 0 0 10px rgba(80, 96, 200, 0.5); transition: width 0.5s var(--ease);
}
.progress span::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent); animation: shimmer 2.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.flashcard, .cloze-card {
    position: relative; min-height: 230px; padding: 26px 20px; margin-bottom: 16px; text-align: center;
    display: flex; flex-direction: column; justify-content: center; gap: 8px; border-radius: 28px; border: 1px solid transparent;
    background:
        linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
        linear-gradient(135deg, var(--brand-1), var(--brand-3)) border-box;
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    animation: card-in 0.45s var(--ease) both;
    user-select: none;
}
.flashcard { cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.flashcard:not(.revealed):hover { transform: translateY(-4px) rotate(-0.4deg); }
.flashcard.revealed { cursor: default; }
.flashcard::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0.5;
    background: radial-gradient(500px 160px at 50% -10%, var(--accent-soft), transparent 70%);
}

@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.97) rotateX(8deg); } to { opacity: 1; transform: none; } }

.fc-lang { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; }
.fc-prompt { font-size: clamp(1.8rem, 7vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fc-answer {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem); font-weight: 700; overflow-wrap: anywhere;
    background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fc-note { font-size: 0.85rem; color: var(--muted); font-style: italic; }
.fc-hint { margin-top: 10px; font-size: 0.85rem; color: var(--muted); animation: pulse-soft 2.4s ease-in-out infinite; }
.fc-example { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.95rem; }
.flashcard hr { width: 55%; height: 2px; border: 0; margin: 14px auto; border-radius: 2px; background: var(--brand-grad); opacity: 0.6; }
/* Antwort klappt weich auf */
.flashcard hr, .flashcard hr ~ * { animation: reveal 0.45s var(--ease) both; }
.flashcard hr ~ *:nth-child(n+2) { animation-delay: 0.05s; }
.flashcard hr ~ *:nth-child(n+4) { animation-delay: 0.1s; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pulse-soft { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.speak { position: absolute; right: 10px; }
.fc-prompt + .speak { top: 10px; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; animation: rise 0.35s var(--ease); }
.grade { min-height: 56px; padding: 6px 4px; font-size: 0.9rem; font-weight: 700; }
.grade.again { color: var(--bad); background: var(--bad-soft); }
.grade.hard { color: var(--warn); background: var(--warn-soft); }
.grade.good { color: var(--ok); background: var(--ok-soft); }
.grade.easy { color: var(--info); background: var(--info-soft); }
@media (max-width: 380px) { .grades { grid-template-columns: 1fr 1fr; } }

.type-form { display: flex; flex-direction: column; gap: 12px; }
.type-form input { font-size: 1.15rem; min-height: 56px; border-radius: 16px; text-align: center; font-weight: 600; }
.verdict { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 700; animation: pop 0.3s var(--ease); }
.verdict.ok { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 16px -8px var(--ok); }
.verdict.close { background: var(--warn-soft); color: var(--warn); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); animation: pop 0.3s var(--ease), shake 0.45s 0.05s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

/* Multiple Choice */
.options { display: grid; gap: 12px; margin-bottom: 14px; }
.option {
    justify-content: flex-start; text-align: left; min-height: 58px; font-weight: 600; white-space: normal; overflow-wrap: anywhere;
    animation: rise 0.4s var(--ease) both;
}
.option:nth-child(2) { animation-delay: 0.05s; }
.option:nth-child(3) { animation-delay: 0.1s; }
.option:nth-child(4) { animation-delay: 0.15s; }
.option .num {
    flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 800;
}
.option.correct { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); box-shadow: 0 0 18px -8px var(--ok); }
.option.correct .num { background: var(--ok); color: #fff; }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); animation: shake 0.45s; }
.option.wrong .num { background: var(--bad); color: #fff; }
.option:disabled { opacity: 1; cursor: default; transform: none; }
.option:disabled:not(.correct):not(.wrong) { opacity: 0.5; }

/* Lückensatz */
.cloze-sentence { font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.cloze-gap {
    display: inline-block; min-width: 4.5ch; padding: 0 8px; margin: 0 3px; border-radius: 8px;
    border-bottom: 3px solid var(--brand-2); background: var(--accent-soft); color: transparent; user-select: none;
    transition: background 0.3s, color 0.3s;
}
.cloze-gap.ok, .cloze-gap.bad { user-select: auto; animation: pop 0.35s var(--ease); }
.cloze-gap.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.cloze-gap.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.cloze-translation { color: var(--muted); font-size: 0.95rem; }
.cloze-hint { font-size: 0.9rem; }
.cloze-hint button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Tagesziel / Serie ---------- */
.goal { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.ring { position: relative; width: 92px; height: 92px; flex: none; filter: drop-shadow(0 6px 12px rgba(60, 72, 160, 0.25)); }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--accent-soft); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dasharray 0.8s var(--ease); }
.goal.met .ring-fg { stroke: url(#ringOk); }
.goal.met .ring { filter: drop-shadow(0 6px 14px rgba(40, 150, 110, 0.35)); animation: ring-pop 0.6s var(--ease); }
@keyframes ring-pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring-text strong { font-size: 1.5rem; font-weight: 800; }
.ring-text span { font-size: 0.75rem; color: var(--muted); }
.goal-title { font-weight: 800; letter-spacing: -0.01em; }
.goal.met .goal-title { color: var(--ok); }
.streak { margin-top: 3px; color: var(--muted); font-weight: 600; }
.streak.on { color: var(--warn); font-weight: 800; }
.streak .muted { font-weight: 500; }
.goal-warn { margin-top: 5px; font-size: 0.85rem; color: var(--warn); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day-dot {
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--line); font-size: 0.85rem; font-weight: 800; color: #fff; transition: transform 0.25s var(--ease);
}
.day:hover .day-dot { transform: scale(1.12); }
.day.met .day-dot { background: linear-gradient(135deg, #2f9a76, #4fb08f); border-color: transparent; box-shadow: 0 4px 10px -3px rgba(40, 150, 110, 0.5); animation: pop 0.4s var(--ease) both; }
.day.today .day-dot { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.day.today.met .day-dot { border-color: transparent; }
.day-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.day.today .day-label { color: var(--text); font-weight: 800; }

.goal-banner {
    margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 800; text-align: center;
    background: linear-gradient(135deg, var(--ok-soft), var(--accent-soft)); color: var(--ok); border: 1px solid var(--ok);
    box-shadow: 0 0 20px -10px var(--ok); animation: pop 0.5s var(--ease);
}

/* Konfetti beim Erreichen des Tagesziels */
.confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden; }
.confetti i {
    position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; opacity: 0;
    animation: confetti-fall var(--dur, 2.4s) var(--delay, 0s) cubic-bezier(0.25, 0.6, 0.4, 1) forwards;
}
@keyframes confetti-fall {
    0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { opacity: 0; transform: translate3d(var(--dx, 0px), 105vh, 0) rotate(var(--rot, 540deg)); }
}

/* ---------- Kurse / Auswahl ---------- */
.sel-row { display: flex; align-items: center; gap: 12px; }
.sel-row input[type="checkbox"] { flex: none; }
.sel-row .list-item { flex: 1; min-width: 0; }

/* ---------- Anmeldung / Verwaltung ---------- */
.gate { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 60vh; color: var(--muted); }
.offline-bar { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 0.85rem; text-align: center; font-weight: 600; }

.anon { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.anon-brand {
    font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; margin: 8px 0 18px;
    background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: rise 0.6s var(--ease) both;
}
.anon-card {
    width: 100%; max-width: 440px; padding: 26px; border-radius: 28px; border: 1px solid var(--line);
    background: var(--glass-strong); box-shadow: var(--shadow-lg); animation: card-in 0.6s 0.1s var(--ease) both;
    -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
.anon-foot { margin-top: 16px; font-size: 0.85rem; }
.consent { align-items: flex-start; margin: 8px 0 12px; }
.consent input { margin-top: 3px; flex: none; }

.seg { display: flex; gap: 4px; padding: 5px; margin-bottom: 16px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; }
.seg button {
    flex: 1; min-height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--muted);
    font: inherit; font-weight: 700; cursor: pointer; transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(60, 72, 160, 0.5); }

.row-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.entries.compact .entry.user-card { padding: 0; }
.user-card .entry-extra { margin: 0; padding: 0 14px 14px; }
.linkbox input { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; margin-bottom: 10px; }
.linkbox { margin-top: 10px; }

/* ---------- App installieren ---------- */
.install-compact { min-height: 34px; padding: 2px 12px; font-size: 0.8rem; white-space: nowrap; border-radius: 999px; }
.install-sheet {
    position: fixed; z-index: 40; left: 12px; right: 12px; top: 64px; max-width: 440px; margin: 0 auto; padding: 18px;
    background: var(--glass-strong); color: var(--text); border: 1px solid var(--accent); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); animation: card-in 0.35s var(--ease);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.install-sheet ol { margin: 6px 0 12px; padding-left: 1.2rem; }

/* ---------- Blazor-Standard ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--ok); }
.invalid { outline: 1px solid var(--bad); }
.validation-message { color: var(--bad); }

#blazor-error-ui {
    color-scheme: light only; background: #fff7d6; color: #2b2b2b;
    bottom: 0; box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25); box-sizing: border-box; display: none; left: 0;
    padding: 0.7rem 1.25rem 0.8rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "Es ist ein Fehler aufgetreten."; }

.loading-progress {
    position: absolute; display: block; width: 8rem; height: 8rem; inset: 20vh 0 auto 0; margin: 0 auto 0 auto;
    filter: drop-shadow(0 6px 14px rgba(60, 72, 160, 0.35));
}
.loading-progress circle { fill: none; stroke: var(--accent-soft); stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child {
    stroke: var(--brand-2); stroke-linecap: round;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text { position: absolute; text-align: center; font-weight: 700; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; color: var(--text); }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Lade"); }

/* ---------- Fallback ohne Unschärfe-Unterstützung ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .panel, .list-item, .entry, .stat, .tabbar, .topbar, .btn, .anon-card { background: var(--glass-strong); }
}

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    body::before, body::after, .confetti { display: none; }
}

/* Lernarten: Symbol und Text bleiben in einer Zeile */
.mode-grid .btn { font-size: 0.95rem; padding-left: 8px; padding-right: 8px; gap: 6px; white-space: nowrap; }
@media (max-width: 400px) { .mode-grid .btn { font-size: 0.88rem; } }
