:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(0, 0, 0, 0.93);
  --panel-2: #07110d;
  --text: #d1fae5;
  --muted: #78a991;
  --green: #00ff9c;
  --green-soft: #00d986;
  --border: rgba(0, 255, 156, 0.22);
  --shadow: rgba(0, 255, 156, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(0, 255, 156, 0.08), transparent 28rem),
    radial-gradient(circle at center, #07101c 0%, var(--bg) 50%, #000 100%);
  color: var(--text);
  font-family: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 4px;
}

.terminal {
  width: min(1040px, 94vw);
  height: min(760px, 88vh);
  height: min(760px, 88dvh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 255, 156, 0.04),
    0 24px 80px rgba(0, 0, 0, 0.58),
    0 0 34px var(--shadow);
  backdrop-filter: blur(10px);
}

.terminal-bar {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(180deg, #0a1511, #050b08);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.terminal-dots {
  display: flex;
  gap: 7px;
}

.terminal-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-soft);
  opacity: 0.35;
}

.terminal-dots span:nth-child(2) {
  opacity: 0.55;
}

.terminal-dots span:nth-child(3) {
  opacity: 0.8;
}

.terminal-title {
  color: #a7cdbb;
  white-space: nowrap;
}

.terminal-status {
  justify-self: end;
  color: var(--green);
}

.terminal-status::before {
  content: "●";
  margin-right: 6px;
  font-size: 8px;
}

.terminal-body {
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

#output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.58;
  font-size: 15px;
}

.output-line {
  min-height: 1.58em;
}

.prompt {
  flex: 0 0 auto;
  margin-right: 10px;
  color: var(--green);
}

.command-echo {
  color: #fff;
}

.heading {
  color: #fff;
  font-weight: 700;
}

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

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

.dir {
  color: #67e8f9;
  font-weight: 700;
}

.link {
  color: #93c5fd;
  text-decoration: underline;
  text-decoration-color: rgba(147, 197, 253, 0.45);
  text-underline-offset: 3px;
}

.link:hover,
.link:focus {
  color: #bfdbfe;
}

.input-line {
  display: flex;
  align-items: center;
  margin-top: 8px;
  line-height: 1.5;
}

input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  caret-color: var(--green);
  font: inherit;
  font-size: 15px;
}

.hidden {
  display: none;
}

.terminal-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  color: #628d79;
  font-size: 11px;
}

.noscript-card {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 90vw);
  padding: 28px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.noscript-card a {
  color: var(--green);
}

::selection {
  background: var(--green);
  color: #00150d;
}

::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: #020805;
}

::-webkit-scrollbar-thumb {
  background: #126b4b;
  border: 2px solid #020805;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-soft);
}

@media (max-width: 700px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .terminal {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .terminal-bar {
    grid-template-columns: auto 1fr auto;
  }

  .terminal-title {
    justify-self: center;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .terminal-body {
    padding: 16px;
  }

  #output,
  input {
    font-size: 13px;
  }

  .prompt {
    margin-right: 7px;
    font-size: 12px;
  }

  .terminal-footer {
    gap: 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-body {
    scroll-behavior: auto;
  }
}
