/* Gemeinsames Design für alle Hilfekarten-Sets und die Übersicht */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #F2F4F9;
  --surface: #FFFFFF;
  --surface-2: #F6F8FC;
  --border: #DDE3EE;
  --text: #1B2433;
  --text-2: #56627A;
  --text-3: #8A94A8;
  --accent: #0073E6;
  --accent-hover: #005BB5;
  --accent-soft: #E6F0FC;
  --accent-ink: #FFFFFF;
  --wait: #B8C6DA;
  --shadow: 0 1px 2px rgba(20, 40, 80, 0.06), 0 8px 24px rgba(20, 40, 80, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1420;
    --surface: #161E2E;
    --surface-2: #1B2537;
    --border: #2A3549;
    --text: #E8EDF6;
    --text-2: #9DA9C0;
    --text-3: #647089;
    --accent: #4B9DF2;
    --accent-hover: #6FB1F5;
    --accent-soft: #1A2C47;
    --accent-ink: #0B1220;
    --wait: #33415A;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1420;
  --surface: #161E2E;
  --surface-2: #1B2537;
  --border: #2A3549;
  --text: #E8EDF6;
  --text-2: #9DA9C0;
  --text-3: #647089;
  --accent: #4B9DF2;
  --accent-hover: #6FB1F5;
  --accent-soft: #1A2C47;
  --accent-ink: #0B1220;
  --wait: #33415A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }

.hilfekarten, .container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 64px;
}

/* Kopf */
header { margin-bottom: 24px; }
.kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 { font-size: 26px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.015em; text-wrap: balance; }
.intro { margin: 0; color: var(--text-2); max-width: 62ch; }

/* Auswahl der Aufgabe */
.picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.pick {
  font: inherit;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.2s, background-color 0.2s;
}
.pick:hover { border-color: var(--accent); }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-3);
}
.pick-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.pick[aria-pressed="true"] .pick-num { color: var(--accent); }

/* Hilfekarte */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.card-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 2px;
}
.card-head h2 { font-size: 17px; font-weight: 600; margin: 0; text-wrap: balance; }
.progress { display: flex; gap: 5px; padding-top: 7px; flex-shrink: 0; }
.progress span {
  width: 18px; height: 4px; border-radius: 2px;
  background: var(--border);
  transition: background-color 0.3s;
}
.progress span.on { background: var(--accent); }

.aufgabe {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.aufgabe > :first-child { margin-top: 0; }
.aufgabe > :last-child { margin-bottom: 0; }
.aufgabe img { display: block; border-radius: 8px; border: 1px solid var(--border); background: #FFFFFF; }
.aufgabe .platzhalter { color: var(--text-3); font-style: italic; }

.hints { list-style: none; margin: 0; padding: 8px 20px 4px; }
.hint {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
}
.hint:not([hidden]) ~ .hint:not([hidden]) { border-top: 1px dashed var(--border); }
.hint.neu { animation: reveal 0.4s ease both; }
.hint-no {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px; font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.hint-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2px;
}
.hint-text iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  margin-top: 10px;
}
.empty { color: var(--text-3); font-size: 14px; padding: 14px 0; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.card-foot {
  padding: 16px 20px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.next {
  position: relative;
  overflow: hidden;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s;
}
.next:hover:not(:disabled) { background: var(--accent-hover); }
.next:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.next:disabled { cursor: not-allowed; }
.next.waiting { background: var(--wait); color: var(--text); }
.next .fill {
  position: absolute; inset: 0;
  background: var(--accent);
  opacity: 0.35;
  transform-origin: left center;
  transform: scaleX(0);
}
.next .lbl { position: relative; }
.next.finished { background: var(--border); color: var(--text-3); }
.status { font-size: 13px; color: var(--text-2); flex: 1; min-width: 180px; margin: 0; }

footer {
  margin-top: 28px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* Übersichtsseite */
.sets { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.sets a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s;
}
.sets a:hover { border-color: var(--accent); }
.sets a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sets .fach {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-3);
}
.sets .name { font-weight: 600; }
.container h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 10px;
}

@media (max-width: 460px) {
  .next { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
