@font-face {
  font-family: 'JetBrainsMono';
  src: url('../fonts/Jetbrain/JetBrainsMono-VariableFont_wght.woff2') format('woff2'),
       url('../fonts/Jetbrain/JetBrainsMono-VariableFont_wght.woff') format('woff'),
       url('../fonts/Jetbrain/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ───────────────────────────────────── */

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

/* ── Tokens ──────────────────────────────────── */

:root {
  --bg: #07070d;
  --terminal-bg: #0b0b14;
  --header-bg: #16162a;
  --text: #c4b5d4;
  --text-dim: #5c5478;
  --accent: #9b6dff;
  --accent-bright: #c084fc;
  --accent-dim: #6d28d9;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --cyan: #67e8f9;
  --link: #a78bfa;
  --border: #1e1e38;
  --glow: rgba(139, 92, 246, 0.12);
}

/* ── Base ────────────────────────────────────── */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'JetBrainsMono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ── CRT scanlines ───────────────────────────── */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* ── Vignette ────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
  z-index: 999;
}

/* ── Terminal container ──────────────────────── */

.terminal-container {
  width: 100%;
  max-width: 920px;
  height: 92vh;
  max-height: 740px;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 0 30px var(--glow),
    0 20px 60px rgba(0, 0, 0, 0.6);
  animation: glow-pulse 5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from { box-shadow: 0 0 20px var(--glow), 0 20px 60px rgba(0, 0, 0, 0.6); }
  to   { box-shadow: 0 0 45px var(--glow), 0 20px 60px rgba(0, 0, 0, 0.6); }
}

/* ── Title bar ───────────────────────────────── */

.terminal-header {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  gap: 7px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 400;
  margin-right: 55px;
  user-select: none;
}

/* ── Terminal body ───────────────────────────── */

.terminal-body {
  position: relative;
  flex: 1;
  background: var(--terminal-bg);
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.65;
  cursor: text;
}

/* scanline sweep */
.terminal-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to bottom,
    rgba(139, 92, 246, 0.06),
    transparent
  );
  animation: sweep 7s linear infinite;
  pointer-events: none;
}

@keyframes sweep {
  0%   { top: -3px; }
  100% { top: 100%; }
}

/* scrollbar */
.terminal-body::-webkit-scrollbar { width: 5px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* ── Output lines ────────────────────────────── */

#output .line {
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: line-in 0.08s ease-out;
}

@keyframes line-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Input line ──────────────────────────────── */

.input-line {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.input-line.hidden { display: none; }

.prompt {
  margin-right: 8px;
  flex-shrink: 0;
  user-select: none;
}

.prompt-user   { color: var(--accent-bright); }
.prompt-path   { color: #818cf8; }
.prompt-symbol { color: var(--accent-dim); }

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  caret-color: var(--accent-bright);
  padding: 0;
}

/* ── ASCII banner ────────────────────────────── */

.ascii-banner {
  font-size: 1em;
  line-height: 1.25;
}

.ascii-l1 { color: #4B0082; }
.ascii-l2 { color: #6a28b9; }
.ascii-l3 { color: #9400D3; }
.ascii-l4 { color: #BA55D3; }
.ascii-l5 { color: #EE82EE; }

/* ── Command output helpers ──────────────────── */

.c-head  { color: var(--accent-bright); font-weight: 600; }
.c-sep   { color: var(--accent-dim); }
.c-label { color: var(--cyan); }
.c-val   { color: var(--text); }
.c-dim   { color: var(--text-dim); }
.c-ok    { color: var(--green); }
.c-err   { color: var(--red); }
.c-warn  { color: var(--yellow); }

.c-link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.c-link:hover {
  border-bottom-color: var(--link);
}

/* ── Game display ────────────────────────────── */

.game-display {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.8;
  margin: 0;
  white-space: pre;
  user-select: none;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
  body { padding: 0; }

  .terminal-container {
    max-width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
  }

  .terminal-body { font-size: 12px; }
  .ascii-banner  { font-size: 0.55em; }
}

@media (max-width: 480px) {
  .ascii-banner  { font-size: 0.42em; }
  .terminal-body { font-size: 11px; padding: 12px; }
}

/* ═══════════════════════════════════════════════
   Parrotzone styles (kept for /parrotzone/)
   ═══════════════════════════════════════════════ */

.center-ascii {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 6vh;
}

.center-ascii-parrot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 6vh;
}

.center-text {
  text-align: center;
}

a {
  color: #5e43f3;
}

.ascii-art {
  font-family: monospace;
  white-space: pre;
  font-size: 1em;
  line-height: 1.2em;
}

.line-1  { color: #ff8a33; }
.line-2  { color: #ff7851; }
.line-3  { color: #ff676f; }
.line-4  { color: #ff558d; }
.line-5  { color: #ff44ab; }
.line-6  { color: #ff33ca; }
.line-7  { color: #e433d7; }
.line-8  { color: #c933e4; }
.line-9  { color: #ae33f1; }
.line-10 { color: #9333ff; }
.line-11 { color: #7944d4; }
.line-12 { color: #5f55a9; }
.line-13 { color: #45667e; }
.line-14 { color: #2b7753; }
.line-15 { color: #118828; }
.line-16 { color: #118828; }

.ascii-art-green {
  font-family: monospace;
  white-space: pre;
  font-size: 1em;
  line-height: 1.2em;
}

.green-line-1  { color: #118828; }
.green-line-2  { color: #118828; }
.green-line-3  { color: #2b7753; }
.green-line-4  { color: #45667e; }
.green-line-5  { color: #5f55a9; }
.green-line-6  { color: #7944d4; }
.green-line-7  { color: #9333ff; }
.green-line-8  { color: #ae33f1; }
.green-line-9  { color: #c933e4; }
.green-line-10 { color: #e433d7; }
.green-line-11 { color: #ff33ca; }
.green-line-12 { color: #ff44ab; }
.green-line-13 { color: #ff558d; }
.green-line-14 { color: #ff676f; }
.green-line-15 { color: #ff676f; }
.green-line-16 { color: #ff7851; }
.green-line-17 { color: #ff7851; }
.green-line-18 { color: #ff8a33; }
.green-line-19 { color: #ff8a33; }

.special-symbol  { color: #FFFFFF; }
.special-symbol2 { color: #ffba5a; }
