:root {
  --bg: #0a0d0b;
  --bg-2: #111612;
  --panel: #171d18;
  --panel-2: #1b231d;
  --line: #314237;
  --line-bright: #4f6e59;
  --text: #c6d6c8;
  --text-dim: #8ea191;
  --accent: #7bd48d;
  --accent-2: #d6b36a;
  --danger: #d97f7f;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(123, 212, 141, 0.05), transparent 32%),
    linear-gradient(to bottom, #0a0d0b, #090b09 30%, #060806 100%);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.45;
  min-height: 100vh;
  text-shadow: 0 0 1px rgba(123, 212, 141, 0.16);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.18;
  mix-blend-mode: screen;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: #b4f3bf;
  text-decoration: underline;
}

.page {
  width: min(1400px, 100% - 24px);
  margin: 12px auto;
  border: 2px solid var(--line-bright);
  background: linear-gradient(to bottom, rgba(23, 29, 24, 0.97), rgba(12, 16, 13, 0.98));
  box-shadow: 0 0 0 1px #050705, 0 10px 30px var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-bottom: 2px solid var(--line);
  padding: 8px 12px;
  background: linear-gradient(to bottom, #202a22, #151b17);
  color: var(--text-dim);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blink {
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: #0d120e;
  color: var(--accent-2);
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
}

.marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 26s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 0;
  min-height: 80vh;
}

.frame {
  border-right: 2px solid var(--line);
  min-width: 0;
}

.frame:last-child {
  border-right: 0;
}

.panel-title {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(to bottom, #202922, #161d18);
  color: var(--accent);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.panel-body {
  padding: 10px;
}

.left-nav {
  background: linear-gradient(to bottom, var(--panel), #111612);
}

.nav-box,
.status-box,
.note-box,
.mini-box,
.terminal-box,
.table-box {
  border: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(22, 28, 23, 0.95), rgba(13, 17, 14, 0.98));
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.nav-list,
.link-list,
.tiny-list,
.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list li + li,
.tiny-list li + li,
.log-list li + li {
  border-top: 1px dashed rgba(79, 110, 89, 0.45);
}

.nav-list a,
.tiny-list a,
.log-list li {
  display: block;
  padding: 8px 10px;
  color: var(--text);
}

.nav-list a:hover,
.tiny-list a:hover {
  background: rgba(123, 212, 141, 0.08);
  text-decoration: none;
}

.nav-list .subtle {
  color: var(--text-dim);
  font-size: 12px;
}

.main {
  background: linear-gradient(to bottom, rgba(17,22,18,0.96), rgba(10,13,11,0.98));
}

.main-inner {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 12px;
}

.hero h1 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line-bright);
  padding: 2px 6px;
  margin: 0 6px 6px 0;
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
}

.ascii {
  margin: 0;
  font-size: 11px;
  line-height: 1.1;
  white-space: pre;
  color: #93e3a4;
  overflow: auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(to bottom, #223026, #18211b);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.btn:hover {
  text-decoration: none;
  background: linear-gradient(to bottom, #28382d, #1c261f);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.table-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-box th,
.table-box td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.table-box th {
  color: var(--accent);
  background: rgba(123, 212, 141, 0.06);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.terminal-box {
  padding: 12px;
  background:
    linear-gradient(to bottom, rgba(9, 12, 10, 0.98), rgba(6, 8, 7, 0.98));
}

#terminal-shell {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  grid-column: 1 / -1;
}

#terminal-output {
  display: block;
  min-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: normal;
}

#terminal-form {
  margin-top: 8px;
  border-top: 1px dashed rgba(79, 110, 89, 0.45);
  padding-top: 8px;
}

#terminal-form .terminal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

#terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--accent);
}

#terminal-input::placeholder {
  color: #6e7d71;
}

.terminal-line {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 13px;
}

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

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

.terminal-line .bad {
  color: var(--danger);
}

.hidden-link {
  opacity: 0.25;
  filter: blur(0.3px);
}

.hidden-link:hover {
  opacity: 1;
  filter: none;
}

.stealth {
  color: inherit;
  text-decoration: none;
  cursor: text;
}

.type-target {
  visibility: hidden;
}

.type-target.is-typing,
.type-target.is-typed {
  visibility: visible;
}

#buried {
  display: none;
}

#buried.is-revealed {
  display: block;
}

.rightbar {
  background: linear-gradient(to bottom, #141a16, #0f1411);
}

.stamp {
  display: inline-block;
  border: 1px dashed var(--accent-2);
  padding: 4px 7px;
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 11px;
  transform: rotate(-2deg);
  margin-bottom: 8px;
}

.small {
  font-size: 12px;
  color: var(--text-dim);
}

.webring {
  text-align: center;
  font-size: 13px;
}

.webring a {
  display: inline-block;
  margin: 4px 6px;
}

.footer {
  border-top: 2px solid var(--line);
  background: #101510;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-section {
  scroll-margin-top: 18px;
}

details {
  border: 1px dashed var(--line);
  padding: 8px 10px;
  background: rgba(255,255,255,0.01);
}

details + details {
  margin-top: 8px;
}

details summary {
  cursor: pointer;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.badge-row img,
.badge-row span {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 4px 6px;
  margin: 2px 4px 2px 0;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
}

.center-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 6px;
}

.arg-noise {
  letter-spacing: 0.14em;
  color: #7f8e82;
  font-size: 12px;
  word-break: break-word;
}

.arg-acrostic span {
  display: inline-block;
  min-width: 1ch;
  font-weight: bold;
}

.npc-log-name {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin-bottom: 4px;
}

.muted-sep {
  border-top: 1px dashed rgba(79, 110, 89, 0.45);
  margin: 8px 0;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 230px 1fr;
  }

  .rightbar {
    grid-column: 1 / -1;
    border-top: 2px solid var(--line);
  }

  .hero,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .frame {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .frame:last-child {
    border-bottom: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .page {
    width: calc(100% - 12px);
    margin: 6px auto;
  }

  .main-inner,
  .panel-body,
  .terminal-box {
    padding-left: 8px;
    padding-right: 8px;
  }

  .terminal-line,
  .small,
  .center-note,
  .arg-noise,
  .table-box table,
  #terminal-input {
    font-size: 12px;
  }

  .ascii {
    font-size: 8px;
    overflow-x: auto;
  }

  #terminal-shell {
    min-height: 360px;
  }

  #terminal-output {
    min-height: 280px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .terminal-line,
  .center-note,
  .arg-noise,
  .table-box th,
  .table-box td,
  .topbar div {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
