@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0a0e0a;
  --term-bg: #0c1210;
  --fg: #baffc9;
  --fg-dim: #6fae7c;
  --accent: #4ade80;
  --accent2: #38bdf8;
  --warn: #facc15;
  --muted: #4b6155;
  --border: #1e3a2a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(74, 222, 128, 0.08), transparent 60%);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg);
  overflow: hidden;
}

.crt {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.terminal {
  width: min(920px, 96vw);
  height: min(680px, 88vh);
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(74, 222, 128, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.titlebar {
  background: #111a15;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.title {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.body {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.55;
}

#output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.prompt { color: var(--accent); font-weight: 600; white-space: nowrap; }
.prompt .path { color: var(--accent2); }
#user-input {
  outline: none;
  color: var(--fg);
  min-width: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  caret-color: transparent;
}
.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.hint code {
  background: #111a15;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Output styling helpers (used via classes injected by JS) */
.h1 { color: var(--accent); font-weight: 700; }
.h2 { color: var(--accent2); font-weight: 600; }
.dim { color: var(--fg-dim); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.link { color: var(--accent2); text-decoration: underline; cursor: pointer; }
.tag { color: var(--warn); }
.err { color: #f87171; }
.ok { color: var(--accent); }

.ascii {
  color: var(--accent);
  font-size: 11px;
  line-height: 1.1;
}

/* Scrollbar */
.body::-webkit-scrollbar { width: 8px; }
.body::-webkit-scrollbar-track { background: transparent; }
.body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

@media (max-width: 640px) {
  .body { font-size: 12.5px; padding: 14px 14px; }
  .ascii { font-size: 8px; }
}
