/* GLAD-O-POLIS 2.0 — Seitengerüst.
   Desktop ab 1000 px: Brett links, Leiste rechts. Darunter: Brett oben über
   die volle Breite, Leiste darunter, und eine Zeile mit dem Spieler am Zug
   und den wichtigsten Knöpfen, die immer sichtbar bleibt. */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--papier);
  color: var(--blau);
  font-family: var(--schrift-text);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}

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

.nur-fuer-vorlesen {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.zur-hauptsache {
  position: absolute;
  left: var(--abstand-s);
  top: -60px;
  z-index: 100;
  background: var(--blau);
  color: var(--papier-hell);
  padding: var(--abstand-s) var(--abstand-m);
  border-radius: var(--radius-s);
  font-family: var(--schrift-eng);
  font-weight: 700;
  text-decoration: none;
  transition: top 120ms;
}
.zur-hauptsache:focus { top: var(--abstand-s); }

/* ---------- Bildschirme ---------- */

/* Sichtbarkeit steht ueber allem anderen: die Bildschirme bringen eigene
   display-Werte mit, und die duerfen das Verstecken nicht aushebeln. */
.bildschirm[data-sichtbar='nein'] { display: none; }
.bildschirm[data-sichtbar='ja'] { display: block; }
.bildschirm--spiel[data-sichtbar='ja'] { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* Ab 1000 px passt alles auf einen Bildschirm: Das Brett nimmt die Hoehe, die
   uebrig bleibt, und die Leiste rollt in sich. Darunter rollt die Seite. */
@media (min-width: 1000px) {
  .bildschirm--spiel[data-sichtbar='ja'] { height: 100vh; height: 100dvh; overflow: hidden; }
  .spielraum { min-height: 0; overflow: hidden; }
  .leiste { height: 100%; }
  .leiste-rolle { flex: 1 1 auto; min-height: 0; }
}
.bildschirm--start[data-sichtbar='ja'] { display: flex; }
.ergebnis[data-sichtbar='ja'] { display: flex; }

/* ---------- Spielansicht ---------- */

.spielraum {
  display: flex;
  gap: var(--abstand-m);
  padding: var(--abstand-m);
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
}

.brettspalte {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--abstand-s);
}

.leiste {
  flex: 1 1 340px;
  min-width: 300px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--abstand-m);
  align-self: stretch;
  min-height: 0;
}

.leiste-rolle {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--abstand-m);
  padding-right: 2px;
}

.kopfzeile {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--abstand-m);
  padding: var(--abstand-s) var(--abstand-m);
  border-bottom: var(--linie);
  background: var(--papier-hell);
  flex-wrap: wrap;
}

.kopfzeile-titel {
  font-family: var(--schrift-titel);
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--blau);
  margin: 0;
}
.kopfzeile-titel span { color: var(--rot); font-size: 14px; margin-left: 4px; }

.kopfzeile-knoepfe { display: flex; gap: var(--abstand-xs); flex-wrap: wrap; }

/* ---------- Zugleiste: immer sichtbar ---------- */

.zugleiste {
  position: sticky;
  bottom: 0;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--abstand-s);
  padding: var(--abstand-s) var(--abstand-m);
  background: var(--papier-hell);
  border-top: var(--linie-kraeftig);
  flex-wrap: wrap;
}

.zugleiste-wer {
  display: flex;
  align-items: center;
  gap: var(--abstand-s);
  font-family: var(--schrift-eng);
  font-weight: 700;
  font-size: 17px;
  flex: 1 1 auto;
  min-width: 0;
}

.zugleiste-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zugleiste-stand {
  font-weight: 600;
  font-size: 14px;
  color: var(--blau-hell);
  white-space: nowrap;
}
.zugleiste-knoepfe { display: flex; gap: var(--abstand-xs); flex-wrap: wrap; }

/* ---------- Tablet und Telefon ---------- */

@media (max-width: 999px) {
  .spielraum {
    flex-direction: column;
    align-items: center;
    padding: var(--abstand-s);
    /* Platz fuer die feste Zugleiste am unteren Rand. */
    padding-bottom: calc(var(--zugleiste-hoehe, 88px) + var(--abstand-s));
    gap: var(--abstand-s);
  }
  .leiste { max-width: none; width: 100%; min-width: 0; }
  .leiste-rolle { overflow: visible; }
  .kopfzeile { padding: var(--abstand-xs) var(--abstand-s); gap: var(--abstand-s); }
  .kopfzeile-titel { font-size: 16px; }
  .kopfzeile .knopf--klein { font-size: 11px; padding: 4px 7px; letter-spacing: .02em; }

  /* `sticky` haengt am Ende des Dokuments und waere beim Start unter dem
     Bildschirmrand. Fest verankert ist die Zugleiste immer sichtbar —
     genau das verlangt spec/05-ui-und-design.md fuer Tablet und Telefon. */
  .zugleiste {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(20, 36, 61, .12);
  }
}

@media (max-width: 560px) {
  .kopfzeile-titel span { display: none; }
  .zugleiste { padding: var(--abstand-xs) var(--abstand-s); gap: var(--abstand-xs); }
  .zugleiste-wer { font-size: 15px; flex-basis: 100%; }
  .zugleiste .knopf--klein, .zugleiste .knopf--haupt { font-size: 13px; padding: 6px 10px; }
  .beraet { font-size: 12px; flex-basis: 100%; }
}

/* ---------- Startbildschirm ---------- */

.start {
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: var(--abstand-m);
}

.start-deckel {
  width: 100%;
  max-width: 820px;
  border: 3px solid var(--blau);
  border-radius: var(--radius-s);
  background: var(--papier);
  padding: var(--abstand-l) var(--abstand-l) var(--abstand-m);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--abstand-m);
}

.start-ueberzeile {
  font-family: var(--schrift-eng);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--messing-dunkel);
  text-align: center;
}

.start-titel { display: flex; align-items: flex-start; justify-content: center; gap: 14px; }
.start-titel-haupt {
  font-family: var(--schrift-titel);
  font-size: clamp(34px, 8vw, 62px);
  line-height: .98;
  letter-spacing: -.025em;
  color: var(--blau);
}
.start-titel-zwei {
  font-family: var(--schrift-titel);
  font-size: clamp(20px, 4.4vw, 34px);
  line-height: 1;
  color: var(--rot);
  margin-top: 6px;
}

.start-unterzeile {
  font-family: var(--schrift-eng);
  font-weight: 600;
  font-size: clamp(12px, 2.4vw, 18px);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blau-hell);
  text-align: center;
}

.start-spruch {
  font-family: var(--schrift-text);
  font-style: italic;
  font-size: clamp(16px, 3vw, 23px);
  color: var(--rot);
  text-align: center;
}

.start-fuss {
  width: 100%;
  border-top: 1.5px solid var(--papier-linie);
  padding-top: var(--abstand-s);
  font-family: var(--schrift-text);
  font-size: 12px;
  line-height: 1.6;
  color: var(--messing-dunkel);
  text-align: center;
}
.start-fuss a { color: var(--rot); }
.start-fuss a:hover { color: var(--rot-dunkel); }

/* Ein Link, der wie ein Knopf aussieht, muss sich auch so verhalten. */
a.knopf { text-decoration: none; display: inline-flex; align-items: center; }

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

.ergebnis {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--abstand-l) var(--abstand-m);
  justify-content: center;
}
.ergebnis-blatt { width: 100%; max-width: 860px; }
