:root {
  --bg: #0d0f0d;
  --bg-card: #131513;
  --bg-sunken: #070807;
  --bd: #3a352e;
  --bd-bright: #5f594f;
  --tx: #ece9df;
  --tx-mute: #a6a195;
  --tx-dim: #6c665b;
  --tx-faint: #4b463e;
  --green: #72d06c;
  --green-bg: #183817;
  --green-bd: #2d6b2d;
  --purple: #d06cff;
  --purple-bg: #241334;
  --purple-bd: #6f35a4;
  --gold: #e1c241;
  --gold-bg: #2d2810;
  --gold-bd: #7c691b;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Code", "Roboto Mono", monospace;

  --glkote-buffer-bg: #070807;
  --glkote-buffer-fg: #ece9df;
  --glkote-buffer-line-height: 1.46;
  --glkote-buffer-reverse-bg: #ece9df;
  --glkote-buffer-reverse-fg: #070807;
  --glkote-buffer-size: 13px;
  --glkote-grid-bg: #070807;
  --glkote-grid-fg: #e1c241;
  --glkote-grid-line-height: 16px;
  --glkote-grid-size: 12.5px;
  --glkote-input-fg: #72d06c;
  --glkote-mono-family: var(--mono);
  --glkote-prop-family: var(--mono);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  min-height: 100vh;
  padding: 0.6rem 1.25rem 3rem;
  background:
    radial-gradient(circle at 70% 10%, rgba(208, 108, 255, 0.05), transparent 34rem),
    radial-gradient(circle at 18% 26%, rgba(114, 208, 108, 0.035), transparent 28rem),
    var(--bg);
  color: var(--tx);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 1px solid var(--bd-bright);
  outline-offset: 2px;
}

.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 0.5px solid var(--bd); display: flex; align-items: center; gap: 14px; padding: 5px 14px; }
.site-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-link { font-size: 10px; letter-spacing: 0.04em; color: var(--green); transition: color 0.12s ease; }
.nav-link:hover, .nav-link:active { color: var(--purple); }
.nav-home:hover, .nav-home:active { color: var(--gold); }
.top .nr-theme-switch { margin-left: auto; }
.status-line { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 5px 0 2px; font-size: 10px; letter-spacing: 0.06em; color: var(--tx-mute); }
.net-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); flex: none; }
.net-sep { color: var(--tx-faint); }

.zork-wrap { max-width: 1080px; margin: 0 auto; }
.intro { text-align: center; margin: 0.6rem auto 1rem; max-width: 74ch; }
.brand-line { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin: 0 0 0.3rem; }
.brand { letter-spacing: 0.18em; color: var(--gold); font-size: 12px; white-space: nowrap; text-shadow: 0 0 12px rgba(225, 194, 65, 0.12); }
.tag { color: var(--tx-dim); font-size: 10px; letter-spacing: 0.08em; }
.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--tx-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
}
h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}
.lede { margin: 0.55rem auto 0; color: var(--tx-mute); }
kbd {
  display: inline-block;
  border: 0.5px solid var(--bd);
  border-radius: 5px;
  background: var(--bg-sunken);
  color: var(--green);
  padding: 0.05rem 0.3rem;
  font: inherit;
}

.terminal-card {
  background: linear-gradient(180deg, rgba(208, 108, 255, 0.035), transparent 38%), var(--bg-card);
  border: 0.5px solid rgba(208, 108, 255, 0.24);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.7rem;
  border-bottom: 0.5px solid var(--bd);
  background: rgba(7, 8, 7, 0.72);
}
.lights { display: flex; gap: 5px; margin-right: auto; }
.lights span { width: 7px; height: 7px; border-radius: 50%; border: 0.5px solid var(--bd-bright); background: var(--bg-sunken); }
.lights span:nth-child(1) { background: var(--gold-bg); border-color: var(--gold-bd); }
.lights span:nth-child(2) { background: var(--green-bg); border-color: var(--green-bd); }
.lights span:nth-child(3) { background: var(--purple-bg); border-color: var(--purple-bd); }
.story-picker { display: flex; align-items: center; gap: 7px; color: var(--tx-mute); font-size: 10px; letter-spacing: 0.05em; }
.story-picker select {
  background: var(--bg-sunken);
  border: 0.5px solid var(--green-bd);
  border-radius: 6px;
  color: var(--green);
  padding: 4px 7px;
  font-size: 10px;
}
.mini-btn {
  border: 0.5px solid var(--green-bd);
  border-radius: 6px;
  background: var(--green-bg);
  color: var(--green);
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.mini-btn:hover { border-color: var(--purple-bd); background: var(--purple-bg); color: var(--purple); }

.terminal-shell {
  height: min(60vh, 560px);
  min-height: 360px;
  padding: 0.55rem;
  background: #060706;
}
#gameport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0.5px solid var(--bd);
  border-radius: 8px;
  background: var(--bg-sunken);
}
#windowport { height: 100%; position: relative; width: 100%; }
.loadingpane {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--tx-dim);
  background: var(--bg-sunken);
}
.loadingpane img { margin: 0 auto; opacity: 0.55; }
#errorpane {
  background: var(--bg-card);
  border: 1px solid var(--purple-bd);
  border-radius: 8px;
  color: var(--tx);
}

.WindowFrame { background: var(--bg-sunken); }
.BufferWindow, .GridWindow { scrollbar-color: rgba(114, 208, 108, 0.35) transparent; }
.BufferWindowInner { padding: 14px 16px 18px; }
.BufferLine .Style_input { color: var(--green); }
.Style_header { color: var(--gold); }
.Style_subheader { color: var(--purple); }

.credits {
  margin: 1rem 0 0;
  border: 0.5px solid var(--bd);
  border-radius: 8px;
  background: rgba(19, 21, 19, 0.72);
  color: var(--tx-mute);
  padding: 0.8rem 1rem;
}
.credits summary { color: var(--green); cursor: pointer; }
.credits p { margin: 0.75rem 0 0; }
.credits ul { margin: 0.75rem 0 0; padding-left: 1.1rem; }
.credits a { color: var(--gold); }
.credits a:hover { color: var(--purple); }
.credits code { color: var(--tx); }
.disclaimer { color: var(--tx-dim); }

@media (max-width: 760px) {
  body { padding-inline: 1rem; }
  .site-nav { gap: 12px; }
  .terminal-head { align-items: flex-start; flex-direction: column; }
  .lights { margin-right: 0; }
  .terminal-shell { height: 60vh; min-height: 340px; padding: 0.45rem; }
}
