/* Spielgeraet. Alles grosszuegig dimensioniert - die Station wird von
   Kindern und von Menschen mit Lesebrille bedient. */

/* Nichts scrollt: alle Bildschirme sind fixiert. Verhindert, dass ein
   Wisch die Ansicht verschiebt, waehrend jemand auf eine Antwort tippt. */
body {
  overflow: hidden;
  touch-action: manipulation;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  padding: clamp(18px, 4vw, 44px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.screen.aktiv {
  display: flex;
  opacity: 1;
}

/* ------------------------------------------------------------ Start */

.start-inhalt {
  margin: auto;
  text-align: center;
  max-width: 640px;
  animation: hoch 0.5s ease both;
}

.kreuz {
  font-size: 44px;
  color: var(--gold);
  opacity: 0.75;
  margin-bottom: 10px;
}

.oberzeile {
  margin: 0 0 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(12px, 1.6vw, 15px);
  color: var(--text-leise);
  font-weight: 700;
}

.titel {
  font-size: clamp(34px, 7.5vw, 62px);
  line-height: 1.08;
  margin-bottom: 18px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.unterzeile {
  color: var(--text-leise);
  font-size: clamp(15px, 2.2vw, 19px);
  margin: 0 0 38px;
}

.knopf.gross {
  font-size: clamp(20px, 3vw, 26px);
  padding: 22px 56px;
}

.puls {
  animation: puls 2.6s ease-in-out infinite;
}

@keyframes puls {
  0%, 100% { box-shadow: 0 8px 26px rgba(245, 196, 81, 0.3); }
  50%      { box-shadow: 0 8px 46px rgba(245, 196, 81, 0.62); }
}

@keyframes hoch {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.hinweis-klein {
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-leise);
  opacity: 0.7;
}

.text-leise {
  color: var(--text-leise);
}

/* ------------------------------------------------------------- Name */

.name-inhalt {
  margin: auto;
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.name-inhalt h2 {
  font-size: clamp(28px, 5vw, 40px);
  margin-bottom: 10px;
}

#feld-name {
  width: 100%;
  margin-top: 26px;
  padding: 22px 24px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#feld-name:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(245, 196, 81, 0.16);
}

#feld-name::placeholder {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 500;
}

.fehler {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--falsch);
  font-weight: 600;
  font-size: 15px;
}

.name-knoepfe {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------- Countdown */

#s-countdown {
  align-items: center;
  justify-content: center;
}

.countdown-zahl {
  font-size: clamp(120px, 30vw, 260px);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 70px rgba(245, 196, 81, 0.5);
  animation: knall 0.9s ease-out;
}

@keyframes knall {
  0%   { transform: scale(2.1); opacity: 0; }
  30%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.86); opacity: 0.15; }
}

/* ------------------------------------------------------------ Frage */

.kopf {
  flex: 0 0 auto;
}

.fortschritt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-leise);
  font-weight: 600;
  margin-bottom: 10px;
}

.punkte-anzeige {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.punkte-anzeige > span:last-of-type {
  color: var(--gold);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.punkte-anzeige small {
  font-size: 13px;
  margin-left: 4px;
}

.streak {
  background: rgba(245, 196, 81, 0.16);
  border: 1px solid rgba(245, 196, 81, 0.4);
  color: var(--gold-hell);
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 14px;
  animation: hoch 0.3s ease;
}

.timerbahn {
  height: 12px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  overflow: hidden;
}

.timerbalken {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--richtig), #8de0a8);
  transform-origin: left center;
}

.timerbalken.warnung {
  background: linear-gradient(90deg, var(--gold), var(--gold-hell));
}

.timerbalken.kritisch {
  background: linear-gradient(90deg, var(--falsch), #ff8b84);
  animation: blinken 0.5s steps(2) infinite;
}

@keyframes blinken {
  50% { opacity: 0.45; }
}

.frage-koerper {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2.5vh, 26px);
  min-height: 0;
  padding: clamp(12px, 3vh, 28px) 0;
}

.schwierigkeit {
  align-self: center;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
}

.schwierigkeit.leicht  { background: rgba(52, 209, 122, 0.16); color: #7fe6ac; }
.schwierigkeit.mittel  { background: rgba(110, 168, 255, 0.16); color: #9dc4ff; }
.schwierigkeit.schwer  { background: rgba(229, 88, 77, 0.18);  color: #ff9c94; }

.frage-text {
  text-align: center;
  font-size: clamp(22px, 4.2vw, 40px);
  line-height: 1.22;
  max-width: 900px;
  margin: 0 auto;
  animation: hoch 0.35s ease both;
}

.frage-bild {
  max-height: 30vh;
  max-width: min(100%, 640px);
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  object-fit: contain;
}

.optionen {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px, 1.6vw, 16px);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.optionen.einspaltig {
  grid-template-columns: 1fr;
  max-width: 620px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: clamp(74px, 11vh, 104px);
  padding: 16px 22px;
  text-align: left;
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 600;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--radius);
  transition: transform 0.14s, background 0.18s, border-color 0.18s;
  animation: einschweben 0.32s ease both;
}

@keyframes einschweben {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.option:active {
  transform: scale(0.975);
}

.option .marke {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 18px;
}

.option.richtig {
  background: rgba(52, 209, 122, 0.22);
  border-color: var(--richtig);
  animation: aufblitzen 0.5s ease;
}

.option.richtig .marke {
  background: var(--richtig);
  color: #06301a;
}

.option.falsch {
  background: rgba(229, 88, 77, 0.2);
  border-color: var(--falsch);
  animation: wackeln 0.4s ease;
}

.option.falsch .marke {
  background: var(--falsch);
  color: #2b0503;
}

.option.blass {
  opacity: 0.35;
}

@keyframes aufblitzen {
  0%   { box-shadow: 0 0 0 0 rgba(52, 209, 122, 0.7); }
  100% { box-shadow: 0 0 0 26px rgba(52, 209, 122, 0); }
}

@keyframes wackeln {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* ------------------------------------------------------ Schaetzfrage */

.schaetzen {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.schaetz-wert {
  font-size: clamp(38px, 8vw, 62px);
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
  letter-spacing: 0.02em;
}

.schaetz-wert small {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  letter-spacing: normal;
}

.ziffernblock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.ziffer {
  padding: clamp(14px, 2.4vh, 20px);
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 800;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  transition: background 0.12s, transform 0.1s;
}

.ziffer:active {
  background: var(--flaeche-hoch);
  transform: scale(0.94);
}

.schaetz-ok {
  width: 100%;
}

/* -------------------------------------------------------- Aufloesung */

.aufloesung {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 30, 0.86);
  backdrop-filter: blur(6px);
}

.aufloesung.sichtbar {
  display: flex;
  animation: hoch 0.25s ease;
}

.aufloesung-karte {
  text-align: center;
  max-width: 620px;
}

.aufloesung-symbol {
  font-size: clamp(60px, 12vw, 100px);
  line-height: 1;
  animation: stempel 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes stempel {
  from { transform: scale(0.2) rotate(-18deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.aufloesung-titel {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  margin-top: 6px;
}

.aufloesung-punkte {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  color: var(--gold);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.aufloesung-text {
  margin-top: 16px;
  font-size: clamp(15px, 2.2vw, 20px);
  line-height: 1.5;
  color: var(--text-leise);
}

.aufloesung.ist-richtig .aufloesung-titel { color: var(--richtig); }
.aufloesung.ist-falsch .aufloesung-titel  { color: var(--falsch); }

/* ----------------------------------------------------------- Ergebnis */

.ende-inhalt {
  margin: auto;
  text-align: center;
  max-width: 620px;
  animation: hoch 0.5s ease both;
}

.ende-name {
  font-size: clamp(30px, 6vw, 48px);
  margin-bottom: 6px;
}

.ende-punkte {
  margin: 14px 0 26px;
}

.ende-punkte span {
  font-size: clamp(56px, 13vw, 104px);
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 60px rgba(245, 196, 81, 0.4);
}

.ende-punkte small {
  display: block;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--text-leise);
  margin-top: 6px;
}

.ende-zeilen {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 34px);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.ende-zeilen div {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  padding: 14px 20px;
  min-width: 108px;
}

.ende-zeilen b {
  display: block;
  font-size: clamp(20px, 3.4vw, 28px);
}

.ende-zeilen span {
  font-size: 12px;
  color: var(--text-leise);
}

.ende-spruch {
  font-size: clamp(17px, 2.6vw, 21px);
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--gold-hell);
}

/* -------------------------------------------------------- Verbindung */

.verbindung {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--falsch);
  color: #fff;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--schatten);
}

/* Schmale Hochkant-Geraete: Antworten untereinander */
@media (max-width: 560px) {
  .optionen {
    grid-template-columns: 1fr;
  }
}
