/* Spiele-Station – gemeinsames Grundlayout für alle Spiele
   Zielgerät: Fire HD 10 im Kiosk (CSS-Viewport ca. 960x600) + PC
   Regeln: keine festen Pixelbretter (SVG-viewBox), Trefferflächen >= 44px,
           keine langen Animationen (Silk-Latenz). */

:root {
  --bg:        #131a24;
  --bg-tief:   #0d1219;
  --panel:     #1c2735;
  --panel-hell:#26344a;
  --linie:     #35465e;
  --text:      #eaf0f8;
  --text-matt: #9aabc2;
  --akzent:    #ffb347;
  --akzent-2:  #4fd18b;
  --warn:      #ff7a6b;

  /* Spielfarben – jede Kachel bekommt eine, damit die Station bei mehreren
     Spielen sofort lesbar bleibt */
  --c-insel:   #2f9e6b;
  --c-lauf:    #e8734a;
  --c-moehre:  #e8912a;
  --c-wuerfel: #d6a83c;
  --c-legen:   #b07cd6;
  --c-sammeln: #4f9ed1;

  --r: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  touch-action: manipulation;
}

#app { display: flex; flex-direction: column; min-height: 100%; }

/* ---------- Kopf / Fuß ---------- */

#kopf, #buehne-kopf {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--bg-tief);
  border-bottom: 1px solid var(--linie);
  min-height: 56px;
}
#kopf h1 { font-size: 22px; margin: 0; flex: 1; letter-spacing: .5px; }
#buehne-titel { font-size: 20px; margin: 0; flex: 1; text-align: center; }
#buehne-rechts, #kopf-rechts { min-width: 96px; display: flex; justify-content: flex-end; gap: 8px; }

.kopf-btn {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--linie); border-radius: 10px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  font-size: 16px; cursor: pointer;
}
.kopf-btn:active { background: var(--panel-hell); }

#fuss {
  padding: 10px 16px; color: var(--text-matt); font-size: 13px;
  border-top: 1px solid var(--linie);
}

/* ---------- Menü mit Spiele-Kacheln ---------- */

#menue {
  flex: 1;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-content: start;
}

.kachel {
  background: var(--panel);
  border: 1px solid var(--linie);
  border-left: 6px solid var(--kf, var(--akzent));
  border-radius: var(--r);
  padding: 16px;
  min-height: 104px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; text-align: left;
  color: var(--text); font: inherit;
}
.kachel:active { background: var(--panel-hell); }
.kachel .em { font-size: 40px; line-height: 1; }
.kachel .txt { flex: 1; min-width: 0; }
.kachel .nm { font-size: 20px; font-weight: 600; }
.kachel .ut { font-size: 14px; color: var(--text-matt); margin-top: 3px; }
.kachel .marke {
  font-size: 12px; color: var(--bg-tief); background: var(--akzent-2);
  border-radius: 999px; padding: 3px 9px; margin-top: 7px; display: inline-block;
  font-weight: 600;
}

.hinweis { color: var(--text-matt); grid-column: 1/-1; padding: 8px 2px; }

/* ---------- Bühne ---------- */

#buehne {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column;
}
#buehne[hidden] { display: none; }
#buehne-body { flex: 1; padding: 12px; overflow: auto; }

.fb {
  padding: 10px 16px; min-height: 44px;
  background: var(--bg-tief); border-top: 1px solid var(--linie);
  font-size: 17px; display: flex; align-items: center;
}
.fb.gut  { color: var(--akzent-2); }
.fb.warn { color: var(--warn); }

/* ---------- Auswahl vor dem Spiel (Modus, Namen, Optionen) ---------- */

.setup { max-width: 720px; margin: 0 auto; }
.setup h3 { font-size: 17px; color: var(--text-matt); margin: 18px 0 8px; font-weight: 600; }
.wahlreihe { display: flex; flex-wrap: wrap; gap: 10px; }

.wahl {
  background: var(--panel); color: var(--text);
  border: 2px solid var(--linie); border-radius: 12px;
  min-height: 52px; padding: 8px 18px;
  font-size: 17px; cursor: pointer; font-family: inherit;
}
.wahl:active { background: var(--panel-hell); }
.wahl.an { border-color: var(--akzent); background: var(--panel-hell); }
.wahl[disabled] { opacity: .4; cursor: default; }

.gross {
  width: 100%; margin-top: 24px;
  background: var(--akzent); color: #241a06;
  border: 0; border-radius: 12px;
  min-height: 60px; font-size: 21px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.gross:active { filter: brightness(.92); }
.gross.zweit { background: var(--panel); color: var(--text); border: 1px solid var(--linie); }

/* ---------- Abschluss ---------- */

.ende { max-width: 620px; margin: 6vh auto 0; text-align: center; }
.ende .em  { font-size: 72px; }
.ende .tit { font-size: 30px; font-weight: 700; margin: 10px 0; }
.ende .txt { font-size: 18px; color: var(--text-matt); }

/* ---------- Statistik ---------- */

.stat-zeile {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--linie); border-radius: 10px; margin-bottom: 8px;
  font-size: 17px;
}

@media (max-width: 700px) {
  #kopf h1 { font-size: 18px; }
  #menue { grid-template-columns: 1fr; padding: 12px; }
}
