/* Noten erkennen – helles Werkzeug im Kleid der Startseite: dieselben
   Farben, dieselben Haarlinien, eine Akzentfarbe. Die Noten selbst bekommen
   ein ruhiges Blau, was gerade klingt, ein warmes Orange. */
:root {
  --grund:   #f4f5f7;
  --flaeche: #ffffff;
  --linie:   #e3e6ea;
  --linie-stark: #c8d0da;
  --schrift: #16202c;
  --leise:   #5c6875;
  --akzent:  #1f3a5f;
  --akzent-hell: #eef2f7;
  --note:    #3b6ea8;
  --klingt:  #e07a2f;
  --fehler:  #b3261e;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  min-height: 100dvh;
  background: var(--grund);
  color: var(--schrift);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 6vw, 64px) 16px calc(28px + env(safe-area-inset-bottom));
  gap: clamp(24px, 4vw, 40px);
}

header, main, footer { width: 100%; max-width: 1040px; }
main { display: flex; flex-direction: column; gap: 18px; }

/* --- Kopf ---------------------------------------------------------------- */

.kopfzeile {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.marke {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--leise); text-decoration: none;
}
.marke:hover { color: var(--schrift); }
.marke .zeichen {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--akzent); color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: 0;
}
.sprachwahl {
  display: flex; gap: 2px; padding: 2px;
  border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche);
}
.sprachwahl:empty { display: none; }
.sprachknopf {
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  padding: 5px 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--leise); cursor: pointer;
}
.sprachknopf:hover { color: var(--schrift); }
.sprachknopf.sel { background: var(--akzent-hell); color: var(--akzent); }

h1 {
  font-size: clamp(30px, 6vw, 42px); line-height: 1.15;
  letter-spacing: -.022em; font-weight: 650;
}
.sub {
  margin-top: 12px; max-width: 62ch; color: var(--leise);
  font-size: clamp(15px, 2.4vw, 17px); text-wrap: pretty;
}

/* --- Karten und Knöpfe --------------------------------------------------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 20px;
}
.karte h2 { font-size: 16px; font-weight: 640; margin-bottom: 12px; }

.knopf {
  font: inherit; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--akzent);
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.knopf:hover { background: var(--akzent-hell); }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: #2a4b78; }
.knopf.leise { border-color: transparent; color: var(--leise); }
.knopf.leise:hover { color: var(--schrift); background: var(--akzent-hell); }
.knopf.klein { padding: 5px 10px; font-size: 13px; }
button:focus-visible, .zone:focus-within, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 2px;
}

/* --- Ablage -------------------------------------------------------------- */

.ablage { padding: 14px; }
.zone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: clamp(32px, 7vw, 64px) 20px;
  border: 1.5px dashed var(--linie-stark); border-radius: 8px;
  text-align: center; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.zone:hover, .zone.drueber { background: var(--akzent-hell); border-color: var(--akzent); }
.zone-symbol {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--akzent-hell); color: var(--akzent);
  display: grid; place-items: center; margin-bottom: 6px;
}
.zone-symbol svg { width: 26px; height: 26px; }
.zone-titel { font-size: 18px; font-weight: 640; }
.zone-oder { color: var(--leise); font-size: 13px; }
.zone .knopf { margin: 2px 0 6px; pointer-events: none; }
.zone-klein { color: var(--leise); font-size: 13px; max-width: 46ch; }
.privat { color: var(--leise); font-size: 13px; text-align: center; padding: 12px 8px 2px; }

/* --- Arbeit -------------------------------------------------------------- */

.arbeit-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.dateiname { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.balken { height: 8px; border-radius: 99px; background: var(--akzent-hell); overflow: hidden; }
.balken span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--akzent); transition: width .25s ease;
}
.balken.unbestimmt span { width: 30%; animation: wandern 1.2s ease-in-out infinite; }
@keyframes wandern { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.status { margin-top: 12px; font-size: 14.5px; }
.status.leise { margin-top: 2px; color: var(--leise); font-size: 13px; }
.status:empty { display: none; }

.fehler {
  background: #fdf0ef; border: 1px solid #f1c9c5; color: var(--fehler);
  border-radius: var(--radius); padding: 12px 16px; font-size: 14.5px;
}

/* --- Rolle --------------------------------------------------------------- */

#ergebnis { display: flex; flex-direction: column; gap: 18px; }
.rolle-karte { padding: 16px; }
.rolle-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.rolle-titel { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.zahl { color: var(--leise); font-size: 13.5px; white-space: nowrap; }
.zoom { display: flex; gap: 6px; flex: none; }
.rund {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--akzent);
  font: 600 18px/1 system-ui, sans-serif; cursor: pointer;
}
.rund:hover { background: var(--akzent-hell); }

.uebersicht {
  display: block; width: 100%; height: 48px;
  border: 1px solid var(--linie); border-radius: 6px 6px 0 0; border-bottom: 0;
  cursor: pointer; touch-action: none;
}
.rolle {
  border: 1px solid var(--linie); border-radius: 0 0 6px 6px; overflow: hidden;
}
.rolle canvas { display: block; width: 100%; cursor: grab; touch-action: pan-y; }
.rolle canvas.ziehen { cursor: grabbing; }
.hilfe { color: var(--leise); font-size: 12.5px; margin-top: 8px; }

/* --- Einstellungen und Folge ----------------------------------------------- */

.spalten { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 820px) { .spalten { grid-template-columns: 340px 1fr; } }

.regler { display: block; margin-bottom: 16px; }
.regler-kopf { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.regler-kopf output { color: var(--leise); font-weight: 400; font-variant-numeric: tabular-nums; }
.regler input[type=range] { width: 100%; margin: 6px 0 2px; accent-color: var(--akzent); }
.regler-hilfe { display: block; color: var(--leise); font-size: 12.5px; line-height: 1.45; }
.haken { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 4px 0 14px; cursor: pointer; }
.haken input { width: 17px; height: 17px; accent-color: var(--akzent); }

.folge { display: flex; flex-direction: column; min-width: 0; }
.folge-text {
  margin: 10px 0 14px; padding: 12px 14px;
  background: var(--grund); border: 1px solid var(--linie); border-radius: 8px;
  font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  height: 220px; overflow: auto; white-space: pre; flex: 1 1 auto;
}
.folge-text .z { color: var(--leise); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Steuerung, klebt unten ------------------------------------------------ */

.steuerung {
  position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--linie-stark); border-radius: 14px;
  padding: 10px 16px 10px 10px;
  box-shadow: 0 6px 24px rgba(22, 32, 44, .10);
}
.spielen {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  border: 0; background: var(--akzent); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.spielen:hover { background: #2a4b78; }
.spielen svg { width: 24px; height: 24px; }
.spielen .aus, .spielen.laeuft .an { display: none; }
.spielen.laeuft .aus { display: block; }
.zeit { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--leise); min-width: 92px; }
.spur { display: flex; align-items: center; gap: 8px; }
.spur input[type=range] { width: 90px; accent-color: var(--akzent); }
.schalter { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.schalter input { width: 16px; height: 16px; accent-color: var(--akzent); }
.schalter.noten input { accent-color: var(--klingt); }
.tempo { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--leise); margin-left: auto; }
.tempo select {
  font: inherit; font-size: 14px; color: var(--schrift);
  border: 1px solid var(--linie-stark); border-radius: 8px; background: var(--flaeche);
  padding: 5px 8px;
}
@media (max-width: 560px) {
  .steuerung { gap: 8px 14px; }
  .spur input[type=range] { width: 64px; }
  .tempo { margin-left: 0; }
}

/* --- Fuss ---------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--linie); padding-top: 18px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  color: var(--leise); font-size: 13px;
}
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--leise); text-decoration: none; }
footer a:hover { color: var(--schrift); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
