@font-face {
  font-family: '3270';
  src: url('fonts/3270-Regular.woff') format('woff'),
       url('fonts/3270-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --green: #4dff5f;
  --green-bright: #baffc4;
  --bg: #020a04;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#crt {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100vh;
  background: radial-gradient(ellipse at center, #04160a 0%, var(--bg) 80%);
  overflow: hidden;
}

#screen {
  position: absolute;
  inset: 0;
  padding: 28px 36px;
  font-family: '3270', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.35;
  color: var(--green);
  text-shadow:
    0 0 1px var(--green-bright),
    0 0 4px var(--green),
    0 0 10px var(--green),
    0 0 20px rgba(77,255,95,0.7);
  overflow-y: auto;
  word-break: break-word;
}

#screen .line, #screen #input-line {
  white-space: pre-wrap;
}

#screen::-webkit-scrollbar { width: 0; }

.line-error { color: #ff5c4d; text-shadow: 0 0 4px #ff5c4d, 0 0 10px #ff5c4d; }

#input-line {
  display: inline;
}

#prompt-text, #typed-before, #typed-after {
  color: var(--green);
}

#cursor {
  animation: blink 1s steps(1) infinite;
  color: var(--green-bright);
  text-shadow: 0 0 2px var(--green-bright), 0 0 8px var(--green), 0 0 16px var(--green);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

#hidden-input {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: none;
  outline: none;
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0.2) 2px,
    rgba(0,0,0,0.2) 3px
  );
  mix-blend-mode: multiply;
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.9; }
  98% { opacity: 1; }
}

.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px 30px rgba(0,0,0,0.75);
}

/* --- nano tarzi editor --- */

#editor {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: radial-gradient(ellipse at center, #04160a 0%, var(--bg) 80%);
  display: flex;
  flex-direction: column;
  font-family: '3270', 'Courier New', monospace;
}

#editor-header {
  color: #021a08;
  background: var(--green);
  padding: 6px 16px;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(77,255,95,0.6);
}

#editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--green);
  font-family: '3270', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.35;
  padding: 16px 24px;
  caret-color: var(--green-bright);
  text-shadow:
    0 0 1px var(--green-bright),
    0 0 4px var(--green),
    0 0 10px var(--green);
}

#editor-footer {
  color: #021a08;
  background: var(--green);
  padding: 6px 16px;
  font-size: 15px;
  box-shadow: 0 0 12px rgba(77,255,95,0.6);
}

/* --- fixed centered branding watermark --- */

#watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  pointer-events: none;
  z-index: 0;
  font-family: '3270', 'Courier New', monospace;
  color: var(--green);
  opacity: 0.16;
  text-shadow: 0 0 6px var(--green), 0 0 16px var(--green);
  letter-spacing: 2px;
}

#watermark div:first-child {
  font-size: 22px;
  font-weight: bold;
}

#watermark div:nth-child(2) {
  font-size: 15px;
}

#watermark div:nth-child(3) {
  font-size: 14px;
  margin-top: 4px;
}

#screen {
  z-index: 1;
}

/* --- HTML rendered inline inside cat/less/more output --- */

#screen .html-block a { color: var(--green-bright); }
#screen .html-block img { max-width: 100%; }
#screen .html-block pre, #screen .html-block code {
  background: rgba(77,255,95,0.08);
  padding: 2px 6px;
  border-radius: 3px;
}
#screen .html-block h1, #screen .html-block h2, #screen .html-block h3 {
  margin: 0.4em 0;
}
