/* ==========================================================================

   The player guide — guide.html

   Kept apart from style.css because it is the one page that is a DOCUMENT
   rather than a screen. Every other page is a 1280-wide interface laid over a
   map; this one is text somebody reads once, at whatever size their window
   happens to be, and it scrolls.

   The palette is the game's own — the same olive metal, the same amber — so a
   player who arrived from a match recognises where they are. What is added is
   a reading measure: prose is capped near 70 characters, figures are
   monospaced and right-aligned so columns of numbers line up, and each side
   keeps its own tint wherever it is named, so a table can be scanned by colour
   instead of read.

   Loaded after style.css, so it may override freely. Everything is scoped to
   .guide-page, and it touches nothing outside this page. */

html.doc.guide-page,
html.doc.guide-page body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.007) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 80% 55% at 72% -8%, rgba(224, 173, 86, 0.055), transparent 62%),
    var(--metal-bg);
}

.guide-page #guide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 0 90px;
}

/* ---- cover ---- */

.guide-page .cover {
  border-bottom: 1px solid var(--metal-line);
  padding-bottom: 26px;
  margin-bottom: 34px;
}
.guide-page .cover .kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--metal-amber-light);
  margin-bottom: 12px;
}
.guide-page .cover h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--metal-text);
}
.guide-page .cover .lede {
  margin: 0;
  max-width: 70ch;
  color: var(--metal-muted);
  font-size: 15px;
  line-height: 1.8;
}
.guide-page .strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--metal-muted);
}
.guide-page .strip b {
  color: var(--metal-text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
}
.guide-page .strip .src {
  margin-inline-start: auto;
  color: var(--metal-amber);
}

/* ---- contents ----

   A reading list, not a grid of cards. The numbers are there because these
   really are read in order. */
.guide-page .toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 34px;
  border: 1px solid var(--metal-line);
  border-radius: 5px;
  padding: 16px 18px 12px;
  margin-bottom: 48px;
  background: linear-gradient(180deg, rgba(48, 53, 38, 0.30), rgba(28, 32, 23, 0.18));
}
.guide-page .toc-title {
  grid-column: 1 / -1;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--metal-muted);
  padding-bottom: 8px;
}
.guide-page .toc-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 2px;
  border-top: 1px solid rgba(183, 188, 146, 0.10);
  color: var(--metal-text);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.12s;
}
.guide-page .toc-row:hover { color: var(--metal-amber-light); }
.guide-page .toc-row i {
  font-family: ui-monospace, Consolas, monospace;
  font-style: normal;
  font-size: 11px;
  color: var(--metal-amber);
  flex: none;
}

/* ---- sections ---- */

.guide-page .manual section {
  margin: 0 0 60px;
  scroll-margin-top: 56px;
}
.guide-page .sec-head {
  display: flex;
  align-items: baseline;
  gap: 13px;
  border-bottom: 1px solid var(--metal-line);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.guide-page .sec-num {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--metal-amber);
  flex: none;
}
.guide-page .sec-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--metal-text);
}

.guide-page h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--metal-text);
  margin: 30px 0 10px;
  padding-inline-start: 9px;
  border-inline-start: 2px solid var(--metal-amber);
  line-height: 1.4;
}
.guide-page h3.fac-head {
  border-inline-start-color: var(--fac);
  font-size: 16px;
  margin-top: 38px;
}

.guide-page p {
  margin: 0 0 12px;
  max-width: 70ch;
  line-height: 1.82;
  color: var(--metal-text);
}
.guide-page p.small,
.guide-page .small { font-size: 12.5px; }
.guide-page .dim { color: var(--metal-muted); }

/* ---- tables ----

   Every table scrolls sideways inside its own frame rather than pushing the
   page wide. The damage table keeps its header stuck while you scroll it —
   nine columns of figures with no names over them is a guessing game. */
.guide-page .tw {
  margin: 10px 0 6px;
  overflow-x: auto;
  border: 1px solid var(--metal-line);
  border-radius: 4px;
}
.guide-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

/* On a phone a six-column table cannot fit whatever is done to it, and a
   header clipped mid-word at the scroll edge reads as a broken table rather
   than as a row you can push. So the columns are allowed to take the room
   they need and wrap inside it: the table grows past the frame and scrolls,
   which it already had to do, but every header is whole when you get there. */
@media (max-width: 640px) {
  .guide-page table { width: auto; min-width: 100%; font-size: 12px; }
  .guide-page th,
  .guide-page td { padding: 6px 6px; }
  .guide-page thead th { white-space: normal; }
  .guide-page .num { font-size: 11.5px; }
}
.guide-page caption {
  caption-side: top;
  text-align: start;
  padding: 9px 11px 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--metal-muted);
  border-bottom: 1px solid var(--metal-line);
}
.guide-page th,
.guide-page td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(183, 188, 146, 0.10);
  text-align: start;
  vertical-align: middle;
}
.guide-page thead th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--metal-muted);
  white-space: nowrap;
  background: #1c2017;
  border-bottom: 1px solid var(--metal-line);
}
.guide-page .tw.sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.guide-page tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.guide-page tbody tr:last-child td { border-bottom: none; }

.guide-page .num {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: end;
  white-space: nowrap;
  /* A figure reads left-to-right in every language, and a Persian table is
     laid out right-to-left. Without this the numbers inside an RTL cell are
     re-ordered by bidi — «$250 / 10s» can come out «10s / 250$» — and the
     decimal point lands on the wrong side of the digits. `isolate` keeps the
     cell's own direction from leaking into the figure. */
  direction: ltr;
  unicode-bidi: isolate;
}
.guide-page td.name { font-weight: 600; white-space: nowrap; }
.guide-page td.void { color: rgba(167, 170, 145, 0.42); }
.guide-page .sub {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--metal-muted);
  font-family: ui-monospace, Consolas, monospace;
}

/* Identification. The game's own silhouette, tinted in the side's colour —
   the same art the build panel shows, so a row here and the button there look
   like the same object. The empty span holds the column steady while the PNG
   arrives, which is the difference between a table that settles and one that
   jumps under the reader. */
.guide-page .sil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-inline-end: 8px;
  vertical-align: middle;
  flex: none;
}
.guide-page .sil canvas {
  width: 24px;
  height: 24px;
  display: block;
}

.guide-page .tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.65;
  white-space: nowrap;
}
.guide-page .tag-america { color: #4a8fe7; border: 1px solid rgba(74, 143, 231, 0.45); }
.guide-page .tag-iran { color: #4bbf73; border: 1px solid rgba(75, 191, 115, 0.45); }
.guide-page .tag-china { color: #e2574c; border: 1px solid rgba(226, 87, 76, 0.45); }

/* ---- faction cards ---- */

.guide-page .factions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 8px;
}
.guide-page .fac {
  border: 1px solid var(--metal-line);
  border-radius: 4px;
  padding: 15px 16px 13px;
  background: linear-gradient(180deg, rgba(48, 53, 38, 0.42), rgba(28, 32, 23, 0.30));
}
.guide-page .fac-america { border-top: 3px solid #4a8fe7; }
.guide-page .fac-iran { border-top: 3px solid #4bbf73; }
.guide-page .fac-china { border-top: 3px solid #e2574c; }
.guide-page .fac h4 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
}
.guide-page .fac-row { margin-bottom: 11px; }
.guide-page .fac-row > span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--metal-muted);
  margin-bottom: 3px;
}
.guide-page .fac-row p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.72;
}

/* ---- callouts ---- */

.guide-page .callout {
  border-inline-start: 2px solid var(--metal-amber);
  background: rgba(201, 139, 50, 0.055);
  padding: 11px 15px;
  margin: 18px 0 6px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--metal-text);
  max-width: 78ch;
}

/* ---- the ten ways ---- */

.guide-page .losses {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.guide-page .losses li {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(183, 188, 146, 0.10);
  font-size: 13.5px;
  line-height: 1.72;
  max-width: 80ch;
}
.guide-page .losses .n {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: #e2574c;
  flex: none;
  padding-top: 3px;
}

/* A label over a table, so a reader knows whether the columns in front of
   them are the building columns or the unit ones without reading a header. */
.guide-page .grp {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--metal-muted);
}
.guide-page .grp::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(183, 188, 146, 0.12);
}

/* ---- narrow ---- */

@media (max-width: 860px) {
  .guide-page #guide { padding: 24px 0 70px; }
  .guide-page .factions { grid-template-columns: 1fr; }
  .guide-page .toc { grid-template-columns: 1fr; }
  .guide-page .strip .src { margin-inline-start: 0; }
}

/* A heading inside a section that labels the table under it rather than
   opening a new idea — quieter than an h3, and with no rule down its side. */
.guide-page h3.sub-head {
  border-inline-start: none;
  padding-inline-start: 0;
  font-size: 13px;
  color: var(--metal-muted);
  margin: 22px 0 6px;
}
