:root {
  --green: #3dff5c;
  --green-dim: #1ea337;
  --green-bright: #b6ffc2;
  --amber: #ffb000;
  --bg: #050805;
  --bezel: #1a1d18;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'VT323', monospace;
  image-rendering: pixelated;
  overflow: hidden;
}

/* ---------- CRT / Monitor shell ---------- */

.crt {
  position: relative;
  width: min(94vw, 900px);
  height: min(88vh, 640px);
  background: var(--bezel);
  border: 14px solid #0e100d;
  border-radius: 18px;
  box-shadow:
    0 0 0 4px #2b2f27,
    0 0 0 8px #050605,
    0 20px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.9);
  padding: 18px;
  display: flex;
}

.screen {
  position: relative;
  flex: 1;
  background: var(--bg);
  border: 4px solid #000;
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  color: var(--green);
  overflow: hidden;
  box-shadow:
    inset 0 0 60px 10px rgba(0, 40, 0, 0.6),
    inset 0 0 4px 2px #000;
}

/* subtle screen curvature illusion */
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0) 60%);
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0px,
    rgba(0, 0, 0, 0.35) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  z-index: 5;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px 40px rgba(0, 0, 0, 0.85);
  z-index: 6;
}

.flicker {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(180, 255, 190, 0.02);
  z-index: 7;
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  95% { opacity: 0.6; }
  96% { opacity: 1; }
}

/* ---------- Title bar / status bar (blocky chrome) ---------- */

.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #0a1a0a;
  background: var(--green);
  padding: 6px 10px;
  letter-spacing: 1px;
  border: 2px solid #000;
  box-shadow: 0 3px 0 #000;
  margin-bottom: 14px;
  text-shadow: none;
  flex-shrink: 0;
}

.titlebar-lights i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 5px;
  background: #0a1a0a;
  border: 1px solid #000;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #04160a;
  background: var(--green-dim);
  padding: 6px 10px;
  border: 2px solid #000;
  margin-top: 12px;
  flex-shrink: 0;
}

/* ---------- ASCII logo ---------- */

.ascii-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1.15;
  color: var(--green-bright);
  text-shadow: 0 0 6px var(--green), 0 0 14px var(--green);
  text-align: left;
  margin: 0 0 10px 0;
  white-space: pre;
  flex-shrink: 0;
}

/* ---------- Terminal body ---------- */

.terminal {
  flex: 1;
  overflow-y: auto;
  font-family: 'VT323', monospace;
  font-size: 26px;
  line-height: 1.5;
  color: var(--green);
  text-shadow: 0 0 5px rgba(61, 255, 92, 0.75), 0 0 1px rgba(61, 255, 92, 0.9);
  outline: none;
  padding-right: 4px;
}

.terminal::-webkit-scrollbar {
  width: 10px;
}
.terminal::-webkit-scrollbar-track {
  background: #000;
}
.terminal::-webkit-scrollbar-thumb {
  background: var(--green-dim);
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 2px 0;
}

.prompt-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.prompt-label {
  white-space: pre;
  margin-right: 2px;
}

.input-echo {
  white-space: pre;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

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

.greeting-name {
  color: var(--green-bright);
  font-weight: bold;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .ascii-logo { display: none; }
  .terminal { font-size: 20px; }
  .titlebar span:first-child { font-size: 8px; }
  .statusbar { font-size: 6px; }
}
