:root {
  color-scheme: dark;
  --page: #111513;
  --frame: #343a36;
  --frame-text: #b7beb8;
  --focus: #d9e2dc;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: var(--page);
  color: #d8ded9;
  font-family: "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  font-variant-ligatures: none;
}

.session { width: min(98vw, 1024px); padding: 12px 0 20px; }
.session-bar {
  height: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--frame);
  border-bottom: 0;
  background: #202522;
  color: var(--frame-text);
  font-size: 12px;
  letter-spacing: .04em;
}

.terminal {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border: 1px solid var(--frame);
  background: #020604;
  outline: 0;
  touch-action: manipulation;
}
.terminal:focus-visible { border-color: var(--focus); }
.terminal:not(.has-focus)::after {
  content: "CLICK TERMINAL OR PRESS KEYBOARD TO ACTIVATE";
  position: absolute;
  inset: auto 0 0;
  padding: 3px 8px;
  background: #212720;
  color: #e2d979;
  font-size: 11px;
  text-align: center;
}
#screen { display: block; width: 100%; height: 100%; image-rendering: auto; }
.key-capture { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.click-layer { position: absolute; inset: 0; }
.hotspot { position: absolute; border: 0; margin: 0; padding: 0; background: transparent; color: transparent; cursor: default; }
.hotspot:hover, .hotspot:focus-visible { outline: 1px dotted rgba(130,255,174,.55); outline-offset: -1px; }

.outside-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 2px 0;
  color: #7f8982;
  font-size: 11px;
  letter-spacing: .035em;
}
.outside-controls button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid #657068;
  padding: 2px 0;
  background: none;
  color: #aeb8b0;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}
.outside-controls span { margin-left: auto; }
.key-reference {
  margin-top: 8px;
  border: 1px solid #515a53;
  padding: 8px 10px;
  background: #e5e1cf;
  color: #1b1d1b;
  font-size: 11px;
  line-height: 1.45;
}
.key-reference p { margin: 0; }
.key-reference p:first-child { margin-bottom: 4px; font-weight: bold; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: pre; border: 0; }

@media (max-width: 720px) {
  body { display: block; }
  .session { width: 100vw; padding: 8px; }
  .terminal, .session-bar, .outside-controls, .key-reference { width: 100%; }
  .outside-controls { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

body.fullscreen .session { width: 100vw; height: 100vh; padding: 0; display: grid; place-items: center; }
body.fullscreen .session-bar, body.fullscreen .outside-controls, body.fullscreen .key-reference { display: none; }
body.fullscreen .terminal { width: min(100vw, calc(100vh * 5 / 3)); height: min(100vh, calc(100vw * 3 / 5)); border: 0; }

.continuous-reader { display: block; background: #020604; }
.reader-mode {
  width: min(78ch, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
  color: #22f26b;
  background: #020604;
  font: 500 17px/1.55 "Courier New", monospace;
  font-variant-ligatures: none;
  white-space: pre-wrap;
}
.reader-mode header { margin-bottom: 30px; border-bottom: 1px solid #406b4d; }
.reader-mode h1, .reader-mode h2 { color: #e9eee9; font: inherit; font-weight: 700; }
.reader-mode h1 { text-align: center; text-transform: uppercase; }
.reader-mode h2 { margin-top: 2em; text-decoration: underline; }
.reader-mode p, .reader-mode blockquote { margin: 0 0 1.4em; }
.reader-mode blockquote { margin-left: 4ch; color: #61e4dc; }
.reader-mode .reader-warning { color: #f1df63; }
.reader-mode button { border: 0; border-bottom: 1px solid #6f94ff; border-radius: 0; padding: 3px 0; background: none; color: #6f94ff; font: inherit; cursor: pointer; }
