/* ImGui WASM showcase embed */

.imgui-demo-host {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.imgui-demo-frame {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  background: #080808;
  aspect-ratio: 680 / 470;
  overflow: hidden;
  contain: layout paint;
  border-radius: 1rem;
}

.imgui-demo-iframe {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #080808;
  image-rendering: auto;
  border-radius: 1rem;
  max-width: 100%;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.imgui-demo-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.055), transparent 38%),
    #080808;
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.imgui-demo-spinner {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-right-color: rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.12));
  animation: imgui-demo-spin 0.85s linear infinite;
}

.imgui-demo-loading-text,
.imgui-demo-error-text {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.imgui-demo-error-text {
  display: none;
  color: rgba(255, 255, 255, 0.58);
}

.imgui-demo-frame.is-ready .imgui-demo-iframe {
  opacity: 1;
}

.imgui-demo-frame.is-ready .imgui-demo-loader {
  visibility: hidden;
  opacity: 0;
}

.imgui-demo-frame.is-failed .imgui-demo-spinner,
.imgui-demo-frame.is-failed .imgui-demo-loading-text {
  display: none;
}

.imgui-demo-frame.is-failed .imgui-demo-error-text {
  display: block;
}

@keyframes imgui-demo-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 1023px) {
  #showcase {
    overflow-x: clip;
  }

  #showcase .mx-auto,
  #showcase .grid {
    max-width: 100%;
    min-width: 0;
  }

  .imgui-demo-host,
  .imgui-demo-frame {
    max-width: 100%;
    width: 100%;
  }

  .imgui-demo-frame {
    min-height: 0;
  }
}

@media (max-width: 639px) {
  html,
  body {
    overflow-x: clip;
  }

  #showcase {
    overflow-x: clip;
  }

  .imgui-demo-host {
    overflow: hidden;
  }

  .imgui-demo-frame {
    --demo-native-w: 680;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 680 / 470;
    overflow: hidden;
  }

  .imgui-demo-iframe {
    width: 680px;
    height: 470px;
    max-width: none;
    transform: scale(var(--demo-scale, 0.52));
    transform-origin: top left;
    border-radius: 0;
  }
}

/* Keep showcase copy visible if animation setup fails. */
#showcase .reveal {
  opacity: 1 !important;
  transform: none !important;
}
