/* ── Terminal / CLI fun-mode overlay ──────────────────────────────────────── */

#terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0f0a;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: #00e533;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#terminal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* CRT scanlines */
#terminal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Header bar ──────────────────────────────────────────────────────────── */
.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: #0d140d;
  border-bottom: 1px solid #1a3a1a;
  font-size: 0.75rem;
  color: #4db84d;
  flex-shrink: 0;
  z-index: 2;
}

.term-dots {
  display: flex;
  gap: 0.4rem;
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a3a1a;
}

.term-dot.red    { background: #ff5f56; }
.term-dot.yellow { background: #ffbd2e; }
.term-dot.green  { background: #27c93f; }

.term-title {
  color: #4db84d;
  opacity: 0.75;
  font-size: 0.72rem;
}

.term-close {
  background: none;
  border: 1px solid #1a3a1a;
  color: #4db84d;
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.term-close:hover { border-color: #00e533; color: #00e533; }

/* ── Output area ─────────────────────────────────────────────────────────── */
.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 0.5rem;
  font-size: 0.88rem;
  line-height: 1.65;
  word-break: break-word;
  z-index: 2;
}

.term-output::-webkit-scrollbar { width: 5px; }
.term-output::-webkit-scrollbar-track { background: transparent; }
.term-output::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 3px; }

/* ── Output line types ───────────────────────────────────────────────────── */
.term-line { white-space: pre-wrap; min-height: 1.65em; }

.term-prompt { color: #00e533; }
.term-prompt .p-user { color: #00cc29; font-weight: bold; }
.term-prompt .p-at   { color: #267326; }
.term-prompt .p-host { color: #33b533; }
.term-prompt .p-sym  { color: #00e533; }

.term-cmd-echo  { color: #ccffcc; }
.term-out       { color: #b3ffb3; }
.term-dim       { color: #4d7a4d; }
.term-accent    { color: #00e533; font-weight: bold; }
.term-err       { color: #ff6b6b; }
.term-link      { color: #5adcff; text-decoration: underline; cursor: pointer; }
.term-link:hover { color: #a8eeff; }

.term-head {
  color: #00e533;
  font-weight: bold;
  display: block;
  border-bottom: 1px solid #1a3a1a;
  padding-bottom: 0.1rem;
  margin-bottom: 0.1rem;
}

/* ── Input row ───────────────────────────────────────────────────────────── */
.term-input-row {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.5rem;
  border-top: 1px solid #1a3a1a;
  background: #0a0f0a;
  flex-shrink: 0;
  z-index: 2;
}

.term-ps1 {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.88rem;
  margin-right: 0.4rem;
}

.term-ps1 .p-user { color: #00cc29; font-weight: bold; }
.term-ps1 .p-at   { color: #267326; }
.term-ps1 .p-host { color: #33b533; }
.term-ps1 .p-sym  { color: #00e533; }

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #00e533;
  font-family: inherit;
  font-size: 0.88rem;
  caret-color: #00e533;
  min-width: 0;
}

