/* css/pyramide.css -- [NEUE-VERSION] Auftrag 278 (Fenster PY1): Pyramidenrechnen. Die App hat keinen Dunkelmodus, darum auch hier keinen. */
.py-wurzel {
  --py-text: var(--farbe-text, #1f2933);
  --py-leise: var(--farbe-text-leise, #5b6b7a);
  --py-karte: var(--farbe-karte, #fff);
  --py-bg: var(--farbe-bg, #eef2f6);
  --py-rand: var(--farbe-rand, #d7dee6);
  --py-akzent: var(--farbe-akzent, #2f6fb0);
  --py-gut: #18794e;          /* 5.3:1 auf Weiss */
  --py-gut-bg: #e7f6ee;
  --py-orange: #c2410c;       /* 5.2:1 auf Weiss */
  --py-orange-bg: #fff4ec;
  --py-grau: #e9edf1;
  box-sizing: border-box;
  max-width: 860px;
  margin: 0 auto;
  color: var(--py-text);
  position: relative;
}
.py-wurzel *, .py-wurzel *::before, .py-wurzel *::after { box-sizing: border-box; }
.py-blockkopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.py-titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.py-titel { margin: 0; font-size: 1.35rem; }
.py-leitsatz { margin: 8px 0 10px; color: var(--py-leise); }
.py-leise { color: var(--py-leise); font-size: .92rem; margin: 6px 0; }
.py-reiter { display: flex; gap: 6px; }
.py-reiter__knopf { flex: 0 1 140px; font-weight: 600; }
.py-wahl { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.py-gruppe__titel { font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.py-kapseln { display: flex; flex-wrap: wrap; gap: 5px; }
.py-kapsel {
  min-height: 44px; min-width: 44px; padding: 4px 10px; border: 1px solid var(--py-rand); border-radius: 22px;
  background: var(--py-karte); color: var(--py-text); font: inherit; cursor: pointer; touch-action: manipulation;
}
.py-kapsel--an { background: var(--py-akzent); border-color: var(--py-akzent); color: #fff; font-weight: 600; }
.py-kapsel:disabled { opacity: .55; cursor: default; }
.py-stand { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 8px 12px; background: var(--py-bg); border-radius: 10px; margin-bottom: 6px; }
.py-stand__zeit { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.py-stand__zahl { font-weight: 600; }
.py-stand__serie { color: var(--py-gut); font-weight: 600; }
.py-stand__best { color: var(--py-leise); font-size: .92rem; margin-left: auto; }
.py-stand__serie:empty { display: none; }
.py-meldung { font-weight: 600; color: var(--py-orange); min-height: 1.4em; margin-bottom: 6px; }
.py-info { border: 1px solid var(--py-rand); border-left: 4px solid var(--py-akzent); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; background: var(--py-karte); }
.py-info p { margin: 4px 0; }
.py-bereich { position: relative; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: flex-start; overflow: hidden; padding: 2px; }
.py-tabelle { flex: 1 1 280px; max-width: 340px; min-width: 0; }
.py-tabelle__titel { font-weight: 700; text-align: center; margin-bottom: 4px; }
.py-pyramide { display: block; width: 100%; max-width: 230px; height: auto; margin: 0 auto 8px; }
.py-pyramide--klein { width: 74px; flex: none; margin: 0; }
.py-pyramide--leuchtet { filter: drop-shadow(0 0 6px rgba(217, 158, 16, .75)); }
.py-stein { fill: var(--py-grau); stroke: #c8d0d8; stroke-width: 1; transition: fill .25s ease; }
.py-stein--voll.py-stein--r0 { fill: #b45309; stroke: #92400e; }
.py-stein--voll.py-stein--r1 { fill: #c96f0c; stroke: #92400e; }
.py-stein--voll.py-stein--r2 { fill: #d98a10; stroke: #92400e; }
.py-stein--voll.py-stein--r3 { fill: #e6a617; stroke: #92400e; }
.py-stein--voll.py-stein--r4 { fill: #f2c230; stroke: #92400e; }
.py-stein--neutral { fill: #8a9bb0; stroke: #5b6b7a; }
.py-stein--falsch { fill: #fff; stroke: var(--py-orange); stroke-width: 2.5; }
/* Der Kopf des Arbeitsraums klebt oben, die Zahlentastatur unten: das aktive Feld bleibt zwischen beiden sichtbar. */
.py-zeile, .py-wahl { scroll-margin-top: 90px; scroll-margin-bottom: 24px; }
.py-wurzel--tastatur .py-zeile { scroll-margin-bottom: 270px; }
.py-raster { display: flex; flex-direction: column; gap: 3px; }
.py-zeile { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px 52px; align-items: center; gap: 5px; min-height: 46px; }
.py-nr { font-size: .75rem; color: var(--py-leise); text-align: right; font-variant-numeric: tabular-nums; }
.py-op { font-weight: 600; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.py-zeichen { font-weight: 800; text-align: center; font-size: 1.05rem; }
.py-fest {
  display: block; min-height: 44px; line-height: 44px; padding: 0 10px; text-align: right; font-size: 1.3rem; font-weight: 800;
  background: var(--py-grau); border: 2px solid #aeb8c2; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.py-feld {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 10px; text-align: right; font: inherit; font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--py-karte); color: var(--py-text); border: 2px solid #8896a5; border-radius: 6px; touch-action: manipulation;
}
.py-feld:focus { outline: 3px solid var(--py-akzent); outline-offset: 1px; }
.py-feld:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.py-zeile--grau .py-feld { background: var(--py-grau); border-color: #c8d0d8; }
.py-zeile--richtig .py-feld { background: var(--py-gut-bg); border-color: var(--py-gut); color: #0f5132; }
.py-zeile--richtig .py-zeichen { color: var(--py-gut); }
/* Beats Fehlerzeichen: die orange Linie, dazu das Zeichen «!», also nie nur Farbe. */
.py-zeile--falsch .py-feld { background: var(--py-orange-bg); border-color: var(--py-orange); border-bottom-width: 5px; }
.py-zeile--falsch .py-zeichen { color: var(--py-orange); }
.py-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; font-size: .88rem; color: var(--py-leise); justify-content: center; }
.py-legende__teil { display: inline-flex; align-items: center; gap: 5px; }
.py-punkt { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid #8896a5; }
.py-punkt--gruen { background: var(--py-gut); border-color: var(--py-gut); }
.py-punkt--orange { background: var(--py-orange); border-color: var(--py-orange); border-radius: 2px; height: 5px; width: 18px; }
.py-punkt--grau { background: var(--py-grau); }
.py-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.py-knopf, .py-schalter {
  min-height: 44px; padding: 6px 14px; border: 1px solid var(--py-rand); border-radius: 8px; background: var(--py-karte); color: var(--py-text);
  font: inherit; cursor: pointer; touch-action: manipulation;
}
.py-knopf--klein { font-size: .9rem; }
.py-knopf--haupt { background: var(--py-akzent); border-color: var(--py-akzent); color: #fff; font-weight: 600; }
.py-knopf--hilfe { border-color: var(--py-orange); color: var(--py-orange); font-weight: 600; }
.py-knopf:disabled { opacity: .7; cursor: default; }
.py-schalter { font-size: .9rem; color: var(--py-leise); }
.py-schalter--an { border-color: var(--py-akzent); color: var(--py-text); font-weight: 600; }
.py-tasten {
  position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; max-width: 340px; margin: 10px auto;
  padding: 6px; background: var(--py-bg); border: 1px solid var(--py-rand); border-radius: 10px;
}
.py-taste { min-height: 46px; font: inherit; font-size: 1.25rem; font-weight: 600; border: 1px solid var(--py-rand); border-radius: 8px; background: var(--py-karte); color: var(--py-text); cursor: pointer; touch-action: manipulation; }
.py-taste--ok { background: var(--py-akzent); border-color: var(--py-akzent); color: #fff; }
.py-abschluss { border: 2px solid #d99e10; border-radius: 12px; background: #fffbea; padding: 12px 14px; margin: 12px 0; }
.py-abschluss--fast { border-color: var(--py-orange); background: var(--py-orange-bg); }
.py-abschluss__kopf { display: flex; gap: 12px; align-items: center; }
.py-abschluss__pokal { font-size: 2.4rem; line-height: 1; }
.py-abschluss__spruch { font-size: 1.15rem; font-weight: 700; }
.py-abschluss__zahlen { margin: 8px 0 0; padding-left: 18px; }
.py-regen { position: fixed; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.py-regen__stern { position: absolute; top: -24px; color: #d99e10; font-size: 1.15rem; animation: py-fallen 2.1s ease-in forwards; }
@keyframes py-fallen { from { transform: translateY(0); opacity: 1; } to { transform: translateY(105vh); opacity: 0; } }
@media (max-width: 480px) {
  .py-stand__best { margin-left: 0; width: 100%; }
  .py-kapsel { padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .py-wurzel * { transition: none !important; animation: none !important; }
  .py-regen { display: none; }
}
