/* ---------- Farben und Grundwerte als Variablen ----------
   Variablen (--name) kannst du später an einer Stelle ändern,
   und die ganze Seite passt sich an. */
:root {
  --hintergrund: #14213d;
  --text: #f4f1de;
  --text-gedimmt: #b8c0d4;
  --master: #e9a23b;   /* Orange für den Spielmaster */
  --spieler: #3fa7a0;  /* Türkis für den Spieler */
  --abstand: 20px;
}

/* Gilt für alle Elemente: Breite/Höhe inklusive Rand und Innenabstand rechnen */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;               /* mindestens so hoch wie das Fenster */
  display: flex;                   /* Spalte: Inhalt füllt den Platz, die Fußzeile rutscht ganz nach unten */
  flex-direction: column;
  background: var(--hintergrund);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

/* ---------- Startseite ---------- */
.start {
  flex: 1;                         /* füllt den Platz zwischen Seitenanfang und Fußzeile */
  display: flex;                   /* Flexbox: Inhalt in einer Spalte anordnen */
  flex-direction: column;
  justify-content: center;         /* vertikal zentrieren */
  align-items: center;             /* horizontal zentrieren */
  padding: var(--abstand);
  text-align: center;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 3.5rem);  /* wächst mit der Bildschirmbreite */
  margin: 0;
  letter-spacing: -0.02em;
}

.untertitel {
  color: var(--text-gedimmt);
  font-size: 1.2rem;
  margin: 8px 0 32px;
}

/* Die zwei Auswahlkarten nebeneinander, auf dem Handy untereinander */
.auswahl {
  display: flex;
  flex-wrap: wrap;                 /* darf umbrechen, wenn kein Platz ist */
  gap: var(--abstand);
  width: 100%;
  max-width: 640px;
}

.karte {
  flex: 1 1 260px;                 /* wachsen, schrumpfen, Wunschbreite 260px */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 24px;
  border-radius: 16px;
  text-decoration: none;           /* Link-Unterstreichung entfernen */
  color: #14213d;
  transition: transform 0.15s;     /* weiche Animation beim Hover */
}

.karte:hover,
.karte:focus-visible {
  transform: translateY(-4px);     /* Karte hebt sich leicht an */
}

.karte-titel {
  font-size: 1.6rem;
  font-weight: 700;
}

.karte-text {
  font-size: 1rem;
}

.spielmaster { background: var(--master); }
.spieler     { background: var(--spieler); }


/* =========================================================
   Spielmaster-Seite (und später auch die Spieler-Seite)
   ========================================================= */

/* Wichtig: Das Attribut "hidden" soll immer gewinnen */
[hidden] { display: none !important; }

.seite {
  width: 100%;
  flex: 1;                         /* schiebt die Fußzeile ganz nach unten */
  max-width: 560px;
  margin: 0 auto;
  padding: var(--abstand);
}

.zurueck {
  color: var(--text-gedimmt);
  text-decoration: none;
}

.seite h1 { margin: 12px 0 20px; font-size: 2rem; }
h2 { margin: 0 0 12px; font-size: 1.3rem; }

/* Abgesetzter Bereich */
.box {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: var(--abstand);
  margin-bottom: 16px;
}

.klein   { color: var(--text-gedimmt); font-size: 0.9rem; margin: 0 0 8px; }
.status  { color: var(--text-gedimmt); margin: 0; }
.fehler  { color: #ff8a80; }

/* Große Spielnummer */
.code {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  color: var(--master);
}

/* Eingabefelder */
label { display: block; margin: 12px 0 6px; color: var(--text-gedimmt); font-size: 0.9rem; }

input {
  width: 100%;
  padding: 12px;
  font: inherit;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #fff;
  color: #14213d;
}
input:focus { outline: none; border-color: var(--master); }

/* Buttons */
.reihe { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  flex: 1 1 140px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--master);
  color: #14213d;
  cursor: pointer;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ja   { background: #4caf7d; font-size: 1.3rem; }
.btn-nein { background: #e5645c; font-size: 1.3rem; }
.btn-grau { background: #8d99ae; }

#startButton { width: 100%; margin-top: 16px; }

/* Ergebnis-Balken */
.balken-zeile {
  display: grid;
  grid-template-columns: 50px 1fr 30px;   /* Text | Balken | Zahl */
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.balken { background: rgba(255, 255, 255, 0.12); border-radius: 8px; height: 28px; overflow: hidden; }
.fuellung { height: 100%; width: 0; transition: width 0.4s; }
.fuellung.ja   { background: #4caf7d; }
.fuellung.nein { background: #e5645c; }


/* =========================================================
   Spieler-Seite
   ========================================================= */
.spieler-seite input:focus { border-color: var(--spieler); }
.btn-spieler { background: var(--spieler); width: 100%; margin-top: 16px; }


/* =========================================================
   Gewählte Antwort hervorheben
   ========================================================= */
.btn-ja.gewaehlt,
.btn-nein.gewaehlt {
  box-shadow: 0 0 0 4px var(--text);   /* heller Rahmen um den gewählten Button */
}
.btn.abgewaehlt { opacity: 0.45; }     /* der andere Button wirkt blasser */
.btn.gewaehlt:disabled { opacity: 1; cursor: default; }  /* bleibt auch nach dem Schließen klar sichtbar */


/* =========================================================
   Fragenvorschläge
   ========================================================= */
.liste { list-style: none; padding: 0; margin: 12px 0 0; }
.liste li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.vorschlag-text { flex: 1 1 180px; word-break: break-word; }

.reihe-klein { display: flex; gap: 8px; }
.btn-klein { flex: none; padding: 8px 14px; font-size: 0.9rem; }

/* Nächste Frage oben beim Spielmaster */
.naechste { border-left: 4px solid var(--master); }
.naechste-frage { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }

/* Markierung beim Spieler */
.marke { font-size: 0.85rem; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.marke-offen     { background: rgba(255, 255, 255, 0.15); color: var(--text-gedimmt); }
.marke-abgelehnt { background: #e5645c; color: #fff; }
.marke-gewaehlt  { background: #4caf7d; color: #14213d; }

#sessionEndeButton { width: 100%; margin-bottom: 16px; }


/* =========================================================
   Tipp-Spiel und Punktestand
   ========================================================= */
.tipp-zeile { display: flex; gap: 10px; }
.tipp-zeile input { flex: 1 1 120px; width: auto; }
.tipp-zeile .btn,
.tipp-zeile .btn-spieler { flex: 0 0 auto; width: auto; margin-top: 0; }

.pkt-detail { display: block; font-size: 0.85rem; color: var(--text-gedimmt); }
.pkt-zahl { font-weight: 700; white-space: nowrap; }


/* Nächste Frage mit Entfernen-Button daneben */
.naechste-zeile { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.naechste-zeile .naechste-frage { flex: 1; }
.reihe-klein { align-items: center; flex-wrap: wrap; }


/* Zähler "Tipps abgegeben: 2 von 3" */
.tipp-zaehler { font-weight: 700; margin: 0 0 12px; color: var(--master); }


/* =========================================================
   Zwischenschritt "Tipps gestoppt": der eigene Tipp riesig
   ========================================================= */
.tipp-vollbild {
  min-height: 100vh;
  min-height: 100dvh;              /* auf dem Handy: ohne die wechselnde Adressleiste */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--abstand);
  background: #0e1730;
}
.tipp-vollbild-label { font-size: clamp(1.2rem, 4vw, 2rem); color: var(--text-gedimmt); margin: 0; }
.tipp-gross {
  font-size: clamp(8rem, 45vw, 24rem);   /* wächst mit der Bildschirmbreite */
  font-weight: 800;
  line-height: 1;
  margin: 0.1em 0;
  color: var(--master);
}
.spieler-seite .tipp-gross { color: var(--spieler); }
.tipp-vollbild-hinweis { color: var(--text-gedimmt); font-size: 1rem; margin: 0; }


/* =========================================================
   Fußzeile: Impressum links, Besucherzähler rechts
   ========================================================= */
.site-footer {
  display: flex;
  justify-content: space-between;  /* eins ganz links, eins ganz rechts */
  align-items: center;
  gap: 16px;
  padding: 16px var(--abstand);
  font-size: 0.85rem;
  color: var(--text-gedimmt);
}
.footer-link { color: var(--text-gedimmt); }
.footer-link:hover { color: var(--text); }

/* Spielnummer klein auf dem Button "Session beenden" */
#sessionEndeButton { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-unterzeile { font-size: 0.75rem; font-weight: 400; }