@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --text: #33ff33;
  --text-dim: #1a9e1a;
  --text-bright: #66ff66;
  --prompt-color: #22cc22;
  --cursor-color: #33ff33;
  --link-color: #5fd7ff;
  --selection-bg: #33ff3340;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 15px;
  line-height: 1.5;
}

#terminal {
  min-height: 100vh;
  padding: 16px;
  cursor: text;
}

#output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#output .line {
  min-height: 1.5em;
}

#output .prompt-text {
  color: var(--prompt-color);
}

#output .command-text {
  color: var(--text-bright);
}

#output .heading {
  color: var(--text-bright);
  font-weight: 700;
}

#output .dim {
  color: var(--text-dim);
}

#output .link {
  color: var(--link-color);
  text-decoration: none;
}

#output .link:hover {
  text-decoration: underline;
}

#input-line {
  display: flex;
  align-items: center;
}

#prompt {
  color: var(--prompt-color);
  white-space: pre;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: 'Fira Code', monospace;
  font-size: 15px;
  line-height: 1.5;
  caret-color: var(--cursor-color);
}

::selection {
  background: var(--selection-bg);
}

/* Scanline overlay */
#terminal::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 999;
}

/* Subtle glow on the text */
#output, #input-line {
  text-shadow: 0 0 3px rgba(51, 255, 51, 0.3);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 4px;
}

/* ── Nano editor overlay ── */

#nano-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  font-family: 'Fira Code', monospace;
  font-size: 15px;
}

#nano-header {
  background: #eeeeee;
  color: #000000;
  padding: 2px 0;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}

#nano-editor {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: none;
  outline: none;
  resize: none;
  padding: 8px 16px;
  font-family: 'Fira Code', monospace;
  font-size: 15px;
  line-height: 1.5;
  caret-color: var(--cursor-color);
  tab-size: 4;
}

#nano-status {
  color: #eeeeee;
  background: var(--bg);
  padding: 2px 0;
  height: 1.5em;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
}

#nano-footer {
  background: #eeeeee;
  color: #000000;
  padding: 4px 16px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

#nano-footer .nano-key {
  font-weight: 700;
  margin-right: 4px;
}

@media (max-width: 600px) {
  html, body {
    font-size: 13px;
  }

  #terminal {
    padding: 10px;
  }
}
