/* Farben und Schriften wie christen-in-oberscheld.de */
@font-face {
  font-family: "Lato";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-normal-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lato-normal-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Josefin Sans";
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/josefin-sans-normal-latin.woff2") format("woff2");
}

:root {
  --gelb: #f8cf41;
  --gelb-dunkel: #e9bb1c;
  --grau: #545454;
  --hellgrau: #f8f8f8;
  --linie: #e4e4e4;
  --blau: #2f4858;
  --text: #222;
  --fehler: #b3261e;
  --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titel: "Josefin Sans", "Lato", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: #fff;
  color: var(--text);
  font: 18px/1.5 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.site-header {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0.5rem;
}

.logo { width: 180px; height: auto; }

main {
  max-width: 30rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.screen { display: flex; flex-direction: column; gap: 1rem; }
.screen[hidden] { display: none; }

h1 {
  font: 400 1.9rem/1.2 var(--font-titel);
  text-align: center;
  margin: 0.5rem 0 0.25rem;
}

.lead { text-align: center; margin: 0; color: var(--grau); }
.hint { text-align: center; margin: 0; color: var(--grau); font-size: 0.95rem; }
.error { color: var(--fehler); margin: 0; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* Eingabe */
.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 700; }
.field input {
  font: inherit;
  font-weight: 400;
  padding: 0.85rem 1rem;
  border: 2px solid var(--linie);
  border-radius: 6px;
  background: #fff;
}
.field input:focus { outline: none; border-color: var(--blau); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 6px;
  font: 700 1.05rem/1.2 var(--font);
  color: #000;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.1s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .link:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.btn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary { background: var(--gelb); }
.btn-primary:hover { background: var(--gelb-dunkel); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-big { min-height: 5rem; font-size: 1.2rem; margin-top: 1rem; }

.btn-secondary { background: #fff; border-color: var(--blau); color: var(--blau); }

.btn-small {
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  background: var(--hellgrau);
  border-color: var(--linie);
  font-size: 0.95rem;
  flex: 1;
}
.btn-play { flex: 1.4; }
.btn-play.playing { background: var(--blau); border-color: var(--blau); color: #fff; }

.link {
  background: none;
  border: 0;
  padding: 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--blau);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link[hidden] { display: none; }
.links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }

/* Fortschritt */
.progress {
  height: 0.75rem;
  background: var(--hellgrau);
  border: 1px solid var(--linie);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--gelb);
  border-radius: inherit;
  transition: width 0.3s;
}
.progress.indeterminate .progress-bar {
  width: 35%;
  animation: wander 1.4s ease-in-out infinite;
}
@keyframes wander { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* Wellenform mit Schiebern */
.wave {
  position: relative;
  height: 130px;
  margin: 0.5rem 0.75rem;
  touch-action: none;
  cursor: pointer;
}
.wave canvas { width: 100%; height: 100%; display: block; }

.handle {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 4px;
  margin-left: -2px;
  background: var(--gelb-dunkel);
  border-radius: 2px;
  pointer-events: none;
}
.handle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: var(--gelb);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}

.marker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.75rem;
}
.marker + .marker { border-top: 1px solid var(--linie); }
.marker:first-of-type { margin-top: 1rem; }
.marker-label { font-size: 1rem; }
.marker-time { font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-left: 0.25rem; }
.marker-controls { display: flex; gap: 0.5rem; }

.summary { text-align: center; margin: 0.5rem 0 0; }
.summary strong { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
