/* Rank & File Weekly — annotated chess games */

:root {
  --surface: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1b19;
  --ink-2: #57534c;
  --ink-3: #8a857c;
  --hair: #e6e1d7;
  --hair-2: #d6d0c4;
  --wash: #f3f0e9;
  --accent: #2c6a4e;
  --accent-ink: #ffffff;
  --accent-wash: #e4efe9;

  /* move quality (status) — always paired with a glyph + word */
  --q-blunder: #d03b3b;
  --q-mistake: #ec835a;
  --q-inaccuracy: #e0a116;
  --q-good: #0ca30c;
  --q-brilliant: #1f7fb8;
  --q-great: #4a77c9;

  /* board */
  --sq-light: #ecdcbf;
  --sq-dark: #b08b66;
  --sq-last: rgba(214, 205, 84, 0.55);
  --sq-select: rgba(44, 106, 78, 0.55);
  --sq-check: radial-gradient(circle, rgba(224, 40, 40, 0.9) 0%, rgba(224, 40, 40, 0.45) 45%, rgba(224, 40, 40, 0) 72%);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.06), 0 4px 16px rgba(28, 27, 25, 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #161615;
    --card: #1f1f1d;
    --ink: #ecebe7;
    --ink-2: #b6b2a9;
    --ink-3: #8a867e;
    --hair: #2e2d2a;
    --hair-2: #3d3b37;
    --wash: #262522;
    --accent: #6cc39a;
    --accent-ink: #0f1a14;
    --accent-wash: #1d2c25;
    --q-brilliant: #4fb3e8;
    --q-great: #87a6e6;
    --sq-light: #d9c7a6;
    --sq-dark: #9c7957;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ------------------------------------------------------------ chrome */

.masthead { border-bottom: 1px solid var(--hair); background: var(--surface); }
.masthead .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(4) { background: var(--ink); }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { background: var(--hair-2); }
.brand-name { font: 600 22px/1 var(--serif); letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 15px; }
.nav a:hover { background: var(--wash); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.footer { border-top: 1px solid var(--hair); margin-top: 72px; padding: 32px 0 48px; color: var(--ink-3); font-size: 13.5px; }
.footer p { margin: 0 0 8px; max-width: 820px; }
.footer a { color: var(--ink-2); }

/* ------------------------------------------------------------ type */

.eyebrow { font: 600 12px/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.3; }
.dek { font: 400 19px/1.45 var(--serif); color: var(--ink-2); margin: 12px 0 0; max-width: 720px; }
.prose { font: 400 18px/1.62 var(--serif); }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 650; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------ home */

.issue-hero { padding: 48px 0 28px; }
.issue-hero .prose { max-width: 760px; margin-top: 20px; color: var(--ink); }
.issue-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--wash); color: var(--ink-2); font: 500 12.5px/1 var(--sans); white-space: nowrap; }
.chip.accent { background: var(--accent-wash); color: var(--accent); }

.level-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 22px; }
.level-picker label { font-size: 14px; color: var(--ink-2); margin-right: 4px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--wash); border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 16px; text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--hair-2); transform: translateY(-1px); }
.card.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.card.upcoming { box-shadow: none; background: transparent; border-style: dashed; }
.card.upcoming:hover { transform: none; border-color: var(--hair); }
.card.upcoming.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.upcoming .thumb { opacity: .45; }
.card.upcoming h3 { color: var(--ink-2); }
.issue-hero .schedule { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }
.card-top { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; align-items: start; }
.card .thumb { width: 108px; height: 108px; border-radius: 6px; overflow: hidden; }
.card h3 { margin: 8px 0 0; font-size: 19px; line-height: 1.25; }
.card .card-dek { margin: 0 0 10px; color: var(--ink-2); font: 15px/1.5 var(--serif); }
.card .players { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.card .players b { color: var(--ink); font-weight: 600; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card .tags .chip { height: 22px; font-size: 12px; }

.level { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 4px; }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 10px; border-radius: 2px; background: var(--hair-2); }
.pips i.on { background: var(--accent); }
.level-name { font: 600 12px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.level-range { font: 500 12px/1.2 var(--sans); color: var(--ink-3); }

.explainer { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.explainer div { border-top: 2px solid var(--ink); padding-top: 14px; }
.explainer h3 { font-size: 17px; margin-bottom: 6px; }
.explainer p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ------------------------------------------------------------ game page */

.game-head { padding: 36px 0 20px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.game-head .level { margin-bottom: 14px; }
.matchup { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 15px; align-items: center; }
.matchup .side { display: inline-flex; align-items: center; gap: 8px; }
.matchup .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--ink-3); }
.matchup .swatch.w { background: #fff; }
.matchup .swatch.b { background: #222; }
.matchup .title { font: 700 11px/1 var(--sans); padding: 3px 4px; border-radius: 3px; background: #c9a227; color: #1c1b19; }
.matchup .result { font-weight: 700; font-family: var(--mono); }
.meta-line { color: var(--ink-3); font-size: 14px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--hair-2); background: var(--card); text-decoration: none; font-weight: 600; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; }

.lede { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; padding: 8px 0 28px; border-bottom: 1px solid var(--hair); }
.why h2 { font-size: 15px; font-family: var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.why ul { list-style: none; margin: 0; padding: 0; }
.why li { padding: 10px 0; border-top: 1px solid var(--hair); font-size: 15px; color: var(--ink-2); }
.why li b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
@media (max-width: 900px) {
  .lede { grid-template-columns: 1fr; gap: 16px; }
  .game-head { grid-template-columns: 1fr; }
}

/* viewer layout */
.viewer { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 28px; padding: 28px 0; align-items: start; }
@media (max-width: 1000px) { .viewer { grid-template-columns: 1fr; } }
.board-col { position: sticky; top: 12px; }
@media (max-width: 1000px) { .board-col { position: static; } }
.board-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }

.evalbar { position: relative; border-radius: 4px; overflow: hidden; background: #3a3936; }
.evalbar .fill { position: absolute; left: 0; right: 0; bottom: 0; background: #f4f2ec; transition: height .35s ease; }
.evalbar.flipped .fill { bottom: auto; top: 0; }
.evalbar .mid { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(128, 128, 128, .6); }
.evalbar .num { position: absolute; left: 0; right: 0; text-align: center; font: 700 9.5px/1 var(--sans); }
.evalbar .num.top { top: 5px; color: #f4f2ec; }
.evalbar .num.bottom { bottom: 5px; color: #3a3936; }

.variation-banner {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 12px; border-radius: 9px; background: var(--accent-wash); color: var(--ink); font-size: 14px;
}
.variation-banner.on { display: flex; }
.variation-banner .line { font-family: var(--mono); font-size: 13px; color: var(--ink-2); flex: 1 1 200px; }
.variation-banner .line b { color: var(--ink); }

.controls { display: flex; gap: 6px; margin: 12px 0 0 32px; align-items: center; flex-wrap: wrap; }
.controls button {
  height: 38px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--hair-2);
  background: var(--card); cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.controls button:hover:not(:disabled) { border-color: var(--ink-3); }
.controls button:disabled { opacity: .4; cursor: default; }
.controls .spacer { flex: 1; }
.controls .grow { font-size: 13.5px; }
.board-hint { margin: 8px 0 0 32px; font-size: 12.5px; color: var(--ink-3); }

.engine-panel { margin: 14px 0 0 32px; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--card); padding: 10px 12px; font-size: 13.5px; }
.engine-head { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.engine-head .name { font-weight: 600; color: var(--ink); }
.engine-head .state { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--hair-2); border: 0; cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(14px); }
.engine-lines { margin-top: 8px; display: grid; gap: 4px; }
.engine-line { display: flex; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine-line .ev { font-weight: 700; color: var(--ink); min-width: 52px; }
.engine-line .pv { overflow: hidden; text-overflow: ellipsis; }

.graph-wrap { margin: 14px 0 0 32px; position: relative; }
.graph-wrap .graph-title { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.evalgraph { display: block; width: 100%; height: 96px; cursor: pointer; border-radius: 6px; background: var(--card); border: 1px solid var(--hair); touch-action: none; }
.evalgraph .area-w { fill: #8f8a80; opacity: .14; }
.evalgraph .area-b { fill: #1c1b19; opacity: .16; }
@media (prefers-color-scheme: dark) {
  .evalgraph .area-w { fill: #f4f2ec; opacity: .16; }
  .evalgraph .area-b { fill: #000; opacity: .35; }
}
.evalgraph .mid { stroke: var(--hair-2); stroke-width: 1; }
.evalgraph .line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evalgraph .cursor { stroke: var(--accent); stroke-width: 2; }
.evalgraph .hover { stroke: var(--ink-3); stroke-width: 1; }
.evalgraph .dot { stroke: var(--card); stroke-width: 2; }
.graph-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 7px;
  padding: 6px 9px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s;
}
.graph-tip b { font-size: 13.5px; }
.graph-tip.on { opacity: 1; }

/* commentary */
.notes-col { min-width: 0; }
.note-card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; min-height: 280px; }
.note-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.note-move { font: 700 26px/1.1 var(--serif); }
.qual { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font: 600 12.5px/1 var(--sans); background: var(--wash); color: var(--ink); }
.qual .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.qual.blunder .dot { background: var(--q-blunder); }
.qual.mistake .dot { background: var(--q-mistake); }
.qual.inaccuracy .dot, .qual.dubious .dot { background: var(--q-inaccuracy); }
.qual.best .dot, .qual.excellent .dot, .qual.good .dot, .qual.book .dot, .qual.forced .dot { background: var(--q-good); }
.qual.brilliant .dot { background: var(--q-brilliant); }
.qual.great .dot, .qual.interesting .dot { background: var(--q-great); }
.qual.ok .dot { background: var(--ink-3); }
.critical-flag { font: 600 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.note-eval { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); margin: 6px 0 14px; }
.note-eval b { color: var(--ink); font-family: var(--mono); font-weight: 700; }
.note-body { font: 400 17.5px/1.62 var(--serif); }
.note-body p { margin: 0 0 .85em; }
.note-body p:last-child { margin-bottom: 0; }
.note-body .auto { color: var(--ink-3); font-style: italic; }

.options { margin-top: 18px; border-top: 1px solid var(--hair); padding-top: 14px; }
.options h4 { margin: 0 0 10px; font: 600 12px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.opt { display: grid; grid-template-columns: 22px 1fr; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--hair); }
.opt:first-of-type { border-top: 0; padding-top: 2px; }
.opt .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--sans); color: #fff; margin-top: 2px; }
.opt.good .mark { background: var(--q-good); }
.opt.bad .mark { background: var(--q-blunder); }
.opt.engine .mark { background: var(--q-brilliant); }
.opt .opt-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.opt .san { font: 700 16px/1.3 var(--serif); }
.opt .ev { font: 700 12.5px/1 var(--mono); color: var(--ink-2); }
.opt .kind { font-size: 12px; color: var(--ink-3); }
.opt .opt-note { grid-column: 2; font: 15.5px/1.55 var(--serif); color: var(--ink-2); }
.opt .show { grid-column: 2; justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--accent); font: 600 13px/1.3 var(--sans); cursor: pointer; }
.opt .show:hover { text-decoration: underline; }
.opt .pvtext { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-weight: 400; }

.movelist-card { margin-top: 18px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
.movelist-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--hair); font-size: 13px; color: var(--ink-3); }
.movelist { max-height: 340px; overflow-y: auto; display: grid; grid-template-columns: 44px 1fr 1fr; font-size: 14.5px; }
.movelist .num { padding: 6px 10px; color: var(--ink-3); background: var(--wash); text-align: right; font-variant-numeric: tabular-nums; }
.movelist button { border: 0; background: transparent; text-align: left; padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.movelist button:hover { background: var(--wash); }
.movelist button.cur { background: var(--accent); color: var(--accent-ink); }
.movelist button .g { font-weight: 800; font-size: 12.5px; }
.movelist button .g.blunder { color: var(--q-blunder); }
.movelist button .g.mistake { color: var(--q-mistake); }
.movelist button .g.inaccuracy, .movelist button .g.dubious { color: var(--q-inaccuracy); }
.movelist button .g.brilliant { color: var(--q-brilliant); }
.movelist button .g.great, .movelist button .g.interesting { color: var(--q-great); }
.movelist button.cur .g { color: inherit; }
.movelist button .star { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.movelist button.cur .star { background: var(--accent-ink); }
.movelist .result-row { grid-column: 1 / -1; text-align: center; padding: 10px; font-weight: 700; border-top: 1px solid var(--hair); }

.explore-moves { font-family: var(--mono); font-size: 13px; }

.takeaways { border-top: 1px solid var(--hair); padding-top: 28px; display: grid; grid-template-columns: 260px 1fr; gap: 32px; }
.takeaways ol { margin: 0; padding-left: 22px; }
.takeaways li { margin-bottom: 12px; padding-left: 6px; }
@media (max-width: 800px) { .takeaways { grid-template-columns: 1fr; gap: 10px; } }

.next-games { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.next-games a { display: block; padding: 16px 18px; border: 1px solid var(--hair); border-radius: var(--radius); text-decoration: none; background: var(--card); }
.next-games a:hover { border-color: var(--hair-2); }
.next-games .dir { font-size: 12.5px; color: var(--ink-3); }
.next-games .t { font: 600 17px/1.3 var(--serif); margin-top: 4px; }
.next-games a.next { text-align: right; }
.next-games .soon { padding: 16px 18px; border: 1px dashed var(--hair); border-radius: var(--radius); }
.next-games .soon .t { color: var(--ink-3); }
.next-games .soon.next { text-align: right; }

/* ------------------------------------------------------------ board */

.board { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 4px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.board .sq { position: absolute; width: 12.5%; height: 12.5%; }
.board .sq.l { background: var(--sq-light); }
.board .sq.d { background: var(--sq-dark); }
.board .sq.last::after, .board .sq.sel::after, .board .sq.check::after, .board .sq.hl::after { content: ""; position: absolute; inset: 0; }
.board .sq.last::after { background: var(--sq-last); }
.board .sq.sel::after { background: var(--sq-select); }
.board .sq.check::after { background: var(--sq-check); }
.board .sq.dest::before { content: ""; position: absolute; left: 50%; top: 50%; width: 28%; height: 28%; margin: -14% 0 0 -14%; border-radius: 50%; background: rgba(20, 60, 40, .35); z-index: 3; pointer-events: none; }
.board .sq.dest.occ::before { width: 92%; height: 92%; margin: -46% 0 0 -46%; background: transparent; border: 5px solid rgba(20, 60, 40, .35); box-sizing: border-box; }
.board .coord { position: absolute; font: 700 10.5px/1 var(--sans); pointer-events: none; z-index: 1; }
.board .coord.file { right: 3px; bottom: 3px; }
.board .coord.rank { left: 3px; top: 3px; }
.board .sq.l .coord { color: var(--sq-dark); }
.board .sq.d .coord { color: var(--sq-light); }
.board .pc { position: absolute; width: 12.5%; height: 12.5%; z-index: 2; background-size: 100% 100%; pointer-events: none; will-change: transform; }
.board .pc.drag { z-index: 10; transition: none !important; }
.board svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.board.interactive { cursor: pointer; }

.mini { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------ archive & about */

.page-head { padding: 48px 0 24px; }
.issue-list { display: grid; gap: 18px; }
.issue-row { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; }
.issue-row h2 { font-size: 22px; }
.issue-row h2 a { text-decoration: none; }
.issue-row ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 24px; }
.issue-row li { font-size: 14.5px; display: flex; gap: 10px; align-items: baseline; }
.issue-row li .level-range { min-width: 74px; }

.bracket-table { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 15px; }
.bracket-table th, .bracket-table td { text-align: left; padding: 12px 10px; border-top: 1px solid var(--hair); vertical-align: top; }
.bracket-table th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-top: 0; }
.bracket-table td:first-child { white-space: nowrap; font-weight: 600; }
.framework { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 16px; }
.framework section { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; }
.framework h3 { font-size: 17px; margin-bottom: 8px; }
.framework ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.framework li { margin-bottom: 6px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 20px; margin-top: 14px; font-size: 14.5px; }
.legend-grid div { display: flex; gap: 10px; align-items: center; }
.about-section { margin-top: 48px; }
.about-section > p { max-width: 760px; }

.empty { padding: 80px 0; text-align: center; color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 1000px) {
  .viewer { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .board-col { display: contents; }
  .variation-banner { order: 1; }
  .board-row { order: 2; }
  .controls { order: 3; margin-left: 0; }
  .board-hint { order: 4; margin-left: 0; }
  .notes-col { order: 5; margin-top: 16px; }
  .engine-panel { order: 6; margin-left: 0; margin-top: 18px; }
  .graph-wrap { order: 7; margin-left: 0; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .masthead .wrap { gap: 10px; height: 56px; }
  .brand-name { font-size: 19px; white-space: nowrap; }
  .brand-mark { width: 24px; height: 24px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 7px; font-size: 13.5px; white-space: nowrap; }
  .board-row { grid-template-columns: 16px 1fr; gap: 6px; }
  .evalbar .num { font-size: 8px; }
  .note-card { padding: 18px 16px; }
  .note-move { font-size: 22px; }
  .engine-head span:nth-child(3) { display: none; }
  .next-games { grid-template-columns: 1fr; }
  .issue-hero { padding-top: 32px; }
}

/* The full name "Rank & File Weekly" plus three links doesn't fit one row on phones:
   put the links on their own row under the name. */
@media (max-width: 480px) {
  .masthead .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 4px; row-gap: 0; }
  .nav { width: 100%; margin-left: -7px; }
}
