@import url('../gemeinsam.css');

/* Die Werkbank zum Bauen einer Rallye.
 *
 * Zwei Spalten: links das Formular, rechts Karte und Prüfliste. Die rechte
 * Spalte bleibt stehen, während man links scrollt — beim Setzen eines Stopps
 * will man Karte und Feld gleichzeitig sehen. */

.kopf {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--glas);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--linie-zart);
  position: sticky; top: 0; z-index: 900;
}
.marke { display: flex; align-items: center; gap: 11px; min-width: 0; }
.taube {
  font-size: 20px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: color-mix(in srgb, var(--akzent) 16%, transparent); flex: none;
}
.kopf h1 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.unterzeile { margin: 1px 0 0; font-size: 12.5px; color: var(--text-leise); }
.kopf-rechts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.konto { font-size: 13px; color: var(--text-leise); }
a.knopf { text-decoration: none; display: inline-block; }

main { padding: 18px; max-width: 1500px; margin: 0 auto; }

.tafel {
  background: var(--flaeche);
  border: 1px solid var(--linie-zart);
  border-radius: var(--r-gross);
  box-shadow: var(--schatten);
  padding: 18px;
  margin-bottom: 16px;
}
.tafel.schmal { max-width: 460px; margin: 40px auto; }
.tafel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); margin: 0 0 12px; font-weight: 650; }
.tafel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap; }
.tafel-kopf h2 { margin: 0; }
.fliesstext { font-size: 13.5px; color: var(--text-leise); margin: 0 0 14px; }

.werkbank { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 16px; align-items: start; }
.spalte { min-width: 0; }
.spalte-fest { position: sticky; top: 78px; }

.feldpaar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.feld input, .feld textarea, .feld select {
  font: inherit; padding: 8px 10px; border-radius: var(--r-klein);
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  width: 100%;
}
.feld input:focus, .feld textarea:focus, .feld select:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.schalterreihe { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding-bottom: 12px; }
.schalter { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.schalter input { width: 16px; height: 16px; accent-color: var(--akzent); }

/* Das Fragezeichen mit Erklärung — dieselbe Idee wie in der App. */
.frage {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--flaeche-leise); color: var(--text-leise);
  font-size: 10px; font-weight: 700; cursor: help; margin-left: 3px;
}

.zahl { font-size: 12px; color: var(--text-leise); background: var(--flaeche-leise);
  border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }

/* ---------- Liste der eigenen Rallyes ---------- */

.liste { display: grid; gap: 10px; }
.eintrag {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--linie-zart); border-radius: var(--r);
  padding: 12px 14px; background: var(--flaeche-leise); cursor: pointer;
  transition: border-color var(--takt), transform var(--takt);
}
.eintrag:hover { border-color: color-mix(in srgb, var(--akzent) 45%, var(--linie)); }
.eintrag:active { transform: scale(.995); }
.eintrag-name { font-weight: 620; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag-ort { font-size: 12.5px; color: var(--text-leise); }
.merkmal { font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--text-leise); }
.merkmal.warnt { color: var(--warnung); border-color: color-mix(in srgb, var(--warnung) 40%, transparent); }
.leerzeile { font-size: 13.5px; color: var(--text-leise); }

/* ---------- Stopps ---------- */

.stoppliste { display: grid; gap: 8px; }
.stopp {
  border: 1px solid var(--linie-zart); border-radius: var(--r);
  background: var(--flaeche-leise); overflow: hidden;
}
.stopp.offen { background: var(--flaeche); border-color: color-mix(in srgb, var(--akzent) 35%, var(--linie)); }
.stopp-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.stopp-nummer {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--akzent); color: #fff; font-size: 12px; font-weight: 700;
}
.stopp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stopp-art { font-size: 11px; color: var(--text-leise); flex: none; }
.stopp-koerper { padding: 0 12px 12px; display: grid; gap: 0; }
.griff { cursor: grab; color: var(--text-leise); font-size: 14px; flex: none; }
.stopp.zieht { opacity: .45; }
.stopp.ziel { border-color: var(--akzent); border-style: dashed; }

.antwortzeile { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.antwortzeile input[type="text"] { flex: 1; }
.antwortzeile input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--akzent); }

/* ---------- Karte ---------- */

.karte-tafel { padding: 12px; }
#karte { height: 380px; border-radius: var(--r); overflow: hidden; }
.suchzeile { display: flex; gap: 8px; margin-bottom: 10px; }
.suchzeile input { flex: 1; font: inherit; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); }
.suchergebnisse { border: 1px solid var(--linie-zart); border-radius: var(--r);
  margin-bottom: 10px; max-height: 200px; overflow-y: auto; }
.suchtreffer { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--linie-zart); }
.suchtreffer:last-child { border-bottom: none; }
.suchtreffer:hover { background: var(--flaeche-leise); }

.stoppmarke {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--akzent); color: #fff; font-weight: 700; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* ---------- Kennzahlen ---------- */

.kennzahlen { display: flex; gap: 8px; flex-wrap: wrap; }
.kennzahl {
  flex: 1; min-width: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 10px; border-radius: var(--r-klein); background: var(--flaeche-leise);
}
.kennzahl-wert {
  font-size: 17px; font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kennzahl-name { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); text-align: center; }

/* ---------- Prüfliste ---------- */

.pruefliste { display: grid; gap: 8px; }
.pruefzeile { display: flex; gap: 9px; font-size: 13px; align-items: flex-start; }
.pruefzeichen { flex: none; font-weight: 700; }
.pruefzeile.fehler .pruefzeichen { color: var(--falsch); }
.pruefzeile.warnung .pruefzeichen { color: var(--warnung); }
.pruefzeile.gut { color: var(--gut); }

@media (max-width: 1000px) {
  .werkbank { grid-template-columns: minmax(0, 1fr); }
  .spalte-fest { position: static; }
  .feldpaar { grid-template-columns: 1fr; }
}

/* ---------- Bilder je Stopp ---------- */

.bilderreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bildzelle { position: relative; width: 84px; height: 84px; border-radius: var(--rundung, 8px); overflow: hidden; background: var(--flaeche-2, #eee); }
.bildzelle img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Name ohne Bytes: Entwurf neu geladen, der Blob ist weg — sichtbar machen. */
.bildzelle.fehlt { outline: 2px dashed var(--warnung, #b8541f); }
.bild-weg {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 12px; line-height: 22px; cursor: pointer;
}
