/* ==========================================================================
   SpellTo — Hausregeln „kein Scrollen" + „Knöpfe ≥ 120 × 96" (Nachtrag 22.11.2026)
   Wird NACH allen übrigen Stylesheets geladen. Zusammen mit js/hausregel.js:
   html.hr-normal | html.hr-schmal (Breite < 660) | html.hr-quer (Höhe ≤ 500, quer)
   ========================================================================== */

/* ---------- gemeinsame Knöpfe der Hausregel (Blättern, Menü) ---------- */
.hr-knopf {
  min-width: 120px; min-height: 96px; padding: var(--space-2) var(--space-3);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px solid var(--color-border-strong); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text);
  font-weight: var(--font-bold); font-size: var(--text-sm); line-height: 1.15; text-align: center;
  position: relative;
}
.hr-knopf svg { width: 34px; height: 34px; }
.hr-knopf__gross { font-size: var(--text-2xl); font-weight: var(--font-bold); line-height: 1; }
.hr-knopf:hover:not(:disabled) { background: var(--color-surface-alt); border-color: var(--color-primary); }
.hr-knopf:disabled { opacity: .35; cursor: default; }
.hr-knopf[aria-pressed="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---------- Blättern in Textseiten ---------- */
.hr-seiten { overflow: hidden !important; }
.hr-weg, .hr-leer { display: none !important; }
#app-content.hr-host { overflow: hidden !important; }
.hr-kette { display: flex !important; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.hr-kette > * { flex: none; }
.hr-kette > .hr-kette, #bb-as > .hr-kette { flex: 1 1 auto; min-height: 0; }
.screen.hr-kette { padding-bottom: var(--space-2); }
.hr-leiste {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-top: 1px solid var(--color-border); background: var(--color-bg);
}
.hr-leiste[hidden] { display: none !important; }
.hr-zahl { text-align: center; font-weight: var(--font-bold); color: var(--color-text-secondary); font-size: var(--text-sm); }

/* ---------- Kopfleiste ---------- */
.statusbar { padding: 4px 8px; gap: 6px; align-items: stretch; }
.statusbar__btn, .statusbar__brand, #sb-mehr {
  min-width: 120px; min-height: 96px; flex: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  border-radius: var(--radius-lg);
}
.statusbar__btn svg, #sb-mehr svg { width: 30px; height: 30px; }
.statusbar__btn-label { display: inline !important; font-size: var(--text-sm); }
.statusbar__btn--font { font-size: var(--text-2xl); }
.statusbar__brand { display: flex; padding: 4px 8px; }
.statusbar__brand > span:not(.statusbar__brand-logo) { display: inline !important; }
.statusbar__brand-logo { width: 40px; height: 40px; font-size: var(--text-xl); }
/* Klappe von kopfleiste-mehr.js: nie scrollen (Inhalt sind dieselben großen Knöpfe) */
body .sb-mehr-klappe { max-height: calc(100vh - 112px); overflow: hidden; gap: 6px; }
#hr-kopf-menue { display: none; }

/* ---------- Schrittleiste unten ---------- */
.bottom-nav { padding: 4px; gap: 6px; }
.bottom-nav__item { min-width: 120px; min-height: 96px; font-size: var(--text-sm); }
.bottom-nav__item svg { width: 30px; height: 30px; }
/* Fußzeile mit kleinen Rechtslinks fällt weg: dieselben Links stehen als Knöpfe in der Hilfe */
.app-footer { display: none !important; }

/* ---------- schmal: Kopf = Marke + Menü ---------- */
html.hr-schmal .statusbar > :not(.statusbar__brand):not(#hr-kopf-menue):not(.statusbar__spacer) { display: none !important; }
html.hr-schmal .statusbar__spacer { display: block !important; flex: 1; }
html.hr-schmal #hr-kopf-menue { display: inline-flex; }
html.hr-schmal .bottom-nav { display: none !important; }

/* ---------- flach quer: Leiste links ---------- */
.hr-schiene { display: none; }
html.hr-quer .statusbar, html.hr-quer .bottom-nav { display: none !important; }
html.hr-quer #app { padding-left: 136px; }
html.hr-quer .hr-schiene {
  display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: 136px;
  padding: 8px; background: var(--color-surface); border-right: 1px solid var(--color-border); z-index: 60;
}
.hr-schiene__platz { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; justify-content: flex-end; }
.hr-schiene__platz .hr-leiste { flex-direction: column; padding: 0; border: 0; gap: 6px; background: transparent; }
.hr-schiene__platz .hr-zahl { order: -1; }
html.hr-quer .hr-schiene .hr-knopf { width: 120px; }

/* ---------- Menü (Vollbild) ---------- */
.hr-menue { position: fixed; inset: 0; z-index: 300; background: var(--color-bg); padding: 8px; display: flex; }
.hr-menue[hidden] { display: none; }
.hr-menue__flaeche { display: grid; gap: 6px; width: 100%; align-content: start; grid-auto-rows: minmax(96px, auto); }
.hr-menue__flaeche .hr-knopf { width: 100%; }
.hr-menue__zu { border-color: var(--color-primary); }
html.hr-menue-offen #app { visibility: hidden; }

/* ---------- Inhaltsknöpfe: Mindestmaß ---------- */
#app-content .btn, #app-content .btn-sm, #app-content .legal-tab, #app-content .switch,
#app-content .lrn-opt, #app-content .chip-btn, #app-content .bb-viewseg button, #app-content .bb-iconbtn,
#app-content .bb-predict__btn, #app-content select, #app-content input[type="number"], #app-content input[type="text"] {
  min-width: 120px; min-height: 96px;
}
#app-content .btn, #app-content .btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-base); }
#app-content .switch { border-radius: var(--radius-lg); }
#app-content .legal-tab { border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; }
#app-content .lrn-key { min-height: 96px; min-width: 96px; }
/* Links im Rechtstext (E-Mail, Webseite) als große Ziele */
#app-content .legal-section__body a[href], #app-content .legal-subsection__body a[href] {
  display: inline-flex; align-items: center; justify-content: center; min-width: 120px; min-height: 96px;
  padding: 0 var(--space-3); margin: 4px 0; border: 2px solid var(--color-border-strong); border-radius: var(--radius-lg);
  text-decoration: underline; overflow-wrap: anywhere;
}

/* ======================= Tafel (Kommunizieren) ======================= */
/* Mitte mit sieben Knöpfen à 120 breit: unter 1100 px in zwei Reihen statt seitlich hinaus */
@media (max-width: 1099px) {
  html:not(.hr-quer) .bb-hub {
    grid-template-areas: "text text" "left right" "predict predict";
    grid-template-columns: auto auto; justify-content: space-between;
    grid-template-rows: minmax(2.2em, 1fr) auto auto;
  }
  html:not(.hr-quer) .bb-hub .bb-actions, html:not(.hr-quer) .bb-textbar .bb-actions { flex-wrap: wrap; }
  html:not(.hr-quer) .bb-textbar { flex-wrap: wrap; }
}
#app-content .bb-iconbtn { width: auto; height: auto; }

/* flach quer: Werkzeugzeile weg (Ansicht-Umschalter im Menü), Knöpfe in die Seitenleisten */
html.hr-quer #app-content.hr-tafel { padding-right: 136px; }
html.hr-quer .hr-tafel .bb-wrap > .toolbar, html.hr-quer .hr-tafel .bb-keyhint,
html.hr-quer .hr-tafel .bb-modehint, html.hr-quer .hr-tafel .bb-legend { display: none !important; }
html.hr-quer .hr-tafel .bb-actions--l, html.hr-quer .hr-tafel .bb-actions--r {
  position: fixed; top: 110px; width: 120px; display: flex; flex-direction: column; gap: 6px; z-index: 61; margin: 0;
}
html.hr-quer .hr-tafel .bb-actions--l { left: 8px; }
html.hr-quer .hr-tafel .bb-actions--r { right: 8px; top: 8px; }
html.hr-quer .hr-tafel .bb-actions--l > :nth-child(3),
html.hr-quer .hr-tafel .bb-actions--r > :last-child { display: none !important; }
html.hr-quer .hr-tafel .bb-actions .bb-iconbtn { width: 120px; height: 96px; min-height: 96px; }
html.hr-quer .hr-tafel .bb-hub { grid-template-areas: "text" "predict"; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
html.hr-quer .hr-tafel .bb-textbar { min-height: 0; }
html.hr-quer .hr-tafel .bb-wrap { padding: 8px; gap: 6px; }
html.hr-quer .hr-tafel .bb-group { padding-top: 20px; }
html.hr-quer .hr-tafel .bb-group .bb-pos { font-size: 10px; white-space: nowrap; }

/* ======================= Üben, Stufen 1–5, flach quer ======================= */
/* links schmale Spalte (Titel, Aufgabe), rechts Tafel; Knopfreihe unter der Tafel;
   „Übersicht" in der Seitenleiste unter „Menü" */
@supports (display: contents) {
  html.hr-quer .ub-wrap.ub-quer {
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-rows: repeat(7, max-content) minmax(0, 1fr) 104px;
  }
  html.hr-quer .ub-quer .ub-quer-kette > .ub-stage { grid-row: 1 / 9; }
  html.hr-quer .ub-quer .ub-quer-kette > .toolbar, html.hr-quer .ub-quer .ub-quer-kette > .bb-textbar {
    grid-column: 2; grid-row: 9; align-self: end; margin: 0; flex-wrap: nowrap; gap: 6px;
  }
  html.hr-quer .ub-quer .ub-quer-kette > .toolbar .btn { min-width: 120px; padding: 4px 6px; font-size: var(--text-sm); }
  html.hr-quer .ub-quer .ub-bar > .btn:first-child { position: fixed; left: 8px; top: 110px; width: 120px; z-index: 61; }
  html.hr-quer .ub-quer .ub-bar > div:not(.ub-progress):not(.ub-bar__spacer) { flex: 1 1 100%; }
  html.hr-quer .ub-quer .ub-prompt__lab { font-size: var(--text-xs); }
}
@supports (display: contents) {
  html.hr-quer .ub-quer .ub-quer-kette > .toolbar .btn {
    flex: 0 0 120px; width: 120px; flex-direction: column; gap: 2px; white-space: normal; line-height: 1.1; text-align: center;
  }
  html.hr-quer .ub-quer .ub-bar > .btn:first-child {
    min-height: 96px; border: 2px solid var(--color-border-strong); background: var(--color-surface);
    flex-direction: column; justify-content: center;
  }
}

/* ======================= Assistenz-Drills ======================= */
#app-content #bb-as .as-choice { min-width: 120px; min-height: 96px; }
@supports (display: grid) {
  html.hr-quer #bb-as .as-fit {
    display: grid; grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: repeat(6, max-content) minmax(0, 1fr); column-gap: 8px; padding: 8px;
  }
  html.hr-quer #bb-as .as-fit > * { grid-column: 1; min-width: 0; margin: 0 0 6px; }
  html.hr-quer #bb-as .as-fit > .as-boardstage { grid-column: 2; grid-row: 1 / -1; margin: 0; height: 100%; align-self: stretch; }
  html.hr-quer #bb-as .as-fit .as-role { display: none; }
  html.hr-quer #bb-as .as-fit .as-bar { min-height: 0; flex-wrap: wrap; }
  html.hr-quer #bb-as .as-fit .as-bar > .btn:first-child {
    position: fixed; left: 8px; top: 110px; width: 120px; min-height: 96px; z-index: 61;
    border: 2px solid var(--color-border-strong); background: var(--color-surface); flex-direction: column; justify-content: center;
  }
  html.hr-quer #bb-as .as-fit .as-ask { font-size: var(--text-sm); text-align: left; }
  html.hr-quer #bb-as .as-fit .bb-group { padding-top: 20px; }
  html.hr-quer #bb-as .as-fit .bb-group .bb-pos { font-size: 10px; white-space: nowrap; }
}
  /* A1: Mitte der (gespiegelten) Tafel kompakt: Gesicht + Hinweis nebeneinander, „Nochmal zeigen" darunter */
@supports (display: grid) {
  html.hr-quer #bb-as .as-fit { width: 100%; max-width: none; margin: 0; }
  html.hr-quer #bb-as .as-fit .as-drillhub { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; padding: 2px; }
  html.hr-quer #bb-as .as-fit .as-drillhub > .btn { order: 9; }
  html.hr-quer #bb-as .as-fit .as-face { height: 40px; }
  html.hr-quer #bb-as .as-fit .as-gazehint { font-size: var(--text-sm); margin: 0; }
  html.hr-quer #bb-as .as-fit .as-drillhub .as-fb { margin: 0; font-size: var(--text-sm); }
}

/* ---------- Drucken: alles, was beim Blättern versteckt ist, wieder zeigen ---------- */
@media print {
  .hr-weg, .hr-leer { display: revert !important; }
  .hr-leiste, .hr-schiene, .hr-menue { display: none !important; }
  .hr-seiten, #app-content.hr-host { overflow: visible !important; }
}
/* Sprunglink (nur bei Tastaturfokus sichtbar) ebenfalls in Zielgröße */
.skip-link { min-width: 120px; min-height: 96px; display: inline-flex; align-items: center; }

/* ---------- Lernen ---------- */
#app-content .lrn-tile__head { min-height: 96px; }
/* Bildschirm-Tastatur der Lektion: Tasten ≥ 120 × 96; Reihen brechen um, statt seitlich hinauszulaufen.
   Auf schmalen Fenstern verteilt das Blättern die Tastenreihen auf Seiten. */
#app-content .lrn-kb__row { flex-wrap: wrap; }
#app-content .lrn-key { min-width: 120px; min-height: 96px; max-width: none; flex: 0 0 auto; }
#app-content .lrn-key--wide { flex: 1 1 250px; }
/* ---------- Hilfe: Rechtslinks und Links im Text als große Ziele ---------- */
#app-content .hilfe-legal a, #app-content .screen p a[href], #app-content .legal-inline-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 120px; min-height: 96px;
  padding: 0 var(--space-3); margin: 4px 0; border: 2px solid var(--color-border-strong); border-radius: var(--radius-lg);
}
/* breite Fenster: Lektionen nutzen die volle Inhaltsbreite, damit die Tastenreihen (je 120 breit) zusammenbleiben */
@media (min-width: 1100px) { #app-content .screen.wrap-narrow.lrn-mod { max-width: none; } }

/* RTL: Blätter-Pfeile spiegeln (vorige Seite zeigt nach rechts, nächste nach links) */
html[dir="rtl"] .hr-zurueck .hr-knopf__ic svg, html[dir="rtl"] .hr-weiter .hr-knopf__ic svg { transform: scaleX(-1); }
html[dir="rtl"] .kb-pfeil__ic svg { transform: scaleX(-1); }
