@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Doto";
  src: url("fonts/Doto-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bar: 40px;
  /* Everything around the screen: bar, padding, hint line, bezel. */
  --chrome: calc(var(--bar) + 84px);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000000;
  color: #aaaaaa;
  font-family: "Courier New", Courier, monospace;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: calc(var(--bar) + 12px) 12px 12px;
}

/* Menu bar, same as the front page's */
#bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--bar);
  padding: 0 10px;
  font-family: "VT323", "Courier New", Courier, monospace;
  font-size: 22px;
  color: #000000;
  background: #aaaaaa;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

#bar a {
  padding: 3px 10px 2px;
  color: inherit;
  text-decoration: none;
}

#bar a:hover,
#bar a:focus-visible {
  background: #00aa00;
  outline: none;
}

.era-switch {
  display: flex;
  margin-left: auto;
  border: 2px solid #000000;
}

.era-switch button {
  padding: 1px 8px 0;
  font: inherit;
  color: #000000;
  background: #aaaaaa;
  border: 0;
  cursor: pointer;
}

.era-switch button:hover {
  background: #00aa00;
}

.era-switch button[aria-pressed="true"] {
  color: #ffff55;
  background: #0000aa;
}

#full {
  margin-left: 10px;
  padding: 3px 10px 2px;
  font: inherit;
  color: #55ffff;
  background: #555555;
  border: 0;
  cursor: pointer;
}

#full[hidden] {
  display: none;
}

#full:hover,
#full:focus-visible {
  color: #ffff55;
  outline: none;
}

/* Full screen: no hint line, so the screen gets that room too. */
:root:fullscreen {
  --chrome: calc(var(--bar) + 36px);
}

:root:fullscreen #hint {
  display: none;
}

@media (max-width: 700px) {
  .bar-wide {
    display: none;
  }
}

/* Phones held sideways: a slimmer bar and no hint line. */
@media (max-height: 500px) {
  :root,
  :root:fullscreen {
    --bar: 30px;
    --chrome: calc(var(--bar) + 28px);
  }

  body {
    padding: calc(var(--bar) + 8px) 8px 8px;
  }

  #bar {
    font-size: 18px;
  }

  #hint {
    display: none;
  }
}

#monitor {
  position: relative;
  background: #000000;
  box-shadow:
    0 0 0 3px #555555,
    0 0 0 6px #222222,
    0 16px 40px rgba(0, 0, 0, 0.7);
}

#game {
  display: block;
  /* As big as the window allows at 16:10 */
  width: min(100vw - 24px, (100vh - var(--chrome)) * 1.6);
  width: min(100vw - 24px, (100dvh - var(--chrome)) * 1.6);
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.noscript {
  margin: 0;
  color: #ffff55;
  text-align: center;
}

/* The game takes keys at the window; a focus ring on the screen itself is just noise. */
#game:focus {
  outline: none;
}

#monitor::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
}

#hint {
  margin: 0;
  max-width: 52rem;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #555555;
}

@media (max-width: 700px) {
  #hint {
    font-size: 10px;
  }
}

/* ?demo: bare screen for the landing page's attract-mode monitor */
body.demo {
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

body.demo #monitor {
  box-shadow: none;
}

body.demo #game {
  width: 100vw;
}

body.demo #hint,
body.demo #bar {
  display: none;
}

#hint a {
  color: #00aaaa;
}

#hint a:hover,
#hint a:focus-visible {
  color: #55ffff;
}

/* Share dialog at the end of a series: a text-mode window like the front page */
.share {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 34px 28px 24px;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  line-height: 1.35;
  color: #aaaaaa;
  background: #0000aa;
  border: 0;
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.7);
}

.share::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.share::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 6px double #ffffff;
  pointer-events: none;
}

.share-title {
  position: absolute;
  top: 1px;
  left: 50%;
  margin: 0;
  padding: 0 10px;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: #0000aa;
  transform: translateX(-50%);
}

.share-title:focus {
  outline: none;
}

.share-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 4px 0 14px;
  background: #000000;
  border: 2px solid #000000;
}

.share-text {
  margin: 0 0 18px;
  color: #ffffff;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.share button {
  padding: 7px 14px 6px;
  font: inherit;
  font-weight: bold;
  color: #000000;
  background: #55ffff;
  border: 0;
  box-shadow: 6px 6px 0 #000000;
  cursor: pointer;
}

.share button[data-act="native"] {
  background: #55ff55;
}

.share button:hover {
  background: #ffff55;
}

.share button:active {
  transform: translate(6px, 6px);
  box-shadow: none;
}

.share button:focus-visible,
.share a:focus-visible {
  outline: 3px solid #ffff55;
  outline-offset: 3px;
}

.share-links {
  margin: 20px 0 4px;
  color: #ffffff;
}

.share-links a {
  margin-left: 10px;
  color: #55ffff;
}

.share-links a:hover {
  color: #ffff55;
}

.share-tip {
  margin: 4px 0 0;
}

.share-note {
  min-height: 1.35em;
  margin: 8px 0 12px;
  color: #55ff55;
}

.share-foot {
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.25);
}

.share-foot button {
  background: #aaaaaa;
}

/* ===================================================================== 2026
 * The play page as a handheld unit: warm-gray housing, black ink, one signal
 * orange, keys that press down. The canvas itself is redrawn by js/game.js.
 */

[data-era="2026"] body {
  color: #5f5c56;
  background: #e9e7e2;
}

[data-era="2026"] #bar {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #111111;
  background: #f4f3ef;
  border-bottom: 1px solid #111111;
  box-shadow: none;
}

[data-era="2026"] #bar a {
  padding: 6px 10px;
  border-radius: 4px;
}

[data-era="2026"] #bar a:hover,
[data-era="2026"] #bar a:focus-visible {
  color: #f4f3ef;
  background: #111111;
}

/* Keys with status LEDs, same as the front page's menu bar. */
[data-era="2026"] .era-switch {
  gap: 4px;
  border: 0;
}

[data-era="2026"] .era-switch button,
[data-era="2026"] #full {
  position: relative;
  padding: 5px 10px 4px 22px;
  font: inherit;
  font-size: 11px;
  color: #111111;
  background: #f4f3ef;
  border: 1px solid #111111;
  border-radius: 6px;
  box-shadow: 0 2px 0 #111111;
}

[data-era="2026"] .era-switch button::before,
[data-era="2026"] #full::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 9px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: #9a968e;
  border-radius: 50%;
}

[data-era="2026"] .era-switch button:hover,
[data-era="2026"] #full:hover,
[data-era="2026"] #full:focus-visible {
  color: #111111;
  background: #ffffff;
}

[data-era="2026"] .era-switch button[aria-pressed="true"] {
  background: #ff4f00;
  box-shadow: 0 0 0 #111111;
  transform: translateY(2px);
}

[data-era="2026"] .era-switch button[aria-pressed="true"]::before,
[data-era="2026"] #full[aria-pressed="true"]::before {
  background: #111111;
}

[data-era="2026"] #monitor {
  overflow: hidden;
  border: 1px solid #111111;
  border-radius: 10px;
  box-shadow: 0 6px 0 #111111;
}

[data-era="2026"] #monitor::after {
  display: none;
}

[data-era="2026"] #game {
  image-rendering: auto;
}

[data-era="2026"] body.demo #monitor {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

[data-era="2026"] #hint {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #9a968e;
}

[data-era="2026"] #hint a {
  color: #111111;
  text-decoration-color: #ff4f00;
}

[data-era="2026"] .share {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #5f5c56;
  background: #f4f3ef;
  border: 1px solid #111111;
  border-radius: 10px;
  box-shadow: 0 6px 0 #111111;
}

[data-era="2026"] .share::backdrop {
  background: rgba(233, 231, 226, 0.8);
}

[data-era="2026"] .share::before {
  display: none;
}

[data-era="2026"] .share-title {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #f4f3ef;
  background: #111111;
  border-radius: 4px;
  transform: none;
}

[data-era="2026"] .share-title::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #ff4f00;
  border-radius: 50%;
}

[data-era="2026"] .share-card {
  border: 1px solid #111111;
  border-radius: 6px;
}

[data-era="2026"] .share-text,
[data-era="2026"] .share-links {
  color: #111111;
}

[data-era="2026"] .share button {
  padding: 8px 14px 7px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #111111;
  background: #ff4f00;
  border: 1px solid #111111;
  border-radius: 6px;
  box-shadow: 0 3px 0 #111111;
}

[data-era="2026"] .share button:hover {
  background: #ff6a26;
}

[data-era="2026"] .share button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #111111;
}

[data-era="2026"] .share button:focus-visible,
[data-era="2026"] .share a:focus-visible {
  outline: 2px solid #ff4f00;
}

[data-era="2026"] .share-foot {
  border-top: 1px solid rgba(17, 17, 17, 0.16);
}

[data-era="2026"] .share-foot button {
  background: #f4f3ef;
}

[data-era="2026"] .share-links a {
  color: #111111;
  text-decoration-color: #ff4f00;
}

[data-era="2026"] .share-note {
  color: #00875a;
}
