/* The look of the game: the 16 colors and the 8x8 font of Leapman, a blue screen in a
   light-blue border, gray message boxes with a yellow line above and below. */
@font-face { font-family: 'Leapman'; font-display: swap; src: url(fonts/leapman.ttf) format('truetype'); }
:root {
  --border: #7c6ed8; --screen: #40329a; --black: #000; --white: #fff; --yellow: #c8d37a;
  --green: #9ce58a; --cyan: #6fc3c9; --box: #4f4f4f; --gray: #a8a8a8; --red: #bc6e64;
  /* A lighter tint of the border color, for the small lines: readable on the blue. */
  --dim: #bcb5f2;
  --px: 'Leapman', 'Courier New', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--border); color: var(--white);
  font: 17px/1.5 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', 'Liberation Mono', Menlo, monospace;
}
a { color: var(--yellow); }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible { outline: 4px solid var(--white); outline-offset: 2px; }
/* The screen inside its border. */
.page { max-width: 1212px; margin: 0 auto; padding: 0 16px 32px; }
main { background: var(--screen); padding: 8px 32px 64px; }
section { margin-top: 64px; scroll-margin-top: 72px; }

/* The top line, as the status bar of the game: black text on a color. */
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--yellow); font: 16px/1 var(--px); border-bottom: 4px solid var(--black);
}
.bar a { color: var(--black); text-decoration: none; padding: 12px; }
.bar a:hover { background: var(--black); color: var(--yellow); }
.bar .brand { background: var(--cyan); padding: 12px 16px; }
.bar .go { background: var(--green); margin-left: auto; padding: 12px 16px; }

h1, h2, h3 { font-family: var(--px); font-weight: 400; margin: 0; }
h1 { font-size: 64px; line-height: 1; color: var(--yellow); }
h2 { font-size: 24px; line-height: 1.34; color: var(--yellow); margin-bottom: 24px; }
h2 small { display: block; font: 17px/1.5 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace; color: var(--dim); margin-top: 8px; }
h3 { font-size: 16px; line-height: 1.5; color: var(--green); margin-bottom: 8px; }
p { margin: 0 0 12px; }
code, kbd { font: inherit; color: var(--yellow); }
.sub { color: var(--dim); font-size: 15px; }

/* A message box of the game. */
.panel { background: var(--box); border-top: 4px solid var(--yellow); border-bottom: 4px solid var(--yellow); padding: 16px 20px; min-width: 0; }
.panel > :last-child { margin-bottom: 0; }

.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; margin-top: 40px; }
.hero .tag { font: 16px/1.5 var(--px); color: var(--white); margin: 24px 0 16px; }
.hero .lead { font-size: 19px; margin-bottom: 28px; max-width: 30em; }
.btn {
  display: inline-block; background: var(--yellow); color: var(--black); text-decoration: none;
  font: 24px/1 var(--px); padding: 14px 24px; box-shadow: 6px 6px 0 var(--black); border: 0;
}
.btn:hover { background: var(--white); }
.btn:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--black); }
.btn[aria-disabled="true"] { background: var(--black); color: #7a7a7a; box-shadow: none; pointer-events: none; }
.meta { margin-top: 18px; color: var(--dim); font-size: 15px; }

/* A picture of the game: its own border color is in the picture. */
.shot { margin: 0; min-width: 0; }
.shot img { display: block; width: 100%; height: auto; background: var(--black); }
.shot figcaption { font: 16px/1.5 var(--px); color: var(--white); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.shot figcaption span { flex: 1; min-width: 0; }
.shot button { font: 16px/1 var(--px); background: var(--yellow); color: var(--black); border: 0; padding: 8px 10px; cursor: pointer; }
.shot button:hover { background: var(--white); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }

/* A tower: two pictures, then its levels as the rows of a menu. */
.tower .pics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.levels { list-style: none; margin: 0; padding: 0; counter-reset: lv var(--from, 0); font: 16px/1.5 var(--px); }
.levels li { counter-increment: lv; display: grid; grid-template-columns: 2ch 1fr; gap: 16px; }
.levels li::before { content: counter(lv, decimal-leading-zero); color: var(--cyan); }

/* Numbered steps: the number in the font of the game. */
.rows { list-style: none; margin: 0; padding: 0; counter-reset: row; }
.rows li { counter-increment: row; display: grid; grid-template-columns: 16px 1fr; gap: 20px; padding: 8px 0; }
.rows li::before { content: counter(row); font: 16px/1.6 var(--px); color: var(--yellow); }
.rows b { color: var(--green); font-weight: 400; }

/* The keys: the key in the font of the game, then what it does. */
.keys { width: 100%; border-collapse: collapse; }
.keys th { font: 16px/1.6 var(--px); color: var(--yellow); text-align: left; white-space: nowrap; padding: 6px 24px 6px 0; vertical-align: top; }
.keys td { padding: 6px 0; }
.panel ul, .panel ol:not(.rows):not(.levels) { margin: 0 0 12px; padding-left: 24px; }
.panel li { margin-bottom: 6px; }

details { border-bottom: 4px solid var(--box); padding: 12px 0; }
summary { cursor: pointer; font: 16px/1.5 var(--px); color: var(--yellow); }
details p { margin: 10px 0 4px; max-width: 46em; }

footer { color: var(--black); text-align: center; padding: 20px 16px 8px; font-size: 15px; }
footer a { color: var(--black); }

/* The download page. */
.narrow main { max-width: 900px; margin: 0 auto; }
.narrow .page { max-width: 932px; }
.agree { display: flex; gap: 14px; align-items: flex-start; margin: 20px 0 24px; cursor: pointer; color: var(--yellow); }
.agree input { width: 24px; height: 24px; margin-top: 1px; accent-color: var(--yellow); flex: none; }
.gets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.gets .meta { margin-top: 16px; }pre { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: var(--yellow); }

@media (max-width: 860px) {
  body { font-size: 16px; }
  .page { padding: 0 8px 16px; }
  main { padding: 8px 16px 48px; }
  .hero, .side { grid-template-columns: 1fr; }
  h1 { font-size: 40px; }
  .btn { font-size: 16px; }
  .bar a:not(.brand):not(.go) { display: none; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
