/* Gestaltung nach dem App-Design „German Method": DM Sans, Indigo, weiße Karten. */
@font-face {
  font-family: 'Uthmanic';
  src: url('fonts/uthmanic.woff2') format('woff2');
  font-display: swap;
}
/* Ersatz, solange uthmanic.woff2 fehlt: Scheherazade New (SIL Open Font License) */
@font-face { font-family: 'Scheherazade New'; src: url('fonts/ScheherazadeNew-Regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('fonts/DMSans.woff2') format('woff2'); font-weight: 100 1000; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('fonts/DMSans-Italic.woff2') format('woff2'); font-weight: 100 1000; font-style: italic; font-display: swap; }

:root {
  --ink: #111827;
  --muted: #6B7280;
  --muted-2: #5B5F6E;
  --primary: #26247B;
  --primary-2: #2D248A;
  --primary-soft: #7273B4;
  --lav: #E6E6FF;
  --lav-2: #EFF0FF;
  --lav-3: #C2C2F7;
  --line: #EAE8F0;
  --chip: #F0EFF5;
  --track: #E9E8F1;
  --ok: #0E9F6E;
  --ok-line: #10B981;
  --ok-bg: #E3F6EE;
  --bad: #B8463D;
  --bad-line: #CD5B52;
  --bad-bg: #FBEAE8;
  --card: #FFFFFF;
  --black: #000000;
  --ar: 'Uthmanic', 'Scheherazade New', 'Amiri Quran', 'Amiri', serif;
  --sans: 'DM Sans', -apple-system, system-ui, sans-serif;
  --bg: radial-gradient(420px 420px at 92% 10%, rgba(99,56,140,0.09), rgba(99,56,140,0) 70%),
        radial-gradient(440px 440px at 4% 50%, rgba(0,127,165,0.07), rgba(0,127,165,0) 70%),
        radial-gradient(360px 360px at 90% 94%, rgba(99,56,140,0.09), rgba(99,56,140,0) 70%),
        radial-gradient(340px 340px at 10% 92%, rgba(185,159,111,0.12), rgba(185,159,111,0) 70%),
        linear-gradient(135deg, #E8E4F0 0%, #F5F3F8 50%, #E0E8F5 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.35;
  background: #ECEAF3;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: currentColor; display: block; flex-shrink: 0; }

/* ---------- Arabisch ---------- */
[lang="ar"], .ar-inline, .ar-word { font-family: var(--ar); font-weight: 400; }
.ar-inline { font-size: 1.5em; line-height: 1; unicode-bidi: isolate; }
.ar-word { font-size: 1.9em; line-height: 1.6; unicode-bidi: isolate; }
.ar-text { font-family: var(--ar); font-size: 34px; line-height: 2; margin: 0; text-align: center; white-space: pre-wrap; color: var(--ink); }
.basmala { font-family: var(--ar); text-align: center; font-size: 24px; line-height: 1.8; color: var(--primary-2); margin: 4px 0 14px; }

/* ---------- Gesamtlayout ---------- */
.layout { min-height: 100%; display: flex; }
.sidebar { display: none; }
.stage { flex: 1; display: flex; min-width: 0; }
.device { position: relative; width: 100%; }
.screen-host { position: relative; height: 100%; }

/* Handy im Desktop-Browser */
body.layout-phone .layout, body.layout-desktop .layout { height: 100vh; }
/* Zwei Leisten: links die Lektionen, rechts die Einstellungen. Beide liegen
   ueber der Buehne, statt ihr Platz wegzunehmen — deshalb steht das Handy
   immer in der Mitte des Fensters, gleich wieviel offen ist. */
body.layout-phone .sidebar, body.layout-desktop .sidebar {
  display: flex; flex-direction: column; gap: 20px;
  width: 300px; flex-shrink: 0; height: 100vh; overflow-y: auto;
  padding: 24px 18px; background: #F7F6FB;
  position: fixed; top: 0; z-index: 40;
  transition: transform .22s ease;
}
body.layout-phone .sidebar.links, body.layout-desktop .sidebar.links {
  left: 0; border-right: 1px solid var(--line);
  transform: translateX(-100%); box-shadow: 20px 0 44px rgba(38, 36, 123, .10);
}
body.layout-phone .sidebar.rechts, body.layout-desktop .sidebar.rechts {
  right: 0; border-left: 1px solid var(--line);
  transform: translateX(100%); box-shadow: -20px 0 44px rgba(38, 36, 123, .10);
}
body.lektionen-offen .sidebar.links { transform: translateX(0); }
body.einstellungen-offen .sidebar.rechts { transform: translateX(0); }
/* Die Buehne weicht den offenen Leisten aus. Dadurch steht das Handy mittig
   in dem, was uebrig bleibt, und wandert mit, sobald eine Leiste auf- oder
   zugeht. */
body.layout-phone .stage, body.layout-desktop .stage { transition: margin .22s ease; }
body.lektionen-offen .stage { margin-left: 300px; }
body.einstellungen-offen .stage { margin-right: 300px; }
/* Jeder Knopf wandert mit seiner Leiste. */
.side-toggle { position: fixed; top: 16px; z-index: 50; width: 44px; height: 44px;
  display: none; align-items: center; justify-content: center; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.86); color: var(--primary);
  cursor: pointer; backdrop-filter: blur(6px);
  transition: left .22s ease, right .22s ease, background .12s; }
.side-toggle:hover { background: #fff; }
.side-toggle.links { left: 16px; }
.side-toggle.rechts { right: 16px; }
body.layout-phone .side-toggle, body.layout-desktop .side-toggle { display: flex; }
body.lektionen-offen .side-toggle.links { left: 316px; }
body.einstellungen-offen .side-toggle.rechts { right: 316px; }

body.layout-phone .stage { align-items: center; justify-content: center; padding: 24px; background: var(--bg); overflow: auto; }
body.layout-phone .device {
  width: 390px; height: min(844px, calc(100vh - 48px)); flex-shrink: 0;
  border-radius: 48px; padding: 10px; background: #15142B;
  box-shadow: 0 30px 60px rgba(38,36,123,0.25), inset 0 0 0 2px #2E2C55;
}
body.layout-phone .screen-host { border-radius: 38px; overflow: hidden; background: var(--bg); }

/* Desktop-Version */
body.layout-desktop .stage { background: var(--bg); overflow: hidden; }
body.layout-desktop .device { height: 100vh; }
body.layout-desktop .screen-host { max-width: 780px; margin: 0 auto; }
body.layout-desktop .ar-text { font-size: 42px; }

/* Handy */
body.layout-mobile .layout { height: 100dvh; }
body.layout-mobile .device { height: 100dvh; }
body.layout-mobile .screen-host { background: var(--bg); }

/* ---------- Seitenmenü ---------- */
/* Die Marke fuehrt zurueck zur Startseite. */
.side-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px;
  color: var(--primary); font-family: inherit; text-align: left; width: 100%;
  padding: 6px 8px; margin: -6px -8px; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.side-brand:hover { background: var(--lav-2); }
.side-brand:hover .side-logo { background: var(--primary-2); }
.side-logo { transition: background .12s; }
.side-logo { width: 36px; height: 36px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; padding-bottom: 4px; }
.side-head { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin: 0 4px 8px; }
.side-list { display: flex; flex-direction: column; gap: 6px; }
.side-lesson { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; background: transparent; text-align: left; cursor: pointer; }
.side-lesson:hover { background: #fff; border-color: var(--line); }
.side-lesson.current { background: var(--lav); border-color: var(--primary-soft); }
.side-lesson-text { display: flex; flex-direction: column; min-width: 0; }
.side-lesson-title { font-weight: 700; font-size: 14px; }
.side-lesson-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-settings { margin-top: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Einstellungen ---------- */
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.setting-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.seg { display: flex; background: var(--chip); border-radius: 12px; padding: 3px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(17,24,39,0.1); }
.toggle-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--lav-3); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sheet-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,0.35); z-index: 20; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; background: #fff; border-radius: 24px 24px 0 0; padding: 18px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 18px; }

/* ---------- Bildschirme ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen.center { align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 8px; }
.topbar { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 18px 16px 8px; }
body.layout-mobile .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
.topbar-title { flex: 1; margin: 0; text-align: center; font-size: 16px; font-weight: 700; }
.topbar-side { width: 36px; flex-shrink: 0; }
.topbar-side.count { width: auto; min-width: 36px; text-align: right; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--chip); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--primary); }
.scroll { flex: 1; overflow-y: auto; padding: 8px 16px 24px; -webkit-overflow-scrolling: touch; }
.footer { flex-shrink: 0; padding: 12px 16px 22px; display: flex; gap: 10px; }
body.layout-mobile .footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.footer.two .btn { flex: 1; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--black); background: var(--black); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; cursor: pointer; }
.btn svg { font-size: 18px; }
.btn:disabled { background: #D6D3E0; border-color: #D6D3E0; color: #fff; cursor: default; }
.btn.secondary { background: #fff; color: var(--primary); border-color: var(--lav-3); font-size: 14px; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.bad { background: var(--bad); border-color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); font-weight: 700; }
.chip { display: inline-flex; padding: 4px 12px; border-radius: 100px; background: rgba(107,114,128,0.1); color: var(--muted-2); font-size: 12px; font-weight: 700; font-style: italic; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--lav-3); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Startseite */
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 14px 16px; text-align: left; cursor: pointer; }
.lesson-card:hover { border-color: var(--lav-3); }
.lesson-card-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lesson-card-title { font-size: 16px; font-weight: 700; }
.lesson-card-sub { font-size: 14px; color: var(--muted); }
.chev { color: var(--muted); font-size: 22px; }
.dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.dot.done { border: 2px solid var(--ok-line); color: var(--ok-line); }
.dot.open { border: 2px dashed #C1C0C9; }

/* Lektion mit Video */
.lesson-title { margin: 6px 4px 16px; font-size: 26px; font-weight: 500; line-height: 1.15; color: var(--primary-2); }
.video-card { background: #000; border-radius: 20px; overflow: hidden; margin-bottom: 16px; }
.video-card video { display: block; width: 100%; max-height: 60vh; background: #000; }
.video-error { margin: 0; padding: 16px; background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 14px; }
.sections { display: flex; flex-direction: column; gap: 8px; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; font-size: 14px; font-family: inherit; color: inherit; text-align: left;
  padding: 7px 8px; margin: -1px -8px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.section-row:hover { background: var(--lav-2); }
.section-row .label { flex: 1; }
.section-row .section-go { display: flex; width: 18px; height: 18px; color: var(--lav-3); flex-shrink: 0; }
.section-row:hover .section-go { color: var(--primary); }
.section-row .section-go svg { width: 100%; height: 100%; fill: currentColor; }

/* Pfeile zum Durchblaettern: eine Aufgabe vor oder zurueck, ohne zu antworten. */
.topbar-side.nav { display: flex; align-items: center; gap: 2px; width: auto; }
.step-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.step-btn svg { width: 20px; height: 20px; fill: currentColor; }
.step-btn:hover:not(:disabled) { background: var(--chip); color: var(--primary); }
.step-btn:disabled { opacity: .3; cursor: default; }

/* Übungslauf */
.progress { display: flex; align-items: center; gap: 12px; padding: 4px 16px 10px; flex-shrink: 0; }
.progress-bar { flex: 1; height: 8px; border-radius: 4px; background: #fff; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--primary-2); border-radius: 4px; transition: width .25s; }
.progress-score { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--primary-2); margin: 4px 2px 10px; }
.section-label .multi { color: var(--muted); }
.frage { font-size: 22px; font-weight: 700; line-height: 1.4; margin: 22px 2px 24px; color: var(--ink); text-align: center; }
.hinweis + .frage, .frage + .hinweis { margin-top: 0; }
.hinweis { font-size: 14px; color: var(--muted); margin: 0 2px 16px; text-align: center; }
.gap { display: inline-block; min-width: 64px; height: 1.1em; border-bottom: 2px solid var(--primary); vertical-align: -0.15em; margin: 0 4px; }
.gap.filled { height: auto; min-width: 0; border-bottom-color: var(--ok-line); color: var(--ok); font-weight: 700; padding: 0 2px; }
.text-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin: 6px 0 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.text-card .gap { min-width: 80px; }

.audio-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--lav-2); margin: 6px 0 14px; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; }
.play-btn:disabled { background: var(--primary-soft); cursor: default; }
.audio-note { font-size: 13px; color: var(--primary-2); font-weight: 600; }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.options.ar-options { display: grid; grid-template-columns: 1fr 1fr; }
/* Ganze Saetze stehen untereinander, jeder ueber die volle Breite. */
.options.ar-options.satz-options { grid-template-columns: 1fr; }
.satz-options .option { min-height: 64px; }
.option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--line); text-align: left; cursor: pointer; font-size: 16px; font-weight: 500; transition: border-color .12s, background .12s; }
.ar-options .option { justify-content: center; text-align: center; min-height: 72px; }
.option:hover:not(:disabled) { border-color: var(--lav-3); }
.option.selected { border-color: var(--primary); background: var(--lav-2); }
.option:disabled { cursor: default; }
.option.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.option.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.option.missed { border-color: var(--ok-line); border-style: dashed; }
.option.dim { opacity: .55; }
.option.hint { border-color: var(--ok-line); border-style: dashed; }
.option.hint::after { content: '✓'; position: absolute; top: 4px; right: 8px; font-size: 12px; font-weight: 800; color: var(--ok); }
.option-text { flex: 1; }
.ar-options .option-text { flex: 0 1 auto; }
.option .ar-word { font-size: 30px; line-height: 1.5; }
.box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--lav-3); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: #fff; color: #fff; }
.option.selected .box { background: var(--primary); border-color: var(--primary); }
.ar-options .box { position: absolute; top: 8px; left: 8px; }
.mark { font-size: 20px; }
.option.ok .mark, .option.missed .mark { color: var(--ok); }
.option.bad .mark { color: var(--bad); }
.ar-options .mark { position: absolute; top: 6px; right: 8px; }

/* Zuordnen */
.pairs { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pair-row { display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 8px 10px 8px 14px; min-height: 64px; transition: border-color .12s; }
.pair-row.drop-over, .cat-box.drop-over, .pool.drop-over { border-color: var(--primary); background: var(--lav-2); }
.pair-row.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.pair-row.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.pair-left { font-size: 16px; font-weight: 600; }
.pair-left.emoji { font-size: 34px; line-height: 1.2; }
.pair-slot { min-height: 48px; border-radius: 12px; border: 2px dashed var(--lav-3); display: flex; align-items: center; justify-content: center; padding: 2px; cursor: pointer; }
.pair-row.ok .pair-slot, .pair-row.bad .pair-slot { border: 0; }
.slot-hint { opacity: .55; color: var(--ok); font-size: 14px; }
.fix { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; font-weight: 600; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; padding: 12px; min-height: 64px; border-radius: 16px; border: 2px solid transparent; }
.how { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.chip-word { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; min-width: 64px; padding: 4px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: 15px; font-weight: 600; box-shadow: 0 2px 0 var(--line); }
.chip-word .ar-word { font-size: 26px; line-height: 1.5; }
.chip-word.selected { border-color: var(--primary); background: var(--lav-2); }
.chip-word.dragging { opacity: .35; }
.chip-word.ok { border-color: var(--ok-line); background: var(--ok-bg); box-shadow: none; }
.chip-word.bad { border-color: var(--bad-line); background: var(--bad-bg); box-shadow: none; }
.chip-word:disabled { cursor: default; color: inherit; }
.pair-slot .chip-word { width: 100%; box-shadow: none; }
.hint-tag { font-size: 10px; font-weight: 700; color: var(--ok); line-height: 1.2; }
.chip-word.bad .hint-tag { color: var(--bad); }
.ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: .95; box-shadow: 0 10px 24px rgba(38,36,123,.25); border-color: var(--primary); }

/* Kategorien */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.cat-box { display: flex; flex-direction: column; gap: 8px; min-height: 170px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px; cursor: pointer; transition: border-color .12s; }
.cat-head { display: flex; flex-direction: column; gap: 2px; }
.cat-name { font-size: 15px; font-weight: 700; color: var(--primary-2); }
.cat-desc { font-size: 12px; color: var(--muted); }
.cat-words { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cat-words .chip-word { box-shadow: none; }

/* Rückmeldung */
.feedback { flex-shrink: 0; padding: 16px 16px 22px; display: flex; flex-direction: column; gap: 10px; border-radius: 20px 20px 0 0; animation: rise .18s ease-out; max-height: 55%; overflow-y: auto; }
body.layout-mobile .feedback { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.feedback.ok { background: var(--ok-bg); }
.feedback.bad { background: var(--bad-bg); }
.feedback-head { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.feedback.ok .feedback-head { color: var(--ok); }
.feedback.bad .feedback-head { color: var(--bad); }
.feedback-icon { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.reason { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.solution { display: flex; flex-direction: column; gap: 4px; }
.solution-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; color: var(--ok); }
.solution-list .ar-word { font-size: 26px; }
.auto-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.7); overflow: hidden; }
.auto-bar span { display: block; height: 100%; width: 100%; transform-origin: left; animation: shrink 1.3s linear forwards; }
.feedback.bad .auto-bar span { animation-duration: 2.6s; background: var(--bad-line); }
.feedback.ok .auto-bar span { background: var(--ok-line); }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Auswertung */
.result { text-align: center; padding-top: 24px; }
.result-title { margin: 0; font-size: 29px; font-weight: 500; letter-spacing: -0.5px; line-height: 1.1; }
.result-sub { margin: 8px 0 20px; font-size: 20px; font-weight: 500; color: var(--muted); }
.score-card { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.score-num { font-size: 26px; font-weight: 800; }
.score-pct { font-size: 14px; font-weight: 700; color: var(--primary-2); }
.result .card { text-align: left; }
.res-row { margin-top: 12px; }
.res-top { display: flex; justify-content: space-between; align-items: baseline; }
.res-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-bar { height: 6px; border-radius: 3px; background: var(--track); margin-top: 6px; overflow: hidden; }
.res-bar span { display: block; height: 100%; background: var(--ok-line); }

/* Desktop-Version: mehr Platz */
body.layout-desktop .scroll { padding: 12px 32px 32px; }
body.layout-desktop .topbar { padding: 24px 32px 8px; }
body.layout-desktop .progress { padding: 6px 32px 12px; }
body.layout-desktop .footer, body.layout-desktop .feedback { padding-left: 32px; padding-right: 32px; }
body.layout-desktop .options.ar-options { grid-template-columns: repeat(4, 1fr); }
body.layout-desktop .options.ar-options.satz-options { grid-template-columns: 1fr; }
body.layout-desktop .frage { font-size: 26px; margin: 26px 2px 28px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Audio */
.audio-text { display: flex; flex-direction: column; gap: 2px; }
.audio-reciter { font-size: 12px; color: var(--muted); }
.audio-card.error .audio-note, .audio-card.notiming .audio-note { color: var(--bad); }
.audio-card.playing .play-btn { background: var(--primary-2); box-shadow: 0 0 0 6px rgba(45,36,138,.15); }
.mini-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
.select { width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); font: inherit; font-size: 13px; color: var(--ink); }
.two-num { flex-direction: row; gap: 10px; }
.two-num label { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.num-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.num { width: 100%; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); font: inherit; font-size: 14px; color: var(--ink); }
.credit { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.credit a { color: var(--primary); }
.sheet { max-height: 85%; overflow-y: auto; }
