:root {
  --paper: #fbfaf8;
  --ink: #141211;
  --ink-2: #5d5855;
  --rule: #dcd8d4;
  --red: #c8102e;
  --on-red: #fff6f4;
  --on-red-2: #ffd9d3;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --fig: "Noto Sans Symbols 2", "Apple Symbols", "Segoe UI Symbol", sans-serif;
  --bar: 3.25rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--bar); scrollbar-color: var(--ink) var(--paper); scrollbar-width: thin; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red); color: var(--on-red); }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.fig { font-family: var(--fig); font-weight: 400; font-style: normal; font-size: 0.92em; margin-right: 0.04em; }
.g { font-style: normal; color: var(--red); margin-left: 0.04em; }

.skip { position: fixed; left: 1rem; top: -4rem; z-index: 20; background: var(--ink); color: var(--paper); padding: 0.5rem 0.875rem; font-family: var(--display); font-weight: 600; }
.skip:focus, .skip:hover { top: 0.75rem; color: var(--paper); }

/* ---------- top bar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
  font-stretch: 88%;
  font-size: 0.875rem;
}
.event b { font-weight: 800; }
.event span { color: var(--ink-2); }
.event #result { color: var(--red); font-weight: 800; }
.top nav { display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.top nav a { text-decoration: none; font-weight: 600; padding: 0.5rem 0; }
.top nav a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; color: var(--ink); }

/* ---------- stage ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.boardcol {
  position: sticky; top: 0; height: 100svh;
  padding-top: var(--bar);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.boardview { position: relative; min-height: 0; container-type: size; }
#board { touch-action: pan-y; position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.6s var(--ease); }
.diagram {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: min(72.6cqh, 66cqw); aspect-ratio: 1;
  background: repeating-conic-gradient(var(--red) 0 25%, #f1eeea 0 50%) 0 0 / 25% 25%;
  outline: 0.45cqh solid var(--ink); outline-offset: 0;
  transition: opacity 0.6s var(--ease) 0.2s;
}
.gl-ready #board { opacity: 1; }
.gl-ready .diagram { opacity: 0; }
.boardfoot { padding: 0 clamp(1.25rem, 3vw, 2.5rem) 1.5rem; display: grid; gap: 0.875rem; }
.caption { font-family: var(--display); font-stretch: 88%; font-weight: 600; font-size: 0.9375rem; min-height: 1.5em; }
.score { display: flex; flex-wrap: wrap; gap: 0.125rem 0.125rem; margin-inline: -0.375rem; }
.score button {
  font: 700 0.875rem/1 var(--display); font-stretch: 80%; font-variant-numeric: tabular-nums;
  padding: 0.4rem 0.375rem; white-space: nowrap;
  background: transparent; color: var(--ink-2); border: 0; border-radius: 0; cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.score .n { margin-right: 0.2em; font-weight: 500; }
.score .g { margin-left: 0; }
.score button.played { color: var(--ink); }
.score button:hover { background: var(--rule); color: var(--ink); }
.score button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.score button[aria-current="true"] .g { color: var(--paper); }
.score .last { color: var(--red); }
.no-gl .boardcol { display: none; }
.no-gl .stage { grid-template-columns: minmax(0, 1fr); }
.no-gl .text { margin-inline: auto; }

.text { padding: 0 clamp(1.5rem, 5vw, 5rem) 0 clamp(1rem, 2.5vw, 2.5rem); max-width: 46rem; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; padding: calc(var(--bar) + 2rem) 0 3rem; display: flex; flex-direction: column; justify-content: center; }
h1 {
  font-family: var(--display); font-stretch: 66%; font-weight: 850;
  font-size: clamp(3rem, 6.4vw, 6rem); line-height: 0.9; letter-spacing: -0.015em;
  text-transform: uppercase;
}
h1 span { display: block; color: var(--red); }
.role { font-family: var(--display); font-stretch: 88%; font-weight: 600; font-size: 1.125rem; margin-top: 1.25rem; }
.lede { font-size: clamp(1.1875rem, 1.5vw, 1.375rem); line-height: 1.5; margin-top: 1.5rem; max-width: 34ch; text-wrap: pretty; }
.glance { margin-top: 2.25rem; border-top: 1px solid var(--ink); }
.glance div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.glance dt { font-family: var(--display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; font-size: 0.875rem; letter-spacing: 0.04em; padding-top: 0.2em; }
.glance dd { font-size: 1rem; line-height: 1.45; }
.links { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-family: var(--display); font-stretch: 88%; font-weight: 600; }
.cue { margin-top: 2.5rem; color: var(--ink-2); font-size: 1rem; }
kbd { font: 700 0.8125rem/1 var(--display); border: 1px solid var(--ink-2); padding: 0.15em 0.45em; }

/* ---------- section heads ---------- */
.sechead { padding: 6rem 0 2rem; border-top: 1px solid var(--ink); }
h2 { font-family: var(--display); font-stretch: 66%; font-weight: 850; text-transform: uppercase; font-size: clamp(2.25rem, 3.6vw, 3.25rem); line-height: 0.95; letter-spacing: -0.01em; text-wrap: balance; }
.sechead p { margin-top: 0.75rem; color: var(--ink-2); max-width: 40ch; }

/* ---------- moves ---------- */
.mv {
  min-height: 62svh; padding: 2.5rem 0;
  display: flex; flex-direction: column; justify-content: center;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  transition: color 0.5s var(--ease);
}
.mv.on { color: var(--ink); }
.mv h3 { font-family: var(--display); font-stretch: 66%; font-weight: 850; font-size: clamp(2.5rem, 4.2vw, 3.75rem); line-height: 1; letter-spacing: -0.01em; }
.mv .num { font-variant-numeric: tabular-nums; }
.mv .ttl { display: block; font-family: var(--serif); font-weight: 600; font-size: clamp(1.375rem, 1.9vw, 1.75rem); line-height: 1.2; letter-spacing: 0; margin-top: 0.6rem; text-wrap: balance; }
.mv .when { font-family: var(--display); font-stretch: 88%; font-weight: 600; font-size: 0.9375rem; margin-top: 0.4rem; }
.mv p:not(.when):not(.reply) { margin-top: 1.1rem; max-width: 58ch; text-wrap: pretty; }
.mv .reply { margin-top: 1.25rem; font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 1.0625rem; }
.mv h3::after { content: ""; display: block; width: 0; height: 3px; background: var(--red); margin-top: 0.9rem; transition: width 0.7s var(--ease); }
.mv.on h3::after { width: 3.5rem; }

/* ---------- sidelines, analysis ---------- */
.plain { padding-bottom: 5rem; }
.vars { counter-reset: v; max-width: 58ch; }
.vars li { counter-increment: v; position: relative; padding: 0.9rem 0 0.9rem 2.25rem; border-top: 1px solid var(--rule); }
.vars li::before { content: counter(v, upper-alpha) ")"; position: absolute; left: 0; font-family: var(--display); font-stretch: 80%; font-weight: 800; }
.vars b { font-weight: 600; }
.refs li { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: baseline; padding: 1rem 0; border-top: 1px solid var(--rule); }
.refs cite { font-style: italic; text-wrap: pretty; }
.refs span { font-family: var(--display); font-stretch: 80%; font-weight: 800; white-space: nowrap; }
.more { margin-top: 1.25rem; color: var(--ink-2); }

/* ---------- close ---------- */
.close {
  background: var(--red); color: var(--on-red);
  margin: 2rem calc(-1 * clamp(1.5rem, 5vw, 5rem)) 0 calc(-1 * clamp(1rem, 2.5vw, 2.5rem));
  padding: clamp(4rem, 14svh, 8rem) clamp(1.5rem, 5vw, 5rem) clamp(4rem, 12svh, 7rem) clamp(1rem, 2.5vw, 2.5rem);
  min-height: 78svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.close ::selection { background: var(--ink); color: var(--paper); }
.close h2 { font-size: clamp(3.5rem, 7vw, 6rem); text-transform: none; }
.close h2 .fig { font-size: 0.88em; }
.close p { margin-top: 1.25rem; font-size: 1.25rem; max-width: 30ch; text-wrap: pretty; }
.close button {
  margin-top: 2.25rem;
  font: 800 1.25rem/1 var(--display); font-stretch: 80%;
  background: var(--on-red); color: var(--ink);
  border: 0; border-radius: 0; padding: 1.1rem 1.75rem; cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(60, 0, 10, 0.55);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.close button:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(60, 0, 10, 0.6); }
.close button:active { transform: translateY(0); }
.close button:focus-visible, .close a:focus-visible { outline-color: var(--on-red); }
.close button[hidden] { display: none; }
.close .mail { font-size: 1.0625rem; color: var(--on-red-2); margin-top: 2rem; }
.close .mail a { color: var(--on-red); }
.close a:hover { color: var(--on-red); text-decoration-thickness: 2px; }
.close.mated h2 { animation: land 0.9s var(--ease); }
@keyframes land { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.foot { padding: 2.5rem 0 3rem; color: var(--ink-2); font-size: 0.9375rem; display: grid; gap: 0.5rem; max-width: 58ch; }

/* ---------- narrow ---------- */
@media (max-width: 860px) {
  html { scroll-padding-top: calc(36svh + 0.75rem); }
  .top { position: static; }
  .top nav a:not(:last-child) { display: none; }
  .stage { grid-template-columns: minmax(0, 1fr); }
  .boardcol { height: 36svh; padding-top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .boardfoot { padding: 0 0 0.375rem; gap: 0.25rem; }
  .caption { font-size: 0.8125rem; padding: 0 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .score { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 0 0.875rem; scrollbar-width: none; }
  .score::-webkit-scrollbar { display: none; }
  .score button { padding: 0.55rem 0.375rem; }
  .text { padding: 0 1.25rem; max-width: none; }
  .hero { min-height: 0; padding: 1.5rem 0 3rem; }
  .hero .role { margin-top: 0.75rem; }
  .hero .links { order: 1; margin-top: 0.5rem; }
  .hero .lede { order: 2; margin-top: 1rem; font-size: 1.0625rem; max-width: none; }
  .hero .glance { order: 3; margin-top: 1.25rem; }
  .hero .cue { order: 4; margin-top: 1.5rem; }
  .glance div { grid-template-columns: 4.25rem 1fr; padding: 0.55rem 0; }
  .glance dd { font-size: 0.9375rem; }
  .mv { min-height: 40svh; }
  .sechead { padding-top: 4rem; }
  .close { margin-inline: -1.25rem; padding-inline: 1.25rem; min-height: 56svh; }
  .refs li { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
