/* The guide (index.html here, made by tools/make-guide.js): the game's own
   look from style.css, on a page that scrolls. A wooden bar along the top with
   the name and the way into the game, then parchment cards on the wood, one a
   section. */

body.guide {
  line-height: 22px;
  overscroll-behavior: auto; /* the game's body stops the page bouncing and zooming: this one's for reading */
  touch-action: auto;
}

/* ---- The bar: the game's planks, kept in view ---- */

.guide-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 16px;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background-color: var(--wood-1);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 7 - var(--u)), rgba(42, 31, 40, 0.28) 0 calc(100% / 7)),
    linear-gradient(transparent 0 46%, rgba(255, 235, 200, 0.05) 46% 54%, transparent 54%);
  box-shadow: inset 0 calc(-2 * var(--u)) 0 var(--wood-0), 0 var(--u) 0 var(--ink), 0 calc(3 * var(--u)) 0 var(--shadow);
}
.guide-bar .logo { --o: 2px; font-size: var(--f4); line-height: 36px; letter-spacing: 2px; text-decoration: none; }
.guide-bar .logo b { color: #edc548; }
.guide-bar .spacer { flex: 1; }

/* ---- The cards ---- */

.sheets {
  display: flex; flex-direction: column; gap: 24px;
  max-width: 852px; margin: 0 auto; padding: 24px 16px 40px;
}
/* Centred, but on a whole pixel, so the pixel font stays sharp. */
@supports (width: round(down, 1px, 1px)) {
  .sheets { margin-left: max(0px, round(down, calc((100% - 852px) / 2), 1px)); }
}

.guide .card {
  padding: 22px 30px 26px;
  color: var(--text);
  background: var(--paper);
  box-shadow:
    inset 0 0 0 calc(3 * var(--u)) var(--wood-2), inset 0 0 0 calc(4 * var(--u)) var(--wood-0),
    inset 0 calc(5 * var(--u)) 0 var(--paper-hi),
    var(--outline), calc(3 * var(--u)) calc(3 * var(--u)) 0 var(--shadow);
  scroll-margin-top: 72px; /* clear of the bar, when a link jumps to it */
}
.guide .card b { color: var(--strong); }
.guide h1, .guide h2 { margin: 0 0 10px; font-size: var(--f4); line-height: 36px; color: var(--strong); text-shadow: 0 var(--u) 0 var(--paper-edge); }
.guide h3 {
  margin: 22px 0 8px; font-size: var(--f2); line-height: 22px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted);
}
.guide p { margin: 8px 0; }
.guide .card a:not(.btn) { color: var(--ice); text-decoration-thickness: var(--u); text-underline-offset: 4px; }
.guide .dim { color: var(--muted); }
.lead { color: var(--text); }

/* What's in the game, a picture and a name to each, and what it is under them. */
.entries { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; padding: 0; list-style: none; }
.entries li { display: flex; align-items: flex-start; gap: 14px; scroll-margin-top: 72px; }
.entries li > div { min-width: 0; }
.entries .name { display: block; }
.entries p { margin: 2px 0 0; }
.meta { color: var(--muted); }
.pic {
  flex: none; display: inline-block; width: 44px; height: 44px; padding: 2px;
  background: var(--paper-lo); box-shadow: inset 0 calc(-1 * var(--u)) 0 var(--paper-deep), var(--outline);
}
.pic img { display: block; width: 40px; height: 40px; }
.brief { margin: 18px 0; }
.brief li { align-items: center; }
.brief p { color: var(--muted); }

/* A dot of wood before each point, as the game's own help has, and the same
   emphasis: a pixel font has no bold, so what stands out is darker. */
.guide .how { margin: 8px 0; padding: 0; list-style: none; }
.guide .how li { position: relative; margin: 8px 0; padding-left: 16px; color: var(--muted); }
.guide .how li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; background: var(--wood-3); box-shadow: 0 0 0 var(--u) var(--ink); }
.guide .claim li { padding-left: 22px; }
.guide .claim li::before { left: 0; top: 0; width: 16px; height: auto; background: none; box-shadow: none; text-align: center; }
.guide .claim li.gain::before { content: '+'; color: var(--good); }
.guide .claim li.risk::before { content: '!'; color: var(--bad); }

.items { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 14px 0; padding: 0; list-style: none; }
.items li { display: flex; align-items: center; gap: 12px; }
.items .pic { width: 36px; height: 36px; }
.items .pic img { width: 32px; height: 32px; }

.play { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 18px 0; }

.toc { margin-top: 22px; padding: 12px 16px 14px; background: var(--paper-lo); box-shadow: inset 0 var(--u) 0 var(--paper-deep), inset 0 calc(-1 * var(--u)) 0 var(--paper-hi); }
.toc h2 { margin: 0 0 4px; font-size: var(--f2); line-height: 22px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); text-shadow: none; }
.toc ol { columns: 2; column-gap: 24px; margin: 0; padding: 0 0 0 26px; }
.toc li { padding: 2px 0; } /* far enough apart for a finger */

/* Upgrades: a turret to a block, its two paths side by side. */
.upgrades { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.upgrade { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.upgrade > .name { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.upgrade .pic { width: 36px; height: 36px; }
.upgrade .pic img { width: 32px; height: 32px; }
.path { padding: 8px 12px 10px; background: var(--paper-lo); box-shadow: inset 0 var(--u) 0 var(--paper-deep), inset 0 calc(-1 * var(--u)) 0 var(--paper-hi); }
.path ol { margin: 4px 0 0; padding-left: 22px; }
.path li { margin: 4px 0; }
.path .cost { color: var(--muted); }
.path .d { display: block; }

/* Research: the four branches, in their colours (as the game's tree has them: .branch h3 in style.css). */
.techs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.techs .branch h3 { margin-top: 16px; }
.techs ol { margin: 0; padding-left: 22px; }
.techs li { margin: 0 0 10px; }
.techs li > b { display: block; }
.techs .meta { margin: 0; }

/* Questions people ask, as they'd ask them. */
#questions h3 { margin-top: 18px; text-transform: none; letter-spacing: 0; color: var(--strong); }

/* The keys, in a well, as the game's help shows them. */
.guide .keys {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; padding: 12px 14px;
  color: var(--muted); background: var(--paper-lo);
  box-shadow: inset 0 var(--u) 0 var(--paper-deep), inset 0 calc(-1 * var(--u)) 0 var(--paper-hi);
}

.end { margin: 0; text-align: center; }
.end .btn { font-size: var(--f4); line-height: 36px; padding: 6px 28px 8px; }

/* ---- Phones ---- */

@media (max-width: 640px) {
  .sheets { gap: 16px; padding: 16px 8px 32px; }
  .guide .card { padding: 18px 18px 20px; }
  .items, .upgrade, .techs, .guide .keys, .toc ol { grid-template-columns: 1fr; columns: 1; }
  .entries li { gap: 12px; }
}
