/* ===== JACK CHAIN TERMINAL — style.css ===== */

:root {
  --green:     #00FF41;
  --dim:       #00AA2A;
  --gold:      #D4AF37;
  --red:       #FF3333;
  --bg:        #0a0a0a;
  --bg-light:  #111111;
  --cyan:      #00E5FF;
  --font:      'JetBrains Mono', monospace;
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font);
  color: var(--green);
}

/* ── Scanline overlay ─────────────────────── */
#scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
}

/* ── CRT vignette + curve ─────────────────── */
#crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.45) 100%
  );
  /* Subtle barrel distortion illusion */
  box-shadow:
    inset 0 0 120px rgba(0, 0, 0, 0.7),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* ── Matrix canvas ────────────────────────── */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  display: none;
}

/* ── Terminal container ───────────────────── */
#terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── Title bar ────────────────────────────── */
#titlebar {
  display: flex;
  align-items: center;
  height: 38px;
  min-height: 38px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  padding: 0 14px;
  user-select: none;
}

#titlebar-buttons {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.tb-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}
.tb-close { background: #FF5F57; }
.tb-min   { background: #FEBC2E; }
.tb-max   { background: #28C840; }

#titlebar-text {
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
}

/* ── Output area ──────────────────────────── */
#output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px 4px 20px;
  font-size: 14.5px;
  line-height: 1.65;
  word-wrap: break-word;
  white-space: pre-wrap;
}

#output .line {
  min-height: 1.65em;
}

#output .green  { color: var(--green); }
#output .dim    { color: var(--dim); }
#output .gold   { color: var(--gold); }
#output .red    { color: var(--red); }
#output .cyan   { color: var(--cyan); }
#output .bold   { font-weight: 700; }
#output .cmd-echo {
  color: #888;
}

/* Phosphor glow on every line */
#output .line {
  text-shadow:
    0 0 5px rgba(0, 255, 65, 0.35),
    0 0 12px rgba(0, 255, 65, 0.12);
}

/* ── Input line ───────────────────────────── */
#input-line {
  display: flex;
  align-items: center;
  padding: 8px 20px 18px 20px;
  font-size: 14.5px;
  min-height: 44px;
}

#prompt {
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
}

#input-wrapper {
  flex: 1;
  position: relative;
}

#cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--font);
  font-size: 14.5px;
  caret-color: transparent; /* we draw our own cursor */
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.35);
}

/* Blinking block cursor */
#cursor {
  display: inline-block;
  width: 9px;
  height: 17px;
  background: var(--green);
  position: absolute;
  top: 1px;
  left: 0;
  animation: blink 1s step-end infinite;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Scrollbar ────────────────────────────── */
#output::-webkit-scrollbar {
  width: 8px;
}
#output::-webkit-scrollbar-track {
  background: var(--bg);
}
#output::-webkit-scrollbar-thumb {
  background: #1a3a1a;
  border-radius: 4px;
}
#output::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

/* ── Selection ────────────────────────────── */
::selection {
  background: rgba(0, 255, 65, 0.2);
  color: var(--green);
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 700px) {
  #output { font-size: 12px; padding: 12px 10px 4px 10px; }
  #input-line { font-size: 12px; padding: 6px 10px 12px 10px; }
  #titlebar-text { font-size: 11px; }
}

/* ── Flicker on boot (one-shot) ───────────── */
@keyframes flicker {
  0%   { opacity: 0.3; }
  5%   { opacity: 0.9; }
  10%  { opacity: 0.4; }
  15%  { opacity: 1; }
  20%  { opacity: 0.6; }
  25%  { opacity: 1; }
  100% { opacity: 1; }
}
.boot-flicker {
  animation: flicker 1.2s ease-out;
}

/* ── Glow pulse on gold values ────────────── */
@keyframes gold-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(212, 175, 55, 0.3); }
  50%      { text-shadow: 0 0 14px rgba(212, 175, 55, 0.7); }
}
.gold-pulse {
  animation: gold-pulse 2s ease-in-out infinite;
}
