.witch-frame {
  background-color: #14071c !important;
  background-image:
    linear-gradient(180deg, rgba(17, 5, 24, 0.08) 0%, rgba(11, 3, 17, 0.24) 42%, rgba(7, 2, 12, 0.7) 100%),
    url("/assets/witch-background-v20261023-2.webp") !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

.witch-frame::before {
  background:
    radial-gradient(circle at 50% 23%, rgba(215, 84, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(20, 5, 28, 0.04), rgba(4, 1, 8, 0.5)) !important;
}

.witch-title-box,
.witch-message,
.witch-loading,
.witch-empty {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.witch-card {
  background: linear-gradient(90deg, rgba(45, 12, 62, 0.92) 0%, rgba(15, 4, 25, 0.88) 62%, rgba(0, 0, 0, 0.82) 100%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.witch-card-icon {
  position: relative;
  flex: none;
  overflow: hidden;
  isolation: isolate;
}

/* The compiled client still renders the old numeric fallback first. Keep it
   available for ritual identification, but never paint it on screen. */
.witch-card-icon > span {
  visibility: hidden !important;
  opacity: 0 !important;
}

.witch-card-icon:not(.witch-art-ready):not(.witch-art-failed)::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 19px;
  height: 19px;
  margin: -12.5px 0 0 -12.5px;
  border: 3px solid rgba(240, 184, 255, 0.28);
  border-top-color: #ffd56e;
  border-radius: 50%;
  animation: witch-art-spin 0.7s linear infinite;
}

.witch-card-icon.witch-art-failed::after {
  content: "✦";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff3a8;
  text-shadow: 0 2px 3px #000;
  font-size: 27px;
}

.witch-ritual-art {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 2px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.84);
  transition: opacity 0.18s ease, transform 0.22s ease;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.62));
}

@keyframes witch-art-spin {
  to { transform: rotate(360deg); }
}

.witch-card-icon.witch-art-ready > span {
  display: none;
}

.witch-card-icon.witch-art-ready > .witch-ritual-art {
  opacity: 1;
  transform: scale(1);
}

.witch-card-icon.witch-art-failed > .witch-ritual-art {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .witch-ritual-art {
    transition: none;
  }

  .witch-card-icon:not(.witch-art-ready):not(.witch-art-failed)::after {
    animation: none;
  }
}
