:root, :root[data-theme="light"] {
  color-scheme: light;
  --seite: #f7f6f3;
  --karte: #ffffff;
  --flaeche: #efedE8;
  --text: #141414;
  --leise: #5f5d58;
  --linie: #dfdcd5;
  --eingabe-rand: #a9a69f;
  --akzent: #141414;
  --akzent-text: #ffffff;
  --fokus: #0b6e99;
  --marker: #d9480f;
  --gruen: #1c7c54; --gruen-hell: #dff3e9; --gruen-text: #135a3c;
  --gelb: #8a5a00;  --gelb-hell: #fdf0d3;
  --rot: #b3261e;
  --schatten: 0 1px 2px rgba(20, 20, 20, .08), 0 8px 24px rgba(20, 20, 20, .06);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --seite: #111111;
  --karte: #1b1b1b;
  --flaeche: #262626;
  --text: #f1efea;
  --leise: #aaa7a0;
  --linie: #333333;
  --eingabe-rand: #5c5a56;
  --akzent: #f1efea;
  --akzent-text: #141414;
  --fokus: #6fc3e6;
  --marker: #ff8a50;
  --gruen: #66d3a4; --gruen-hell: #1a3429; --gruen-text: #b4efd3;
  --gelb: #f3c969;  --gelb-hell: #3a2e12;
  --rot: #ff8a80;
  --schatten: 0 1px 2px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--seite);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
.leise { color: var(--leise); }
.klein { font-size: .9rem; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

/* Kopfzeile */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px max(16px, calc((100vw - 1120px) / 2));
  background: var(--karte); border-bottom: 1px solid var(--linie);
}
.logo {
  font-size: clamp(1.55rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: .16em;
  line-height: 1; color: var(--text); text-decoration: none; white-space: nowrap;
}
.kopf-rechts { display: flex; align-items: center; gap: 8px; }

/* Knöpfe */
button {
  font: inherit; font-size: .95rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; min-height: 44px;
  border: 1px solid var(--eingabe-rand); background: var(--karte); color: var(--text);
}
button:hover { background: var(--flaeche); }
button.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
button.haupt:hover { opacity: .86; background: var(--akzent); }
button.gut { background: var(--gruen); border-color: var(--gruen); color: var(--karte); font-weight: 600; }
button.gut:hover { opacity: .88; background: var(--gruen); }
button.schlicht { border-color: transparent; background: transparent; color: var(--leise); }
button.schlicht:hover { color: var(--text); background: var(--flaeche); }
button:disabled { opacity: .5; cursor: not-allowed; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 80px; }

/* Übersicht */
.gruss { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 8px; }
.einleitung { max-width: 62ch; color: var(--leise); }
.fortschritt { margin: 24px 0 8px; font-weight: 600; }
.balken { height: 6px; border-radius: 3px; background: var(--flaeche); overflow: hidden; margin-bottom: 28px; }
.balken div { height: 100%; background: var(--gruen); transition: width .25s; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.kachel {
  display: block; padding: 0; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden;
  background: var(--karte); text-align: left; min-height: 0; box-shadow: var(--schatten);
  transition: transform .15s;
}
.kachel:hover { background: var(--karte); transform: translateY(-2px); }
.kachel-bild { position: relative; aspect-ratio: 9 / 16; background: #000; }
.kachel-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kachel-text { padding: 10px 12px 12px; }
.kachel-titel { font-weight: 600; font-size: 1rem; line-height: 1.3; margin-bottom: 8px; }
.projekt-titel { font-size: 1.25rem; margin: 40px 0 16px; }

/* Status */
.status { display: inline-block; font-size: .82rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--flaeche); color: var(--leise); white-space: nowrap; }
.status.frei { background: var(--gruen-hell); color: var(--gruen-text); }
.status.aendern { background: var(--gelb-hell); color: var(--gelb); }

/* Einzelnes Video */
.brotkrumen { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.titelzeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.titelzeile h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
.buehne { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
.spieler { position: sticky; top: 16px; min-width: 0; }
.rahmen { position: relative; aspect-ratio: 9 / 16; max-height: calc(100vh - 150px); margin: 0 auto; background: #000; border-radius: 12px; overflow: hidden; }
.rahmen video { width: 100%; height: 100%; display: block; background: #000; }
.video-hinweis { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #fff; background: rgba(0, 0, 0, .72); }
.zeitleiste { position: relative; height: 22px; margin-top: 8px; }
.zeitleiste::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--linie); }
.position { position: absolute; top: 5px; width: 2px; height: 12px; margin-left: -1px; background: var(--text); pointer-events: none; }
.punkt { position: absolute; top: 3px; width: 16px; height: 16px; min-height: 0; margin-left: -8px; padding: 0; border-radius: 50%; border: 2px solid var(--seite); background: var(--marker); }
.punkt:hover { background: var(--marker); transform: scale(1.2); }
.punkt.erledigt { background: var(--eingabe-rand); }
.zeitanzeige { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.zeitanzeige strong { font-variant-numeric: tabular-nums; }
.schritte { display: flex; gap: 6px; }
.schritte button { min-height: 40px; padding: 4px 10px; font-size: .88rem; }

.spalte { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.feld { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 20px; }
.feld h2 { font-size: 1.1rem; margin-bottom: 12px; }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.vorschlag { border-left: 3px solid var(--marker); padding-left: 12px; margin-bottom: 12px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
textarea, input[type="number"] { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--eingabe-rand); background: var(--karte); color: var(--text); }
textarea { width: 100%; min-height: 96px; resize: vertical; display: block; }
textarea.gross { min-height: 240px; }
.wunsch-kopf { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sekunde-feld input { width: 110px; font-variant-numeric: tabular-nums; }
.wunsch-kopf button { min-height: 46px; }
.fehler { color: var(--rot); margin-top: 8px; font-size: .95rem; }
.fehler:empty { display: none; }

.wuensche { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wunsch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px; border-radius: 8px; background: var(--flaeche); }
.wunsch.erledigt { opacity: .62; }
.zeitmarke { min-height: 34px; padding: 2px 10px; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wunsch-text { white-space: pre-wrap; overflow-wrap: anywhere; align-self: center; }
.wunsch.erledigt .wunsch-text { text-decoration: line-through; }
.wunsch-fuss { grid-column: 2; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.wunsch-fuss button { min-height: 32px; padding: 2px 8px; font-size: .85rem; }
.leer { color: var(--leise); }

.abschluss { display: flex; flex-direction: column; gap: 8px; }
.abschluss p { color: var(--leise); }
.mitte { max-width: 520px; margin: 15vh auto; padding: 0 16px; text-align: center; }
.mitte .logo { display: inline-block; margin-bottom: 20px; }

@media (max-width: 820px) {
  main { padding-top: 20px; }
  .buehne { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .spieler { position: static; max-width: 340px; margin: 0 auto; width: 100%; }
  .rahmen { max-height: none; }
  .feld { padding: 16px; }
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
