/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: #0a0a0a;
  color: #33ff33;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.4;
  overflow-x: hidden;
}

/* ===== CRT OVERLAY ===== */
.crt {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Scan lines */
.crt::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 9999;
}

/* Subtle CRT flicker */
@keyframes flicker {
  0%   { opacity: 0.97; }
  5%   { opacity: 1; }
  10%  { opacity: 0.95; }
  15%  { opacity: 1; }
  20%  { opacity: 0.98; }
  50%  { opacity: 1; }
  80%  { opacity: 0.96; }
  90%  { opacity: 1; }
  100% { opacity: 0.97; }
}

.crt::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
  z-index: 9998;
}

body {
  animation: flicker 0.15s infinite;
}

/* ===== ASCII ART ===== */
.ascii-logo {
  color: #33ff33;
  font-size: clamp(0.4rem, 1.5vw, 0.9rem);
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 0 8px #33ff33, 0 0 15px #33ff3377;
  margin-bottom: 4px;
  letter-spacing: normal;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ascii-art {
  color: #33ff33;
  font-size: clamp(0.25rem, 0.9vw, 0.55rem);
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 0 5px #33ff3388;
  margin-bottom: 10px;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== MARQUEE ===== */
.marquee-text {
  color: #ffb347;
  font-size: clamp(0.8rem, 2.5vw, 1.2rem);
  text-shadow: 0 0 10px #ffb34788;
  margin: 6px 0 14px 0;
  width: 100%;
}

/* ===== TERMINAL WINDOW ===== */
.terminal-window {
  width: 100%;
  max-width: 720px;
  border: 1px solid #33ff3366;
  border-radius: 6px;
  background: #0d0d0d;
  box-shadow: 0 0 20px rgba(51, 255, 51, 0.1), inset 0 0 30px rgba(0,0,0,0.5);
  margin-bottom: 20px;
  overflow: hidden;
}

.terminal-header {
  background: #1a1a1a;
  padding: 8px 14px;
  border-bottom: 1px solid #33ff3344;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red    { background: #ff5555; }
.dot.yellow { background: #ffb347; }
.dot.green  { background: #33ff33; }

.title {
  margin-left: auto;
  font-size: 0.75rem;
  color: #33ff3388;
}

.terminal-body {
  padding: 14px 16px;
  min-height: 120px;
}

.line {
  margin-bottom: 6px;
  word-wrap: break-word;
}

.welcome {
  color: #ffb347;
  font-weight: bold;
  margin-bottom: 12px;
}

.prompt {
  color: #33ff33;
  font-weight: bold;
}

/* ===== CURSOR ===== */
.cursor {
  display: inline-block;
  color: #33ff33;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ===== COMMAND HINTS ===== */
.command-hint {
  font-size: 0.8rem;
  color: #33ff3388;
  margin-bottom: 8px;
}

.cmd {
  color: #ffb347;
  cursor: pointer;
  transition: color 0.2s;
}

.cmd:hover {
  color: #33ff33;
  text-shadow: 0 0 8px #33ff33;
}

/* ===== INPUT LINE ===== */
.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #33ff3322;
  background: #111;
}

.terminal-input-line .prompt {
  flex-shrink: 0;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #33ff33;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  caret-color: #33ff33;
}

#terminal-input::placeholder {
  color: #33ff3344;
}

/* ===== OUTPUT AREA ===== */
#output-area {
  margin-top: 6px;
}

.output-line {
  color: #33ff33;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.output-error {
  color: #ff5555;
}

.output-success {
  color: #33ff33;
}

.output-info {
  color: #ffb347;
}

/* ===== FOOTER ===== */
.footer {
  width: 100%;
  max-width: 720px;
  margin-top: 10px;
  font-size: 0.7rem;
  color: #33ff3355;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .crt {
    padding: 10px;
  }

  .ascii-logo {
    font-size: clamp(0.3rem, 2.2vw, 0.5rem);
  }

  .ascii-art {
    font-size: clamp(0.18rem, 1.5vw, 0.35rem);
  }

  .terminal-body {
    padding: 10px 12px;
    min-height: 100px;
  }

  .terminal-input-line {
    padding: 8px 12px;
  }

  #terminal-input {
    font-size: 0.85rem;
  }

  .command-hint {
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .ascii-logo {
    font-size: clamp(0.15rem, 1.8vw, 0.3rem);
  }
  .ascii-art {
    font-size: clamp(0.1rem, 1.2vw, 0.22rem);
  }
  .title {
    font-size: 0.6rem;
  }
}