.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #000;
  color: #e8e8e8;
  font-family: "Perfect DOS VGA 437", "Courier New", monospace;
  overflow: hidden;
}

.boot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0.04) 2px 3px),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.5));
  mix-blend-mode: screen;
  opacity: 0.3;
  animation: crt-flicker 0.18s steps(2) infinite;
}

.boot-stage {
  width: min(760px, 94vw);
  position: relative;
  z-index: 1;
}

.boot-stage-bios {
  min-height: 250px;
  align-self: center;
}

.bios-lines {
  font-size: clamp(13px, 2.8vw, 18px);
  line-height: 1.5;
  white-space: pre-wrap;
  letter-spacing: 0.2px;
  text-shadow: 0 0 6px rgba(218, 218, 218, 0.3);
}

.bios-line {
  margin: 0;
  animation: text-jitter 1.2s steps(2, end) infinite;
}

.bios-cursor {
  margin: 8px 0 0;
  animation: blink 0.9s steps(1, end) infinite;
}

.boot-stage-splash {
  background: #c0c0c0;
  color: #000;
  border: 2px solid #fff;
  border-right-color: #5f5f5f;
  border-bottom-color: #5f5f5f;
  padding: 20px 18px;
  box-shadow: 4px 4px 0 #202020;
}

.splash-shell {
  text-align: center;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
}

.splash-logo svg {
  width: min(180px, 42vw);
  height: auto;
  image-rendering: pixelated;
}

.boot-stage-splash h1 {
  margin: 8px 0 2px;
  font-size: clamp(24px, 5.5vw, 34px);
  letter-spacing: 0.4px;
}

.boot-stage-splash h2 {
  margin: 0;
  font-size: clamp(13px, 3.7vw, 20px);
  font-weight: 600;
}

.splash-subtitle {
  margin: 12px 0 10px;
  font-size: clamp(11px, 2.8vw, 14px);
}

.boot-credit {
  margin: -4px 0 10px;
  font-size: clamp(10px, 2.2vw, 12px);
  font-style: italic;
  opacity: 0.82;
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
}

.retro-progress {
  margin: 8px auto 12px;
  width: min(360px, 80vw);
  height: 18px;
  background: #fff;
  border: 2px solid #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
}

.retro-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, #00008b 0 10px, #1c4ad8 10px 20px);
}

.splash-percent {
  margin: -6px 0 8px;
  font-size: 12px;
  font-family: "Courier New", monospace;
}

.system-messages {
  text-align: left;
  margin: 0 auto;
  width: min(500px, 82vw);
  min-height: 110px;
  font-family: "Courier New", monospace;
  font-size: clamp(11px, 2.3vw, 13px);
}

.system-message {
  margin: 3px 0;
}

.final-ready {
  margin: 12px 0 0;
  font-weight: bold;
  animation: text-jitter 0.9s steps(2, end) infinite;
}

.boot-skip {
  margin-top: 10px;
  border: 1px solid #000;
  background: #d5d5d5;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 12px;
}

.boot-complete {
  animation: boot-fade-out 0.7s ease forwards;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes crt-flicker {
  0%, 100% { opacity: 0.24; }
  50% { opacity: 0.33; }
}

@keyframes text-jitter {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(0.4px, -0.3px); }
  50% { transform: translate(-0.35px, 0.25px); }
}

@keyframes boot-fade-out {
  to { opacity: 0; visibility: hidden; }
}

@media (max-width: 640px) {
  .boot-stage-splash {
    padding: 14px 12px;
  }

  .retro-progress {
    height: 16px;
  }
}
