/* Erdell Collectibles – 3D-Ansicht. Nutzt die Farben/Schriften der Website, falls vorhanden. */
.ec3d {
  --ec-ink: var(--ink, #161412);
  --ec-muted: var(--muted, #5b554c);
  --ec-line: var(--line, #e4e0d8);
  --ec-paper: var(--paper, #ffffff);
  --ec-soft: var(--soft, #f6f4ef);
  --ec-display: var(--display, "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif);
  --ec-body: var(--body, "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  position: relative;
  color: var(--ec-ink);
  font-family: var(--ec-body);
}

.ec3d-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 340px;
  max-height: 78vh;
  overflow: hidden;
  background: var(--ec-soft);
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.ec3d-stage.is-grabbing { cursor: grabbing; }
.ec3d-stage:focus-visible { outline: 3px solid var(--ec-ink); outline-offset: -3px; }

.ec3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ec3d-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ec3d-lines line { stroke: var(--ec-ink); stroke-width: 1; opacity: 0; transition: opacity .35s ease; }
.ec3d-lines line.is-on { opacity: .55; }
.ec3d-labels { position: absolute; inset: 0; pointer-events: none; }

.ec3d-label {
  position: absolute; left: 0; top: 0;
  max-width: 220px;
  padding: 9px 12px 10px;
  background: var(--ec-paper);
  opacity: 0;
  transition: opacity .35s ease;
  will-change: transform, opacity;
}
.ec3d-label.is-on { opacity: 1; }
.ec3d-label strong {
  display: block;
  font: 800 15px/1.2 var(--ec-display);
  font-stretch: 112%;
  letter-spacing: -.01em;
}
.ec3d-label span { display: block; margin-top: 3px; font-size: 15px; line-height: 1.35; color: var(--ec-muted); }

.ec3d-dot {
  position: absolute; left: -8px; top: -8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ec-ink);
  border: 3px solid var(--ec-paper);
  box-sizing: content-box;
  opacity: 0; transition: opacity .35s ease;
}
.ec3d-dot.is-on { opacity: 1; }

.ec3d-head {
  position: absolute; left: 22px; top: 18px; margin: 0;
  max-width: min(440px, 70%);
  font: 800 var(--t-sub, clamp(22px, 2.4vw, 32px))/1.08 var(--ec-display);
  font-stretch: 125%;
  letter-spacing: -.4px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease;
  pointer-events: none;
}
.ec3d-head.is-on { opacity: 1; transform: none; }

.ec3d-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 7px 14px;
  background: var(--ec-paper);
  font: 600 15px/1 var(--ec-body);
  color: var(--ec-ink);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .4s ease;
}
.ec3d-hint.is-off { opacity: 0; }

.ec3d-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--ec-muted);
  background: var(--ec-soft);
  transition: opacity .5s ease;
}
.ec3d-loading.is-off { opacity: 0; pointer-events: none; }

/* Schritte + Button */
.ec3d-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 14px;
}
.ec3d-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
  flex: 1; max-width: 560px;
}
.ec3d-step {
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 0 0 4px; margin: 0;
  background: none; border: 0; cursor: pointer;
  font: 600 13px/1.2 var(--ec-body); color: var(--ec-muted);
  text-align: left;
  min-height: 44px;
}
.ec3d-step::before {
  content: ""; display: block; width: 100%; height: 3px;
  background: var(--ec-line);
  transition: background .3s ease;
}
.ec3d-step.is-done::before, .ec3d-step.is-current::before { background: var(--ec-ink); }
.ec3d-step.is-current { color: var(--ec-ink); }
.ec3d-step:hover { color: var(--ec-ink); }
.ec3d-step:focus-visible { outline: 2px solid var(--ec-ink); outline-offset: 3px; }

.ec3d-next {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 22px;
  background: var(--ec-ink); color: var(--ec-paper);
  border: 0; cursor: pointer;
  font: 700 15px/1 var(--ec-body);
  transition: background .2s ease, transform .1s ease;
}
.ec3d-next:hover { background: #2e2a26; }
.ec3d-next:active { transform: translateY(1px); }
.ec3d-next:focus-visible { outline: 2px solid var(--ec-ink); outline-offset: 3px; }

.ec3d-status {
  /* nur für Screenreader sichtbar, keine Linie – taste-skill-ignore */
  position: absolute; width: 1px; height: 1px; overflow: hidden; /* taste-skill-ignore */
  clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
}

.ec3d--error .ec3d-fallback, .ec3d--nowebgl .ec3d-fallback { display: block; }

@media (max-width: 760px) {
  .ec3d-stage { aspect-ratio: 4 / 5; min-height: 0; max-height: 82vh; }
  .ec3d-head { left: 16px; top: 16px; max-width: 78%; }
  .ec3d-label { max-width: 150px; padding: 7px 9px 8px; }
  .ec3d-label strong { font-size: 14px; }
  .ec3d-label span { font-size: 13px; }
  .ec3d-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ec3d-steps { max-width: none; }
  .ec3d-step { font-size: 13px; }
  .ec3d-next { width: 100%; }
}

/* Geschichte auf der Startseite: Bühne füllt die angeheftete Fläche, die Schritte stehen im Text daneben */
.ec3d--story { height: 100%; }
.ec3d--story .ec3d-stage { height: 100%; aspect-ratio: auto; min-height: 0; max-height: none; }
.ec3d--story .ec3d-bar { display: none; }
@media (min-width: 761px) { .ec3d--story:not(.is-final) .ec3d-head { opacity: 0; } }
@media (max-width: 760px) {
  .ec3d--story { height: auto; }
  .ec3d--story .ec3d-stage { height: auto; aspect-ratio: 4 / 5; max-height: 82vh; }
  .ec3d--story .ec3d-bar { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .ec3d-head, .ec3d-label, .ec3d-dot, .ec3d-lines line { transition: none; }
}
