:root {
  --creme: #ffffff;
  --creme-hell: #fafafa;
  --creme-tief: #e6e4e0;

  --kupfer: #a66a3f;
  --kupfer-tief: #7f4f2e;
  --messing: #9a7328;
  --messing-hell: #c79f52;
  --tinte: #33302b;

  --leit: var(--kupfer);
  --leit-tief: var(--kupfer-tief);
  --akzent: var(--messing);
  --akzent-hell: var(--messing-hell);

  --linie: rgba(166, 106, 63, 0.3);
  --linie-fein: rgba(51, 48, 43, 0.16);

  --sans: "Frutiger", "Frutiger LT Std", "Frutiger Neue LT", "Segoe UI",
          system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --rand: clamp(1.1rem, 2.6vw, 2.8rem);
  --luft: clamp(0.7rem, 2.2vh, 1.9rem);
  --helm-hoehe: clamp(9rem, 30vh, 20rem);
  --helm-hoehe-klein: clamp(4.5rem, 15vh, 10rem);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { font-size: clamp(16px, min(1.45vw, 2.1vh), 26px); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--creme);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.ebene {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(var(--rand) * 0.9) var(--rand);
  overflow: hidden;
}

.ebene--aktiv { display: flex; animation: ebene-auf 0.4s ease both; }

@keyframes ebene-auf { from { opacity: 0; } to { opacity: 1; } }

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
}

.marke, .raum, .anonym {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--akzent);
}

.entwurf {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tinte);
  opacity: 0.55;
  text-align: center;
}

.zaehler {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--leit);
  font-variant-numeric: tabular-nums;
}

.mitte {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--luft);
  overflow-y: auto;
  scrollbar-width: none;
  width: 100%;
}

.mitte::-webkit-scrollbar { width: 0; height: 0; }

.navigation {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: calc(var(--luft) * 0.7);
}

.schlagzeile {
  margin: 0;
  font-size: 2.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--leit);
  max-width: 22ch;
}

.unterzeile {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--tinte);
  max-width: 26ch;
}

.einleitung {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 400;
  max-width: 40ch;
}

#ebene-start .mitte { gap: calc(var(--luft) * 0.4); }
#ebene-start .schlagzeile { margin-top: calc(var(--luft) * 0.45); }
#ebene-start .start-block { margin-top: calc(var(--luft) * 0.6); }
#ebene-start .anonym { margin-top: calc(var(--luft) * 0.6); }

.kernsatz {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--leit);
  max-width: 20ch;
}

.helm { width: 100%; height: var(--helm-hoehe); display: flex; justify-content: center; }
.helm--klein { height: var(--helm-hoehe-klein); }
.helm svg { height: 100%; width: auto; max-width: 100%; }
.helm text { font-family: var(--sans); }

.helm-figur { transform-box: fill-box; transform-origin: 50% 4%; }

body[data-ton="laeuft"] .helm-figur { animation: helm-neigen 5s ease-in-out infinite; }

@keyframes helm-neigen {
  0%, 100% { transform: rotate(-0.6deg); }
  50% { transform: rotate(0.6deg); }
}

.schall { opacity: 0; }
body[data-ton="laeuft"] .schall { opacity: 1; }

.pegel {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.2rem, 0.5vw, 0.45rem);
  height: clamp(1.6rem, 5vh, 3.4rem);
  width: 100%;
  visibility: hidden;
}

body[data-ton="laeuft"] .pegel,
body[data-ton="pause"] .pegel { visibility: visible; }

.pegel span {
  width: clamp(0.3rem, 0.7vw, 0.7rem);
  height: 14%;
  background: var(--leit);
  border-radius: 999px;
}

body[data-ton="pause"] .pegel span { background: var(--creme-tief); }

body[data-ton="fehlt"] .pegel,
body[data-ton="fehler"] .pegel,
body[data-ton="fehlt"] .regler-block,
body[data-ton="fehler"] .regler-block { display: none; }

.status {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--leit);
}

.hinweis {
  max-width: 48ch;
  padding: calc(var(--luft) * 0.9) calc(var(--luft) * 1.2);
  border: 2px solid var(--linie);
  border-radius: 8px;
  background: var(--creme-hell);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.hinweis-titel { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--leit); }
.hinweis-text { margin: 0; font-size: 1.1rem; }

.regler-block {
  width: 100%;
  max-width: 46rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--luft) * 0.5);
}

.regler-block--schmal { max-width: 26rem; }

.reglerwert {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tinte);
}

.regler {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2.8rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.regler::-webkit-slider-runnable-track {
  height: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(to right, var(--leit) var(--fuell, 0%), var(--creme-tief) var(--fuell, 0%));
}

.regler::-moz-range-track {
  height: 0.75rem;
  border-radius: 999px;
  background: var(--creme-tief);
}

.regler::-moz-range-progress { height: 0.75rem; border-radius: 999px; background: var(--leit); }

.regler::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.9rem;
  height: 1.9rem;
  margin-top: -0.575rem;
  border: 4px solid var(--leit);
  border-radius: 50%;
  background: var(--creme);
}

.regler::-moz-range-thumb {
  width: 1.9rem;
  height: 1.9rem;
  border: 4px solid var(--leit);
  border-radius: 50%;
  background: var(--creme);
}

.regler:disabled { opacity: 0.45; cursor: not-allowed; }
.regler:focus, .regler:focus-visible { outline: none; }
.regler:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(166, 106, 63, 0.3); }
.regler:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(166, 106, 63, 0.3); }

.aktionen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.6rem, 1.4vw, 1.4rem);
}

.start-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--luft) * 0.7);
}

.btn {
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 1rem 2.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
}

.btn--voll { background: var(--leit); color: var(--creme); }
.btn--voll:active { background: var(--leit-tief); }
.btn--linie { background: var(--creme-hell); border-color: var(--leit); color: var(--leit); }
.btn--linie:active { background: var(--creme-tief); }
.btn--start { font-size: 1.8rem; padding: 1.7rem 3.8rem; }
a.btn { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--akzent); outline-offset: 4px; }
.btn svg { width: 1em; height: 1em; flex: none; }
.btn--start svg { width: 1.1em; height: 1.1em; }

.ausloeser { width: clamp(3rem, 5.4vw, 5rem); flex: none; }
.ausloeser svg { width: 100%; height: auto; }
.ausloeser-kappe { animation: knopf-druecken 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }

@keyframes knopf-druecken {
  0%, 46%, 100% { transform: translateY(0); }
  10%, 30% { transform: translateY(9%); }
  20%, 40% { transform: translateY(0); }
}

.teaser-laeuft .teaser { animation: teaser-ein 0.8s ease both; animation-delay: var(--verz, 0s); }

@keyframes teaser-ein {
  from { opacity: 0; transform: translateY(1.2rem); }
  to { opacity: 1; transform: translateY(0); }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--creme);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--rand);
}

.overlay-innen {
  width: min(64rem, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--luft);
  text-align: center;
}

.overlay-titel {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--leit);
}

.overlay-text {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  text-align: left;
  max-width: 62ch;
  padding-right: 0.6rem;
}

.overlay-text p { margin: 0 0 0.9rem; font-size: 1.15rem; }
.overlay-text p:last-child { margin-bottom: 0; }
.overlay-text .quelle { font-weight: 700; color: var(--leit); }

.dgs-platz {
  width: min(48rem, 100%);
  aspect-ratio: 16 / 9;
  border: 2px solid var(--linie);
  border-radius: 8px;
  background: var(--creme-hell);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.2rem;
  font-size: 1.15rem;
  font-weight: 600;
}

@media (min-width: 1200px) {
  .regler-block, .einleitung, .hinweis { max-width: min(1500px, 94%); }
  .regler-block--schmal { max-width: min(34rem, 60%); }
  .einleitung { max-width: 52ch; }
  .schlagzeile { font-size: clamp(2.9rem, 3.6vw, 4.1rem); }
  .unterzeile { font-size: clamp(1.85rem, 1.9vw, 2.4rem); }
  .einleitung { max-width: 46ch; }
  .kernsatz { font-size: clamp(2.2rem, 2.6vw, 3.2rem); }
}

@media (max-height: 900px) {
  :root { --helm-hoehe: clamp(8rem, 27vh, 17rem); --helm-hoehe-klein: clamp(3.2rem, 11vh, 7rem); }
}

@media (max-height: 800px) {
  :root { --luft: clamp(0.6rem, 1.9vh, 1.4rem); --helm-hoehe: clamp(7.5rem, 25vh, 15rem); }
}

@media (max-height: 760px) {
  .btn--start { font-size: 1.6rem; padding: 1.4rem 3.1rem; }
}

@media (max-height: 700px) {
  :root { --helm-hoehe: clamp(7rem, 23vh, 13rem); --helm-hoehe-klein: clamp(5rem, 16vh, 9rem); }
  .schlagzeile { font-size: 2.5rem; }
  .unterzeile { font-size: 1.6rem; }
  .einleitung { font-size: 1.3rem; }
}

@media (max-height: 680px) {
  :root { --rand: clamp(1rem, 2.2vw, 2rem); }
  .btn { padding: 0.85rem 1.9rem; }
}

@media (max-height: 620px) {
  :root { --luft: clamp(0.5rem, 1.5vh, 1rem); --helm-hoehe: clamp(6.5rem, 21vh, 11rem); }
  .pegel { height: clamp(1.3rem, 4vh, 2.4rem); }
  .regler { height: 2.4rem; }
}

@media (max-height: 560px) {
  :root { --helm-hoehe: clamp(5.5rem, 19vh, 9rem); --helm-hoehe-klein: clamp(4.2rem, 14vh, 7rem); }
  .btn--start { font-size: 1.35rem; padding: 1.1rem 2.5rem; }
  .schlagzeile { font-size: 2.2rem; }
  .unterzeile { font-size: 1.4rem; }
  .kernsatz { font-size: 1.8rem; }
}

@media (max-height: 500px) {
  :root { --luft: clamp(0.4rem, 1.2vh, 0.8rem); --helm-hoehe: clamp(5rem, 17vh, 8rem); }
  .status { font-size: 1.15rem; }
  .einleitung { font-size: 1.1rem; }
  .regler { height: 2.1rem; }
}

@media (max-height: 440px) {
  :root { --helm-hoehe: clamp(4.4rem, 15vh, 7rem); --helm-hoehe-klein: clamp(3.6rem, 12vh, 5.5rem); }
  .helm--klein { display: none; }
  .btn { padding: 0.75rem 1.6rem; font-size: 1.1rem; }
  .btn--start { font-size: 1.2rem; padding: 0.95rem 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ebene--aktiv, .helm-figur, .ausloeser-kappe, .teaser-laeuft .teaser { animation: none !important; }
  .teaser { opacity: 1; transform: none; }
  * { transition: none !important; }
}