/* Terminal-Oberfläche: Android-Tablet im Querformat, heller Kassenbereich.
   Hoher Kontrast, große Tap-Ziele, Größen an der Bildschirmhöhe ausgerichtet (die ist im Querformat knapp). */

:root {
  --text: #111;
  --grund: #fff;
  --flaeche: #eef1f5;
  --linie: #9aa3ad;
  --blau: #0b3d91;
  --gruen: #0a7a2f;
  --rot: #b00020;
  --gelb: #ffd400;
  --grau: #5b6470;
  --tap: clamp(52px, 9vh, 84px);     /* Mindesthöhe für Tap-Ziele */
  --schrift: clamp(18px, 3.2vh, 28px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: var(--schrift)/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--grund);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;  /* kein Doppeltipp-Zoom, keine Verzögerung */
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; }

button {
  font: inherit;
  font-weight: 600;
  min-height: var(--tap);
  padding: 0 1em;
  border: 3px solid var(--text);
  border-radius: 10px;
  background: var(--grund);
  color: var(--text);
  cursor: pointer;
}
button:active { transform: scale(.97); }
button:disabled { opacity: .35; }
button.gross { font-size: 1.15em; min-width: 8em; }
button.gruen { background: var(--gruen); border-color: var(--gruen); color: #fff; }
button.blau { background: var(--blau); border-color: var(--blau); color: #fff; }
button.grau { background: var(--flaeche); border-color: var(--grau); }
button.weiss { background: #fff; border-color: #fff; color: var(--text); }
.link-knopf { border: 0; background: none; text-decoration: underline; font-weight: 400; color: var(--grau); }

.knopfreihe { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.knopfreihe.umbruch { flex-wrap: wrap; }
.knopfreihe.mitte { justify-content: center; }
.knopfreihe > button { flex: 1; }

/* ---------- Kopfleiste ---------- */
#kopf {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 16px;
  background: var(--blau);
  color: #fff;
  min-height: calc(var(--tap) + 12px);
}
#kopf-standort { font-weight: 700; font-size: 1.1em; }
#kopf-status { flex: 1; display: flex; gap: 16px; align-items: center; }
#kopf-nav { display: flex; gap: 10px; }
#kopf-nav button { background: transparent; border-color: #fff; color: #fff; }
.punkt::before { content: "●"; margin-right: .3em; color: #5ee07a; }
.punkt.aus::before { color: #ff6b6b; }
#status-offen { background: var(--gelb); color: #000; padding: 2px 10px; border-radius: 6px; font-weight: 700; }

main { flex: 1; position: relative; overflow: hidden; }
.ansicht { position: absolute; inset: 0; padding: 16px; overflow: auto; }

/* ---------- Ruhezustand ---------- */
#v-ruhe { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.scan-hinweis svg { width: 22vh; height: 22vh; color: var(--blau); }
.scan-hinweis h1 { font-size: 9vh; line-height: 1.1; }
#ruhe-standort { font-size: 1.2em; color: var(--grau); margin: .2em 0; }
.offen-hinweis { background: var(--gelb); padding: .3em .8em; border-radius: 8px; font-weight: 700; }
#btn-info { position: absolute; bottom: 8px; }

/* ---------- Anzeige- und Tastaturelemente ---------- */
.anzeige {
  border: 3px solid var(--text);
  border-radius: 10px;
  min-height: var(--tap);
  padding: 0 .5em;
  display: flex;
  align-items: center;
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: .08em;
  background: #fff;
}
.kz-anzeige .platzhalter { color: var(--linie); font-weight: 400; letter-spacing: 0; }

.tastatur { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 8px; }
.tastatur button { padding: 0; min-height: clamp(44px, 8.2vh, 76px); font-size: 1.1em; border-width: 2px; }
.tastatur button.breit { grid-column: span 2; }
.tastatur.ziffern { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; margin: 0; }
.tastatur.ziffern button { font-size: 1.4em; }
.tastatur.ziffern button.breit { grid-column: auto; }

.vorschlaege { display: flex; gap: 8px; margin-top: 8px; min-height: var(--tap); }
.vorschlaege button { flex: 1; background: var(--flaeche); border-color: var(--blau); color: var(--blau); padding: 0 .3em; white-space: nowrap; overflow: hidden; }
.vorschlaege b { text-decoration: underline; }

/* ---------- Popup nach dem Scan ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.popup-inhalt {
  background: var(--grund);
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 34% 1fr;
  grid-template-rows: 1fr auto;
  gap: 12px 16px;
}
.popup-kz, .spalte-links { display: flex; flex-direction: column; min-height: 0; }
.popup-kz .tastatur, .spalte-links .tastatur { flex: 1; grid-auto-rows: 1fr; max-height: 60vh; }
.popup-kz .tastatur button, .spalte-links .tastatur button { min-height: 0; }
.popup-programme { display: flex; flex-direction: column; gap: 10px; }
.popup-programme button {
  flex: 1;
  font-size: 1.3em;
  text-align: left;
  padding: 0 .8em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-width: 3px;
  border-color: var(--linie);
  background: var(--flaeche);
}
.popup-programme button.aktiv { background: var(--blau); border-color: var(--blau); color: #fff; }
.popup-programme button.aktiv::after { content: "✓"; font-size: 1.3em; }
.popup-aktionen { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; }
.popup-aktionen button { min-height: calc(var(--tap) * 1.1); }
#pp-speichern { flex: 0 0 34%; font-size: 1.4em; }
.pp-hinweis { flex: 1; text-align: center; color: var(--rot); font-weight: 700; }

/* ---------- Bestätigung / Meldung ---------- */
.overlay.voll { background: none; }
.gruen-bg { background: var(--gruen) !important; color: #fff; }
.rot-bg { background: var(--rot) !important; color: #fff; }
.best-inhalt { text-align: center; padding: 24px; max-width: 90vw; }
.best-kz { font-size: 11vh; font-weight: 800; letter-spacing: .06em; }
.best-zeile { font-size: 6vh; font-weight: 700; margin: .2em 0; }
.best-praemie { display: inline-block; margin-top: .4em; font-size: 7vh; font-weight: 800; background: var(--gelb); color: #000; padding: .1em .6em; border-radius: 12px; }
.best-klein { margin-top: 1em; font-size: 1em; }

.frage-inhalt { background: var(--grund); padding: 24px; border-radius: 12px; max-width: 720px; width: 90vw; font-size: 1.2em; }
.info-inhalt { max-height: 90vh; overflow: auto; font-size: 1em; user-select: text; }
.meldungstext { color: var(--rot); font-weight: 700; text-align: center; }

/* ---------- Einlösen / Selbsttest: zweispaltig ---------- */
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; height: 100%; }
.spalte-rechts { overflow: auto; }
.leer { color: var(--grau); }
.stand-gross { font-size: 2.2em; font-weight: 800; }
.liste { list-style: none; padding: 0; margin: .4em 0; }
.liste li { padding: .25em 0; border-bottom: 1px solid var(--linie); }
.praemie-knopf { width: 100%; margin: 6px 0; background: var(--gelb); border-color: #000; }

.ampel { padding: .4em .7em; border-radius: 10px; font-weight: 800; font-size: 1.1em; }
.ampel.gruen { background: var(--gruen); color: #fff; }
.ampel.rot { background: var(--rot); color: #fff; }
.ampel.grau { background: var(--flaeche); color: var(--grau); }
.ampel small { display: block; font-weight: 400; font-size: .8em; margin-top: .3em; }
.roh {
  font: 16px/1.4 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  background: #111;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  min-height: 5em;
  user-select: text;
}
.roh .auffaellig { background: var(--rot); color: #fff; }
.werte { border-collapse: collapse; width: 100%; font-size: .85em; }
.werte td { padding: .2em .4em; border-bottom: 1px solid var(--flaeche); vertical-align: top; }
.werte td:first-child { color: var(--grau); white-space: nowrap; }
#st-demo button { flex: 0 0 auto; font-size: .85em; }
