/* ===== Vokabelheld – großes, klares Design zum Nebenbei-Lernen ===== */
:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #64708a;
  --primary: #3b6ef6;
  --primary-dark: #2b55c9;
  --green: #22a35d;
  --green-bg: #e3f7ec;
  --red: #e04545;
  --red-bg: #fdeaea;
  --amber: #f0a500;
  --en: #3b6ef6;
  --fr: #9b51e0;
  --la: #e08a00;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(28,36,52,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ===== Buttons ===== */
.btn {
  border: none; border-radius: 14px; padding: .7rem 1.2rem;
  font-size: 1rem; font-weight: 600; transition: transform .08s, filter .15s;
  background: #e6eaf2; color: var(--text);
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-ghost { background: transparent; }
.btn-big { font-size: 1.2rem; padding: 1rem 1.6rem; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ===== Auth ===== */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 2.5rem 2rem; width: 100%; max-width: 430px; text-align: center;
}
.auth-card .logo { font-size: 3.5rem; }
.auth-card h1 { font-size: 2rem; margin: .3rem 0 .2rem; }
.subtitle { color: var(--muted); margin-bottom: 1.5rem; }
.tabs { display: flex; gap: .5rem; background: #eef1f7; border-radius: 14px; padding: .3rem; margin-bottom: 1.2rem; }
.tab { flex: 1; border: none; background: transparent; border-radius: 11px; padding: .7rem; font-size: 1rem; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
#auth-form input {
  width: 100%; font-size: 1.15rem; padding: .9rem 1rem; margin-bottom: .8rem;
  border: 2px solid #dde3ee; border-radius: 14px; outline: none;
}
#auth-form input:focus { border-color: var(--primary); }
.form-error { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: .6rem; margin-bottom: .8rem; font-weight: 600; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 1rem; line-height: 1.4; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: .8rem 1.2rem; background: var(--card); box-shadow: 0 2px 10px rgba(28,36,52,.06);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 1.3rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: .4rem; }
.topbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; position: relative; }
.stat-pill {
  background: #eef1f7; border-radius: 999px; padding: .45rem .9rem; font-size: 1rem; white-space: nowrap;
}
.stat-pill.hot { background: #ffe9d6; }
.menu {
  position: absolute; right: 0; top: 110%; background: #fff; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15); overflow: hidden; z-index: 50; min-width: 220px;
}
.menu button { display: block; width: 100%; text-align: left; padding: .9rem 1.1rem; border: none; background: none; font-size: 1rem; }
.menu button:hover { background: #f2f5fa; }

/* ===== Layout ===== */
main { max-width: 1000px; margin: 0 auto; padding: 1.4rem 1rem 4rem; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 .9rem; }

/* ===== Dashboard-Statistik ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.stat-card .big { font-size: 2rem; font-weight: 800; }
.stat-card .label { color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.xp-bar { background: #e8ecf4; border-radius: 999px; height: 14px; overflow: hidden; margin-top: .6rem; }
.xp-bar > div { background: linear-gradient(90deg, var(--primary), #6f9bff); height: 100%; border-radius: 999px; transition: width .4s; }
.goal-done { color: var(--green); font-weight: 700; }

/* ===== Sprachfilter ===== */
.lang-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.4rem 0 1rem; }
.lang-tab {
  border: 2px solid transparent; background: var(--card); box-shadow: var(--shadow);
  border-radius: 999px; padding: .6rem 1.2rem; font-size: 1.05rem; font-weight: 700;
}
.lang-tab.active { border-color: var(--primary); color: var(--primary); }

/* ===== Listen ===== */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.list-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem;
  border-top: 6px solid var(--primary);
}
.list-card.lang-en { border-top-color: var(--en); }
.list-card.lang-fr { border-top-color: var(--fr); }
.list-card.lang-la { border-top-color: var(--la); }
.list-card h3 { font-size: 1.2rem; }
.list-meta { color: var(--muted); font-size: .95rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.badge { border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 700; }
.badge-global { background: #e5ecff; color: var(--primary); }
.badge-error { background: var(--red-bg); color: var(--red); }
.badge-lang { background: #eef1f7; color: var(--muted); }
.list-actions { display: flex; gap: .5rem; margin-top: auto; flex-wrap: wrap; }
.list-actions .btn { flex: 1; }
.empty-box {
  background: var(--card); border: 2px dashed #ccd5e4; border-radius: var(--radius);
  padding: 2rem; text-align: center; color: var(--muted); font-size: 1.05rem; line-height: 1.5;
}

/* ===== Fehlerwörter-Banner ===== */
.error-banner {
  background: linear-gradient(100deg, #fff3f3, #ffeaea); border: 2px solid #f6c9c9;
  border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem;
}
.error-banner b { font-size: 1.1rem; }

/* ===== Lern-Session ===== */
.learn-wrap { max-width: 660px; margin: 0 auto; }
.learn-top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.progress-track { flex: 1; background: #e2e7f0; height: 16px; border-radius: 999px; overflow: hidden; }
.progress-track > div { background: var(--green); height: 100%; transition: width .3s; border-radius: 999px; }
.learn-count { font-weight: 700; color: var(--muted); white-space: nowrap; }
.question-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 2.2rem 1.6rem; text-align: center; margin-bottom: 1.2rem; position: relative;
}
.question-card .word { font-size: 2.4rem; font-weight: 800; line-height: 1.2; word-break: break-word; }
.question-card .task-hint { color: var(--muted); margin-bottom: .8rem; font-weight: 600; }
.error-flag {
  position: absolute; top: .8rem; right: .8rem; background: var(--red-bg); color: var(--red);
  border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; font-weight: 700;
}
.choices { display: grid; gap: .8rem; }
.choice {
  background: var(--card); border: 3px solid #dde3ee; border-radius: 16px;
  padding: 1.1rem 1rem; font-size: 1.25rem; font-weight: 600; text-align: center; word-break: break-word;
}
.choice:hover { border-color: var(--primary); }
.choice.correct { border-color: var(--green); background: var(--green-bg); }
.choice.wrong { border-color: var(--red); background: var(--red-bg); }
.choice:disabled { cursor: default; }
.type-row { display: flex; gap: .6rem; }
.type-row input {
  flex: 1; font-size: 1.3rem; padding: 1rem 1.1rem; border: 3px solid #dde3ee;
  border-radius: 16px; outline: none; min-width: 0;
}
.type-row input:focus { border-color: var(--primary); }
.type-row input.correct { border-color: var(--green); background: var(--green-bg); }
.type-row input.wrong { border-color: var(--red); background: var(--red-bg); }
.feedback { text-align: center; font-size: 1.15rem; font-weight: 700; margin-top: 1rem; min-height: 1.6rem; }
.feedback.good { color: var(--green); }
.feedback.bad { color: var(--red); }
.learn-next { margin-top: 1.2rem; }

/* ===== Ergebnis ===== */
.result-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 2.5rem 1.5rem; text-align: center; max-width: 560px; margin: 2rem auto;
}
.result-card .emoji { font-size: 4rem; }
.result-card h2 { margin: .6rem 0; }
.result-nums { display: flex; justify-content: center; gap: 2rem; margin: 1.2rem 0; flex-wrap: wrap; }
.result-nums .big { font-size: 2rem; font-weight: 800; }
.result-nums .label { color: var(--muted); }
.result-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ===== Tabellen (Wörter, Admin) ===== */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid #edf0f6; }
th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
td .btn { padding: .4rem .8rem; font-size: .9rem; }
.word-error td:first-child { position: relative; }
.tag-error { background: var(--red-bg); color: var(--red); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; margin-left: .4rem; }

/* ===== Abzeichen ===== */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.badge-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; text-align: center;
}
.badge-card .icon { font-size: 2.4rem; }
.badge-card.locked { opacity: .38; filter: grayscale(1); }
.badge-card b { display: block; margin-top: .3rem; }
.badge-card small { color: var(--muted); }

/* ===== Modal ===== */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: #fff; border-radius: 22px; padding: 1.8rem; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.modal label { display: block; font-weight: 700; margin: .9rem 0 .3rem; }
.modal input[type=text], .modal input[type=password], .modal select, .modal input[type=file] {
  width: 100%; font-size: 1.05rem; padding: .75rem .9rem; border: 2px solid #dde3ee; border-radius: 12px; outline: none; background: #fff;
}
.modal input:focus, .modal select:focus { border-color: var(--primary); }
.modal .btn-row { display: flex; gap: .6rem; margin-top: 1.4rem; }
.modal .btn-row .btn { flex: 1; }
.seg { display: flex; gap: .4rem; background: #eef1f7; padding: .3rem; border-radius: 12px; }
.seg button { flex: 1; border: none; background: transparent; border-radius: 9px; padding: .6rem .4rem; font-weight: 700; font-size: .95rem; color: var(--muted); }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.format-hint { background: #f4f7fd; border-radius: 12px; padding: .8rem; font-size: .88rem; color: var(--muted); margin-top: 1rem; line-height: 1.5; }
.format-hint code { background: #e6ecf7; padding: .05rem .35rem; border-radius: 6px; color: var(--text); }

/* ===== Toast ===== */
#toast-wrap { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast {
  background: #1c2434; color: #fff; border-radius: 999px; padding: .7rem 1.4rem;
  font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.3); animation: pop .25s;
}
.toast.xp { background: var(--green); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== Responsiv ===== */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .question-card .word { font-size: 1.8rem; }
  .topbar { padding: .6rem .8rem; }
  .stat-pill { font-size: .9rem; padding: .35rem .7rem; }
}
/* ===== Verb-Modus Ergänzungen ===== */
.list-card.list-verbs { border-top-color: #e04545; }
.list-card.list-verbs h3::before { content: "🔥 "; }

.verb-table th { background: #fff3f3; color: #b93636; }
.verb-form-table {
  width: 100%; max-width: 500px; margin: 0 auto 1.2rem;
  border-collapse: separate; border-spacing: 0 .6rem;
}
.verb-form-table td { border: none; padding: .4rem; vertical-align: middle; }
.verb-form-table .vlabel { width: 38%; font-weight: 700; color: var(--muted); text-align: right; padding-right: 1rem; }
.verb-form-table .vinput { width: 62%; }
.verb-form-table input {
  width: 100%; font-size: 1.25rem; padding: .8rem 1rem; border: 3px solid #dde3ee;
  border-radius: 14px; outline: none;
}
.verb-form-table input:focus { border-color: var(--primary); }
.verb-form-table input.given { background: #f4f7fd; color: var(--muted); font-weight: 700; }
.verb-form-table input.correct { border-color: var(--green); background: var(--green-bg); }
.verb-form-table input.wrong { border-color: var(--red); background: var(--red-bg); }
/* ===== Karteikarten-Modus ===== */
.flash-answer {
  font-size: 2.2rem; font-weight: 800; color: var(--primary); text-align: center;
  animation: fadeIn .3s;
}
.question-card.flipped { background: linear-gradient(135deg, #f4f7fd, #ffffff); }
.flash-actions {
  display: flex; gap: .8rem; margin-top: 1rem;
}
.flash-actions .btn { font-size: 1.1rem; padding: 1rem; }
#btn-flip { margin-top: 1rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
