/* Bruch-Werkstatt — App-spezifische Stile. Panel-/Dock-Look kommt aus ../_shared/visukit.css. */

html, body { touch-action: none; overscroll-behavior: none; }
canvas { touch-action: none; }
body.theme-dark  { background: #070912; }
body.theme-light { background: #f5f5f4; }

/* Bühne: eigener Scroll-Container (scrollt nur, wenn das schmale Layout höher als der Schirm ist) */
#stage { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
#sheet { position: relative; width: 100%; }
#cv { position: absolute; left: 0; top: 0; display: block; }

/* Filmmodus: nur die Bühne, keine Bedienelemente (buehne.js setzt die Klasse) */
body.buehne-film .panel, body.buehne-film #desktop-dock, body.buehne-film #mobile-navbar,
body.buehne-film [id^="va-"] { display: none !important; }
body.buehne-film #stage { overflow: hidden; }

/* Panels an den Ecken */
#panel-bruch { top: 16px; left: 16px; width: 280px; max-height: calc(100vh - 100px); }
#panel-ueben { top: 16px; right: 16px; width: 300px; max-height: calc(100vh - 100px); }
#panel-info  { left: 50%; right: auto; bottom: 64px; transform: translateX(-50%); width: 500px; max-height: calc(100vh - 120px); }
@media (max-width: 768px) {
  #panel-info { transform: translateX(-50%) translateY(18px); }
  #panel-info.open { transform: translateX(-50%) translateY(0); }
  .panel-hd { cursor: default; }
}

/* Kachelbild (?vorschau=1): nur die Szene */
body.vorschau .panel, body.vorschau #desktop-dock, body.vorschau #mobile-navbar, body.vorschau [id^="va-"] { display: none !important; }
/* Handy: Bottom-Sheets nicht höher als der VisuKit-Standard (56vh), sonst decken die ID-Regeln oben die Szene zu */
@media (max-width: 768px) {
  #panel-bruch, #panel-ueben, #panel-info { max-height: 56vh; }
}

.panel .sec { margin-top: 12px; }
.panel .sec:first-of-type { margin-top: 2px; }
.panel .sec > .lab { margin: 0 0 7px; }

/* Stepper: große Tippflächen (≥ 44 px) */
.panel .stepper { display: flex; align-items: center; gap: 8px; }
.panel .stepper button {
  flex: none; width: 44px; height: 44px; border-radius: 11px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: currentColor;
  background: var(--vk-panel-surface); transition: background .15s, opacity .15s;
}
.panel .stepper button svg { width: 18px; height: 18px; }
body.theme-dark  .panel .stepper button:hover { background: rgba(255,255,255,0.13); }
body.theme-light .panel .stepper button:hover { background: rgba(15,23,42,0.10); }
.panel .stepper button:disabled { opacity: .32; cursor: default; }
.panel .stepper b { flex: 1; text-align: center; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
#val-z { color: var(--bw-a); }

.panel .seg button { min-height: 44px; min-width: 0; white-space: normal; overflow-wrap: break-word; line-height: 1.15; font-size: 12px; }
body.theme-dark  .panel .seg button:not(.active):hover { background: rgba(255,255,255,0.07); }
body.theme-light .panel .seg button:not(.active):hover { background: rgba(15,23,42,0.06); }
.panel .check { min-height: 44px; font-size: 12.5px; }
.panel .check input[type="checkbox"]:disabled { opacity: .4; cursor: default; }
.panel .check:has(input:disabled) { opacity: .55; cursor: default; }
#hint-bruch { margin-top: 10px; font-size: 12.2px; line-height: 1.6; opacity: .85; }

/* Gestapelte Brüche in Panels (Zähler über Bruchstrich über Nenner) */
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle;
  line-height: 1; font-size: .9em; font-weight: 700; margin: 0 .14em; font-variant-numeric: tabular-nums; }
.fr > span { display: block; padding: 0 .16em; }
.fr > .fz { padding-bottom: .1em; border-bottom: .09em solid currentColor; }
.fr > .fn { padding-top: .1em; }
.gz { font-weight: 700; margin-left: .1em; vertical-align: middle; }
.fr .fz.a { color: var(--bw-a); }

/* Üben */
.ue-aufgabe { font-size: 14px; line-height: 1.7; font-weight: 600; margin: 2px 0 10px; }
.ue-aufgabe .fr { font-size: 1.05em; }
.ue-opt { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ue-opt:empty { display: none; }
.ue-opt button {
  min-height: 52px; min-width: 0; border: none; border-radius: 10px; cursor: pointer; color: currentColor;
  background: var(--vk-panel-surface); font-size: 17px; font-weight: 700; transition: background .15s, opacity .15s;
}
body.theme-dark  .ue-opt button:not(:disabled):hover { background: rgba(255,255,255,0.12); }
body.theme-light .ue-opt button:not(:disabled):hover { background: rgba(15,23,42,0.09); }
.ue-opt button:disabled { cursor: default; opacity: .5; }
.ue-opt button.richtig { opacity: 1; background: var(--vk-ui-active-bg); color: var(--vk-ui-active-ink); }
.ue-opt button.falsch { opacity: 1; background: var(--bw-b-flaeche); }
.panel .act#ue-pruefen { min-height: 44px; margin-top: 10px; }
.panel .act#ue-pruefen.hidden { display: none; }
.ue-rueck { margin-top: 10px; font-size: 12.5px; line-height: 1.6; }
.ue-rueck:empty { display: none; }
.ue-rueck b.ok { color: var(--bw-ok); }
.ue-rueck b.no { color: var(--bw-no); }
.ue-fuss { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ue-fuss .ghost { flex: 1; min-height: 44px; }
#ue-stand { font-size: 11.5px; opacity: .66; white-space: nowrap; font-variant-numeric: tabular-nums; }

#panel-info p { font-size: 12.4px; line-height: 1.6; }
#panel-info p + p { margin-top: 8px; }

/* Scrollbalken — global, heyprof-Look (Skill visuapp-create, Constraint 3) */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; }
  body.theme-light { scrollbar-color: rgba(0,0,0,0.15) transparent; }
  body.theme-dark  { scrollbar-color: rgba(255,255,255,0.15) transparent; }
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.panel::-webkit-scrollbar-track { margin: 15px 0; }
::-webkit-scrollbar-thumb { border-radius: 4px; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
*::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
body.theme-light ::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.15); }
body.theme-light ::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,0.30); }
body.theme-dark  ::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.15); }
body.theme-dark  ::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.30); }
html::-webkit-scrollbar-thumb { background-color: rgba(127,127,160,0.35); }
