/* =======================================================
   Ayra.NET – ErrorHandler::fatal Overlay
   ======================================================= */

:root {
  --eh-bg: rgba(0, 0, 0, 0.92);
  --eh-card-bg: rgb(25, 25, 25);
  --eh-text: #fff;
  --eh-muted: #cfcfcf;
  --eh-accent: orange;
  --eh-divider: rgba(255, 255, 255, 0.15);
  --eh-radius: 14px;
  --eh-gap: 16px;
  --eh-z: 2147483000; /* über (fast) allem */
}

/* Vollflächiges Overlay */
.errorhandler-fatal-overlay {
  position: fixed;
  inset: 0;
  background: var(--eh-bg);
  display: grid;
  place-items: center;
  z-index: var(--eh-z);
  padding: 24px;
}

/* Karte im Zentrum */
.errorhandler-fatal-card {
  width: min(880px, 92vw);
  background: var(--eh-card-bg);
  color: var(--eh-text);
  border-radius: var(--eh-radius);
  box-shadow: 0 10px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
  padding: clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--eh-gap);
}

/* Icon links */
.errorhandler-fatal-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  display: grid;
  place-items: center;
}
.errorhandler-fatal-icon img {
  height: 56px;
  width: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,165,0,0.35));
}

/* Titel (oben, in Orange) */
.errorhandler-fatal-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--eh-accent);
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: 0.02em;
  font-weight: 700;
}

/* Dünner Trenner */
.errorhandler-fatal-divider {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--eh-divider) 8%,
    var(--eh-divider) 92%,
    transparent 100%
  );
}

/* Nachrichtentext */
.errorhandler-fatal-message {
  grid-column: 1 / -1;
  grid-row: 3;
  color: var(--eh-text);
  line-height: 1.5;
  font-size: 15px;
}
.errorhandler-fatal-message p {
  margin: 0 0 8px 0;
}
.errorhandler-fatal-message strong {
  color: var(--eh-accent);
}
.errorhandler-fatal-details {
  color: var(--eh-muted);
}

/* Optionaler Stacktrace */
.errorhandler-fatal-trace {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 4px 0 0 0;
  padding: 12px 14px;
  max-height: 40vh;
  overflow: auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--eh-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Motion: dezent, respektiert prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  .errorhandler-fatal-card {
    animation: eh-pop .18s ease-out both;
  }
  @keyframes eh-pop {
    from { transform: translateY(4px) scale(.985); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
  }
}

/* Kleine Screens */
@media (max-width: 560px) {
  .errorhandler-fatal-card {
    grid-template-columns: 48px 1fr;
  }
  .errorhandler-fatal-icon img {
    height: 44px; width: 44px;
  }
}