:root {
  --bg: #0d0d0d;
  --fg: #999999;
  --muted: #666666;
  --border: #262626;
  --green: #00e000;
  --accent: #ff1ab3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Share Tech Mono', monospace;
}

.terminal {
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: text;
}

.logo-wrap {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 10;
}

.logo {
  display: block;
  max-width: 220px;
  height: auto;
}

.logo-fallback {
  display: none;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}

.screen {
  width: 100%;
  max-width: 42rem;
}

.line {
  min-height: 1.75rem;
  line-height: 1.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.line-muted {
  color: var(--muted);
}

.line-green {
  color: var(--green);
}

.line-accent {
  color: var(--accent);
}

.line-default {
  color: var(--fg);
}

.line-title {
  font-weight: 700;
  font-size: 1rem;
}

.line-fade {
  animation: scramble-fade 1.5s ease-out forwards;
}

.prompt-row {
  min-height: 1.75rem;
  line-height: 1.75rem;
  display: flex;
  align-items: center;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-symbol {
  color: var(--green);
  margin-right: 0.35rem;
}

.prompt-text {
  color: var(--fg);
}

.cursor {
  width: 7px;
  height: 14px;
  margin-left: 2px;
  background: rgba(0, 224, 0, 0.7);
  animation: cursor-blink 1s steps(1, end) infinite;
}

.hidden-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.hidden {
  display: none;
}

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

@keyframes scramble-fade {
  0% { opacity: 1; }
  80% { opacity: 0.6; }
  100% { opacity: 0; }
}

@media (min-width: 640px) {
  .terminal {
    padding: 40px;
  }

  .logo-wrap {
    top: 40px;
    left: 40px;
  }
}

/* ── ASCII Scene Overlay ─────────────────────────────────────── */
.ascii-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  overflow: hidden;
}

.ascii-art {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(8px, 1.3vw, 16px);
  line-height: 1.2;
  white-space: pre;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}

.ascii-input-wrap {
  margin-top: 4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ascii-input-prompt {
  color: var(--green);
  font-size: 2rem;
  font-family: 'Share Tech Mono', monospace;
}

.ascii-name-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--green);
  color: var(--fg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  outline: none;
  padding: 4px 8px;
  width: 480px;
  caret-color: var(--green);
}

.ascii-name-input::placeholder {
  color: var(--muted);
}

.ascii-links {
  margin-top: 3.5rem;
  display: flex;
  gap: 4rem;
}

.ascii-link {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4rem;
  color: rgba(0, 200, 0, 0.7);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.ascii-link:hover {
  color: rgba(0, 200, 0, 0.7);
}

@media (max-width: 639px) {
  /* Let the art scroll sideways inside its own box instead of clipping */
  .ascii-art {
    font-size: clamp(6px, 1.8vw, 10px);
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
  }

  /* Keep prompt + input + cursor all on ONE row */
  .ascii-input-wrap {
    margin-top: 2rem;
    gap: 0.4rem;
    width: 100%;
  }

  .ascii-input-prompt {
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  /* Grow to fill remaining row space instead of fixed 480px */
  .ascii-name-input {
    font-size: 1.2rem;
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .ascii-links {
    margin-top: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .ascii-link {
    font-size: 1.1rem;
  }
}
