/* ==========================================================
   Interaktion und Bewegung für die Schritt-für-Schritt-Führung
   ========================================================== */

/* ---------- Fortschritt ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--ink);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 20;
}

/* ---------- Download-Zeilen gestaffelt ---------- */
.js .slide .stores li {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(0.18s + var(--i, 0) * 0.1s);
}
.js .slide.active .stores li {
  opacity: 1;
  transform: none;
}

/* ---------- Markierungen zeichnen sich ein ---------- */
.pen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.pen rect {
  fill: none;
  stroke: var(--pen);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.js .pen rect {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.85s cubic-bezier(0.55, 0, 0.2, 1) calc(0.35s + var(--d, 0s));
}
.js .slide.active .pen rect {
  stroke-dashoffset: 0;
}

/* Gelber Marker im Text fährt von links nach rechts */
.js .slide .mark {
  background-size: 0% 100%;
  transition: background-size 0.65s cubic-bezier(0.5, 0, 0.2, 1) 0.25s;
}
.js .slide.active .mark {
  background-size: 100% 100%;
}

/* ---------- Antippbare Stellen ---------- */
.hot {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.2s ease;
}
.hot:hover { background: rgba(228, 87, 46, 0.06); }
.hot.sym:hover { background: rgba(21, 30, 40, 0.06); }
.hot:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Kleines Etikett direkt am roten Rahmen, verschwindet nach dem ersten Tippen */
.hot[data-tip]::before,
.tap-flag {
  content: attr(data-tip);
  position: absolute;
  right: 10px;
  top: 0;
  transform: translateY(-100%);
  padding: 0.14rem 0.48rem;
  background: var(--pen);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 5px 5px 0 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease 1s;
}

.tap-flag {
  right: 11%;
  top: 85.4%;
}

.slide.active .shot:not(.used) .hot[data-tip]::before,
.slide.active .shot:not(.used) .tap-flag {
  opacity: 1;
}

.shot.used .hot[data-tip]::before,
.shot.used .tap-flag {
  opacity: 0;
  transition-delay: 0s;
}

.ripple {
  position: absolute;
  width: 2.6rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.3rem;
  border-radius: 50%;
  background: rgba(21, 30, 40, 0.2);
  pointer-events: none;
  z-index: 4;
  animation: ripple 0.65s ease-out forwards;
}
@keyframes ripple {
  from { transform: scale(0.2); opacity: 1; }
  to   { transform: scale(2.3); opacity: 0; }
}

.hint {
  color: var(--ink) !important;
  transition: color 0.35s ease;
}
.shot:not(.used) .hint::before {
  content: "";
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-right: 0.42em;
  vertical-align: -0.06em;
  border: 2px solid var(--pen);
  border-radius: 2px;
}
.shot.used .hint { color: var(--ink); font-weight: 500; }

/* ---------- Text, der sich selbst tippt ---------- */
.typed {
  position: absolute;
  display: none;
  align-items: center;
  padding-left: 0.2em;
  background: #fff;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.2;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.typed.multi { align-items: flex-start; padding-top: 0.15em; }
.typed.on { display: flex; }
.typed span { display: block; }
.typed:not(.multi) span { white-space: nowrap; }
.typed span::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 0.06em;
  vertical-align: -0.14em;
  background: var(--ink);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Symbol hebt sich sanft ab ---------- */
.frame img.sprite {
  position: absolute;
  width: 12.9%;
  height: auto;
  border-radius: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  animation: fly 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fly {
  0%   { opacity: 0; transform: translateY(0) scale(0.95); }
  25%  { opacity: 1; transform: translateY(-35%) scale(1.22); }
  75%  { opacity: 1; transform: translateY(-75%) scale(1.08); }
  100% { opacity: 0; transform: translateY(-100%) scale(0.95); }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}
