/* Dark, low-chrome framing so the 320x200 canvas is the loudest thing here. */
:root {
  --bg: #0d0b0a;
  --fg: #e8ddd4;
  --muted: #9a8d83;
  --accent: #d97742;
  --rule: #2a2320;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 46rem; margin: 0 auto; }

header { text-align: center; margin-bottom: 1.75rem; }

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 4rem);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--accent);
  font-weight: 700;
}

.tagline { margin: 0.35rem 0 0; color: var(--muted); }

/* The emulator canvas. 4:3 keeps mode 13h's aspect honest. */
#player {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: #000;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

#screen_container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* v86 renders text modes into a <div> and graphics into the <canvas>. */
#screen_container .v86-text {
  white-space: pre;
  font: 13px/13px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #b8b0a8;
}

#screen_container canvas {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

#screen_container.is-locked { cursor: none; }

.notice {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 0.75rem 1rem;
  background: #1a1512;
  color: #b8b0a8;
  font-size: 0.9rem;
  text-align: center;
}

.hint {
  margin: 0.9rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

kbd {
  padding: 0.1em 0.4em;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #191412;
  font: 0.85em ui-monospace, SFMono-Regular, Menlo, monospace;
}

section { border-top: 1px solid var(--rule); padding-top: 1.5rem; }

h2 { font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: #191412;
  color: var(--accent);
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace;
}

footer { margin-top: 2.5rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }

.links { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #f0a070; }

.legal { margin: 0; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 480px) {
  body { padding: 1.25rem 0.75rem 3rem; }
}

.notice.is-error { background: #3a1410; color: #ffb4a2; }
