/* EduPlay — accurate process animations (code-built, matches facts) */

.sp-viz {
  width: 100%;
  min-height: 200px;
  border-radius: 16px;
  background: linear-gradient(160deg, #e8f5e9 0%, #e0f7fa 50%, #fff8e1 100%);
  border: 2px solid rgba(42, 157, 143, 0.25);
  padding: 12px;
  position: relative;
  overflow: hidden;
  font-family: "Nunito", system-ui, sans-serif;
}
.sp-viz__title {
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #0d5c56;
  margin-bottom: 8px;
}
.sp-stage {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sp-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  z-index: 2;
}
.sp-node__icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.12));
  transition: transform 0.35s ease;
}
.sp-node__label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #1b4332;
  text-align: center;
  max-width: 72px;
  line-height: 1.15;
}
.sp-arrow {
  font-size: 1.2rem;
  color: #2a9d8f;
  font-weight: 900;
  opacity: 0.35;
  transition: opacity 0.3s, transform 0.3s;
}
.sp-node.is-active .sp-node__icon {
  transform: scale(1.25);
  animation: sp-pulse 0.6s ease;
}
.sp-node.is-active .sp-node__label {
  color: #0d5c56;
  background: rgba(255,255,255,.85);
  padding: 2px 6px;
  border-radius: 8px;
}
.sp-arrow.is-active {
  opacity: 1;
  transform: scale(1.2);
  color: #e76f51;
}
@keyframes sp-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1.25); }
}

.sp-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #37474f;
  min-height: 2.4em;
  line-height: 1.3;
  padding: 6px 8px;
  background: rgba(255,255,255,.75);
  border-radius: 10px;
}
.sp-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b2dfdb;
}
.sp-dot.is-on { background: #2a9d8f; transform: scale(1.2); }

/* Special scenes */
.sp-foto .sp-sun {
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 2.4rem;
  animation: sp-spin 8s linear infinite;
}
@keyframes sp-spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
.sp-foto .sp-leaf {
  font-size: 4rem;
  animation: sp-breathe 2s ease-in-out infinite;
}
@keyframes sp-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.sp-foto .sp-gas {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0;
}
.sp-foto .sp-co2 {
  left: 12%;
  bottom: 30%;
  color: #546e7a;
  animation: sp-in 3s ease-in-out infinite;
}
.sp-foto .sp-o2 {
  right: 14%;
  top: 35%;
  color: #2e7d32;
  animation: sp-out 3s ease-in-out infinite;
}
@keyframes sp-in {
  0% { opacity: 0; transform: translateY(12px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}
@keyframes sp-out {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-28px); }
}

.sp-volcano .sp-mountain {
  font-size: 5rem;
  position: relative;
}
.sp-volcano .sp-lava {
  position: absolute;
  left: 50%;
  bottom: 40%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  opacity: 0;
  animation: sp-erupt 2.5s ease-in-out infinite;
}
@keyframes sp-erupt {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  40% { opacity: 1; transform: translateX(-50%) translateY(-18px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

.sp-water .sp-wave {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 4px;
  opacity: 0.5;
  animation: sp-wave 2s ease-in-out infinite;
}
@keyframes sp-wave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}
.sp-water .sp-cloud {
  position: absolute;
  top: 12px;
  left: 50%;
  font-size: 2.5rem;
  animation: sp-cloud 4s ease-in-out infinite;
}
@keyframes sp-cloud {
  0%, 100% { transform: translateX(-40px); }
  50% { transform: translateX(20px); }
}
.sp-water .sp-rain {
  position: absolute;
  top: 50px;
  left: 50%;
  font-size: 1rem;
  opacity: 0;
  animation: sp-rain 4s ease-in-out infinite;
}
@keyframes sp-rain {
  0%, 30% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; }
  80% { opacity: 0; transform: translateY(40px); }
}

.sp-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.sp-btn {
  border: none;
  background: #2a9d8f;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.sp-btn:active { transform: scale(0.96); }
.sp-btn--ghost {
  background: #fff;
  color: #0d5c56;
  border: 2px solid #b2dfdb;
}
.sp-host--mini .sp-viz {
  min-height: 140px;
  padding: 8px;
}
.sp-host--mini .sp-stage {
  height: 100px;
}
.sp-host--mini .sp-node__icon {
  font-size: 1.5rem;
}
.sp-host--mini .sp-controls {
  display: none; /* autoplay only in mini quiz view */
}
.sp-host--mini .sp-caption {
  font-size: 0.75rem;
  min-height: 2em;
}

/* Embed in story card */
.sf-story .sp-viz {
  border-radius: 0;
  border: none;
  border-bottom: 2px solid rgba(42, 157, 143, 0.15);
}
.sf-story__img-wrap--replaced {
  display: none !important;
}
