.cr-result-visual {
  width: min(100%, 320px);
  height: 230px;
  margin: 0 auto 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0f1b2c, #08101c);
  box-shadow: 0 22px 60px rgba(0, 13, 51, 0.2);
}

.mag-state-pending,
.mag-state-paid,
.mag-state-failed,
.mag-state-cancelled {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.mag-state-spinner-shell {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.mag-state-spinner-shell::before,
.mag-state-spinner-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid transparent;
}

.mag-state-spinner-shell::before {
  border-top-color: #d4af37;
  border-right-color: rgba(212, 175, 55, 0.28);
  animation: magPendingSpin 1s linear infinite;
}

.mag-state-spinner-shell::after {
  inset: 14px;
  border-bottom-color: rgba(255,255,255,0.38);
  border-left-color: rgba(255,255,255,0.12);
  animation: magPendingSpinReverse 1.45s linear infinite;
}

.mag-state-spinner-core {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(212,175,55,0.7) 52%, rgba(212,175,55,0.08));
  box-shadow: 0 0 0 12px rgba(212,175,55,0.06);
  animation: magPendingPulse 1.6s ease-in-out infinite;
}

.mag-state-check-shell {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(212,175,55,0.1), rgba(255,255,255,0));
  display: grid;
  place-items: center;
}

.mag-state-check-svg {
  width: 180px;
  height: 180px;
  overflow: visible;
}

.mag-state-check-ring {
  fill: rgba(212, 175, 55, 0.1);
  stroke: #d4af37;
  stroke-width: 4;
  stroke-dasharray: 326;
  stroke-dashoffset: 326;
  animation: magCheckRing 0.9s ease forwards;
}

.mag-state-check {
  fill: none;
  stroke: #ffffff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 76;
  stroke-dashoffset: 76;
  animation: magCheckPath 0.55s ease 0.55s forwards;
}

.mag-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mag-confetti-piece {
  position: absolute;
  top: 20%;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  opacity: 0;
  animation: magConfetti 1.9s cubic-bezier(.2,.8,.2,1) forwards;
  transform-origin: center;
}

.mag-state-badge {
  position: relative;
  width: 164px;
  height: 164px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,0.12);
}

.mag-state-failed .mag-state-badge {
  background: radial-gradient(circle at center, rgba(178, 67, 67, 0.18), rgba(178, 67, 67, 0.05));
  border-color: rgba(206, 86, 86, 0.34);
  box-shadow: 0 0 0 20px rgba(206, 86, 86, 0.06);
}

.mag-state-cancelled .mag-state-badge {
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 20px rgba(255,255,255,0.04);
}

.mag-state-badge span {
  color: #fff;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.mag-state-cancelled .mag-state-badge span {
  font-size: 3rem;
  color: rgba(255,255,255,0.82);
}

.cr-result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cr-result-actions .cr-restart,
.cr-result-actions .cr-refresh {
  margin: 0;
}

.cr-result-actions button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #000d33;
  cursor: pointer;
  font: 800 12px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cr-refresh {
  background: #d9b632;
  color: #000d33;
}

@keyframes magPendingSpin { to { transform: rotate(360deg); } }
@keyframes magPendingSpinReverse { to { transform: rotate(-360deg); } }
@keyframes magPendingPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.82; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes magCheckRing { to { stroke-dashoffset: 0; } }
@keyframes magCheckPath { to { stroke-dashoffset: 0; } }
@keyframes magConfetti {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) scale(0.72); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--mag-x), 190px, 0) rotate(var(--mag-r)) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mag-state-spinner-shell::before,
  .mag-state-spinner-shell::after,
  .mag-state-spinner-core,
  .mag-state-check-ring,
  .mag-state-check,
  .mag-confetti-piece {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 560px) {
  .cr-result-visual { height: 210px; }
  .cr-result-actions { display: grid; grid-template-columns: 1fr; }
  .cr-result-actions .cr-restart,
  .cr-result-actions .cr-refresh { width: 100%; justify-content: center; }
}
