/* Rhythmus – gemeinsamer Stil für Übungsseite, Test und Verwaltung */
  @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
  /* Farben aus der Familie von Liedtexte und Musiktheorie. Dort sind Gold,
     Blau und Lila vergeben – hier kommt Altrosa dazu. */
  :root {
    --bg: #F7F6F3; --paper: #FFFFFF; --ink: #2B2E33; --muted: #5B6068; --line: #E4E1DA;
    --accent: #B86F8C; --accent-soft: #FAF0F4; --accent-rand: #E8C4D2; --accent-deep: #94506B;
    --pause: #A8A296;
    --ok: #5E9E6C; --ok-bg: #EFF6F0; --err: #C0584A; --err-bg: #FBEAE8;
    --radius: 10px; --radius-lg: 16px;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow: 0 2px 10px rgba(43,46,51,.06);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
  main { max-width: 1080px; margin: 0 auto; padding: 14px 16px 40px; }

  /* Dachzeile (gleich in allen musikwerkzeug-Bereichen), bündig mit dem Inhalt */
  .dachzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 46px;
    padding: 6px max(16px, calc((100% - 1080px) / 2 + 16px)); background: var(--paper); border-bottom: 1px solid var(--line);
    font-size: 15px; line-height: 1.3; font-weight: 700; }
  .dachzeile a { text-decoration: none; }
  .dachzeile a:hover { text-decoration: underline; }
  .dach-start { color: var(--ink); font-weight: 800; }
  .dach-pfeil { color: #B5B0A6; }
  .dach-bereich { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
  .dach-bereich img { width: 20px; height: 20px; display: block; }

  header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin: 6px 0 14px; }
  h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
  .brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .tagline { margin: 0; color: var(--muted); font-size: 0.95rem; }
  nav { display: flex; gap: 4px; background: #EFEEE9; padding: 4px; border-radius: 12px; max-width: 100%; overflow-x: auto; }
  nav button { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 8px 18px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
  nav button[aria-selected="true"] { background: var(--paper); font-weight: 700; box-shadow: 0 1px 3px rgba(43,46,51,.15); }
  button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent-rand); outline-offset: 1px; }

  .bereich[hidden] { display: none; }
  .karte { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
  .lead { color: var(--muted); margin: 0 0 12px; }
  .folgt { color: var(--muted); font-style: italic; }

  /* Bedienleiste */
  .leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 14px; }
  .gruppe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .gruppe > .etikett { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
  .seg { display: inline-flex; background: #EFEEE9; border-radius: 10px; padding: 3px; gap: 2px; }
  .seg button { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--ink); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
  .seg button[aria-pressed="true"] { background: var(--paper); color: var(--accent-deep); box-shadow: 0 1px 3px rgba(43,46,51,.15); }
  .schalter { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: 0.95rem; }
  .schalter input { width: 18px; height: 18px; accent-color: var(--accent); }
  .knopf { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 9px 18px; cursor: pointer; background: var(--accent); color: #fff; }
  .knopf:hover { background: var(--accent-deep); }
  /* Einstellungen geändert, aber noch nicht erzeugt: der Knopf lädt ein */
  .knopf.lockt { animation: locken 1.6s ease-in-out infinite; }
  @keyframes locken {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184,111,140,.55); }
    50%      { box-shadow: 0 0 0 8px rgba(184,111,140,0); background: var(--accent-deep); }
  }
  @media (prefers-reduced-motion: reduce) {
    .knopf.lockt { animation: none; outline: 3px solid var(--accent-rand); outline-offset: 2px; }
  }

  /* Was hinter den Stufen steckt */
  .stufen { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 14px;
    padding: 10px 14px; background: #FAF9F6; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.92rem; }
  .stufen .nr { font-weight: 800; color: var(--muted); white-space: nowrap; }
  .stufen .was { color: var(--muted); }
  .stufen .gewaehlt { color: var(--ink); }
  .stufen .nr.gewaehlt { color: var(--accent-deep); }
  .stufen .zusatz { grid-column: 1 / -1; color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
  .knopf.leise { background: var(--accent-soft); color: var(--accent-deep); border: 1.5px solid var(--accent-rand); }
  .knopf.leise:hover { background: #F4E2EA; }

  /* Notenbild. Alles Gezeichnete nimmt currentColor – so lässt sich eine
     Note samt Silbe mit einer einzigen Klasse einfärben. */
  .notenblatt { width: 100%; }
  .notenblatt svg { display: block; width: 100%; height: auto; color: var(--ink); overflow: visible; }
  .notenblatt .silbe { font-family: var(--font); font-size: 16px; font-weight: 700; fill: var(--ink); }
  .notenblatt .silbe.p { fill: var(--pause); font-weight: 600; font-style: italic; }
  .notenblatt.ohne-silben .silbe { visibility: hidden; }
  .note.an, .silbe.an { color: var(--accent); fill: var(--accent); }
  .notenblatt .silbe.an { font-size: 19px; }

  /* Abspielleiste */
  .spieler { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 4px 0 6px;
    padding: 10px 14px; background: var(--accent-soft); border: 1px solid var(--accent-rand); border-radius: var(--radius); }
  .spielknopf { font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: 8px 18px 8px 14px; cursor: pointer;
    background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; min-width: 132px; justify-content: center; }
  .spielknopf:hover { background: #000; }
  .spielknopf svg { width: 16px; height: 16px; fill: currentColor; }
  .tempo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
  .tempo input { width: 150px; accent-color: var(--accent); }
  .tempo output { min-width: 62px; font-variant-numeric: tabular-nums; font-weight: 800; }
  .vorzaehler-kreis circle { fill: var(--accent); }
  .vorzaehler-kreis text { fill: #fff; font-family: var(--font); font-weight: 800; font-size: 19px; }
  .seg.klein button { padding: 4px 10px; font-size: 0.92rem; }

  /* Übersicht der Bausteine */
  .bausteine { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .baustein { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 6px 8px 8px; background: var(--paper); }
  .baustein svg { display: block; height: 104px; width: auto; max-width: 100%; margin: 0 auto; color: var(--ink); }
  .baustein .silbe { font-family: var(--font); font-size: 16px; font-weight: 700; fill: var(--ink); }
  .baustein .silbe.p { fill: var(--pause); font-weight: 600; font-style: italic; }
  .baustein .name { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 2px; }
  h2 { font-size: 1.2rem; margin: 4px 0 8px; }
  h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--muted); }

  /* Lernteil */
  .lern .karte { padding: 18px 22px 20px; }
  .lern h2 { font-size: 1.35rem; margin: 2px 0 10px; }
  .lern ul { padding-left: 22px; margin: 8px 0; }
  .lern li { margin: 3px 0; }
  .lern .hinweis { color: var(--muted); font-size: 0.95rem; }
  .silbentext { font-weight: 800; color: var(--accent-deep); white-space: nowrap; }
  .silbentext.p { color: var(--pause); font-style: italic; }
  .inhalt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .inhalt a { text-decoration: none; color: var(--accent-deep); font-weight: 700; font-size: 0.92rem;
    padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-rand); }
  .inhalt a:hover { background: #F4E2EA; }
  .lern .karte { scroll-margin-top: 12px; }

  .hoeren { font: inherit; font-weight: 700; font-size: 0.9rem; border: 1.5px solid var(--accent-rand); border-radius: 999px;
    padding: 4px 12px 4px 9px; cursor: pointer; background: var(--accent-soft); color: var(--accent-deep);
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .hoeren:hover { background: #F4E2EA; }
  .hoeren[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .hoeren svg { width: 12px; height: 12px; fill: currentColor; }

  .beispiel { margin: 12px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; }
  .beispiel .kopfzeile { display: flex; align-items: center; gap: 12px; }
  .beispiel .titel { font-weight: 700; color: var(--muted); font-size: 0.92rem; }

  .pyramide { margin: 8px 0 4px; }
  .pyramide .zeile { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px;
    border-top: 1px solid var(--line); padding: 2px 0; }
  .pyramide .zeile:last-child { border-bottom: 1px solid var(--line); }
  .pyramide .name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .pyramide .name strong { font-size: 1rem; }
  .pyramide .name span { font-size: 0.85rem; color: var(--muted); }
  .pyramide .noten svg { display: block; width: 100%; height: auto; color: var(--ink); }
  .pyramide .silbe { font-family: var(--font); font-size: 16px; font-weight: 700; fill: var(--ink); }
  .pyramide .silbe.p { fill: var(--pause); font-style: italic; }
  .pyramide .silbe.an { fill: var(--accent); }
  @media (max-width: 620px) {
    .pyramide .zeile { grid-template-columns: 1fr; padding-top: 8px; }
    .pyramide .name { flex-direction: row; align-items: center; gap: 10px; }
  }

  .gleichung { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0; }
  .gleichung .op { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
  .gleichung .baustein { min-width: 120px; }
  .gleichung .baustein svg { height: 88px; }
  .gleichung .baustein.ergebnis { border-color: var(--accent-rand); background: var(--accent-soft); }
  .gleichung .erklaerung { color: var(--muted); font-size: 0.95rem; flex-basis: 100%; }

  .tabelle { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }

  .baustein.spielbar { cursor: pointer; transition: border-color .15s, background .15s; }
  .baustein.spielbar:hover { border-color: var(--accent-rand); }
  .baustein.spielbar:focus-visible { outline: 3px solid var(--accent-rand); outline-offset: 1px; }
  .baustein.spielt { border-color: var(--accent); background: var(--accent-soft); }
  .baustein .silbe.an { fill: var(--accent); }

  /* Üben */
  .uebungsart { color: var(--muted); margin: -4px 0 14px; }
  .stand { font-weight: 700; color: var(--muted); }
  .stand b { color: var(--accent-deep); }
  .aufgabe h2 { font-size: 1.2rem; margin: 2px 0 4px; }
  .aufgabe .anleitung { color: var(--muted); margin: 0 0 12px; }
  .aufgabe .notenblatt svg { color: var(--ink); }
  .slot { cursor: pointer; }
  .slot rect { fill: var(--paper); stroke: #CEC9BD; stroke-width: 1.5; stroke-dasharray: 4 3; }
  .slot.voll rect { stroke-dasharray: none; fill: #FAF9F6; }
  .slot.aktiv rect { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: none; fill: var(--accent-soft); }
  .slot text { font-family: var(--font); font-size: 15px; font-weight: 800; fill: var(--ink); text-anchor: middle; }
  .slot.ok rect { stroke: var(--ok); fill: var(--ok-bg); stroke-dasharray: none; }
  .slot.falsch rect { stroke: var(--err); fill: var(--err-bg); stroke-dasharray: none; }
  .slot.falsch text { fill: var(--err); }
  .slot.ok, .slot.falsch { cursor: default; }
  .vorrat { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
  .vorrat .silbenknopf { font: inherit; font-weight: 800; font-size: 1rem; border: 1.5px solid var(--accent-rand); background: var(--paper);
    color: var(--ink); border-radius: 10px; padding: 7px 14px; cursor: pointer; }
  .vorrat .silbenknopf:hover { background: var(--accent-soft); }
  .vorrat .silbenknopf:disabled, .vorrat .baustein[aria-disabled="true"] { opacity: .4; cursor: default; }
  .vorrat.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .vorrat .baustein { cursor: pointer; padding: 4px; }
  .vorrat .baustein svg { height: 70px; }
  .vorrat .baustein:hover { border-color: var(--accent-rand); background: var(--accent-soft); }
  .silbenraster { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
  .silbenraster .takt { display: grid; border: 1.5px solid #CEC9BD; border-radius: 10px; overflow: hidden; background: #FAF9F6; flex: 1 1 260px; }
  .silbenraster .zahl { font-size: 0.78rem; color: var(--muted); text-align: center; padding: 3px 0 0; border-left: 1px solid var(--line); }
  .silbenraster .feld { font-weight: 800; font-size: 1.1rem; text-align: center; padding: 6px 4px 10px; border-left: 1px solid var(--line);
    color: var(--accent-deep); white-space: nowrap; }
  .silbenraster .feld.p { color: var(--pause); font-style: italic; font-weight: 700; }
  .silbenraster .zahl:first-child, .silbenraster .erste { border-left: 0; }
  .knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
  .rueckmeldung { font-weight: 700; margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius); }
  .rueckmeldung.ok { background: var(--ok-bg); color: #3F7A4D; }
  .rueckmeldung.falsch { background: var(--err-bg); color: #9C4034; }
  .rueckmeldung:empty { display: none; }
  .optionen { display: grid; gap: 10px; }
  .option { font: inherit; text-align: left; border: 2px solid var(--line); background: var(--paper); border-radius: var(--radius);
    padding: 4px 10px 2px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; color: var(--ink); }
  .option:hover:not(:disabled) { border-color: var(--accent-rand); background: var(--accent-soft); }
  .option .buchstabe { font-weight: 800; font-size: 1.1rem; color: var(--muted); width: 1.4em; text-align: center; }
  .option.ok { border-color: var(--ok); background: var(--ok-bg); }
  .option.falsch { border-color: var(--err); background: var(--err-bg); }
  .option:disabled { cursor: default; }
  .baustelle { border: 1.5px dashed #CEC9BD; border-radius: var(--radius); padding: 2px 8px; min-height: 80px; }
  .baustelle .leer { color: var(--muted); font-style: italic; padding: 22px 6px; }
  .loesung h3 { margin-top: 16px; }
  .rundenergebnis { text-align: center; padding: 18px 0 8px; }
  .rundenergebnis .gross { font-size: 2.6rem; font-weight: 800; color: var(--accent-deep); line-height: 1.1; }
  footer { color: var(--muted); font-size: 14px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
  @media (max-width: 560px) { h1 { font-size: 28px; } nav button { padding: 8px 12px; } }

/* Hinweis auf einen laufenden Test */
.testhinweis { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 14px; }
.testhinweis[hidden] { display: none; }
.testhinweis .knopf { text-decoration: none; }
.lehrerlink { color: var(--muted); }

