/* Design "Klar & ruhig": large, high-contrast type for the beamer,
   green = current class, orange = next class (as in the original). */

.thema-hell {
  --hintergrund: #f4f5f1;
  --flaeche: #ffffff;
  --text: #15201a;
  --text-leise: #5b6660;
  --linie: #dfe3dc;
  --gruen: #1d7444;
  --gruen-text: #ffffff;
  --orange: #c9650a;
  --orange-hell: #fdf0e3;
  --rot: #b3261e;
  --rot-hell: #fde7e6;
  --ok-hell: #e3f2e8;
  --schatten: 0 1px 3px rgba(20, 30, 25, 0.08), 0 6px 20px rgba(20, 30, 25, 0.06);
}

.thema-dunkel {
  --hintergrund: #0e1411;
  --flaeche: #19221d;
  --text: #eef2ef;
  --text-leise: #9aa7a0;
  --linie: #2a3530;
  --gruen: #22864f;
  --gruen-text: #ffffff;
  --orange: #f29a3f;
  --orange-hell: #2c2318;
  --rot: #ff8a80;
  --rot-hell: #3a1d1b;
  --ok-hell: #17301f;
  --schatten: none;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--hintergrund);
}

[hidden] { display: none !important; }

/* ================= Display (beamer) ================= */
body.anzeige {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.kopf {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1vh 2vw;
  padding: 2vh 3vw 0;
  font-size: 3.6vh;
}
.kopf .titel { font-weight: 600; color: var(--text-leise); }
.kopf .verzug { margin-left: auto; }
.kopf .uhr { margin-left: auto; font-weight: 700; }
.kopf .verzug + .uhr { margin-left: 0; }

.verzug {
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85em;
  background: var(--ok-hell);
  color: var(--gruen);
}
.verzug.mittel { background: var(--orange-hell); color: var(--orange); }
.verzug.hoch { background: var(--rot-hell); color: var(--rot); }

.buehne {
  display: grid;
  grid-template-rows: 3fr 2fr;
  gap: 2.5vh;
  padding: 2.5vh 3vw;
  min-height: 0;
}

.anzeige .feld {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 2.5vh;
  padding: 2vh 3vw;
  min-height: 0;
  overflow: hidden;
  text-align: center;
}
.anzeige .feld h1 {
  margin: 0;
  font-size: 3.4vh;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.anzeige .feld h1 small {
  font-size: 0.75em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.8;
  margin-left: 0.6em;
}
.anzeige .klasse {
  margin: 0;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.anzeige .klasse:empty::before { content: "–"; opacity: 0.4; }
.anzeige .zeit { margin: 0.6vh 0 0; font-size: 3vh; }
.anzeige .zeit:empty { display: none; }

/* Current class: the hero, solid green */
.anzeige .feld.aktuell { background: var(--gruen); color: var(--gruen-text); box-shadow: var(--schatten); }
.anzeige .feld.aktuell .klasse { font-size: min(30vh, 22vw); }
.anzeige .feld.aktuell .zeit { opacity: 0.85; }

/* Next class: calm card with orange accent */
.anzeige .feld.naechste {
  background: var(--flaeche);
  border-top: 1.2vh solid var(--orange);
  box-shadow: var(--schatten);
}
.anzeige .feld.naechste h1 { color: var(--orange); }
.anzeige .feld.naechste .klasse { font-size: min(17vh, 13vw); }
.anzeige .feld.naechste .zeit { color: var(--text-leise); }

.fuss {
  display: flex;
  align-items: baseline;
  gap: 1.5vw;
  padding: 0 3vw 2.5vh;
  font-size: 3.6vh;
  white-space: nowrap;
  overflow: hidden;
}
.fuss .etikett {
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-leise);
}
.fuss #danach { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.neu { animation: aufblitzen 1.6s ease-out; }
@keyframes aufblitzen {
  0% { transform: scale(1.06); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .neu { animation: none; }
}

.offline {
  position: fixed;
  bottom: 1vh;
  right: 1vw;
  padding: 0.3rem 0.8rem;
  background: var(--rot);
  color: #fff;
  border-radius: 999px;
  font-size: 0.9rem;
}

/* ================= Shared form elements ================= */
label { display: block; margin: 0.9rem 0; font-weight: 600; }
label input { display: block; width: 100%; margin-top: 0.35rem; }

input[type="text"], input[type="password"], textarea {
  font: inherit;
  font-weight: 400;
  width: 100%;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 8px;
}
input:focus, textarea:focus, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gruen) 45%, transparent);
  outline-offset: 1px;
}
textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; resize: vertical; }

button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border: 0;
  border-radius: 8px;
  background: var(--gruen);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.zweit { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); }
button.leise { background: var(--orange-hell); color: var(--orange); }
button.link { background: none; color: inherit; padding: 0; font-weight: 400; text-decoration: underline; }

.meldung { padding: 0.7rem 0.9rem; border-radius: 8px; }
.meldung.fehler { background: var(--rot-hell); color: var(--rot); }
.meldung.ok { background: var(--ok-hell); color: var(--gruen); }
.hinweis { color: var(--text-leise); font-size: 0.92rem; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--schatten);
}
.karte h1, .karte h2 { margin-top: 0; }
.karte h2 { font-size: 1.1rem; }

/* ================= Login / setup ================= */
body.formular {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
body.formular .karte { width: 100%; max-width: 26rem; border-top: 6px solid var(--gruen); }
body.formular h1 { font-size: 1.4rem; }
body.formular button[type="submit"] { width: 100%; margin-top: 0.5rem; }

/* ================= Control page ================= */
.leiste {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.8rem 1.25rem;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}
.leiste nav { display: flex; gap: 1.2rem; align-items: center; }
.leiste a { color: inherit; }
form.inline { display: inline; }

.steuerung main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.steuerung .meldung { margin: 0; }

.status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  align-items: stretch;
}
.status .verzug { grid-column: 1 / -1; justify-self: center; font-size: 1rem; }
.status-feld {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
}
.status-feld.aktuell { background: var(--gruen); color: var(--gruen-text); }
.status-feld.naechste { background: var(--flaeche); border: 1px solid var(--linie); border-top: 5px solid var(--orange); }
.status-feld .etikett { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.status-feld.naechste .etikett { color: var(--orange); }
.status-feld .wert { font-size: 2.6rem; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.status-feld .wert:empty::before { content: "–"; opacity: 0.4; }
.status-feld .zeit { font-size: 0.9rem; opacity: 0.8; min-height: 1.2em; }

.knoepfe { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.knoepfe.links { justify-content: flex-start; }
.knoepfe button { font-size: 1.15rem; padding: 0.9rem 1.6rem; }
.knoepfe button.haupt { flex: 1; max-width: 22rem; font-size: 1.4rem; }

.schnell { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: center; }
.schnell .etikett { color: var(--text-leise); font-size: 0.92rem; }

.liste { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: nr; }
.liste li {
  counter-increment: nr;
  display: grid;
  grid-template-columns: 2rem 3.5rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--linie);
}
.liste li::before { content: counter(nr); color: var(--text-leise); font-size: 0.85rem; }
.liste .uhrzeit { color: var(--text-leise); font-variant-numeric: tabular-nums; }
.liste .klasse { font-weight: 600; }
.liste .badge { font-size: 0.78rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--hintergrund); color: var(--text-leise); }
.liste li.laeuft { background: var(--ok-hell); border-radius: 8px; }
.liste li.laeuft .badge { background: var(--gruen); color: #fff; }
.liste li.erledigt .klasse, .liste li.erledigt .uhrzeit { text-decoration: line-through; opacity: 0.55; }

details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 0.5rem; }
details.karte { padding-top: 1rem; padding-bottom: 1rem; }
.karte details { margin-top: 0.5rem; }
.abstand { margin-top: 0.8rem; }

@media (max-width: 30rem) {
  .status { grid-template-columns: 1fr; }
  .status-feld .wert { font-size: 2rem; }
}

/* View switches on the control page */
.ansicht {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  justify-content: center;
  padding: 0.7rem 1rem;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
}
.umschalter { display: flex; align-items: center; gap: 0.5rem; }
.umschalter .etikett { font-size: 0.85rem; color: var(--text-leise); }
.segmente { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.segmente button {
  padding: 0.35rem 0.8rem;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  color: var(--text);
}
.segmente button + button { border-left: 1px solid var(--linie); }
.segmente button[aria-pressed="true"] { background: var(--gruen); color: #fff; cursor: default; filter: none; }
