/* MekoTools — Sprache
   Farben und Formen folgen dem Werkzeugkatalog (Teal, luftige Karten). */

:root {
  --grund: #f8f9fa;
  --flaeche: #ffffff;
  --rand: #d7dde2;
  --rand-stark: #b6c0c8;
  --schrift: #1f2933;
  --schrift-leise: #5b6b78;
  --akzent: #0b7285;
  --akzent-voll: #0f766e;
  --akzent-hell: #e6f4f1;
  --fehler: #b42318;
  --fehler-hell: #fef3f2;
  --schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 12px;
  --schrift-art: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1417;
    --flaeche: #161c20;
    --rand: #2a343a;
    --rand-stark: #3b4850;
    --schrift: #e6edf3;
    --schrift-leise: #9aabb6;
    --akzent: #4dd0c4;
    --akzent-voll: #2dd4bf;
    --akzent-hell: #10302d;
    --fehler: #ff9b91;
    --fehler-hell: #2c1512;
    --schatten: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 16px/1.55 var(--schrift-art);
}

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

.kopf {
  border-bottom: 1px solid var(--rand);
  background: var(--flaeche);
}

.kopf-innen {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.marke {
  color: var(--akzent);
  font-weight: 650;
  text-decoration: none;
  letter-spacing: .01em;
}
.marke:hover { text-decoration: underline; }
.kopf-trenner { color: var(--rand-stark); }
.kopf-titel { color: var(--schrift-leise); }

/* ---------- Grundriss ---------- */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}

.einstieg { margin-bottom: 22px; }

h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}

.lead {
  margin: 0 0 14px;
  color: var(--schrift-leise);
  font-size: 1.02rem;
  max-width: 62ch;
}

.abzeichen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.abzeichen li {
  font-size: .82rem;
  color: var(--akzent);
  background: var(--akzent-hell);
  border: 1px solid color-mix(in srgb, var(--akzent) 22%, transparent);
  border-radius: 999px;
  padding: 3px 10px;
}

/* Zustand des Modells: neutral, damit es nicht wie ein Werbeversprechen aussieht */
.abzeichen li.stand {
  color: var(--schrift-leise);
  background: transparent;
  border-color: var(--rand);
}

.meldung-knopf {
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--fehler);
  background: none;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 2px 10px;
  cursor: pointer;
}
.meldung-knopf:hover { background: color-mix(in srgb, var(--fehler) 10%, transparent); }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 20px;
  margin-bottom: 20px;
}

.karte-titel {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--schrift-leise);
  margin: 0 0 16px;
  font-weight: 650;
}

/* ---------- Felder ---------- */

.feld { margin-bottom: 18px; }

.feld > label,
.feld-kopf label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 6px;
}

.feld-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feld-reihe {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.feld-reihe select { flex: 1 1 auto; min-width: 0; }
.feld-reihe .knopf { flex: 0 0 auto; white-space: nowrap; }

select,
textarea {
  font: inherit;
  color: var(--schrift);
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23708490' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

.zaehler {
  font-size: .82rem;
  color: var(--schrift-leise);
  font-variant-numeric: tabular-nums;
}
.zaehler.knapp { color: var(--fehler); }

.hilfe {
  font-size: .82rem;
  color: var(--schrift-leise);
  margin: 6px 0 0;
}

.beispiele {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.beispiele-label {
  font-size: .82rem;
  color: var(--schrift-leise);
}

.chip {
  font: inherit;
  font-size: .84rem;
  color: var(--schrift);
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.chip:hover { border-color: var(--akzent); color: var(--akzent); }

/* ---------- Knöpfe ---------- */

.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.knopf {
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.knopf-haupt {
  background: var(--akzent-voll);
  color: #fff;
}
.knopf-haupt:hover { filter: brightness(1.08); }

.knopf-zweit {
  background: transparent;
  color: var(--schrift);
  border-color: var(--rand-stark);
}
.knopf-zweit:hover { border-color: var(--akzent); color: var(--akzent); }

.knopf:disabled {
  opacity: .5;
  cursor: not-allowed;
  filter: none;
}

.knopf-rund {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: var(--akzent-hell);
  color: var(--akzent);
  border-color: transparent;
}

.link {
  font: inherit;
  font-size: .82rem;
  color: var(--akzent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Meldung ---------- */

.meldung {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--fehler);
  background: var(--fehler-hell);
  color: var(--fehler);
  font-size: .9rem;
}

/* ---------- Fortschritt ---------- */

.fortschritt { margin-top: 16px; }

.fortschritt-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .88rem;
  margin-bottom: 6px;
}

.fortschritt-wert {
  color: var(--schrift-leise);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balken {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rand) 70%, transparent);
  overflow: hidden;
}

.balken-fuellung {
  height: 100%;
  width: 0;
  background: var(--akzent-voll);
  border-radius: 999px;
  transition: width .2s linear;
}

.balken.unbestimmt .balken-fuellung {
  width: 30%;
  animation: wandern 1.4s ease-in-out infinite;
}

@keyframes wandern {
  0%   { margin-left: -30%; }
  100% { margin-left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .balken.unbestimmt .balken-fuellung { animation: none; width: 100%; opacity: .4; }
}

/* ---------- Ergebnis ---------- */

.ergebnis {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rand);
}

.ergebnis-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.ergebnis-titel {
  font-weight: 600;
  font-size: .92rem;
}

.ergebnis-zeit {
  font-size: .82rem;
  color: var(--schrift-leise);
  font-variant-numeric: tabular-nums;
}

.spieler {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spieler input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--akzent-voll);
  height: 22px;
}

.spieler-zeit {
  font-size: .82rem;
  color: var(--schrift-leise);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 92px;
  text-align: right;
}

.statistik {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 14px 0 0;
  font-size: .84rem;
  color: var(--schrift-leise);
}

.statistik div { display: flex; gap: 6px; }
.statistik dt { margin: 0; }
.statistik dd { margin: 0; color: var(--schrift); font-variant-numeric: tabular-nums; }

.ergebnis-fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* ---------- Erklärung ---------- */

.erklaerung details {
  border-top: 1px solid var(--rand);
  padding: 12px 0;
}
.erklaerung details:first-of-type { border-top: 0; padding-top: 0; }

.erklaerung summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.erklaerung summary::-webkit-details-marker { display: none; }
.erklaerung summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--schrift-leise);
  border-bottom: 2px solid var(--schrift-leise);
  transform: rotate(-45deg);
  transition: transform .15s;
  flex: 0 0 auto;
}
.erklaerung details[open] summary::before { transform: rotate(45deg); }

.erklaerung p {
  margin: 10px 0 2px;
  color: var(--schrift-leise);
  font-size: .93rem;
  max-width: 70ch;
}

.erklaerung strong { color: var(--schrift); }

.liste {
  margin: 10px 0 2px;
  padding-left: 20px;
  color: var(--schrift-leise);
  font-size: .93rem;
}
.liste li { margin-bottom: 6px; }

.erklaerung a { color: var(--akzent); }

/* ---------- Fuß ---------- */

.fuss {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px 40px;
  font-size: .82rem;
  color: var(--schrift-leise);
}
.fuss p { margin: 4px 0; }
.fuss a { color: var(--akzent); }

/* ---------- Schmal ---------- */

@media (max-width: 620px) {
  main { padding: 20px 14px 4px; }
  .karte { padding: 16px; }
  h1 { font-size: 1.5rem; }
  .feld-reihe { flex-direction: column; }
  .feld-reihe select { flex: 0 0 auto; }
  .feld-reihe .knopf { width: 100%; justify-content: center; }
  .aktionen .knopf { flex: 1 1 auto; justify-content: center; }
  .spieler-zeit { min-width: 78px; font-size: .78rem; }
}
