:root {
  --win-blue: #0078d7;
  --win11-blue: #0063b1;
  --xp-blue: #0000aa;
  --accent: #00ff41;
  --panel: rgba(10, 12, 16, 0.96);
  --border: #1d2530;
  --muted: #9aa0a6;
  --text: #e8eaed;
  --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the hidden attribute must beat the .field display:flex rule */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: #06080a;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Control panel ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 6vw;
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo a { color: var(--accent); text-decoration: none; font-weight: 700; letter-spacing: 0.06em; }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover { color: var(--accent); }

.stage {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 6vw 0;
}

.stage h1 {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.lede { color: var(--muted); margin-bottom: 22px; max-width: 70ch; }

.controls {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.control-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1 1 180px; }

.field label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select,
.field input[type="text"] {
  background: #0c0f14;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 9px 10px;
  border-radius: 6px;
  width: 100%;
}

.field select:focus,
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.field.check { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; }
.field.check label { text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: var(--text); }
.field.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

.btn {
  font-family: var(--font);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 11px 22px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--accent); color: #04060a; }
.btn.primary { background: var(--accent); color: #04060a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.15); }

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 12px;
}

.hint kbd {
  background: #0c0f14;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.8em;
  color: var(--text);
}

/* ---------- The screen itself ---------- */
.bsod {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 10vw;
  cursor: none;
  user-select: none;
  font-family: 'Segoe UI', 'Selawik', Tahoma, Geneva, Verdana, sans-serif;
}

.bsod.active { display: flex; }

.bsod .exit-hint {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.32;
  font-family: var(--font);
  transition: opacity 0.4s ease;
}

.bsod.hide-hint .exit-hint { opacity: 0; }

/* Windows 10 / 11 */
.bsod.win10 { background: var(--win-blue); color: #fff; }
.bsod.win11 { background: var(--win11-blue); color: #fff; }

.bsod.win10 .sad,
.bsod.win11 .sad {
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: 1;
  margin-bottom: 3vh;
  font-weight: 300;
}

.bsod.win10 .headline,
.bsod.win11 .headline {
  font-size: clamp(1.3rem, 3.3vw, 2.4rem);
  font-weight: 400;
  line-height: 1.35;
  max-width: 32ch;
  margin-bottom: 3vh;
}

.bsod.win10 .progress,
.bsod.win11 .progress {
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  margin-bottom: 4vh;
}

.bsod .detail {
  font-size: clamp(0.8rem, 1.35vw, 1rem);
  line-height: 1.6;
  max-width: 62ch;
}

.bsod .detail p { margin-bottom: 10px; }

.bsod .qr-row { display: flex; gap: 22px; align-items: flex-start; margin-top: 1vh; }

.bsod .qr {
  width: clamp(70px, 9vw, 108px);
  height: clamp(70px, 9vw, 108px);
  flex: none;
  background: #fff;
  padding: 6px;
}

.bsod .qr svg { width: 100%; height: 100%; display: block; }

.bsod .stopcode { margin-top: 12px; }
.bsod .stopcode strong { font-weight: 600; }

/* Windows XP */
.bsod.winxp {
  background: var(--xp-blue);
  color: #fff;
  font-family: 'Lucida Console', 'Courier New', monospace;
  justify-content: center;
  align-items: center;
  padding: 6vh 8vw;
}

.bsod.winxp .xp-body {
  max-width: 74ch;
  font-size: clamp(0.72rem, 1.35vw, 1rem);
  line-height: 1.5;
}

.bsod.winxp .xp-title {
  background: #aaa;
  color: var(--xp-blue);
  display: inline-block;
  padding: 0 8px;
  margin-bottom: 1.4em;
  font-weight: 700;
}

.bsod.winxp p { margin-bottom: 1.1em; }

/* Windows 9x */
.bsod.win98 {
  background: #0000a8;
  color: #fff;
  font-family: 'Lucida Console', 'Courier New', monospace;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6vh 8vw;
}

.bsod.win98 .w98-body { max-width: 68ch; font-size: clamp(0.75rem, 1.4vw, 1rem); line-height: 1.7; }
.bsod.win98 .w98-title { background: #a8a8a8; color: #0000a8; display: inline-block; padding: 0 10px; margin-bottom: 1.6em; }
.bsod.win98 p { margin-bottom: 1.3em; }
.bsod.win98 .blink-cursor::after { content: '_'; animation: blink 1s step-end infinite; }

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

/* ---------- Reference content ---------- */
.tool-info {
  max-width: 1100px;
  margin: 40px auto 90px;
  padding: 0 6vw;
  color: var(--muted);
}

.tool-info h2 {
  color: var(--accent);
  font-size: 1.25rem;
  margin: 32px 0 12px;
  letter-spacing: 0.02em;
}

.tool-info h3 { color: var(--text); font-size: 1.02rem; margin: 22px 0 8px; }
.tool-info p, .tool-info li { margin-bottom: 12px; }
.tool-info ul, .tool-info ol { margin: 0 0 16px 22px; }
.tool-info strong { color: var(--text); }
.tool-info a { color: var(--accent); }
.tool-info code {
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
  font-size: 0.88em;
}

.stop-table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 0.88rem; }
.stop-table th, .stop-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.stop-table th { background: #0c0f14; color: var(--accent); }
.stop-table td code { white-space: nowrap; }

.callout {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #0a0e13;
  padding: 14px 18px;
  margin: 8px 0 22px;
}

.callout p { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 10px;
  text-align: center;
  font-size: 0.85rem;
  background: rgba(10, 12, 16, 0.95);
}

.site-footer .links { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer .copy { color: var(--muted); font-size: 0.75rem; }

@media (max-width: 640px) {
  .bsod { padding: 6vh 7vw; }
  .control-row { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bsod.win98 .blink-cursor::after { animation: none; }
  html { scroll-behavior: auto; }
}
