/* Nebeneinander, Nacheinander – nur für diese Seite.
   Farben, Schriften und Abstände kommen aus ../../styles.css (Variablen). */

/* ---------- Bühne: weisse Fläche, Rad im Zentrum, Ergebnis daneben/darunter ---------- */
.rad-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: 40px;
}

.rad-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rad-wheel {
  display: block;
  width: min(100%, 620px);
  aspect-ratio: 1 / 1;
  color: var(--text);
  touch-action: none;             /* die Geste gehört dem Rad */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  border-radius: 50%;
  outline: none;
}

.rad-wheel.is-dragging { cursor: grabbing; }
.rad-wheel[data-state="spinning"],
.rad-wheel[data-state="settling"] { cursor: default; }

.rad-wheel:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 6px;
}

/* Linien: Breite in Bildschirmpixeln, unabhängig von der Grösse des Rads */
.rad-wheel path,
.rad-wheel circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rad-guide { stroke-width: 0.6; stroke-dasharray: 2 5; opacity: 0.35; }
.rad-hair { stroke-width: 0.6; opacity: 0.18; }
.rad-cross { stroke-width: 1; opacity: 0.7; }
.rad-wheel .rad-dot { fill: currentColor; stroke: none; }

.rad-edge { stroke-width: 1.4; }
.rad-edge--thin { stroke-width: 0.8; opacity: 0.6; }
.rad-fine { stroke-width: 0.6; opacity: 0.4; }
.rad-bound { stroke-width: 0.9; opacity: 0.75; }

.rad-axis-line { stroke-width: 0.7; opacity: 0.22; }
.rad-axis-notch { stroke-width: 1.4; }
.rad-wheel .rad-axis-mark { fill: currentColor; stroke: none; }

/* Zeichen */
.rad-wheel .sym { transition: opacity 0.6s ease; }
.rad-wheel .sym-line { stroke-width: 1.3; }
.rad-wheel .sym-ghost { opacity: 0.45; }
.rad-wheel .sym-over { stroke-width: 0.9; }
.rad-wheel .sym-dot { fill: currentColor; stroke: none; }

/* nach dem Stillstand treten die übrigen Zeichen leicht zurück */
.rad-wheel.is-selected .sym { opacity: 0.28; }
.rad-wheel.is-selected .sym.is-hit { opacity: 1; }
.rad-wheel.is-selected .sym.is-hit .sym-line { stroke-width: 1.8; }

/* Spur früherer Begegnungen */
.rad-wheel .rad-trace { fill: currentColor; stroke: none; }

/* Namen der beiden getroffenen Plätze (§6a): erst nach dem Stillstand, weg mit der nächsten Drehung */
.rad-wheel .rad-hitnames text {
  fill: currentColor;
  font-family: var(--font);
  letter-spacing: 0.02em;
  /* schmale Aussparung in der Grundfarbe, damit die feine Hilfslinie die Buchstaben nicht schneidet */
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.rad-wheel .rad-hitnames {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.rad-wheel .rad-hitnames.is-shown { opacity: 1; }

/* Hinweis in der leeren Mitte, nur vor der ersten Berührung */
.rad-cue {
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: 0.3em;
  fill: var(--muted);
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.rad-wheel.is-touched .rad-cue { opacity: 0; }

/* ---------- Legende: alle 40 Namen neben ihrem Zeichen (§6a) ---------- */
.rad-legend-toggle {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
.rad-legend-toggle:hover,
.rad-legend-toggle:focus-visible { color: var(--text); }

.rad-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  width: min(100%, 620px);
  margin-top: 18px;
  font-size: 0.85rem;
}
.rad-legend[hidden] { display: none; }

.rad-legend h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rad-legend ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rad-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.rad-legend-sym {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text);
  opacity: 0.55;
}
.rad-legend-sym path,
.rad-legend-sym circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 1.1;
}
.rad-legend-sym .sym-dot { fill: currentColor; stroke: none; }
.rad-legend-sym .sym-ghost { opacity: 0.45; }

/* nur die beiden gezogenen Namen, erst beim Stillstand */
.rad-legend li.is-hit { color: var(--text); }
.rad-legend li.is-hit .rad-legend-sym { opacity: 1; }

/* ---------- Ergebnis ---------- */
.rad-result {
  max-width: 680px;
  margin: 0 auto;
  min-height: 1px;
}

.rad-result > * {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.9s ease, transform 0.9s ease, visibility 0s linear 0.9s;
}

.rad-result > .is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.9s ease, transform 0.9s ease, visibility 0s;
}

.rad-result:not(.is-active) > * {
  transition-duration: 0.2s, 0.2s, 0s;
  transition-delay: 0s, 0s, 0.2s;
}

.rad-names {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rad-artist,
.rad-theorist {
  display: inline-block;          /* Namen bleiben zusammen */
}

.rad-x {
  padding: 0 0.15em;
  color: var(--muted);
}

.rad-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.75;
}

.rad-question {
  margin: 2.2em 0 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.5;
}

/* zwei gleich gestaltete, zurückhaltende Knöpfe unter der Frage */
.rad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.6em;
  margin-top: 2.4em;
}

.rad-again,
.rad-share {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.rad-again:hover,
.rad-again:focus-visible,
.rad-share:hover,
.rad-share:focus-visible { color: var(--text); }

/* Rückfall, wenn weder Teilen noch Zwischenablage verfügbar sind: Adresse zum Markieren */
.rad-address {
  margin: 1.2em 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.rad-address[hidden] { display: none; }
.rad-address input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.4em;
  padding: 0.4em 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  font: inherit;
  color: var(--text);
}

/* ---------- Laufband mit allen Namen ---------- */
.rad-ticker {
  margin: 40px 0 0;
  overflow: hidden;
  background: transparent;
  color: var(--accent);
}

.rad-ticker-track {
  display: flex;
  width: max-content;
  animation: rad-ticker var(--ticker-duration, 60s) linear infinite;
}

.rad-ticker:hover .rad-ticker-track { animation-play-state: paused; }

.rad-ticker-list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rad-ticker-list li {
  padding: 11px 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.rad-ticker-list li::after {
  content: "·";
  padding: 0 0.9em;
}

@keyframes rad-ticker {
  to { transform: translateX(-50%); }
}

/* ---------- Einführung ---------- */
.rad-about {
  margin: 56px 0 0;
}

/* Beschreibung rechtsbündig am rechten Rand */
.rad-intro {
  max-width: 720px;
  margin-left: auto !important;
  text-align: right;
}

.rad-about p { margin: 0 0 14px; line-height: 1.7; }

/* Hinweise unter der Beschreibung (Geste und Ziehung, Herkunft der Texte): rechtsbündig, kleiner */
.rad-about .rad-note {
  max-width: 720px;
  margin: 0 0 14px auto;
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
}
.rad-about .rad-note a { color: inherit; text-underline-offset: 3px; }

/* Hinweis «Als App installieren»: über dem Rad, deutlich, aber im Stil des Instruments –
   feine Linie, keine Fläche, kleines App-Symbol. Steht mittig zwischen Untertitel und Rad
   (gleicher Abstand oben und unten wie der Kopf nach dem Untertitel). */
.rad-install {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 40px;
  text-align: center;
}
.rad-install[hidden] { display: none; }
.rad-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 8px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.rad-install-btn img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
}
.rad-install-btn:hover,
.rad-install-btn:focus-visible {
  background: var(--text);
  color: var(--bg);
  outline: none;
}
.rad-install-hilfe {
  max-width: 30em;
  margin: 10px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}
.rad-install-hilfe[hidden] { display: none; }
.rad-install-hilfe span { white-space: nowrap; }   /* Namen der Knöpfe nicht trennen */
.rad-install-chrome { color: var(--text); white-space: nowrap; }
/* Rückfall auf Android: Manche Geräte lassen die Installation nicht zu (Warnung «unsichere App»);
   eine Verknüpfung geht immer. Klein und still unter dem Knopf. */
.rad-install-alt {
  max-width: 30em;
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}
.rad-install-alt[hidden] { display: none; }
.rad-install-alt span { white-space: nowrap; }

/* Verweis auf die Feldansicht, rechtsbündig unter der Beschreibung */
.rad-about .rad-more-link {
  max-width: 720px;
  margin: 8px 0 0 auto;
  text-align: right;
}

/* ---------- Diagnose (nur ?debug) ---------- */
.rad-debug {
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed var(--muted);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.rad-debug pre { margin: 0 0 10px; white-space: pre-wrap; }
.rad-debug button, .rad-debug select { font: inherit; margin: 0 6px 6px 0; }

/* ---------- Breite Bildschirme: Rad links, Ergebnis rechts ---------- */
@media (min-width: 980px) {
  .rad-stage {
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    gap: 56px;
    padding: 48px;
  }
  .rad-result { margin: 0; }
}

/* ---------- Smartphone: Rad zuerst, möglichst breit, Ergebnis darunter ---------- */
@media (max-width: 640px) {
  .rad-stage {
    margin: 0 -20px;
    padding: 20px 10px 32px;
    gap: 28px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .rad-result { padding: 0 10px; }
  .rad-ticker { margin: 32px -20px 0; }
  .rad-names { font-size: 1.35rem; }
  .rad-question { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rad-result > *, .rad-wheel .sym, .rad-cue, .rad-wheel .rad-hitnames { transition: none; }
  /* ohne Bewegung: alle Namen stehen umbrochen im Band */
  .rad-ticker-track { animation: none; width: auto; }
  .rad-ticker-list { flex-wrap: wrap; padding: 10px 16px; }
  .rad-ticker-list li { padding: 3px 0; }
  .rad-ticker-list[aria-hidden] { display: none; }
}

/* ---------- Als App installiert (Startbildschirm): ohne Menü der Website ---------- */
@media (display-mode: standalone) {
  .site-header .topbar,
  .site-header .divider,
  .work-kicker,
  main > .back { display: none; }
  .site-header { padding-top: max(24px, env(safe-area-inset-top)); }
}

/* ---------- ORNA: Startbild der App, das Rad setzt sich zusammen (js/intro.js) ---------- */
.orna-intro-open { overflow: hidden; }

/* bis das Startbild steht: leere Fläche in der Grundfarbe statt eines kurzen Blicks auf das fertige Rad */
.orna-pre body > :not(.orna-intro) { visibility: hidden; }

.orna-intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  background: var(--bg);
  color: var(--text);
  transition: opacity 0.55s ease;
  cursor: pointer;
}
.orna-intro.is-leaving { opacity: 0; pointer-events: none; }

.orna-wheel {
  width: min(78vw, 58vh, 460px);
  height: auto;
  overflow: visible;
}
.orna-wheel path,
.orna-wheel circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.orna-wheel .sym-line { stroke-width: 1.3; }
.orna-wheel .sym-ghost { opacity: 0.45; }
.orna-wheel .sym-over { stroke-width: 0.9; }
.orna-wheel .sym-dot { fill: currentColor; stroke: none; }

/* Ringe stehen von Anfang an, genau wie auf dem App-Symbol (Android-Startbildschirm) */
.orna-ring { stroke-width: 1.4; }
.orna-ring--thin { stroke-width: 0.8; opacity: 0.6; }

/* Zeichen kommen aus der Streuung an ihren Platz */
.orna-sym {
  transform-box: fill-box;          /* drehen und skalieren um die eigene Mitte */
  transform-origin: center;
  opacity: 0;
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s ease;
  transition-delay: calc(0.15s + var(--i) * 0.03s);
}

.orna-wheel .orna-mark { fill: currentColor; stroke: none; opacity: 0; transition: opacity 0.4s ease 2.1s; }
.orna-wheel .orna-cross { stroke-width: 1; opacity: 0; transition: opacity 0.4s ease 2.1s; }

.orna-name {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  letter-spacing: 0.6em;
  padding-left: 0.6em;              /* optisch zentriert trotz Sperrung */
  opacity: 0;
  transition: opacity 0.6s ease 2.2s;
}

.orna-intro.is-assembling .orna-sym { opacity: 1; transform: none; }
.orna-intro.is-assembling .orna-wheel .orna-mark,
.orna-intro.is-assembling .orna-wheel .orna-cross,
.orna-intro.is-assembling .orna-name { opacity: 1; }
