:root {
  color-scheme: light;
  --paper: #f4efe3;
  --sheet: #fbf8ed;
  --ink: #202b24;
  --muted: #5c6458;
  --rule: #a8a493;
  --rule-light: #d7d0be;
  --green: #344a3c;
  --red: #8d372e;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.06rem/1.62 var(--serif);
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--red); }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
h1, h2, p, ol, ul { margin: 0; }
.page { width: min(100% - 5rem, 68rem); margin-inline: auto; }
.skip, .sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  inline-size: auto;
  block-size: auto;
  margin: 0;
  clip-path: none;
  z-index: 5;
  top: 1em;
  left: 1em;
  padding: .45em .65em;
  background: var(--sheet);
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-height: 4.5rem;
  padding-block: 1.48rem 1.1rem;
  border-bottom: 3px double var(--ink);
}
.imprint {
  color: var(--ink);
  font: 700 .8rem/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.print-link { font: 700 .875rem/1.4 var(--mono); }
button.print-link {
  padding: .25rem 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .22em;
  cursor: pointer;
}
button.print-link:hover { color: var(--red); }
.print-link span { margin-left: .14rem; color: var(--red); }

.spread {
  display: grid;
  grid-template-columns: 1.17fr 1fr;
  align-items: start;
  gap: clamp(3rem, 7vw, 6.35rem);
  margin-block: 4rem 4.5rem;
}
.cover h1, .missing h1 {
  font-size: clamp(4rem, 8.8vw, 8.45rem);
  font-weight: 400;
  letter-spacing: -.083em;
  line-height: .86;
}
.cover em { color: var(--red); font-weight: 400; }
.standfirst { margin-top: 1.72rem; font-size: clamp(1.18rem, 2vw, 1.48rem); font-style: italic; line-height: 1.4; }
.intro { max-width: 29rem; margin-top: .5rem; color: var(--muted); }
.contents {
  display: grid;
  max-width: 25.75rem;
  margin-top: 1.85rem;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.contents li { border-bottom: 1px solid var(--rule); }
.contents a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .66rem;
  font-weight: 700;
  text-decoration: none;
}
.contents a:hover > span { text-decoration: underline; }
.contents small { color: var(--muted); font: .8rem/1.3 var(--mono); text-align: right; }

.front-game {
  position: relative;
  padding: 1.55rem 1.65rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: .3rem .3rem 0 -.075rem var(--paper), .3rem .3rem 0 0 var(--rule);
}
.front-game::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-top: 3px solid var(--green);
}
.front-game, .game { scroll-margin-block-start: 1rem; }
.game-header { display: flex; align-items: baseline; gap: .74rem; }
.game-number {
  color: var(--red);
  font: italic 400 2rem/1 var(--serif);
}
.game h2, .game-header h2 {
  margin-block-end: .46rem;
  font-size: clamp(1.7rem, 3vw, 2.48rem);
  font-weight: 400;
  letter-spacing: -.048em;
  line-height: 1.02;
}
.game-header p { max-width: 34ch; color: var(--muted); line-height: 1.5; }
.sums-form { margin-top: 1.42rem; }
.sums {
  --cell: clamp(2.75rem, 5vw, 4.35rem);
  border-collapse: collapse;
  margin: 0 auto .9rem;
  text-align: center;
  font: 1.72rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.sums td, .sums th {
  inline-size: var(--cell);
  block-size: var(--cell);
  padding: 0;
}
.sums tr:not(.column-totals) td { border: 1px solid var(--green); }
.sums .given { background: #e7e9dc; font-weight: 700; }
.sums td input {
  display: block;
  inline-size: 100%;
  block-size: var(--cell);
  padding: .25rem;
  border: 0;
  background: transparent;
  color: var(--green);
  text-align: center;
}
.sums td input:focus-visible { outline-offset: -3px; }
.sums th, .sums .column-totals td {
  color: var(--red);
  font: italic 400 1.22rem/1 var(--serif);
}
.sums .column-totals td { block-size: 2.15rem; }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.actions button {
  min-height: 2.6rem;
  padding: .5rem .75rem;
  border: 1px solid var(--green);
  border-radius: 0;
  background: var(--green);
  color: var(--sheet);
  font: 700 .85rem/1.35 var(--mono);
  cursor: pointer;
}
.actions button:hover { background: var(--ink); }
.actions button.quiet { background: transparent; color: var(--green); }
.actions button.quiet:hover { background: #e9e7da; }
.status {
  min-height: 2rem;
  margin-top: .55rem;
  color: var(--green);
  font-size: .875rem;
  line-height: 1.5;
}
.status[data-tone="error"] { color: var(--red); }
.game {
  display: grid;
  grid-template-columns: 1.17fr 1fr;
  align-items: start;
  gap: clamp(3rem, 7vw, 6.35rem);
  padding: 2.2rem 0 2.42rem;
  border-top: 1px solid var(--ink);
}
.game-copy { padding-block-start: .25rem; }
.ladder, .bridge-board { padding: 0; }
.ladder { list-style: none; }
.ladder li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: center;
  gap: .85rem;
  min-height: 2.85rem;
  border-bottom: 1px solid var(--rule-light);
}
.ladder li:first-child { border-top: 1px solid var(--rule-light); }
.terminal, .ladder input {
  box-sizing: border-box;
  font: 700 1rem/1 var(--mono);
  letter-spacing: .25em;
  text-align: center;
}
.terminal { display: block; color: var(--red); }
.ladder input {
  width: 100%;
  height: 2.25rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sheet);
  color: var(--green);
  text-transform: uppercase;
}
.ladder label, .rung-note { font-size: .9rem; color: var(--muted); line-height: 1.2; }
.ladder-form .actions, .bridge-game .actions { margin-top: .9rem; }

.bridge-board {
  --bank-width: 5.7rem;
  display: flex;
  justify-content: space-between;
  position: relative;
  border: 1px solid var(--rule);
  background: var(--sheet);
}
.bridge-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.bank {
  display: grid;
  justify-items: center;
  grid-template-rows: 2rem repeat(5, 2.25rem);
  align-items: center;
  width: var(--bank-width);
  padding: .4rem 0 .5rem;
  background: #e7e9dc;
  border-right: 1px solid var(--rule-light);
}
.bank.right-bank { border-right: 0; border-left: 1px solid var(--rule-light); }
.bank > span { color: var(--muted); font: .74rem/1 var(--mono); }
.bank button {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.bank button::after {
  content: "";
  width: .67rem;
  height: .67rem;
  border-radius: 50%;
  border: 1px solid var(--green);
  background: var(--sheet);
}
.bank button:hover::after, .bank button[aria-pressed="true"]::after { background: var(--red); border-color: var(--red); }
.bank button:disabled { cursor: default; }
.bank button:disabled::after { background: var(--green); }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-block: 1.3rem 2.3rem;
  border-top: 3px double var(--ink);
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.45;
}
.footer strong { color: var(--ink); }
.missing { padding-top: 4rem; }
.missing p { margin-block: 1.4rem .65rem; }

@media (max-width: 780px) {
  .spread, .game { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .page { width: calc(100% - 3rem); }
  .front-game { padding-inline: .85rem; }
}
@media (max-width: 620px) {
  .page { width: calc(100% - 2rem); }
  .masthead { min-height: 0; padding-block: .95rem .78rem; }
  .spread, .game { grid-template-columns: 1fr; gap: 1.55rem; }
  .spread { margin-block: 2.65rem 2.75rem; gap: 2.25rem; }
  .cover h1 { font-size: clamp(4.15rem, 14.5vw, 6.2rem); }
  .standfirst { margin-top: 1.3rem; }
  .contents { margin-top: 1.4rem; }
  .front-game { padding-inline: 1rem; }
  .game { padding-block: 1.55rem 1.3rem; }
  .game-header { gap: .56rem; }
  .game-number { font-size: 1.7rem; }
  .ladder li { grid-template-columns: minmax(5.8rem, 28%) 1fr; gap: .6rem; }
  .bridge-board { --bank-width: 4.8rem; }
  .footer { flex-wrap: wrap; padding-bottom: 1.7rem; }
}

@media print {
  @page { margin: 12mm; }
  :root {
    --paper: white;
    --sheet: white;
    --ink: black;
    --muted: #333;
    --rule: #777;
    --rule-light: #aaa;
    --green: #333;
    --red: #333;
  }
  body { font-size: 10pt; line-height: 1.3; }
  .page { width: auto; }
  .masthead { padding-block: 0 2mm; min-height: 0; }
  .imprint { font-size: 8pt; }
  .print-link, .skip, .contents, .actions, .status, .footer, .bridge-board canvas, noscript { display: none; }
  .spread { display: grid; grid-template-columns: 1fr 1fr; gap: 9mm; margin-block: 6mm; }
  .cover h1 { font-size: 38pt; }
  .standfirst { margin-top: 4mm; font-size: 13pt; }
  .intro { margin-top: 2mm; }
  .front-game { padding: 3mm; box-shadow: none; }
  .front-game::before { display: none; }
  .game-number { font-size: 14pt; }
  .game-header h2 { margin-block-end: 2mm; font-size: 17pt; }
  .game-header p { line-height: 1.35; }
  .sums-form { margin-top: 3mm; }
  .sums { --cell: 10mm; margin-bottom: 0; font-size: 14pt; }
  .sums .column-totals td { block-size: 7mm; }
  .sums th, .sums .column-totals td { font-size: 11pt; }
  .game { grid-template-columns: 1fr 1fr; gap: 8mm; padding-block: 5mm; break-inside: avoid; }
  .ladder li { min-height: 7.6mm; gap: 2mm; grid-template-columns: 20mm 1fr; }
  .ladder input { height: 6mm; }
  .ladder label, .rung-note { font-size: 8pt; }
  .sums td input, .ladder input { color: transparent; -webkit-text-fill-color: transparent; }
  .bridge-board { --bank-width: 21mm; }
  .bank { padding: 1mm 0; grid-template-rows: 7mm repeat(5, 7mm); }
  .bank button { width: 6mm; height: 6mm; }
  .bank button::after,
  .bank button:disabled::after { background: #333; border-color: #333; width: 2.3mm; height: 2.3mm; }
}
