:root {
  --phosphor: #41ff7a;
  --dim: #1f9a48;
  --glass: #04140a;
  --case: #d9cfb4;
  --case-dark: #a89d82;
  --desk: #15110d;
  --glow: 0 0 2px rgba(65, 255, 122, 0.9), 0 0 8px rgba(65, 255, 122, 0.45);
}

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

html, body { height: 100%; }

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 50% 30%, #2a2119, var(--desk) 70%);
  font-family: 'VT323', ui-monospace, Consolas, monospace;
  font-size: 23px;
  line-height: 1.25;
  color: var(--phosphor);
}

/* The beige casing */
.monitor {
  position: relative;
  width: min(960px, 100%);
  padding: 34px 34px 54px;
  background: linear-gradient(170deg, #e6ddc4, var(--case) 40%, #c4b99c);
  border-radius: 28px;
  box-shadow: inset 0 2px 0 #f4ecd6, inset 0 -4px 0 var(--case-dark), 0 24px 60px rgba(0, 0, 0, 0.6);
}

.badge {
  position: absolute;
  right: 40px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  letter-spacing: 2px;
  color: #6f6550;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor);
}

/* The glass */
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(76vh, 680px);
  min-height: 420px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #072212 0%, var(--glass) 75%, #010603 100%);
  border-radius: 22px / 26px;
  box-shadow: inset 0 0 0 6px #1d1a14, inset 0 0 50px rgba(0, 0, 0, 0.9);
  text-shadow: var(--glow);
  animation: flicker 6s infinite steps(1);
}

/* Scanlines and vignette over the text */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  border-radius: inherit;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.94; }
  48% { opacity: 1; }
  83% { opacity: 0.97; }
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px 6px;
  color: var(--glass);
  text-shadow: none;
}

.status span {
  padding: 0 8px;
  background: var(--phosphor);
  box-shadow: 0 0 8px rgba(65, 255, 122, 0.5);
}

.out {
  flex: 1;
  overflow-y: auto;
  padding: 14px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}

.out p, .out .line { min-height: 1.25em; white-space: pre-wrap; overflow-wrap: anywhere; }

.title {
  margin: 8px 0 14px;
  font-family: inherit;
  font-size: clamp(9px, 2.9vw, 26px);
  line-height: 1.05;
  white-space: pre;
}

.dim { color: var(--dim); }

.inverse {
  display: inline-block;
  padding: 0 8px;
  color: var(--glass);
  background: var(--phosphor);
  text-shadow: none;
}

/* Menu choices: numbered lines you can also click */
.choice {
  display: block;
  margin-left: 2ch;
  font: inherit;
  color: inherit;
  text-align: left;
  text-shadow: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.choice:hover, .choice:focus-visible { color: var(--glass); background: var(--phosphor); text-shadow: none; outline: none; }

.prompt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1ch; margin-top: 0.6em; }

.prompt input {
  flex: 1;
  min-width: 6ch;
  font: inherit;
  color: inherit;
  text-shadow: inherit;
  background: transparent;
  border: 0;
  outline: none;
  caret-color: var(--phosphor);
  caret-shape: block;
}

.cursor { display: inline-block; width: 0.55em; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: var(--phosphor); animation: blink 1s steps(1) infinite; }

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

.road { white-space: pre; overflow: hidden; }

/* No-JavaScript fallback */
.plain { display: grid; gap: 10px; margin-top: 16px; }
.plain input[type=email], .plain button {
  padding: 4px 8px;
  font: inherit;
  color: var(--phosphor);
  background: transparent;
  border: 2px solid var(--phosphor);
}
.plain button { justify-self: start; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 640px) {
  body { padding: 12px 8px; font-size: 19px; align-items: stretch; }
  .monitor { padding: 12px 12px 40px; border-radius: 18px; }
  .screen { height: auto; min-height: calc(100dvh - 76px); border-radius: 14px / 16px; }
  .status { padding: 10px 14px 4px; font-size: 16px; }
  .out { padding: 10px 14px 20px; }
  .badge { right: 20px; bottom: 11px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .cursor { animation: none; }
}
