/* 55V-Nachbau – Aussehen nach dem Original von 1993: weißes Blockbild, graues Pult mit Knöpfen, darunter der
   Stromlaufplan. Farben aus Percys Palette (USERSCR.BMP). Tastenblock, Fehlervorgabe und Relaisdiagramm sind im
   Aussehen nachgestellt. Entwurf vom 2026-11-25, Schritte 1–5. */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../../assets/schrift/nunito-latin.woff2") format("woff2");
}
:root {
  --grau: #c2c2c2; --dunkel: #828282; --weiss: #fff; --schwarz: #000; --blau: #007db2; --hell: #00a2ff;
  --rot: #ff0000; --gruen: #00d286; --orange: #ffa200; --text: #1f2326; --tisch: #e9e6df;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--tisch); color: var(--text); font: 17px/1.55 Nunito, system-ui, sans-serif; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blau); }
kbd { font: 700 .72em/1 ui-monospace, Consolas, monospace; padding: .15em .35em; border: 1px solid var(--dunkel);
  border-bottom-width: 2px; border-radius: 3px; background: #f4f4f4; color: #333; white-space: nowrap; }
code { font: .9em ui-monospace, Consolas, monospace; }

.leiste { display: flex; align-items: center; gap: .8rem; padding: .45rem 1rem; background: #2b2f33; color: #ddd; min-height: 2.6rem; }
.leiste a { color: #ffce9a; text-decoration: none; white-space: nowrap; }
.leiste a:hover, .leiste a:focus-visible { text-decoration: underline; }
.leiste p { margin: 0; flex: 1; text-align: center; color: #b9b6ad; font-size: .9rem; }
@media (max-width: 700px) { .leiste p span { display: none; } }
.leiste .andere { color: #cfc9b6; font-size: .85rem; }
@media (max-width: 520px) { .leiste .andere { display: none; } }
html.eingebettet .leiste { display: none; }

/* Das Gestell: so breit wie möglich, der Plan soll groß sein */
.gestell { flex: 1; width: min(100%, 1180px, max(760px, calc((100vh - 19rem) * 1.97 + 2.5rem))); margin: 0 auto; padding: 1rem .8rem 3rem; display: grid; gap: 0; }

.gestell > * { min-width: 0; }

/* 3D-Rahmen wie die VGA-Knöpfe von 1993 */
.erhaben { box-shadow: inset 1px 1px 0 var(--weiss), inset -1px -1px 0 var(--dunkel); }

/* Blockbild: Percys BLOCK.BLD als Bild, darüber Knöpfe an den Klickflächen des Originals (Koordinaten 640 × 120) */
.blockbild { background: var(--weiss); border: 2px solid var(--dunkel); border-bottom: 0; padding: .4rem .5rem .5rem; }
.blockrahmen { overflow: hidden; }
.blockflaeche { position: relative; width: 100%; aspect-ratio: 640 / 120; }
.blockflaeche img, .blockflaeche .feld, .blockflaeche .anzeige, .blockflaeche .hinweisfeld {
  position: absolute; left: calc(var(--x, 0) / 640 * 100%); top: calc(var(--y, 0) / 120 * 100%);
  width: calc(var(--b, 640) / 640 * 100%); height: calc(var(--h, 120) / 120 * 100%); }
.blockflaeche img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.blockbild-bild { left: 0; top: 0; width: 100%; height: 100%; }
.feld { margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; color: transparent; font-size: 1px; overflow: hidden; }
.feld:hover, .feld:focus-visible { outline: 2px solid var(--orange); outline-offset: 0; }
.feld.plan[aria-pressed="true"] { background: rgb(0 0 0 / .38); box-shadow: inset 2px 2px 0 #000; }   /* gedrückt wie die VGA-Knöpfe */
.feld:active { background: rgb(0 0 0 / .3); }
#hoerer[aria-pressed="false"] { animation: winken 2.4s ease-in-out infinite; border-radius: 6px; box-shadow: 0 0 0 3px rgb(255 162 0 / .55); }
@keyframes winken { 0%, 70%, 100% { box-shadow: 0 0 0 3px rgb(255 162 0 / .55); } 85% { box-shadow: 0 0 0 7px rgb(255 162 0 / .15); } }
@media (prefers-reduced-motion: reduce) { #hoerer[aria-pressed="false"] { animation: none; } }
.tastenblock[hidden] { display: none; }
.anzeige { display: flex; align-items: center; justify-content: flex-end; font: 700 clamp(7px, 1.25vw, 15px)/1 ui-monospace, Consolas, monospace;
  color: #000; letter-spacing: .05em; padding-right: .1em; }
.hinweisfeld { margin: 0; display: flex; align-items: center; padding: 0 .4em; overflow: hidden; white-space: nowrap;
  font: 700 clamp(7px, 1.3vw, 15px)/1 ui-monospace, Consolas, monospace; color: #000;
  background: var(--grau); box-shadow: inset 1px 1px 0 var(--dunkel), inset -1px -1px 0 var(--weiss); }   /* Rahmen wie VGA.TXT „rahmen“ */
.wischen-block { display: none; }
.status { margin: .4rem 0 0; min-height: 2.9em; padding: .3rem .7rem; border: 1px solid var(--dunkel); background: #f3f3f3;
  box-shadow: inset 1px 1px 0 var(--dunkel), inset -1px -1px 0 var(--weiss); font-weight: 700; font-size: .92rem; }

/* Pult */
.pult { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .5rem .8rem; background: var(--grau);
  border: 2px solid var(--dunkel); border-top: 1px solid var(--dunkel); border-bottom: 0;
  box-shadow: inset 1px 1px 0 var(--weiss), inset -1px -1px 0 var(--dunkel); font-size: .9rem; }
.tempo { display: flex; flex-wrap: wrap; gap: .2rem .7rem; border: 1px solid var(--dunkel); padding: .1rem .6rem .3rem; margin: 0; }
.tempo legend { font-weight: 800; color: var(--dunkel); padding: 0 .3rem; font-size: .8rem; }
.tempo label, .schalter { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
input[type=radio], input[type=checkbox] { accent-color: var(--blau); width: 1.05rem; height: 1.05rem; margin: 0; }
.knopf { font: 700 .9rem Nunito, sans-serif; background: var(--grau); color: var(--text); border: 1px solid var(--schwarz);
  padding: .3rem .7rem; cursor: pointer; box-shadow: inset 1px 1px 0 var(--weiss), inset -2px -2px 0 var(--dunkel); }
.knopf:active:not(:disabled) { box-shadow: inset 2px 2px 0 var(--dunkel); }
.knopf:disabled { color: #8a8a8a; cursor: default; }
.knopf:focus-visible, .schalter:focus-within, .tempo label:focus-within { outline: 2px solid var(--orange); outline-offset: 2px; }
.zaehler { margin: 0 0 0 auto; font-variant-numeric: tabular-nums; color: #333; }

/* Plan */
.planfeld { margin: 0; background: var(--grau); border: 2px solid var(--dunkel); padding: .5rem; }
.planfeld figcaption { font-weight: 800; font-size: .9rem; padding: 0 .2rem .35rem; }
.planrahmen { background: var(--weiss); border: 1px solid var(--dunkel); box-shadow: inset 1px 1px 0 var(--dunkel); }
#plan { display: block; width: 100%; height: auto; aspect-ratio: 608 / 309; }
#plan image { image-rendering: pixelated; image-rendering: crisp-edges; }
.leitung { fill: none; stroke-width: 1; stroke-linecap: square; shape-rendering: crispEdges; }
.leitung.stromfuehrend { stroke-width: 1.6; }
.zunge { stroke-width: 1.1; stroke-linecap: square; }
.loeschen { stroke-width: 1.5; stroke-linecap: square; }
.hilfe-flaeche { opacity: 0; mix-blend-mode: multiply; }
.hilfe-flaeche.an { opacity: .9; }
.stellungszahl { font: 700 8px/1 ui-monospace, Consolas, monospace; paint-order: stroke; stroke: #fff; stroke-width: 2px; }
.relais-flaeche { fill: var(--rot); opacity: 0; mix-blend-mode: multiply; transition: opacity .12s; }
.relais-flaeche.an { opacity: 1; }
.relais-uhr { fill: var(--orange); }
.treffer { fill: transparent; stroke: none; }
.teil { cursor: help; outline: none; }
.teil:hover .treffer, .teil:focus-visible .treffer { fill: rgb(255 162 0 / .22); stroke: var(--orange); stroke-width: 1; }
.wischen { display: none; }
.info { margin: .45rem .1rem 0; min-height: 1.6em; font-size: .92rem; padding: .1rem .3rem; border-radius: 3px; }
.info.aktiv { background: #ff0000; color: #fff; }   /* Original: Funktionstext rot unterlegt, wenn aktiv */

/* Fehlervorgabe */
.fehler { background: #f6f3ec; border: 2px solid var(--dunkel); border-bottom: 0; padding: .6rem .9rem .8rem; font-size: .92rem; }
.fehler h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
.fehler h3 { font-size: .95rem; margin: .7rem 0 .3rem; }
.fehler p { margin: .2rem 0 .5rem; }
.gewaehlt-teil { font-weight: 700; }
.fehlerarten, .uebungen { display: flex; flex-wrap: wrap; gap: .35rem; }
.knopf[aria-pressed="true"] { background: var(--blau); color: var(--weiss); box-shadow: inset 2px 2px 0 #00405c; }
.fehlerliste { margin: .5rem 0; padding-left: 1.2rem; }
.passwort { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .3rem 0 .6rem; }
.passwort input { font: inherit; padding: .2rem .4rem; width: 10rem; }

/* Relaisdiagramm (Zustände wie 0C71:11C6, Zeichnung nachgestellt) */
.diagramm { background: var(--weiss); padding: .4rem .3rem; }
.diagramm svg { display: block; width: 100%; height: auto; }
.diagramm .name { font: 700 9px Nunito, sans-serif; }
.diagramm .raster { stroke: #e3e3e3; stroke-width: .6; }
.diagramm .grund { stroke: #bbb; stroke-width: .5; }
.diagramm .achse { font: 7px Nunito, sans-serif; fill: #666; }
.diagramm .leer { margin: 2rem 1rem; text-align: center; font-weight: 700; }
.legende { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .3rem .1rem 0; padding: 0; font-size: .82rem; }
.legende i { display: inline-block; width: 1.6rem; height: 3px; background: var(--f); vertical-align: middle; margin-right: .35rem; }
.legende i.rel { height: .8rem; width: 1.2rem; background: var(--rot); border: 1px solid #000; }

/* Erklärung */
.erklaerung { max-width: 46rem; padding: 1.4rem .2rem 0; }
.erklaerung h1 { font-size: 1.6rem; line-height: 1.25; margin: .2rem 0 .6rem; }
.erklaerung h2 { font-size: 1.1rem; margin: 1.3rem 0 .3rem; }
.erklaerung li { margin: .25rem 0; }
.erklaerung details { margin-top: 1.2rem; border-top: 1px solid #c9c4b8; padding-top: .6rem; }
.erklaerung summary { cursor: pointer; font-weight: 700; }

@media (max-width: 760px) {
  html { font-size: 16px; }
  .gestell { padding: .5rem .3rem 2rem; }
  .blockbild { padding: .4rem .3rem; }
  .blockrahmen { overflow-x: auto; overscroll-behavior-x: contain; }
  .blockflaeche { width: 640px; }
  .wischen-block { display: block; margin: .2rem .1rem 0; font-size: .8rem; color: #555; }
  .wischen-block::before { content: "↔ "; }
  .pult { gap: .4rem .6rem; }
  .planrahmen { overflow-x: auto; overscroll-behavior-x: contain; }
  #plan { width: 608px; max-width: none; }
  .wischen { display: block; margin: .3rem .1rem 0; font-size: .8rem; color: #555; }
  .wischen::before { content: "↔ "; }
  .zaehler { margin-left: 0; }
}
@media print {
  .leiste, .pult { display: none; }
  html { background: #fff; }
}
