/* Mastering-Tool – Gestaltung. Farben als Tokens, hell und dunkel. */
:root {
  --bg: #f5f4f0;
  --flaeche: #ffffff;
  --flaeche2: #eeece6;
  --text: #1c1b19;
  --text2: #5b5850;
  --linie: #dcd8ce;
  --akzent: #b8460b;
  --akzent-hover: #9a3a08;
  --akzent-text: #ffffff;
  --akzent-zart: #fbe8dc;
  --orig: #8b877d;
  --ziel: #2563a8;
  --ref: #7c3aed;
  --gut: #177a3c;
  --warn: #a35a00;
  --schlecht: #b42318;
  --gut-zart: #e3f3e8;
  --warn-zart: #fbefd9;
  --schlecht-zart: #fbe4e1;
  --fokus: #2563a8;
  --schatten: 0 1px 2px rgba(20, 18, 14, .05), 0 6px 24px rgba(20, 18, 14, .05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --flaeche: #1b1b1d;
    --flaeche2: #252528;
    --text: #f1efea;
    --text2: #aaa69d;
    --linie: #333337;
    --akzent: #fb8a46;
    --akzent-hover: #ffa36b;
    --akzent-text: #1a0e05;
    --akzent-zart: #3a2416;
    --orig: #8e8a82;
    --ziel: #6ea8ef;
    --ref: #b18cff;
    --gut: #5ad48a;
    --warn: #f5b84a;
    --schlecht: #ff7b6e;
    --gut-zart: #16291e;
    --warn-zart: #30250f;
    --schlecht-zart: #351816;
    --fokus: #6ea8ef;
    --schatten: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --flaeche: #1b1b1d; --flaeche2: #252528; --text: #f1efea; --text2: #aaa69d; --linie: #333337;
  --akzent: #fb8a46; --akzent-hover: #ffa36b; --akzent-text: #1a0e05; --akzent-zart: #3a2416; --orig: #8e8a82;
  --ziel: #6ea8ef; --ref: #b18cff; --gut: #5ad48a; --warn: #f5b84a; --schlecht: #ff7b6e; --gut-zart: #16291e;
  --warn-zart: #30250f; --schlecht-zart: #351816; --fokus: #6ea8ef; --schatten: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--akzent); }
a:hover { color: var(--akzent-hover); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
h3 { font-size: 1.05rem; margin: 1.8rem 0 .4rem; }
.klein { font-size: .875rem; color: var(--text2); }
[hidden] { display: none !important; }

.kopf { border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.kopf-innen, main, .fuss { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.marke { white-space: nowrap; display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; min-height: 44px; }
.marke-grund { fill: var(--akzent); }
.marke-linie { fill: none; stroke: var(--akzent-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kopf-link { white-space: nowrap; font-size: .9rem; font-weight: 600; text-decoration: none; padding: .55rem .9rem; border: 1px solid var(--linie); border-radius: 999px; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.kopf-link:hover { border-color: var(--akzent); color: var(--akzent); }

main { padding-top: 28px; padding-bottom: 40px; }
.einstieg { padding: 12px 0 18px; }
.lead { font-size: 1.1rem; color: var(--text2); max-width: 46rem; margin: .7rem 0 1.4rem; }

.ablage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .35rem;
  min-height: 190px; padding: 24px; border: 2px dashed var(--linie); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s;
}
.ablage:hover, .ablage.ueber { border-color: var(--akzent); background: var(--akzent-zart); }
.ablage:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }
.ablage svg { color: var(--akzent); }
.ablage input, .knopf input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ablage-titel { font-size: 1.15rem; font-weight: 650; }
.ablage-info { font-size: .875rem; color: var(--text2); max-width: 30rem; }
.status { min-height: 1.5em; margin: .9rem 0 .4rem; color: var(--text2); }
.status.fehler { color: var(--schlecht); font-weight: 600; }
.balken { height: 6px; border-radius: 3px; background: var(--flaeche2); overflow: hidden; }
.balken-fuellung { height: 100%; width: 0; background: var(--akzent); transition: width .2s; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 22px; margin-top: 18px;
}
.nr {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--akzent); color: var(--akzent-text); font-size: .9rem; font-weight: 700; flex: none;
}
.datei-info { color: var(--text2); font-size: .9rem; margin: 0 0 .8rem; overflow-wrap: anywhere; }

.befunde { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.befunde li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; background: var(--flaeche2); }
.befunde li.problem { background: var(--schlecht-zart); }
.befunde li.hinweis { background: var(--warn-zart); }
.befunde li.ok { background: var(--gut-zart); }
.punkt { width: 10px; height: 10px; border-radius: 50%; margin-top: .45em; }
.ok .punkt { background: var(--gut); }
.hinweis .punkt { background: var(--warn); }
.problem .punkt { background: var(--schlecht); }
.befunde strong { font-weight: 650; }

.baender { display: grid; gap: 6px; margin-top: .6rem; }
.band { display: grid; grid-template-columns: minmax(7.5rem, 9rem) 1fr 4.2rem; gap: 10px; align-items: center; font-size: .9rem; }
.band-name small { color: var(--text2); display: block; font-size: .75rem; }
.band-spur { position: relative; height: 14px; background: var(--flaeche2); border-radius: 7px; }
.band-spur::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--linie); }
.band-wert { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: var(--akzent); }
.band-wert.weit { background: var(--warn); }
.band-zahl { text-align: right; font-variant-numeric: tabular-nums; }

.raster-einst { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin-top: 14px; }
.feld { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.feld-name { font-weight: 600; font-size: .9rem; }
select, input[type=number] {
  font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
  padding: .55rem .7rem; min-height: 44px; width: 100%; max-width: 100%;
}
select:hover, input[type=number]:hover { border-color: var(--text2); }
.eigen { flex-direction: row; gap: 10px; }
.eigen label { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.segment { display: flex; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; min-height: 44px; }
.segment label { flex: 1; position: relative; display: flex; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segment span { flex: 1; display: grid; place-items: center; padding: .5rem .4rem; font-weight: 600; font-size: .92rem; border-left: 1px solid var(--linie); }
.segment label:first-child span { border-left: 0; }
.segment input:checked + span { background: var(--akzent); color: var(--akzent-text); }
.segment input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: -3px; }

.referenz { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--flaeche2); }
.referenz p { margin: .2rem 0 0; }
.referenz-name { grid-column: 1 / -1; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.referenz-name:empty { display: none; }

.knopf {
  font: inherit; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; position: relative;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--linie); cursor: pointer;
  background: var(--flaeche); color: var(--text); text-decoration: none; white-space: nowrap;
}
.knopf:hover { border-color: var(--akzent); }
.knopf:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.haupt:hover { background: var(--akzent-hover); border-color: var(--akzent-hover); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf.rund { width: 52px; height: 52px; border-radius: 50%; padding: 0; background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); flex: none; }

.erweitert { margin-top: 16px; border-top: 1px solid var(--linie); padding-top: 10px; }
.erweitert summary, .hinweise summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.module { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 18px; margin: 8px 0 12px; }
.module > label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; }
.module input[type=number] { width: 5.2rem; min-height: 36px; padding: .3rem .5rem; display: inline-block; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--akzent); margin: 0; flex: none; }
.regler { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.regler label { display: flex; flex-direction: column; gap: 6px; }
.regler .haken { flex-direction: row; align-items: center; }
input[type=range] { width: 100%; accent-color: var(--akzent); min-height: 32px; }
.haken { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.aktion { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

.spieler { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--flaeche2); }
.spieler-zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.versionen { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.version {
  font: inherit; font-weight: 650; font-size: .92rem; min-height: 44px; padding: .45rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.version[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.version.ist-master[aria-checked="true"] { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.zeit { font-variant-numeric: tabular-nums; color: var(--text2); min-width: 7.5rem; text-align: right; }
.welle { display: block; width: 100%; height: 96px; margin-top: 12px; cursor: pointer; border-radius: 8px; background: var(--flaeche); touch-action: none; }
.spieler-optionen { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; margin-top: 8px; }
.tasten { margin: 4px 0 0; }

.herunterladen { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 18px; }
.klein-feld { width: auto; min-width: 14rem; }

.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: 12px; }
.werte { width: 100%; border-collapse: collapse; font-size: .92rem; }
.werte th, .werte td { padding: .55rem .75rem; text-align: right; border-bottom: 1px solid var(--linie); white-space: nowrap; font-variant-numeric: tabular-nums; }
.werte th:first-child, .werte td:first-child { text-align: left; position: sticky; left: 0; background: var(--flaeche); white-space: normal; min-width: 10rem; }
.werte thead th { font-size: .82rem; color: var(--text2); font-weight: 650; background: var(--flaeche); }
.werte thead th.master { color: var(--akzent); }
.werte tr:last-child td { border-bottom: 0; }
.werte td.master { font-weight: 700; }
.werte td small { display: block; font-weight: 400; color: var(--text2); font-size: .75rem; }
.gut { color: var(--gut); }
.warn { color: var(--warn); }
.schlecht { color: var(--schlecht); }

.schritte { padding-left: 1.2rem; margin: .4rem 0; }
.schritte li { margin: .35rem 0; }

.diagramm { display: block; width: 100%; height: 260px; background: var(--flaeche2); border-radius: 12px; }
#verlauf { height: 240px; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .85rem; color: var(--text2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.legende i.gestrichelt { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; }

.vergleich { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--linie); }

.hinweise details { border-top: 1px solid var(--linie); }
.hinweise details:first-of-type { border-top: 0; }
.hinweise details p { margin: 0 0 12px; color: var(--text2); }

.fuss { padding-top: 10px; padding-bottom: 40px; color: var(--text2); font-size: .875rem; }
.fuss a { color: var(--text2); }

@media (max-width: 560px) {
  .karte { padding: 16px; }
  .referenz { grid-template-columns: 1fr; }
  .band { grid-template-columns: 6.6rem 1fr 3.6rem; gap: 8px; font-size: .85rem; }
  .zeit { min-width: 0; width: 100%; text-align: left; }
  .herunterladen .knopf, .klein-feld { width: 100%; }
  .kopf-innen { gap: 8px; }
  .marke { font-size: .95rem; gap: .4rem; }
  .kopf-link { padding: .4rem .65rem; font-size: .8rem; }
}
@media (max-width: 380px) {
  .marke span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
