/* Scan phase (before 99%) */
.panic-scan-ui {
  transition: opacity 0.35s ease;
}

#prank-shell.prank-shell--failed .panic-scan-ui,
#prank-shell.prank-shell--failed .bsod-scan-ui {
  display: none !important;
}

/* —— FAILED panel (same page) —— */
.failed-panel {
  display: none !important;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  animation: failed-in 0.5s ease-out;
}

.failed-panel.is-visible,
#prank-shell.prank-shell--failed .failed-panel.is-visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@keyframes failed-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.failed-panel--mac {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: rgba(28, 28, 30, 0.95);
  border: 1px solid rgba(255, 59, 48, 0.5);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.failed-panel--mac .failed-titlebar {
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, #3a3a3c, #2c2c2e);
  color: #f5f5f7;
  border-bottom: 1px solid #48484a;
}

.failed-badge {
  display: block;
  width: fit-content;
  margin: 16px auto 12px;
  padding: 6px 16px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: #ff3b30;
  border-radius: 6px;
  animation: failed-blink 1s ease-in-out infinite;
}

@keyframes failed-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

.failed-body {
  padding: 8px 22px 22px;
  color: #f5f5f7;
}

.failed-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  color: #ff6961;
  font-weight: 600;
}

.failed-facts {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid #48484a;
}

.failed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.failed-row:last-child {
  border-bottom: none;
}

.failed-row-label {
  color: #a1a1a6;
  font-weight: 500;
}

.failed-row-value {
  font-weight: 700;
  text-align: right;
  word-break: break-all;
}

.failed-mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
}

.failed-bank {
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.15);
  border: 2px solid #ff3b30;
  font-size: 13px;
  line-height: 1.55;
}

.failed-bank strong {
  color: #ff6961;
}

.failed-call-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: #a1a1a6;
  text-align: center;
}

.failed-phone {
  display: block;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #2997ff;
  text-decoration: none;
  margin-bottom: 14px;
}

.failed-working {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 13px;
  color: #a1a1a6;
}

.failed-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #2997ff;
  border-radius: 50%;
  animation: fail-spin 0.8s linear infinite;
}

@keyframes fail-spin {
  to {
    transform: rotate(360deg);
  }
}

/* —— FAILED on BSOD: same Windows Defender dialog as landing alert —— */
.failed-panel--win.alert-dialog--win {
  max-width: 480px;
  margin: 0 auto;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 24px 48px rgba(0, 0, 0, 0.28);
  animation: win-failed-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes win-failed-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.failed-panel--win .win-failed-icon {
  font-size: 40px;
  filter: none;
}

.failed-panel--win .win-failed-status {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: #d13438;
  border-radius: 2px;
  font-family: 'Segoe UI', sans-serif;
}

.failed-panel--win .alert-dialog__headline {
  font-size: 15px;
  margin-top: 4px;
}

.failed-panel--win .win-failed-phone-box {
  text-align: center;
  padding: 14px 16px;
  margin-top: 4px;
  background: #f3f2f1;
  border: 1px solid #edebe9;
  border-radius: 4px;
}

.failed-panel--win .win-failed-phone-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
  font-family: 'Segoe UI', sans-serif;
}

.failed-panel--win .win-failed-phone-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #0067c0;
  text-decoration: none;
  letter-spacing: 0.02em;
  font-family: 'Segoe UI', sans-serif;
}

.failed-panel--win .win-failed-phone-num:hover {
  text-decoration: underline;
}

.failed-panel--win .win-failed-footer {
  padding: 12px 20px 16px;
}

.failed-panel--win .win-failed-working {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: #605e5c;
  font-family: 'Segoe UI', sans-serif;
}

.failed-panel--win .win-failed-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid #edebe9;
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: fail-spin 0.75s linear infinite;
}

#prank-shell.prank-shell--failed .bsod-wrap {
  justify-content: center;
  align-items: center;
  padding: 4vh 5vw;
  min-height: 100dvh;
}

.phase-panic--mac-only .panic-content .failed-panel--mac.is-visible {
  position: relative;
  z-index: 25;
}

.phase-panic--win .bsod-wrap.prank-shell--failed-layout {
  justify-content: center;
  align-items: center;
}

#prank-shell.prank-shell--failed .phase-panic--win {
  display: block !important;
  visibility: visible !important;
}

html.os-win #prank-shell.prank-shell--failed .failed-panel--win.is-visible {
  display: block !important;
  z-index: 10;
  position: relative;
}

html.prank-failed-active .mac-support-corner {
  opacity: 0.3;
  pointer-events: none;
}
