/* ======================================================
   Globales Layout
   ====================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gap: 12px;
  --radius: 8px;
  --border: #d7d7d7;
  --bg: #ffffff;
  --bg-muted: #f6f6f6;
  --text: #111;
  --accent: #0a66ff;
}

html,
body {
  height: 100%;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #fafafa;
  padding: 20px;
  line-height: 1.4;
}

h1 {
  margin-bottom: 28px;
  font-size: 1.75rem;
}
h2 {
  margin: 18px 0;
  font-size: 1.2rem;
}

label {
  display: inline-block;
  margin: 0 10px 6px 0;
  font-weight: 600;
}
select {
  margin: 0 20px 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  min-width: 200px;
}

/* Ergebnisbereich */
#ergebnis {
  margin-top: 22px;
}

/* ======================================================
   Stage Tabs
   ====================================================== */
#stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px 0;
}

.stage-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  background: var(--bg-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.stage-tab:hover {
  background: #eee;
}
.stage-tab.active {
  background: var(--bg);
  border-bottom-color: var(--bg);
  font-weight: 700;
}

#stage-content {
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 8px;
  padding: 14px;
  background: var(--bg);
}

#stage-content p {
  margin-bottom: 8px;
}

/* ======================================================
   SVG – Tachometer
   ====================================================== */
/* Das SVG bitte inline einfügen (kein <img>) */
svg {
  display: block;
  max-width: 100%; /* kannst du anpassen */
  width: 100%;
  height: auto;
  margin: 14px 0;
}

/* Zeiger-Basis: weiche Bewegung */
.zeiger,
.zeiger2 {
  /* sehr wichtig: damit transform-origin im SVG-Koordinatensystem interpretiert wird */
  transform-box: fill-box;
  transition: transform 2.2s cubic-bezier(0.22, 0.8, 0.18, 1); /* smooth */
  will-change: transform;
}

/* >>> KORREKTE DREHPUNKTE (aus deiner SVG ausgelesen) <<< */

/* Linker Zeiger (PS) – Knopf unter .st51: cx=150.1, cy=96.5 */
.zeiger {
  transform-origin: 150.1px 96.5px;
}

/* Rechter Zeiger (Nm) – Knopf unter .st31: cx=249.1, cy=96.5 */
.zeiger2 {
  transform-origin: 249.1px 96.5px;
}

/* Optional: falls der „Knopf“ sicher über den Zeigern liegen soll
   (die Z-Order im SVG regelt normalerweise die Zeichenreihenfolge) */
.st51,
.st31 {
  pointer-events: none;
}

/* Accessibility: weniger Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  .zeiger,
  .zeiger2 {
    transition: none;
  }
}

/* Kleine Screens */
@media (max-width: 520px) {
  select {
    min-width: 160px;
  }
}

/* --- Grundlegende Styles für SVG-Zeigeranimation --- */
#Zeiger_Links,
#Zeiger_Rechts {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1s ease-in-out;
}

#Zeiger_Rechts {
  transform: rotate(0deg);
  transform-origin: 99px 74.4px;
}
#Zeiger_Links {
  transform: rotate(0deg);
  transform-origin: 75px 74.4px;
}

/* Optional: sanftere Übergänge bei Werteänderungen */
.animated {
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

#highlight-links {
  stroke-width: 6px;
  opacity: 1;
}
#highlight-rechts {
  stroke-width: 6px !important;
  opacity: 1;
}
