/* PROTOTYP – Wegwerf-Code. Gestaltungsregeln aus dem Bedienkonzept für die Sehschwäche. */

@font-face { font-family: 'Atkinson Hyperlegible'; src: url(fonts/atkinson-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url(fonts/atkinson-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff; --fg: #000000; --soft: #efefef; --line: #000000;
  --btn-bg: #000000; --btn-fg: #ffffff;
  --ok-bg: #0a5c1f; --ok-fg: #ffffff; --no-bg: #9b0000; --no-fg: #ffffff;
  --proto-bg: #4b1d78; --proto-fg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --border: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --fg: #ffffff; --soft: #1e1e1e; --line: #ffffff;
    --btn-bg: #ffffff; --btn-fg: #000000;
    --ok-bg: #7fe39b; --ok-fg: #000000; --no-bg: #ffb3b3; --no-fg: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --fg: #ffffff; --soft: #1e1e1e; --line: #ffffff;
  --btn-bg: #ffffff; --btn-fg: #000000;
  --ok-bg: #7fe39b; --ok-fg: #000000; --no-bg: #ffb3b3; --no-fg: #000000;
  color-scheme: dark;
}
@media (prefers-contrast: more) { :root { --border: 4px; } }
:root[data-font="atkinson"] { --font: 'Atkinson Hyperlegible', sans-serif; }

* { box-sizing: border-box; }
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  line-height: 1.35; padding: calc(44px + env(safe-area-inset-top)) 16px env(safe-area-inset-bottom);
  min-height: 100dvh;
}
#app { max-width: 640px; margin: 0 auto; min-height: calc(100dvh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
h1 { font-size: 1.5rem; margin: 0.6em 0 0.3em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
p { margin: 0.4em 0; }

/* Knöpfe: ≥ 56 pt, Text + Symbol, nicht auswählbar */
button {
  font: inherit; font-weight: 700; min-height: 56px; padding: 0.4em 0.9em; border-radius: 14px;
  border: var(--border) solid var(--line); background: var(--bg); color: var(--fg);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer;
  touch-action: manipulation;
}
button.primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
button.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bg); }
button.no { background: var(--no-bg); color: var(--no-fg); border-color: var(--no-bg); }
button:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
button[disabled] { opacity: 0.55; }
.wide { width: 100%; }
.big { min-height: 72px; font-size: 1.1rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* Lerntexte: fett, auswählbar */
.lt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0.3em 0; }
.lt-text { font-size: 1.5rem; font-weight: 700; -webkit-user-select: text; user-select: text; }
.lt.small .lt-text { font-size: 1.1rem; }
.stress { text-decoration: underline; text-decoration-thickness: 0.14em; text-underline-offset: 0.18em; text-decoration-skip-ink: none; }
.play { min-height: 56px; font-size: 0.95rem; }
.dir { font-size: 0.9rem; margin: 0 0 0.4em; }
.tag { display: inline-block; border: 2px solid var(--line); border-radius: 8px; padding: 0 0.4em; font-weight: 700; font-size: 0.9rem; }

.hint { background: var(--soft); border: 2px solid var(--line); border-radius: 12px; padding: 0.5em 0.7em; margin: 0.7em 0; -webkit-user-select: text; user-select: text; }
.hint-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.15em; }
.also { margin-top: 0.8em; }
.also-label { font-weight: 700; font-size: 0.95rem; }
.answer-block { animation: fadein 0.35s ease-out; }
hr.sep { border: 0; border-top: 2px solid var(--line); margin: 0.9em 0; }

/* Kopfzeile der Lernsitzung */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; }
.topbar .count { font-weight: 700; }
.spacer { flex: 1; }
.actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }

/* Variante A: Karte, die sich dreht */
.card-a { perspective: 1400px; margin: 8px 0; }
.card-a .inner { display: grid; transition: transform 0.6s ease; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; }
.card-a .face { grid-area: 1 / 1; border: var(--border) solid var(--line); border-radius: 20px; padding: 18px; background: var(--bg); backface-visibility: hidden; -webkit-backface-visibility: hidden; min-height: 42dvh; }
.card-a .back { transform: rotateY(180deg); visibility: hidden; }
.card-a.flipped .inner { transform: rotateY(180deg); }
.card-a.flipped .back { visibility: visible; }
.card-a.done .front { visibility: hidden; }
.card-a.fade .inner { transition: none; transform: none; }
.card-a.fade .back { transform: none; }
.card-a.fade.flipped .front { visibility: hidden; }
.card-a.fade.flipped .back { animation: fadein 0.35s ease-out; }

/* Variante C: Vollbild mit Tippzonen */
.full { flex: 1; display: flex; flex-direction: column; }
.full .stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0; }
.full .stage .lt-text { font-size: 1.7rem; }
.full .zone { min-height: 30dvh; font-size: 1.2rem; border-radius: 20px; }
.full .zones { display: flex; gap: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.full .zones > * { flex: 1; }
.full .prompt-small { font-size: 1rem; }

/* Lob am Ende */
.praise { text-align: center; padding-top: 10dvh; }
.praise .big-it { font-size: 2rem; font-weight: 700; }
.praise .emoji { font-size: 3rem; }

/* Einstellungen und Gerätetest */
.setting { margin: 0.9em 0; }
.setting .label { font-weight: 700; margin-bottom: 0.3em; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 1 auto; }
.diag { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.diag td { border-bottom: 1px solid var(--line); padding: 0.35em 0.2em; vertical-align: top; }
.diag td:first-child { font-weight: 700; width: 45%; }
.check { border: 2px solid var(--line); border-radius: 12px; padding: 0.5em 0.7em; margin: 0.6em 0; }
.check .q { font-weight: 700; }
.check .seg button { min-height: 52px; font-size: 0.9rem; }
.sysbody { font: -apple-system-body; }
.footer { font-size: 0.75rem; text-align: center; padding: 1.5em 0 0.5em; }

/* Prototyp-Leiste (gehört nicht zum Design) */
#proto-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--proto-bg); color: var(--proto-fg); font: 700 14px/1 -apple-system, sans-serif;
}
#proto-bar button { min-height: 34px; padding: 0 10px; font-size: 14px; border: 2px solid var(--proto-fg); background: transparent; color: var(--proto-fg); border-radius: 8px; }
#proto-bar .lbl { min-width: 9em; text-align: center; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .answer-block, .card-a.fade.flipped .back { animation: none; } }
