:root {
  --bg: #1c1c1c;
  --ink: #c4c4c4;
  --dim: #8a8a8a;
  --mute: #5e5e5e;
  --hi: #e8e8e8;
  --warn: #d4b483;
  --ok: #a8c5a2;
  --err: #c98989;
  --link: #b7c4d4;
  --ps1: #9aa7b5;
  --line: #2a2a2a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Share Tech Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 8px;
  background: var(--bg);
  color: var(--hi);
  padding: 6px 10px;
  z-index: 4;
}

.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  mix-blend-mode: multiply;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px 80px;
  position: relative;
  z-index: 1;
}

.mast-wrap {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  padding: 16px 0 8px;
}

.mast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 0 10px;
}

.mast h1 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(18px, 4.6vw, 42px);
  font-weight: 400;
  letter-spacing: 2px;
  color: #b0b0b0;
  text-shadow: 2px 2px 0 #0a0a0a;
  white-space: nowrap;
}

.win {
  width: clamp(40px, 7vw, 64px);
  height: clamp(40px, 7vw, 64px);
  flex: none;
  image-rendering: pixelated;
}

.tag {
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  margin: 0 0 24px;
}

.term {
  min-height: 52vh;
  outline: none;
}

.out {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
}

.row {
  margin: 0 0 2px;
}

.row.cmd { color: var(--hi); }
.row.dim { color: var(--dim); }
.row.mute { color: var(--mute); }
.row.ok { color: var(--ok); }
.row.warn { color: var(--warn); }
.row.err { color: var(--err); }
.row.hi { color: var(--hi); }

.k { color: var(--dim); }
.v { color: var(--hi); }

a, button.linkish {
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.help-grid {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 2px 18px;
  margin: 6px 0 14px;
  white-space: normal;
}

.help-grid code {
  color: var(--hi);
  font: inherit;
}

.hex {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px 16px;
  margin: 8px 0 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hex .off { color: var(--dim); }
.hex .asc { color: var(--mute); }

.line {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ps1 {
  color: var(--ps1);
  white-space: nowrap;
  font-size: 15px;
}

.who { color: var(--ok); }

#cmd {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--hi);
  font: inherit;
  font-size: 15px;
  caret-color: var(--hi);
  outline: none;
  padding: 0;
}

#cmd::placeholder { color: var(--mute); }

@media (max-width: 720px) {
  .shell { padding: 18px 12px 64px; }
  .mast { gap: 10px; }
  .help-grid { grid-template-columns: 1fr; }
  .hex { grid-template-columns: 44px 1fr; }
  .hex .asc { display: none; }
  .out, .ps1, #cmd { font-size: 13px; }
  .mast h1 { white-space: normal; line-height: 1.25; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .crt { display: none; }
}
