@keyframes crt-scanline-move {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(480px);
  }
}

@keyframes crt-hum-line {
  0% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(100dvh);
  }
}

@keyframes crt-glow-pulse {
  0%,
  100% {
    text-shadow:
      0 0 4px #fff,
      0 0 8px #fff,
      0 0 12px #8888ff,
      0 0 20px #8888ff;
  }
  50% {
    text-shadow:
      0 0 2px #fff,
      0 0 4px #fff,
      0 0 6px #8888ff,
      0 0 10px #8888ff;
  }
}

.bsod-overlay {
  position: fixed;
  inset: 0;
  background-color: #0a0a2e;
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.5;
  z-index: 999999;
  overflow: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: none;
  filter: url(#crt-distortion) url(#crt-noise);
}

.bsod-overlay::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

.bsod-overlay::after {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    farthest-corner at center,
    transparent 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.bsod-curved-container {
  position: relative;
  height: 100%;
  overflow-y: auto;
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    inset 0 0 100px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(136, 136, 255, 0.1);
}

.bsod-hum-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent 100%
  );
  z-index: 3;
  animation: crt-hum-line 8s linear infinite;
  pointer-events: none;
}

.bsod-content {
  position: relative;
  padding: 2em;
  z-index: 5;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff,
    0 0 8px #8888ff,
    0 0 16px #8888ff,
    1px 1px 0 #ff0000,
    -1px -1px 0 #0000ff;
}

.bsod-header {
  margin-bottom: 24px;
}

.bsod-stop-code {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 16px;
  letter-spacing: 1px;
  animation: crt-glow-pulse 3s ease-in-out infinite;
}

.bsod-body {
  margin-bottom: 24px;
}

.bsod-body p {
  margin: 0 0 8px;
}

.bsod-error-name {
  font-weight: bold;
  margin: 16px 0;
  font-size: 18px;
  animation: crt-glow-pulse 2s ease-in-out infinite;
}

.bsod-details {
  margin: 16px 0 24px;
}

.bsod-details > summary {
  cursor: pointer;
  user-select: none;
  outline: none;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #8888ff;
}

.bsod-details[open] > summary {
  margin-bottom: 8px;
}

.bsod-stack {
  background: rgba(20, 20, 60, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px;
  font-size: 13px;
  margin-top: 8px;
  font-family: "Courier New", Courier, monospace;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #8888ff;
}

.bsod-stack-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bsod-stack-line:last-child {
  border-bottom: none;
}

.bsod-frame-num {
  color: #888;
  margin-right: 8px;
  user-select: none;
  text-shadow:
    0 0 2px #666,
    0 0 4px #888;
}

.bsod-func {
  color: #ffffff;
  font-weight: bold;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #aaaaff;
}

.bsod-loc {
  color: #88ccff;
  text-shadow:
    0 0 2px #4488ff,
    0 0 4px #4488ff;
}

.bsod-line-num,
.bsod-col-num {
  color: #88ccff;
  text-shadow:
    0 0 2px #4488ff,
    0 0 4px #4488ff;
}

.bsod-timestamp {
  font-size: 12px;
  color: #cccccc;
  margin-top: 4px;
  text-shadow:
    0 0 2px #666,
    0 0 4px #888;
}

.bsod-url {
  font-size: 12px;
  color: #88ccff;
  word-break: break-all;
  margin-top: 8px;
  text-shadow:
    0 0 2px #4488ff,
    0 0 4px #4488ff;
}

.bsod-copy-btn {
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  margin-top: 8px;
  text-shadow: 0 0 4px #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.bsod-copy-btn:hover,
.bsod-copy-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.4),
    inset 0 0 8px rgba(255, 255, 255, 0.1);
  outline: none;
}

.bsod-reboot-btn,
.bsod-reset-btn {
  background: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 24px;
  cursor: pointer;
  margin-top: 24px;
  text-shadow:
    0 0 4px #fff,
    0 0 8px #8888ff;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.2),
    inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.bsod-reboot-btn:hover,
.bsod-reboot-btn:focus,
.bsod-reset-btn:hover,
.bsod-reset-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  outline: none;
}

.bsod-footer {
  margin-top: 48px;
  font-size: 14px;
  text-shadow: 0 0 4px #fff;
}

@media (max-width: 600px) {
  .bsod-overlay {
    font-size: 14px;
  }

  .bsod-stop-code {
    font-size: 16px;
  }

  .bsod-footer {
    margin-top: 32px;
  }
}
