/* Deutsch-Trainer - Metzgerei Wiersch
   Mobile first. Alles muss mit Arbeitshänden auf einem Handy bedienbar sein:
   grosse Flächen, viel Abstand, keine filigranen Ziele. */

:root {
  --gruen:        #4A7C3F;
  --gruen-dunkel: #3A6231;
  --gruen-hell:   #E6EFE1;
  --beige:        #F5EFE3;
  --sand:         #D9C7A7;
  --sand-hell:    #EFE6D4;
  --weiss:        #FDFBF6;
  --text:         #2E2A24;
  --text-hell:    #6B6355;
  --rot:          #B4483C;
  --rot-hell:     #F7E4E1;
  --gelb:         #C68A1E;
  --gelb-hell:    #FBF0DA;
  --blau:         #3D6E8F;
  --blau-hell:    #E3EDF3;
  --radius:       14px;
  --schatten:     0 2px 10px rgba(46, 42, 36, .08);
}

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

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--beige);
  padding-bottom: 48px;
}

/* ---------------------------------------------------------- Kopfzeile */

header.top {
  background: var(--gruen);
  color: var(--weiss);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
header.top a.back {
  color: var(--weiss); text-decoration: none;
  font-size: 28px; line-height: 1; padding: 0 6px;
}
header.top .titel { font-weight: 700; font-size: 19px; flex: 1; }
header.top .user  { font-size: 15px; opacity: .92; white-space: nowrap; }
header.top .user a { color: var(--weiss); text-decoration: none; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* ---------------------------------------------------------- Bausteine */

h1 { font-size: 24px; margin: 4px 0 14px; }
h2 { font-size: 20px; margin: 26px 0 12px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
p  { margin: 0 0 12px; }

.karte {
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--schatten);
}
.karte.gruen { background: var(--gruen-hell); }
.karte.sand  { background: var(--sand-hell); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gruen); color: var(--weiss);
  border: none; border-radius: var(--radius);
  padding: 15px 22px;
  font-size: 17px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  min-height: 52px;
}
.knopf:active { background: var(--gruen-dunkel); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.breit { width: 100%; }
.knopf.zweit { background: var(--sand); color: var(--text); }
.knopf.stumm { background: transparent; color: var(--gruen); border: 2px solid var(--sand); }
.knopf.klein { padding: 9px 14px; font-size: 15px; min-height: 40px; }
.knopf.rot   { background: var(--rot); }

.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; }
.knopfreihe .knopf { flex: 1; min-width: 130px; }

.meldung {
  padding: 13px 16px; border-radius: var(--radius);
  margin-bottom: 14px; font-size: 16px;
}
.meldung.error { background: var(--rot-hell); color: var(--rot); }
.meldung.ok    { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.meldung.info  { background: var(--blau-hell); color: var(--blau); }
.versteckt { display: none !important; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 14px;
  border: 2px solid var(--sand); border-radius: var(--radius);
  font-size: 17px; font-family: inherit; background: var(--weiss); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gruen);
}
input[type=range] { width: 100%; accent-color: var(--gruen); height: 38px; }

.klein     { font-size: 14px; }
.hell      { color: var(--text-hell); }
.mitte     { text-align: center; }
.vi        { color: var(--blau); font-style: italic; }
.dick      { font-weight: 700; }

/* ---------------------------------------------------------- Kacheln */

.kacheln {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.kachel {
  background: var(--weiss); border-radius: var(--radius);
  padding: 16px 14px; text-decoration: none; color: var(--text);
  box-shadow: var(--schatten); display: block;
  border: 2px solid transparent;
}
.kachel:active { border-color: var(--gruen); }
.kachel .emoji { font-size: 30px; display: block; margin-bottom: 6px; }
.kachel .name  { font-weight: 700; font-size: 16px; line-height: 1.3; }
.kachel .unter { font-size: 13px; color: var(--text-hell); margin-top: 4px; }
.kachel .zahl  { font-size: 13px; color: var(--gruen); font-weight: 600; margin-top: 6px; }

@media (min-width: 620px) {
  .kacheln { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------- Balken */

.balken {
  background: var(--sand-hell); border-radius: 10px;
  height: 10px; overflow: hidden; margin-top: 6px;
}
.balken > i { display: block; height: 100%; background: var(--gruen); border-radius: 10px; }
.balken.duenn { height: 6px; }

.werte { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wert {
  background: var(--weiss); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--schatten); text-align: center;
}
.wert .zahl  { font-size: 27px; font-weight: 700; color: var(--gruen); line-height: 1.2; }
.wert .name  { font-size: 13px; color: var(--text-hell); }
@media (min-width: 520px) { .werte { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------- Lernkarte */

.lernkarte {
  background: var(--weiss); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: var(--schatten); margin-bottom: 14px;
}
.lernkarte .wort {
  font-size: 28px; font-weight: 700; line-height: 1.25; margin-bottom: 2px;
}
.lernkarte .wort .artikel { color: var(--gruen); }
.lernkarte .lautschrift {
  font-size: 16px; color: var(--gelb); font-weight: 600; margin-bottom: 12px;
}
.lernkarte .zeile { margin: 9px 0; font-size: 16px; }
.lernkarte .zeile .marke {
  display: inline-block; min-width: 92px;
  font-size: 13px; color: var(--text-hell); font-weight: 600;
}
.lernkarte .beispiel {
  background: var(--gruen-hell); border-radius: 10px;
  padding: 11px 13px; margin-top: 12px;
}
.lernkarte .merk {
  background: var(--gelb-hell); border-radius: 10px;
  padding: 11px 13px; margin-top: 10px; font-size: 15px;
}
.boxmarke {
  display: inline-block; background: var(--sand-hell); color: var(--text-hell);
  border-radius: 20px; padding: 3px 11px; font-size: 13px; font-weight: 600;
}
.boxmarke.sitzt { background: var(--gruen-hell); color: var(--gruen-dunkel); }

/* ---------------------------------------------------------- Abfrage */

.antwort {
  display: block; width: 100%; text-align: left;
  background: var(--weiss); border: 2px solid var(--sand);
  border-radius: var(--radius); padding: 15px;
  font-size: 17px; font-family: inherit; color: var(--text);
  margin-bottom: 10px; cursor: pointer; min-height: 54px;
}
.antwort:active { border-color: var(--gruen); }
.antwort.richtig { background: var(--gruen-hell); border-color: var(--gruen); font-weight: 600; }
.antwort.falsch  { background: var(--rot-hell); border-color: var(--rot); }
.antwort:disabled { cursor: default; }

.frage { font-size: 19px; font-weight: 600; margin-bottom: 14px; line-height: 1.4; }
.zaehler { font-size: 14px; color: var(--text-hell); margin-bottom: 10px; }

/* ---------------------------------------------------------- Chat */

.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.blase {
  max-width: 84%; padding: 12px 15px; border-radius: 18px;
  font-size: 17px; line-height: 1.45;
}
.blase.andere { background: var(--weiss); align-self: flex-start; border-bottom-left-radius: 5px;
                box-shadow: var(--schatten); }
.blase.ich    { background: var(--gruen); color: var(--weiss); align-self: flex-end;
                border-bottom-right-radius: 5px; }
.blase .vi    { color: var(--blau); font-size: 15px; display: block; margin-top: 6px; }
.korrektur {
  background: var(--gelb-hell); border-left: 4px solid var(--gelb);
  padding: 11px 14px; border-radius: 8px; font-size: 15px; margin: 4px 0 4px 0;
}
.vorschlag {
  background: var(--sand-hell); border: none; border-radius: 20px;
  padding: 10px 15px; font-size: 15px; font-family: inherit; color: var(--text);
  cursor: pointer; margin: 0 6px 6px 0;
}
.vorschlag:active { background: var(--sand); }

/* ---------------------------------------------------------- Sprechen */

.mikro {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--gruen); color: var(--weiss); border: none;
  font-size: 40px; cursor: pointer; box-shadow: var(--schatten);
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.mikro.laeuft { background: var(--rot); animation: pulsieren 1.2s infinite; }
@keyframes pulsieren {
  0%   { box-shadow: 0 0 0 0 rgba(180, 72, 60, .5); }
  70%  { box-shadow: 0 0 0 22px rgba(180, 72, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 72, 60, 0); }
}
.hoerknopf {
  background: var(--sand-hell); border: none; border-radius: 50%;
  width: 46px; height: 46px; font-size: 22px; cursor: pointer; flex: none;
}
.hoerknopf:active { background: var(--sand); }
.satzzeile { display: flex; align-items: center; gap: 12px; }
.satzzeile .satz { flex: 1; font-size: 20px; font-weight: 600; line-height: 1.35; }

.treffer { font-size: 46px; font-weight: 700; text-align: center; line-height: 1.1; }
.treffer.gut  { color: var(--gruen); }
.treffer.mies { color: var(--gelb); }

/* ---------------------------------------------------------- Chef */

.tage { display: flex; gap: 3px; flex-wrap: wrap; margin: 10px 0; }
.tag {
  width: 15px; height: 15px; border-radius: 3px; background: var(--sand-hell);
}
.tag.s1 { background: #C8DCC0; }
.tag.s2 { background: #93BC85; }
.tag.s3 { background: #669B56; }
.tag.s4 { background: var(--gruen-dunkel); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--sand-hell); }
th { font-size: 13px; color: var(--text-hell); font-weight: 600; }
td.rechts, th.rechts { text-align: right; }

.reihe {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sand-hell);
}
.reihe:last-child { border-bottom: none; }

/* ---------------------------------------------------------- Laden */

.laden { text-align: center; padding: 30px 16px; color: var(--text-hell); }
.laden .kreisel {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 4px solid var(--sand); border-top-color: var(--gruen);
  border-radius: 50%; animation: dreh .9s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

.leiste { position: fixed; left: 0; right: 0; bottom: 0; background: var(--weiss);
          padding: 10px 16px; box-shadow: 0 -2px 10px rgba(0,0,0,.08); z-index: 40; }
.leiste .innen { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
body.mit-leiste { padding-bottom: 92px; }
