/* Uhr-Schule — Styles für public/js/uebungen/uhr.js
   Farben kommen aus den App-Variablen (--card, --ink, --primary, --accent,
   --success, --radius, --shadow). Fest sind NUR die beiden Zeigerfarben,
   damit Stunden- und Minutenzeiger immer eindeutig unterscheidbar bleiben
   (die stehen im JS: FARBE_STUNDE / FARBE_MINUTE).
   Touch-Ziele durchgehend >= 44px — Jonas ist 5. */

/* ---------- Analoguhr ---------- */

.uhr-wrap {
  background: var(--card);
  border-radius: 50%;
  box-shadow: var(--shadow);
  line-height: 0;
  flex-shrink: 0;
  max-width: 78vw;
  max-height: 78vw;
}

.uhr-svg { display: block; overflow: visible; }

.uhr-rand {
  fill: var(--card);
  stroke: var(--primary);
  stroke-width: 5;
}

.uhr-strich { stroke: var(--ink); stroke-width: 1.5; opacity: 0.35; }
.uhr-strich-gross { stroke: var(--ink); stroke-width: 3.5; opacity: 0.65; stroke-linecap: round; }

.uhr-zahl {
  fill: var(--ink);
  font-family: inherit;
  font-size: 21px;
  font-weight: 900;
}

.uhr-mitte-punkt { fill: var(--card); }

/* Zeiger springen beim Stellen weich auf die Rasterposition */
/* Die Drehachse steckt schon im SVG-Attribut rotate(winkel 100 100).
   transform-origin MUSS deshalb 0 0 bleiben — sonst wird die Verschiebung
   ein zweites Mal angewendet und die Zeiger landen neben dem Ziffernblatt. */
.uhr-zeiger { transition: transform 0.18s ease-out; transform-origin: 0 0; }

/* Der gerade gewählte Zeiger wird deutlich hervorgehoben */
.uhr-zeiger.aktiv line {
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.45));
  stroke-width: 15;
}
.uhr-zeiger-minute.aktiv line { stroke-width: 9; }

/* Interaktive Uhr: Ziehen darf die Seite nicht scrollen */
.uhr-interaktiv {
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  outline: 4px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 6px;
}

.uhr-wrap.uhr-richtig { outline: 5px solid var(--success); outline-offset: 6px; }
.uhr-wrap.falsch { animation: wackeln 0.45s; }

/* ---------- Zeiger-Umschalter (Stunde / Minute), ab Stufe 2 ---------- */

.zeiger-wahl {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.zeiger-knopf {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 4px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 18px 10px 12px;
  min-height: 66px;
  min-width: 132px;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
  opacity: 0.65;
}

.zeiger-knopf .zeiger-icon {
  width: 44px;
  height: 44px;
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}

.zeiger-knopf.aktiv {
  opacity: 1;
  border-color: var(--accent);
  transform: scale(1.06);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
}

.zeiger-knopf:active { transform: scale(0.96); }
.zeiger-knopf-text { letter-spacing: 0.02em; }

/* ---------- Fertig-Knopf ---------- */

.uhr-fertig {
  font-size: 24px;
  padding: 16px 42px;
  min-height: 64px;
}

.uhr-fertig.richtig { filter: none; }

/* ---------- Digitalanzeige ---------- */

.uhr-digital {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 4px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 22px;
}

.uhr-digital.richtig { border-color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--card)); }
.uhr-digital.falsch { animation: wackeln 0.45s; border-color: var(--danger, #e85d75); }

.uhr-slot {
  display: inline-block;
  min-width: 42px;
  text-align: center;
  font-size: 52px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ink) 30%, transparent);
}

.uhr-slot.gefuellt { color: var(--ink); }

.uhr-doppelpunkt {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  padding-bottom: 6px;
}

.uhr-digital-gross .uhr-slot,
.uhr-digital-gross .uhr-doppelpunkt { font-size: 64px; }

/* ---------- Ziffernblock 0–9 ---------- */

.ziffern-block {
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  gap: 10px;
  max-width: 380px;
  width: 100%;
  justify-content: center;
}

.ziffer-taste {
  background: var(--card);
  border: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  min-height: 60px;
  min-width: 56px;
}

.ziffer-taste:active { transform: scale(0.93); border-color: var(--accent); }
.ziffer-taste:disabled { filter: grayscale(0.8); opacity: 0.6; }

.ziffer-loeschen {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  font-size: 24px;
}

/* ---------- Auswahl aus drei Analoguhren ---------- */

.uhr-wahl-reihe {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.antwort.uhr-wahl {
  padding: 10px;
  line-height: 0;
  min-width: 0;
  border-radius: 50%;
}

.antwort.uhr-wahl .uhr-wrap {
  box-shadow: none;
  max-width: 26vw;
  max-height: 26vw;
}

/* ---------- Zeit-Knöpfe beim Ablesen ---------- */

.antwort.uhr-zeit-knopf {
  font-size: 36px;
  min-width: 126px;
  padding: 18px 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Schmale Handys: Uhr und Knöpfe etwas kompakter */
@media (max-width: 420px) {
  .antwort.uhr-zeit-knopf { font-size: 30px; min-width: 104px; padding: 14px 16px; }
  .uhr-slot, .uhr-doppelpunkt { font-size: 42px; }
  .uhr-digital-gross .uhr-slot,
  .uhr-digital-gross .uhr-doppelpunkt { font-size: 52px; }
  .ziffern-block { grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: 8px; }
}
