/* The Archive Quest — chapter 1 looks like an Apple II running a 1980 Hi-Res Adventure */
@font-face { font-family: "AGI8"; src: url("../fonts/agi8.woff") format("woff"), url("../fonts/agi8.ttf") format("truetype"); font-display: block; }
:root { --ink: #f4f4f4; --dim: #9a9a9a; --bg: #000; --case: #1b1712; --case-hi: #3a3229; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; background: #000; color: var(--ink); }
body { font: 16px/1.5 AGI8, "Courier New", monospace; min-height: 100vh; }
.q-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 40px; }

/* everything sits straight on black, like the Apple II screen itself */
.q-monitor { background: none; border: 0; padding: 0; }
.q-screen { background: #000; padding: 0; position: relative; }
#q-pic { display: block; width: 100%; aspect-ratio: 280 / 160;   /* drawn at 280 x 320 (every second row a black scanline), shown 4x */
  background: #000; }
.q-log { height: 14.4em; overflow-y: auto; margin-top: 12px; font-size: clamp(13px, 1.9vw, 16px); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; text-transform: uppercase; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.q-log p { margin: 0 0 .5em; }
.q-log .you { color: var(--dim); }
.q-log .win { color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.q-log .die { color: #fff; background: #fff; color: #000; padding: 0 .3em; }
.q-line { position: relative; display: flex; align-items: center; gap: .4em; margin-top: 6px; font-size: clamp(13px, 1.9vw, 16px); text-transform: uppercase; }
.q-prompt { flex: none; }
#q-in { flex: 1; background: transparent; border: 0; color: var(--ink); font: inherit; text-transform: uppercase; caret-color: transparent; outline: none; padding: 4px 0; font-size: max(16px, 1em); }
.q-status { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: #8a8a8a; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* quick commands, mostly for phones */
.q-pad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.q-pad button { font: 12px AGI8, monospace; text-transform: uppercase; color: #ddd; background: #000; border: 1px solid #333; border-radius: 6px; padding: 9px 10px; min-height: 36px; cursor: pointer; }
.q-pad button:hover, .q-pad button:focus-visible { background: #111; outline: none; border-color: #888; }
@media (hover: hover) and (pointer: fine) { .q-pad { display: none; } }   /* on a computer with a keyboard and mouse, players type */

.q-shelf { margin-top: 22px; padding: 16px 18px; border: 1px solid #333; border-radius: 12px; background: #000; font: 15px/1.5 system-ui, sans-serif; }
.q-shelf h2 { margin: 0 0 8px; font: 14px AGI8, monospace; text-transform: uppercase; letter-spacing: .06em; color: #ddd; }
.q-shelf ol { margin: 0 0 8px; padding-left: 1.4em; }
.q-shelf a { color: #fff; }
.q-shelf p { margin: 0; color: #888; font-size: 13px; }
.q-foot { margin: 20px 0 0; font: 13px system-ui, sans-serif; }
.q-foot a { color: #888; }

/* ===== chapter 2: the 3-D animated adventures — 16 colours, a status bar on top, a parser line below ===== */
@font-face { font-family: "SierraAGI"; src: url("../fonts/sierra-agi.woff") format("woff"), url("../fonts/sierra-agi.otf") format("opentype"); font-display: block; }
.ch2 .q-wrap { max-width: 960px; }
.a-screen { background: #000; font-family: SierraAGI, AGI8, monospace; }
.a-status { display: flex; justify-content: space-between; gap: 12px; background: #fff; color: #000; padding: 2px 10px; font-size: clamp(12px, 1.9vw, 18px); line-height: 1.3; white-space: nowrap; overflow: hidden; }
.a-status #a-room { opacity: .55; overflow: hidden; text-overflow: ellipsis; }
.a-pic { position: relative; }
#a-pic { display: block; width: 100%; aspect-ratio: 320 / 202; background: #000; cursor: crosshair; touch-action: manipulation; }
/* the message window: black text on white with a red edge, in the middle of the picture */
.a-msg { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: min(78%, 560px); max-height: 72%; overflow: auto; background: #fff; color: #000; padding: 12px 16px; font-size: clamp(13px, 1.9vw, 18px); line-height: 1.35; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #aa0000, 0 0 0 7px #fff; white-space: pre-wrap; cursor: pointer; }
.a-msg.die { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000, 0 0 0 7px #fff; }
.a-msg small { display: block; margin-top: 10px; text-align: right; opacity: .5; font-size: .75em; }
.a-line { position: relative; display: flex; align-items: center; gap: .4em; padding: 6px 10px 8px; color: #fff; font-size: clamp(13px, 1.9vw, 18px); }
#a-in { flex: 1; background: transparent; border: 0; color: #fff; font: inherit; font-size: max(16px, 1em); caret-color: transparent; outline: none; padding: 2px 0; }
.a-arrows { display: inline-flex; gap: 4px; margin-left: auto; }
.a-arrows button { min-width: 38px; }
.a-keys { margin: 10px 0 0; color: #777; font: 13px system-ui, sans-serif; }
.a-msg.low { top: auto; bottom: 4%; max-height: 40%; width: min(86%, 620px); }
/* the artist's templates page */
.a-tpl { font: 15px/1.5 system-ui, sans-serif; color: #ddd; }
.a-tpl h1 { font: 22px SierraAGI, monospace; } .a-tpl h2 { font: 17px SierraAGI, monospace; margin: 28px 0 10px; border-top: 1px solid #333; padding-top: 16px; }
.a-tpl-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.a-tpl figure { margin: 0; } .a-tpl figure img { display: block; width: 320px; max-width: 100%; image-rendering: pixelated; background: repeating-conic-gradient(#222 0 25%, #333 0 50%) 0 0 / 12px 12px; }
.a-tpl figcaption { font-size: 13px; color: #aaa; margin-top: 4px; } .a-tpl figcaption b { color: #fff; }
.a-tpl a { color: #ffd76a; }
.a-tpl figure img { outline: 1px solid #444; }
/* the end of chapter 1 while chapter 2 isn't open yet: an AGI message window over the castle */
.q-awaits { font-family: SierraAGI, AGI8, monospace; text-transform: none; top: 18%; }
/* a dark, thin scrollbar that suits the game (seen when the shelf of named titles grows below it) */
html { color-scheme: dark; scrollbar-width: thin; scrollbar-color: #3a3a3a #000; }
::-webkit-scrollbar { width: 8px; height: 8px; background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: #000; }

/* the game's own cursor (the browser's thin one is hidden): a solid block, or an underscore in chapter 2 */
.q-caret { position: absolute; pointer-events: none; background: currentColor; color: var(--ink, #fff); }
.a-line .q-caret { color: #fff; }
.q-caret.under { background: none; }
.q-caret.under::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .16em; min-height: 2px; background: currentColor; }
.q-caret.blink { animation: q-caret 1.06s steps(1) .5s infinite; }
@keyframes q-caret { 50% { visibility: hidden; } }
