@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap");

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

:root {
  --green: #0f0;
  --green-dim: #0a0;
  --amber: #ffb000;
  --bg: #0a0a0a;
  --glow: 0 0 5px var(--green), 0 0 10px var(--green), 0 0 20px var(--green);
}

html, body {
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

body {
  font-family: "Fira Code", monospace;
  font-size: 14px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CRT monitor effect */
.crt {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  background: #000;
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0,255,0,0.1), inset 0 0 80px rgba(0,0,0,0.9);
  padding: 30px;
  overflow: hidden;
}

.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 90%);
  pointer-events: none;
}

/* Scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1000;
  animation: flicker 0.15s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.97; }
  50% { opacity: 1; }
}

/* Terminal */
.terminal {
  height: 100%;
  overflow-y: auto;
  padding-right: 10px;
}

.terminal::-webkit-scrollbar { width: 8px; }
.terminal::-webkit-scrollbar-track { background: #111; }
.terminal::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 4px; }

#output {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.line { margin-bottom: 2px; }
.line.system { color: var(--amber); }
.line.error { color: #f44; }
.line.success { color: #4f4; text-shadow: var(--glow); }
.line.ascii { color: var(--green); line-height: 1.1; }
.line.dim { color: #555; }

/* Input */
.input-line {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.prompt {
  color: var(--amber);
  margin-right: 8px;
  text-shadow: 0 0 5px var(--amber);
}

#input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font: inherit;
  caret-color: transparent;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--green);
  animation: blink 1s step-end infinite;
  box-shadow: var(--glow);
}

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

/* Typing animation */
.typing::after {
  content: "▌";
  animation: blink 0.5s step-end infinite;
}

/* Glitch effect */
@keyframes glitch {
  0%, 100% { text-shadow: var(--glow); }
  25% { text-shadow: -2px 0 #f0f, 2px 0 #0ff; }
  50% { text-shadow: 2px 0 #f0f, -2px 0 #0ff; }
  75% { text-shadow: var(--glow); }
}

.glitch {
  animation: glitch 0.3s ease-in-out;
}

/* Mobile submit button */
.send-btn {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: #000;
  font-size: 16px;
  padding: 4px 10px;
  margin-left: 8px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  .send-btn { display: inline-block; }
  .cursor { display: none; }
  .crt { padding: 15px; border-radius: 10px; }
  body { font-size: 12px; }
  .prompt { font-size: 11px; }
}

#input-form {
  display: flex;
  align-items: center;
  margin-top: 10px;
}
