/* Aussehen der Chinesisch-App (Projekt 35).
   Nur Systemschriften: Android und iPhone bringen chinesische Zeichen mit. */

:root {
  --grund: #12261a;      /* dunkles Waldgrün als Hintergrund */
  --karte: #1f3d2b;      /* Karten */
  --hell: #eaf4ec;       /* Text */
  --matt: #9fbfa8;       /* Nebentext */
  --gruen: #4cc073;      /* richtig */
  --rot: #e0605a;        /* falsch */
  --gold: #f3c34d;       /* Punkte */
  --cn: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

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

html, body {
  margin: 0; height: 100%;
  background: var(--grund); color: var(--hell);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;   /* kein "Gummiband" beim Wischen */
}

/* Am PC/Tablet nicht über die ganze Breite ziehen, sondern Handy-Breite in der Mitte */
body { display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }

/* ---------- Kopfzeile ---------- */
#kopf {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 4px 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 6px;
  font-size: 15px; font-weight: 600;
}
#punkte { color: var(--gold); }
/* Symbole in der Kopfzeile sind antippbar (Erklär-Blase) */
#kopf [role=button] { cursor: pointer; padding: 4px 2px; }
/* Tagesziel-Balken: größere Tippfläche, Balken selbst bleibt dünn */
#tagesziel { flex-basis: 100%; height: 6px; background: #ffffff1a; border-radius: 3px; overflow: hidden;
             background-clip: content-box; padding: 6px 0; box-sizing: content-box; }

/* Erklär-Blase unter der Kopfzeile */
#erklaerung {
  position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(92vw, 480px); z-index: 8;
  background: #2b5239; color: var(--hell); border-radius: 14px; padding: 12px 14px;
  font-size: 15px; line-height: 1.45; box-shadow: 0 8px 24px #000a; border: 1px solid #ffffff40;
  animation: blase .2s ease-out;
}
#erklaerung b { font-size: 16px; }
@keyframes blase { from { opacity: 0; transform: translate(-50%, -8px); } }
#tagesziel-balken { height: 100%; width: 0; background: var(--gruen); transition: width .4s; }

/* ---------- Seiten ---------- */
main { flex: 1; overflow: hidden; position: relative; }
.seite { display: none; height: 100%; overflow-y: auto; padding: 12px 14px 20px; }
.seite.aktiv { display: block; }
#seite-ueben { overflow: hidden; }

/* ---------- Untere Leiste ---------- */
#leiste {
  display: flex; background: #0c1a11; padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #ffffff14;
}
#leiste button {
  flex: 1; background: none; border: 0; color: var(--matt); font-size: 22px;
  padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
#leiste button span { font-size: 12px; }
#leiste button.aktiv { color: var(--hell); }

/* ---------- Karten im Feed ---------- */
#feed { height: 100%; position: relative; }
.karte {
  position: absolute; inset: 0;
  background: var(--karte); border-radius: 22px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; box-shadow: 0 10px 30px #0006;
  animation: rein .35s ease-out;
}
.karte.raus { animation: raus .3s ease-in forwards; }
@keyframes rein { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes raus { to { transform: translateY(-70%); opacity: 0; } }

.chip { position: absolute; top: 14px; left: 14px; font-size: 12px; padding: 3px 10px;
        border-radius: 99px; background: #ffffff1a; color: var(--matt); }
.combo { position: absolute; top: 14px; right: 14px; font-size: 13px; color: var(--gold); font-weight: 700; }

.zh { font-family: var(--cn); font-size: 64px; line-height: 1.15; font-weight: 500; }
.zh.lang { font-size: 40px; }
.py { font-size: 22px; color: var(--gold); }
.de { font-size: 19px; }
.bsp { font-size: 16px; color: var(--matt); font-family: var(--cn); }
.frage { font-size: 18px; color: var(--matt); }
.versteckt { visibility: hidden; }

.knopf {
  border: 0; border-radius: 14px; padding: 13px 18px; font-size: 17px; font-weight: 600;
  background: #ffffff1f; color: var(--hell); min-width: 120px;
}
.knopf:active { transform: scale(.97); }
.knopf.haupt { background: var(--gruen); color: #08200f; }
.knopf.gross { font-size: 44px; padding: 18px 30px; border-radius: 50%; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.optionen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; }
.optionen .knopf { min-width: 0; font-size: 16px; padding: 14px 8px; }
.optionen .knopf.richtig { background: var(--gruen); color: #08200f; }
.optionen .knopf.falsch { background: var(--rot); }

.weiter-hinweis { position: absolute; bottom: 12px; font-size: 13px; color: var(--matt); animation: wippen 1.4s infinite; }
@keyframes wippen { 50% { transform: translateY(-5px); } }

/* ---------- Garten ---------- */
.beet {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px;
  background: linear-gradient(#2c5a39, #23472e); border-radius: 18px; padding: 12px; min-height: 120px;
  font-size: 30px; text-align: center;
}
.beet .baum { font-size: 44px; grid-column: span 2; grid-row: span 2; display: flex; align-items: end; justify-content: center; }
.beet .welk { filter: grayscale(.8) brightness(.8); transform: rotate(18deg); }
.beet .tot { opacity: .5; }
.beet .neu { animation: spriessen .8s ease-out; }
@keyframes spriessen { from { transform: scale(0) translateY(20px); } 70% { transform: scale(1.3); } }
.hinweis { background: #ffffff12; border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.hinweis.warnung { background: #e0605a33; }
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vergleich h3 { margin: 6px 0; font-size: 16px; }
/* Rangliste der Mitspieler */
.rangliste { width: 100%; border-collapse: collapse; font-size: 14px; }
.rangliste td { padding: 6px 4px; border-bottom: 1px solid #ffffff14; white-space: nowrap; }
.rangliste tr.ich { background: #4cc07326; font-weight: 700; }
.knopf.klein { min-width: 0; padding: 6px 10px; font-size: 13px; margin-top: 6px; }
/* Lautschrift (IPA) unter dem Pinyin */
.ipa { font-size: 18px; color: var(--matt); font-family: "Segoe UI", Roboto, "Noto Sans", "Arial Unicode MS", sans-serif; }
.legende td { padding: 3px 6px; vertical-align: top; font-size: 14px; }
.legende td:first-child { font-size: 17px; white-space: nowrap; color: var(--gold); }

h2 { font-size: 20px; margin: 14px 0 8px; }
textarea, input[type=text] {
  width: 100%; background: #0c1a11; color: var(--hell); border: 1px solid #ffffff2a;
  border-radius: 10px; padding: 10px; font-size: 15px; font-family: inherit;
}
textarea { font-family: monospace; }
[hidden] { display: none !important; }
.fortschritt { height: 8px; background: #ffffff1a; border-radius: 4px; overflow: hidden; margin: 4px 0 10px; }
.fortschritt div { height: 100%; background: var(--gruen); }
.stufe-zeile { display: flex; justify-content: space-between; font-size: 15px; }

/* ---------- Preis-Spiel ---------- */
.anzeige { font-size: 44px; text-align: center; min-height: 56px; letter-spacing: 2px; }
.ziffern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.ziffern .knopf { min-width: 0; font-size: 24px; }

/* ---------- Meldung ---------- */
#toast {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%, 0);
  font-size: 28px; font-weight: 800; color: var(--gold); pointer-events: none; opacity: 0;
  text-shadow: 0 2px 10px #000a; text-align: center; white-space: nowrap;
}
#toast.zeigen { animation: aufsteigen 1.3s ease-out; }
@keyframes aufsteigen { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); }
                        20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
                        100% { opacity: 0; transform: translate(-50%, -60px); } }
/* Längere Meldungen: umbrechen, im Bild bleiben, ruhig stehen (2,8 s) */
#toast.lang {
  white-space: normal; width: max-content; max-width: min(88vw, 460px);
  font-size: 20px; font-weight: 700; line-height: 1.35; padding: 12px 16px;
  background: #0c1a11e6; border: 1px solid #ffffff30; border-radius: 14px;
  animation: stehen 2.8s ease-out; z-index: 10;
}
@keyframes stehen { 0% { opacity: 0; transform: translate(-50%, 10px); }
                    8%, 85% { opacity: 1; transform: translate(-50%, 0); }
                    100% { opacity: 0; transform: translate(-50%, -10px); } }

/* Name beim ersten Start */
.dialog { position: fixed; inset: 0; background: #000c; display: flex; align-items: center; justify-content: center; z-index: 9; padding: 20px; }
.dialog > div { background: var(--karte); border-radius: 18px; padding: 20px; max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
