:root {
  --bg: #000;
  --fg: #33ff66;
  --fg-dim: #1f9e40;
  --fg-bright: #b6ffc8;
  --err: #ff5555;
  --glow: 0 0 4px rgba(51, 255, 102, 0.55);
  --font: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  text-shadow: var(--glow);
}

body {
  min-height: 100vh;
  /* Clear the notch / status bar on phones (needs viewport-fit=cover). */
  padding:
    calc(48px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(32px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
}

/* CRT scanlines + vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.25) 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
  z-index: 10;
}

::selection { background: var(--fg); color: var(--bg); text-shadow: none; }

a { color: var(--fg-bright); }
a:hover { background: var(--fg); color: var(--bg); text-shadow: none; }

.term {
  max-width: 880px;
  margin: 0 auto;
  word-break: break-word;
}

.line { min-height: 1.5em; white-space: pre-wrap; }
.dim { color: var(--fg-dim); }
.bright { color: var(--fg-bright); }
.err { color: var(--err); text-shadow: 0 0 4px rgba(255, 85, 85, 0.5); }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--fg);
  box-shadow: var(--glow);
  animation: blink 1s steps(1) infinite;
}

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

/* Real input kept focusable but invisible; its text is mirrored into the line. */
.ghost-input {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
  width: 1px;
  height: 1px;
}

pre.ascii {
  margin: 0 0 16px;
  font-size: clamp(7px, 1.9vw, 14px);
  line-height: 1.15;
  color: var(--fg-bright);
  overflow: hidden;
}

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