@import url('https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@400;600&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;1,6..72,300&display=swap');

:root {
  --raum: #1b1713;
  --pult: #262019;
  --pult-hell: #322a20;
  --kante: #3d352b;
  --papier: #ece4d6;
  --gedaempft: #9a8f7f;
  --messing: #c9a227;
  --rost: #b4522f;
  --salbei: #7f9b72;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--raum);
  color: var(--papier);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}


.vorhang {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 32px 22px;
  background: var(--raum);
}

.vorhang[hidden] { display: none; }

.vorhang-inhalt {
  width: 100%;
  max-width: 460px;
}

h1 {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: 58px;
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}

.anriss {
  margin: 0 0 34px;
  color: var(--gedaempft);
  font-size: 17px;
  max-width: 40ch;
}

.wahl { margin-bottom: 26px; }

.wahl-frage {
  margin: 0 0 9px;
  font-size: 15px;
  color: var(--gedaempft);
}

.knopfreihe {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.knopfreihe button {
  font-family: 'Newsreader', serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--papier);
  background: var(--pult);
  border: 1px solid var(--kante);
  border-radius: 2px;
  padding: 8px 15px;
  cursor: pointer;
}

.knopfreihe button[aria-checked="true"] {
  background: var(--pult-hell);
  border-color: var(--messing);
  color: var(--messing);
}

.wahl-notiz {
  margin: 9px 0 0;
  font-size: 14px;
  font-style: italic;
  color: var(--gedaempft);
}

.haupt-knopf {
  font-family: 'Newsreader', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--raum);
  background: var(--messing);
  border: none;
  border-radius: 2px;
  padding: 13px 30px;
  cursor: pointer;
  margin-top: 8px;
}

.haupt-knopf:hover { background: #dbb437; }

.text-knopf {
  font-family: 'Newsreader', serif;
  font-size: 15px;
  color: var(--gedaempft);
  background: none;
  border: none;
  border-bottom: 1px solid var(--kante);
  padding: 1px 0;
  cursor: pointer;
}

.text-knopf:hover { color: var(--papier); border-color: var(--papier); }


.bestenliste {
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--kante);
}

.bestenliste h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 400;
  color: var(--gedaempft);
}

.bestenliste ol {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.bestenliste li {
  display: flex;
  align-items: baseline;
  gap: 13px;
  padding: 7px 0;
  border-bottom: 1px solid var(--kante);
  font-size: 14px;
  color: var(--gedaempft);
}

.bestenliste li:last-child { border-bottom: none; }

.bestenliste b {
  font-family: 'Azeret Mono', monospace;
  font-weight: 600;
  font-size: 16px;
  color: var(--papier);
  min-width: 52px;
}


.ende-zeile {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--gedaempft);
}

.punktzahl {
  font-family: 'Azeret Mono', monospace;
  font-weight: 600;
  font-size: 68px;
  line-height: 1;
  margin: 0 0 12px;
  color: var(--messing);
}

.ende-notiz {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--gedaempft);
  line-height: 1.6;
}

.fehlerliste {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  max-height: 230px;
  overflow-y: auto;
}

.fehlerliste li {
  padding: 7px 0;
  border-bottom: 1px solid var(--kante);
  font-size: 15px;
  color: var(--gedaempft);
}

.fehlerliste b { color: var(--papier); font-weight: 600; }


.spiel[hidden] { display: none; }

.leiste {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--kante);
  font-size: 15px;
  color: var(--gedaempft);
}

.leiste-links, .leiste-rechts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leiste .trenner {
  width: 1px;
  height: 13px;
  background: var(--kante);
}

#fortschritt { font-family: 'Azeret Mono', monospace; font-size: 13px; }

.buehne {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 34px;
  padding: 26px 20px 40px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}


.gitter-huelle { max-width: 640px; margin: 0 auto; }

.gitter {
  display: grid;
  grid-template-columns: repeat(var(--spalten), 1fr);
  gap: 2px;
  width: 100%;
}

.zelle {
  position: relative;
  aspect-ratio: 1;
  background: var(--pult);
  border: 1px solid var(--kante);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.zelle.leer {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.zellnummer {
  position: absolute;
  top: 1px;
  left: 2px;
  font-family: 'Azeret Mono', monospace;
  font-size: var(--nummerschrift, 9px);
  font-weight: 400;
  color: var(--gedaempft);
  line-height: 1;
  pointer-events: none;
}

.zellbuchstabe {
  font-family: 'Azeret Mono', monospace;
  font-size: var(--zellschrift, 18px);
  font-weight: 400;
  color: var(--papier);
  line-height: 1;
  pointer-events: none;
}


.zelle.gefuellt .zellbuchstabe { color: var(--papier); }

.zelle.wortaktiv { background: var(--pult-hell); }

.zelle.feldaktiv {
  outline: 2px solid var(--messing);
  outline-offset: -2px;
  z-index: 2;
}

.zelle.falsch .zellbuchstabe { color: var(--rost); }
.zelle.falsch::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: linear-gradient(to top right,
    transparent calc(50% - 0.6px), var(--rost) calc(50% - 0.6px),
    var(--rost) calc(50% + 0.6px), transparent calc(50% + 0.6px));
  pointer-events: none;
}
.zelle.geloest .zellbuchstabe { color: var(--salbei); font-weight: 600; }
.zelle.geloest::before {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--salbei);
  pointer-events: none;
}

#tastaturfang {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  padding: 0;
  pointer-events: none;
}


.aktiv-leiste {
  margin: 20px auto 0;
  max-width: 640px;
  padding: 13px 15px;
  background: var(--pult);
  border-left: 2px solid var(--messing);
}

.aktiv-nummer {
  margin: 0 0 3px;
  font-family: 'Azeret Mono', monospace;
  font-size: 12px;
  color: var(--gedaempft);
}

.aktiv-text { margin: 0; font-size: 18px; }

.werkzeuge {
  display: flex;
  gap: 9px;
  margin: 16px auto 0;
  max-width: 640px;
}

.werkzeuge button {
  font-family: 'Newsreader', serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--papier);
  background: var(--pult);
  border: 1px solid var(--kante);
  border-radius: 2px;
  padding: 10px 17px;
  cursor: pointer;
}

.werkzeuge button:hover:not(:disabled) { border-color: var(--messing); color: var(--messing); }
.werkzeuge button:disabled { opacity: 0.4; cursor: default; }


.hinweis-spalte section { margin-bottom: 28px; }

.hinweis-spalte h2 {
  margin: 0 0 11px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--kante);
  font-size: 15px;
  font-weight: 400;
  color: var(--gedaempft);
}

.hinweisliste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hinweisliste li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 9px;
  align-items: baseline;
  padding: 6px 7px 6px 3px;
  cursor: pointer;
  border-left: 2px solid transparent;
  font-size: 16px;
}

.hinweisliste li:hover { background: var(--pult); }

.hinweisliste li.aktiv {
  background: var(--pult-hell);
  border-left-color: var(--messing);
}

.hinweisliste li.fertig .hinweis-text {
  color: var(--gedaempft);
  text-decoration: line-through;
  text-decoration-color: var(--salbei);
}

.hinweis-nummer {
  font-family: 'Azeret Mono', monospace;
  font-size: 12px;
  color: var(--gedaempft);
}

.hinweis-stufen {
  font-size: 11px;
  color: var(--messing);
  letter-spacing: 1px;
}


@media (max-width: 860px) {
  .buehne {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 16px 12px 36px;
  }
  .aktiv-text { font-size: 17px; }
  h1 { font-size: 46px; }
  body { font-size: 16px; }

  .aktiv-leiste {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 14px;
    background: var(--pult);
    border-top: 1px solid var(--kante);
  }
}


@media (max-width: 600px) {
  .leiste {
    padding: 10px 12px;
    font-size: 14px;
    gap: 10px;
  }
  .leiste-links, .leiste-rechts { gap: 9px; }
  #fortschritt { white-space: nowrap; }
  .nur-breit { display: none; }

  .zellnummer + .zellbuchstabe { transform: translate(10%, 12%); }

  .werkzeuge button { flex: 1; padding: 12px 10px; }
}

.aktiv-leiste.ueber-tastatur {
  position: fixed;
  left: 0;
  right: 0;
  bottom: auto;
  max-width: none;
  margin: 0;
  z-index: 30;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
}


:focus-visible {
  outline: 2px solid var(--messing);
  outline-offset: 2px;
}

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


.quellenhinweis {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--gedaempft);
  max-width: 42ch;
}

.fussnote {
  margin: 34px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--kante);
  font-size: 13px;
  line-height: 1.65;
  color: var(--gedaempft);
  max-width: 48ch;
}

.fussnote .text-knopf { font-size: 13px; }

.haupt-knopf:disabled { opacity: 0.45; cursor: default; }

.zellversuch {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-family: 'Azeret Mono', monospace;
  font-size: var(--nummerschrift, 9px);
  line-height: 1;
  color: var(--rost);
  pointer-events: none;
}

.zelle.aufgeloest { cursor: default; }

.zelle.war-falsch {
  background: rgba(180, 82, 47, 0.16);
  border-color: rgba(180, 82, 47, 0.5);
}

.zelle.war-leer .zellbuchstabe { color: var(--gedaempft); }

.hinweis-antwort {
  grid-column: 2 / -1;
  font-family: 'Azeret Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  padding-top: 2px;
}

.hinweisliste li.war-richtig { border-left-color: var(--salbei); }
.hinweisliste li.war-richtig .hinweis-antwort { color: var(--salbei); }

.hinweisliste li.war-falsch { border-left-color: var(--rost); }
.hinweisliste li.war-falsch .hinweis-antwort { color: var(--rost); }


.ende-knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.zweit-knopf {
  font-family: 'Newsreader', serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--papier);
  background: transparent;
  border: 1px solid var(--kante);
  border-radius: 2px;
  padding: 13px 22px;
  cursor: pointer;
}

.zweit-knopf:hover { border-color: var(--messing); color: var(--messing); }
