/* The layout of the ladder pages. The shared look is in theme.css. */
body { margin: 0 auto; max-width: 56rem; padding: 0 1.2rem 3rem; }
.offers button, .action { background: var(--seal); color: #fbf7ee; border: 1px solid var(--seal); }
.offers button:hover, .action:hover { background: var(--seal-dark); border-color: var(--seal-dark); }

header {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: baseline; margin: 0 0 2.2rem; padding: 1.1rem 0 0.7rem;
  border-bottom: 1px solid var(--ink); color: var(--dim);
}
header a.site { margin-right: auto; color: var(--ink); text-decoration: none; letter-spacing: 0.04em; }
header .mark {
  font-family: var(--mark); font-size: 2rem; line-height: 1; margin-right: 0.5rem; vertical-align: -0.1em;
}
header a { color: var(--dim); text-decoration: none; }
header a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.15em; }
header form { margin: 0; }
header button { padding: 0; border: 0; background: none; color: var(--dim); white-space: nowrap; }
header button:hover { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 0.15em; }

main { max-width: 32rem; }
main:has(table) { max-width: none; }
main:has(table) form { max-width: 32rem; }
h1 { margin: 0 0 1.2rem; font-size: 1.6rem; font-weight: 400; }
main form p { margin: 0 0 0.9rem; }
label { color: var(--dim); }
section { margin: 0 0 2.4rem; }
section p { margin: 0 0 0.8rem; }
.lead { font-size: 1.3rem; line-height: 1.4; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; margin: 0 0 0.9rem; }
.inline label, .inline span { color: var(--dim); }
/* Words and the control they belong to wrap as one piece, never "or" alone at the end of a line. */
.inline .unit { display: flex; align-items: center; gap: 0.5rem 0.6rem; }
.inline input { display: inline-block; width: 11rem; margin: 0; }
.inline input[name="code"] { width: 5.5rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.15em; }
.action { display: inline-block; padding: 0.45rem 1.1rem; border-radius: 2px; text-decoration: none; }
.code { font: 2rem/1.3 var(--mono); letter-spacing: 0.3em; color: var(--seal); margin: 0.2rem 0 0.6rem; user-select: all; }
.offers { list-style: none; margin: 0; padding: 0; }
.offers li { display: flex; gap: 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.offers .who { margin-right: auto; overflow-wrap: anywhere; }
.offers button { padding: 0.2rem 0.8rem; }
table { width: 100%; margin-top: 1rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 0.4rem 0.6rem 0.4rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
td .hint, td .notice { display: block; }
td.num, th.num { text-align: right; width: 1%; white-space: nowrap; padding-left: 1.2rem; }
tr.own td { font-weight: 700; }
fieldset { margin: 0 0 0.9rem; padding: 0; border: 0; }
legend { padding: 0; color: var(--dim); }
fieldset label { margin-right: 1.2rem; color: var(--ink); }
input[type="radio"] { display: inline; width: auto; margin: 0 0.3rem 0 0; accent-color: var(--seal); }
.tag { margin-left: 0.6rem; color: var(--dim); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1.2rem; margin: 0 0 1.4rem; }
.stats dt { color: var(--dim); }
.stats dd { margin: 0; }
main:has(article) { max-width: 40rem; }
article li { margin-bottom: 0.4rem; }
article h2 { margin-top: 2.4rem; }
article code { font: 0.92em/1.4 var(--mono); }
article pre { margin: 0 0 0.9rem; padding: 0.7rem 0.9rem; overflow-x: auto; background: var(--field); border: 1px solid var(--line); }
article pre code { font-size: 0.95rem; }

/* Verification keeps the command in view and occasional help behind a disclosure. */
.verify .lead { margin-bottom: 1.4rem; }
.verify-download { margin-bottom: 0.35rem; }
.verify-download + .hint { margin-top: 0; }
.verify details { margin: 1rem 0; }
.verify summary { color: var(--link); cursor: pointer; width: fit-content; }
.verify summary:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.verify details p { margin: 0.6rem 0; }
.verify pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.verify-outcomes dt { margin-top: 0.8rem; }
.verify-outcomes dd { margin: 0.15rem 0 0; }

/* A game's played result, audit and rating changes have separate places. */
main:has(.game-history) { max-width: 46rem; }
.game-history { list-style: none; margin: 0; padding: 0; }
.game-history > li { border-top: 1px solid var(--line); padding: 1.2rem 0 1.5rem; }
.game-history .game-meta { margin-bottom: 0.45rem; }
.game-history h3 { margin: 0 0 0.35rem; font-size: 1.3rem; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.game-history h3 a { color: inherit; text-decoration: none; }
.game-history h3 a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.game-history p { margin: 0 0 0.4rem; }
.game-settlement:empty { display: none; }
.game-settlement { margin-top: 1rem; }
.game-rating-changes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.3rem; margin-top: 0.55rem; }
.game-rating-changes > p { margin: 0; }
.game-ratings { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; }
.game-ratings > div { display: flex; gap: 0.5rem; align-items: baseline; }
.game-ratings dt { overflow-wrap: anywhere; }
.game-ratings dd { margin: 0; font-variant-numeric: tabular-nums; }
.game-actions { display: flex; flex-wrap: wrap; gap: 0.55rem 1.2rem; margin-top: 1rem; font-size: 0.92rem; }
.game-history .game-reveal { margin-top: 0.8rem; }
@media (max-width: 34rem) {
  .game-actions { flex-direction: column; align-items: flex-start; gap: 0; }
  .game-actions a { padding: 0.45rem 0; }
}

/* The rules page. The diagram and the chips take the colours of the game board. */
.contents a { margin-right: 0.9rem; white-space: nowrap; }
.rules figure { margin: 0 0 1rem; }
.rules figcaption { margin-top: 0.5rem; }
.rules .diagram { display: block; width: 100%; max-width: 384px; background: #ebe3d1; outline: 1px solid var(--line); }
.rules .diagram line.road { stroke: #b5a98f; stroke-width: 1.5; }
.rules .diagram line.rail { stroke: #7d7261; stroke-width: 4; stroke-dasharray: 7 4; }
.rules .diagram rect { fill: var(--field); stroke: #c9bea9; }
.rules .diagram rect.camp { fill: #e2dec6; stroke: #aeab8c; }
.rules .diagram rect.hq { fill: #f1e6c4; stroke: #f2c200; stroke-width: 5; }
.rules .wide { overflow-x: auto; }
.rules table { margin-top: 0.4rem; }
.rules td.n { white-space: nowrap; }
/* On a phone the notes keep a readable width, and the table scrolls sideways. */
.rules .pieces td:last-child { min-width: 14rem; }
.chip { display: inline-block; width: 1.6em; height: 0.9em; border: 1px solid; border-radius: 3px; vertical-align: -1px; }
.chip.post { background: var(--field); border-color: #c9bea9; }
.chip.camp { border-radius: 0.5em; background: #e2dec6; border-color: #aeab8c; }
.chip.hq { background: #f1e6c4; border-color: #ebe3d1; box-shadow: 0 0 0 2px #f2c200; margin: 0 3px; }
.chip.own { background: #2b4a7a; border-color: #1d3458; }
.chip.enemy { background: var(--seal); border-color: #8c2415; }
.line { display: inline-block; width: 1.8em; vertical-align: middle; border-top: 1.5px solid #b5a98f; }
.line.rail { border-top: 4px dashed #7d7261; }
