/* Spiel „Hin und her“ (erbe/hin-und-her.php). Nur Tokens aus erbe.css.
   Farbsinn: Gold = du, Grau = deine Schwester, Beige-Fläche = Monate im
   Tagesgeld, Salbei = vorn, Schwarz mit Minus = hinten. Die Website kennt
   keinen Dunkelmodus, deshalb hier auch keiner. */

.erbe section.hh { padding: calc(var(--kopf-hoehe) + var(--raum-m)) 0 var(--raum-l); }
.hh .wrap { max-width: 920px; }

/* ---------- Start ---------- */
.erbe .hh-start h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 1;
}
.hh-unterzeile { font-size: var(--fs-gross); color: var(--gray-dark); margin: 10px 0 28px; }
.hh-start > p { margin-bottom: 14px; }

.hh-regeln {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  margin: 30px 0 34px;
  padding: 22px 26px;
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-card);
}
.hh-regeln dt { font-weight: 600; }
.hh-regeln dd { margin: 0; color: var(--gray-dark); }

/* Moduswahl: zwei Karten mit Radioknopf, die gewählte mit Goldrand */
.hh-modus { border: 0; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hh-modus legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.hh-modus label { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--white); border: 1px solid var(--beige-dark); border-radius: var(--radius-card); cursor: pointer; font-size: var(--fs-klein); color: var(--gray-dark); }
.hh-modus label:has(input:checked) { border-color: var(--gold-dark); box-shadow: 0 0 0 1px var(--gold-dark); }
.hh-modus input { margin-top: 3px; accent-color: var(--gold-dark); }
.hh-modus strong { display: block; color: var(--black); font-size: var(--fs-normal, 1rem); margin-bottom: 2px; }
@media (max-width: 560px) { .hh-modus { grid-template-columns: 1fr; } }

.erbe .hh-los {
  font: inherit;
  font-weight: 600;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 3px;
  background: var(--gold-dark);
  color: var(--cream);
  cursor: pointer;
  transition: background var(--transition-base);
}
.erbe .hh-los:hover { background: var(--black); }
.hh-los:focus-visible, .hh-knopf:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.erbe .hh-los--leicht { background: transparent; color: var(--black); border: 1px solid var(--gray-light); }
.erbe .hh-los--leicht:hover { background: var(--white); }

/* ---------- Spiel ---------- */
.hh-buehne, .hh-ergebnis {
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
  padding: clamp(16px, 2.6vw, 30px);
  /* Beim Ansichtswechsel springt die Seite hierher; die feste Kopfzeile darf nichts verdecken. */
  scroll-margin-top: calc(var(--kopf-hoehe) + 12px);
}

.hh-stand { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hh-wert { display: flex; flex-direction: column; }
.hh-wert--sie { text-align: right; }
.hh-wer { font-size: var(--fs-klein); color: var(--gray-mid); }
.hh-wert strong {
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.hh-wert--du strong { color: var(--gold-dark); }
.hh-wert--sie strong { color: var(--gray-dark); }
.hh-zustand { font-size: var(--fs-klein); color: var(--gray-dark); }

.hh-uhr { margin: 18px 0 8px; font-size: var(--fs-micro); color: var(--gray-mid); font-variant-numeric: tabular-nums; }

/* Höhe folgt auch der Fensterhöhe, damit Stand, Kurve und Knopf zusammen auf den Schirm passen. */
.hh-kurve { display: block; width: 100%; height: clamp(180px, min(42vw, 100svh - 470px), 360px); }
.hh-kurve-rahmen { position: relative; }
/* Countdown vor jeder Runde, mittig über der (noch leeren) Kurve. */
.hh-zaehler {
  position: absolute; inset: 0; margin: 0;
  display: grid; place-items: center;
  font-size: clamp(4rem, 14vw, 8rem); font-weight: 600; line-height: 1;
  color: var(--gold-dark); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.hh-zaehler[hidden] { display: none; }
.hh-draussen { fill: var(--beige-light); }
.hh-null { stroke: var(--gray-light); stroke-dasharray: 4 5; }
.hh-achse { fill: var(--gray-mid); font-size: 12px; }
.hh-linie { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.hh-linie--du { stroke: var(--gold-dark); }
.hh-linie--sie { stroke: var(--gray-mid); stroke-width: 2; }

.erbe .hh-knopf {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 84px;
  margin-top: 20px;
  border: 0;
  border-radius: 3px;
  color: var(--cream);
  cursor: pointer;
  touch-action: manipulation;   /* kein Doppeltipp-Zoom beim schnellen Wechseln */
  user-select: none;
  transition: background var(--transition-base);
}
.erbe .hh-knopf[data-zustand="aktien"] { background: var(--dunkelgrund); }
.erbe .hh-knopf[data-zustand="tagesgeld"] { background: var(--gold-dark); }
.hh-knopf-text { font-size: var(--fs-h3); font-weight: 600; }
.hh-knopf-unter { font-size: var(--fs-klein); opacity: .85; }

/* ---------- Ergebnis ---------- */
.hh-runde-nr { font-size: var(--fs-klein); color: var(--gray-mid); margin-bottom: 6px; }
.hh-kopfzahl { font-size: clamp(2.6rem, 8vw, 4.4rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hh-kopfzahl--vorn, .hh-vorn { color: var(--salbei); }
.hh-kopfzahl--hinten, .hh-hinten { color: var(--black); }
.hh-gleich { color: var(--gray-dark); }
.hh-kopflabel { color: var(--gray-dark); margin-bottom: 26px; }

.hh-zeilen { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; max-width: 420px; margin-bottom: 30px; }
.hh-zeilen dt { color: var(--gray-dark); }
.hh-zeilen dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.erbe .hh-zwischen { font-size: var(--fs-h3); margin-bottom: 10px; }
.hh-liste { margin: 0 0 30px 1.1em; }

.hh-tabelle-rahmen { overflow-x: auto; margin-bottom: 28px; }
.hh-tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hh-tabelle th { text-align: right; font-size: var(--fs-klein); font-weight: 600; color: var(--gray-dark); vertical-align: top; padding: 0 0 8px 12px; }
.hh-tabelle td { text-align: right; padding: 8px 0 8px 12px; border-top: 1px solid var(--beige-dark); white-space: nowrap; }
.hh-tabelle th:first-child, .hh-tabelle td:first-child { text-align: left; padding-left: 0; }
.hh-tabelle tfoot td { font-weight: 600; }

.erbe .hh-gedanke { font-size: var(--fs-gross); line-height: 1.4; margin-bottom: 14px; }
.hh-klein { font-size: var(--fs-klein); color: var(--gray-dark); margin-bottom: 28px; }
.erbe .hh-grund { margin: -14px 0 24px; max-width: 46ch; }
.hh-ergebnis .hh-los { margin-bottom: 40px; }
.erbe .hh-glueck-zahl { font-size: var(--fs-gross); margin-bottom: 6px; }
.hh-glueck-zahl + .hh-klein { margin-bottom: 12px; }
.erbe .hh-zufall { margin-bottom: 24px; }

/* Welche Jahre waren das: Rückblick-Kurve mit nummerierten Ereignissen */
.erbe .hh-jahre { font-size: var(--fs-gross); font-weight: 600; margin-bottom: 10px; }
.hh-kurve.hh-kurve--rueckblick { height: 260px; margin-bottom: 14px; }
.hh-ereignis-linie { stroke: var(--gray-mid); stroke-dasharray: 2 3; }
.hh-ereignis-kreis { fill: var(--white); stroke: var(--gray-dark); }
.hh-ereignis-nr { fill: var(--black); font-size: 11px; font-weight: 600; }
.hh-ereignisse { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 20px; font-size: var(--fs-klein); }
.hh-ereignisse li { display: flex; gap: 8px; align-items: baseline; }
.hh-nr { flex: none; width: 20px; height: 20px; border: 1px solid var(--gray-dark); border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; }
.hh-klein.hh-klein--eng { margin-bottom: 6px; }
.hh-stuecke { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: stueck; }
.hh-stuecke li { counter-increment: stueck; font-size: var(--fs-klein); padding: 3px 10px; border: 1px solid var(--beige-dark); border-radius: 999px; background: var(--beige-light); }
.hh-stuecke li::before { content: counter(stueck) ". "; color: var(--gray-mid); }

/* Können oder Glück: Punktewolke der Zufallsspieler */
.hh-glueck { display: block; width: 100%; height: 200px; margin-bottom: 6px; }
.hh-punkt { fill: var(--gray-light); }
.hh-punkt--vorn { fill: var(--salbei); }
.hh-marke { stroke-width: 1.6; }
.hh-marke--du { stroke: var(--gold-dark); }
.hh-marke--sie { stroke: var(--gray-dark); }
.hh-marke-text { fill: var(--black); font-size: 13px; font-weight: 600; stroke: var(--white); stroke-width: 4px; paint-order: stroke; }

.erbe .hh-hinweis { margin-top: 26px; font-size: var(--fs-micro); color: var(--gray-mid); max-width: 72ch; }
.erbe .hh-hinweis p { margin: 0 0 6px; }
.hh-rechenweg summary { cursor: pointer; color: var(--gray-dark); font-weight: 600; }
.hh-rechenweg ul { margin: 8px 0 0 1.1em; padding: 0; }
.hh-rechenweg li { margin-bottom: 4px; }

@media (max-width: 560px) {
  .hh-regeln { grid-template-columns: 1fr; gap: 2px; }
  .hh-regeln dd { margin-bottom: 10px; }
}
