:root {
  --hintergrund:   #0d0e12;
  --text:          #e8e4da;
  --text-leise:    #9a968c;
  --akzent:        #d9b77a;

  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --uebergang-langsam: 1.5s;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--hintergrund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: clamp(16px, 1.1vw + 10px, 22px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.ausgeblendet {
  opacity: 0;
  pointer-events: none;
}

.btn {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(232, 228, 218, 0.35);
  border-radius: 999px;
  padding: 0.7em 2em;
  cursor: pointer;
  transition: border-color 0.6s, background-color 0.6s;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--akzent);
  background: rgba(217, 183, 122, 0.08);
  outline: none;
}

.btn-klein {
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-leise);
  background: rgba(13, 14, 18, 0.5);
  border: 1px solid rgba(154, 150, 140, 0.25);
  border-radius: 999px;
  padding: 0.35em 1em;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.6s;
}

.btn-klein:hover,
.btn-klein:focus-visible {
  opacity: 1;
  outline: none;
}

#start {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: opacity var(--uebergang-langsam) ease;
}

#start-titel {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 0.08em;
}

#start-einleitung {
  margin: 0;
  max-width: 34em;
  color: var(--text-leise);
}

#spiel {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transition: opacity var(--uebergang-langsam) ease;
}

#spielfeld {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#btn-ton {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}

.overlay-text {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: min(90%, 32em);
  margin: 0;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
  text-shadow: 0 0 14px rgba(13, 14, 18, 0.8), 0 0 3px rgba(13, 14, 18, 0.6);
}

#stations-titel {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

#stations-inhalt {
  margin: 0;
}

.overlay-hinweis {
  position: absolute;
  left: 50%;
  bottom: max(2rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(90%, 28em);
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-leise);
  pointer-events: none;
  opacity: 0;
  transition: opacity 3s ease;
}

.overlay-text.sichtbar {
  opacity: 1;
}

.overlay-hinweis.sichtbar {
  opacity: 0.7;
}

#ende {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  pointer-events: none;

  text-shadow: 0 0 14px rgba(13, 14, 18, 0.7), 0 0 3px rgba(13, 14, 18, 0.5);
}

.ende-teil {
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease;
}

.ende-teil.sichtbar {
  opacity: 1;
  pointer-events: auto;
}

#ende-form.verweht {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-24px);
  pointer-events: none;
  transition: opacity 4s ease, filter 4s ease, transform 4s ease;
}

#ende-frage {
  margin: 0;
  max-width: 30em;
  font-size: 1.25rem;
  font-weight: 300;
}

#ende-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(100%, 26em);
}

#ende-antwort {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(232, 228, 218, 0.04);
  border: 1px solid rgba(232, 228, 218, 0.2);
  border-radius: 12px;
  padding: 0.8em 1em;
  resize: none;
  transition: border-color 0.6s;
}

#ende-antwort:focus {
  outline: none;
  border-color: var(--akzent);
}

#ende-antwort::placeholder {
  color: var(--text-leise);
}

#ende-hinweis {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-leise);
}

#link-erklaerung {
  font-size: 0.85rem;
  color: var(--text-leise);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity 4s ease, color 0.6s, border-color 0.6s;
}

@media (max-height: 500px) {
  #ende {
    bottom: 0;
    gap: 0.75rem;
    padding: 1rem;
  }

  #ende-antwort {
    height: 3.5em;
  }

  .overlay-text {
    top: 5%;
    font-size: 0.9rem;
  }

  #stations-titel {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
  }
}

#link-erklaerung:hover,
#link-erklaerung:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text-leise);
  outline: none;
}

#erklaerung {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 4rem 1.5rem 6rem;
  transition: opacity var(--uebergang-langsam) ease;
}

.erklaerung-inhalt {
  max-width: 38em;
  margin: 0 auto;
}

#erklaerung-titel {
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.04em;
  margin: 0 0 2.5rem;
}

.erklaerung-abschnitt {
  margin-bottom: 2.5rem;
}

.erklaerung-abschnitt h3 {
  font-weight: 400;
  color: var(--akzent);
  margin: 0 0 0.5rem;
}

.erklaerung-abschnitt p {
  margin: 0;
}

#quellen-titel {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-leise);
  margin: 4rem 0 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(154, 150, 140, 0.2);
}

#quellen-liste {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.85rem;
  color: var(--text-leise);
}
