/* Isaac R+ achievement guide.
   Scene: a phone propped next to the monitor at night, read between runs in a dim room.
   Palette: umber basement neutrals, bone text, tear-blue accent for interaction and progress;
   tier colours only for reward value. System fonts; the serif is for page and hub titles only.
   Type scale: 13 / 15 / 17 / 21 / 28-32 px, plus the h1.
   Shapes: containers (cards, panels) 14px, controls (chips, inputs, buttons) 10px,
   counters and tags fully round, inline source codes 4px (they sit in running text). */

:root {
  color-scheme: dark;

  --bg: oklch(0.165 0.011 40);
  --bg-sunk: oklch(0.135 0.01 40);
  --surface: oklch(0.205 0.013 40);
  --surface-2: oklch(0.245 0.015 40);
  --surface-3: oklch(0.29 0.017 40);
  --line-soft: oklch(0.275 0.015 40);
  --line: oklch(0.36 0.018 40);
  --line-strong: oklch(0.52 0.02 50);

  --text: oklch(0.93 0.014 80);
  --text-2: oklch(0.82 0.016 75);
  --text-3: oklch(0.7 0.016 70);

  --accent: oklch(0.8 0.085 225);
  --accent-strong: oklch(0.87 0.07 222);
  --accent-wash: oklch(0.25 0.03 232);
  --accent-line: oklch(0.42 0.06 230);

  --red: oklch(0.72 0.15 27);

  /* reward value tiers */
  --t-s: oklch(0.87 0.13 86);
  --t-a: oklch(0.8 0.1 78);
  --t-b: oklch(0.74 0.07 70);
  --t-c: oklch(0.69 0.045 64);
  --t-d: oklch(0.64 0.025 60);
  --t-n: oklch(0.57 0.012 58);

  /* the completion note: aged paper and ink */
  --paper: oklch(0.8 0.045 85);
  --ink: oklch(0.24 0.02 50);
  --ink-faint: oklch(0.5 0.035 70);

  --shadow: oklch(0.08 0.01 40);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.3125rem;
  --fs-lg: 1.75rem;
  --fs-h1: 2.375rem;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --r-ctl: 10px;
  --r-lg: 14px;

  --gutter: 16px;
  --bar-h: 52px;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);

  --z-sticky: 10;
  --z-topbar: 30;
  --z-toast: 50;

  --ext-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2h6v6M10 2 3 9' fill='none' stroke='%23528faa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* sticky top bar: anchors and focused elements land below it */
  scroll-padding-top: calc(var(--bar-h) + var(--s-3));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  letter-spacing: 0.005em;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--accent-line);
}

a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

/* external links: a small arrow drawn in the padding, so it never wraps alone and is not read aloud */
a[href^="http"] {
  padding-right: 0.95em;
  background: var(--ext-icon) no-repeat right 0.05em center / 0.62em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

main:focus {
  outline: none;
}

strong {
  font-weight: 650;
  color: var(--text);
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.08em 0.32em;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 600;
  padding: 0.05em 0.45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

mark {
  background: oklch(0.36 0.06 228);
  color: var(--text);
  border-radius: 3px;
  padding: 0 1px;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--r-ctl);
  font-weight: 650;
  text-decoration: none;
}

.skip:focus {
  top: var(--s-3);
}

.k {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
}

.fine {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.h-note {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.is-flash {
  animation: flash 1.6s var(--ease-out);
}

@keyframes flash {
  from {
    background-color: oklch(0.33 0.05 228);
    box-shadow: 0 0 0 6px oklch(0.33 0.05 228);
  }

  to {
    background-color: transparent;
    box-shadow: 0 0 0 6px transparent;
  }
}

/* ---------- Top bar: the four views and search ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: stretch;
  height: var(--bar-h);
  padding: 0 max(var(--s-1), env(safe-area-inset-right)) 0 max(var(--s-1), env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.tabs {
  display: flex;
  flex: 1;
  min-width: 0;
}

.tab {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0 8px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current="page"] {
  color: var(--text);
}

.tab span {
  position: relative;
  display: grid;
  align-items: center;
  height: 100%;
}

.tab[aria-current="page"] span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.tab-search {
  flex: none;
  position: relative;
  width: 48px;
  padding: 0;
  background: none;
  border-radius: var(--r-ctl);
}

.tab-search span,
.side-search-i {
  position: absolute;
  left: 15px;
  top: 16px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--text-2);
  border-radius: 50%;
}

.tab-search span::after,
.side-search-i::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  width: 7px;
  height: 2px;
  background: var(--text-2);
  border-radius: 1px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.tab-search[aria-current="page"] span,
.tab-search[aria-current="page"] span::after {
  border-color: var(--accent);
  background-color: transparent;
}

.tab-search[aria-current="page"] span::after {
  background: var(--accent);
}

/* ---------- Layout and views ---------- */

.side {
  display: none;
}

main {
  display: block;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) var(--s-6) max(var(--gutter), env(safe-area-inset-left));
}

.js .view,
.js .hub {
  display: none;
}

.js[data-view="plan"] #plan,
.js[data-view="play"] #play,
.js[data-view="achievements"] #achievements,
.js[data-view="rewards"] #rewards,
.js[data-view="reference"] #reference,
.js[data-view="search"] #search,
.js .hub.is-active {
  display: block;
}

/* without JavaScript every view is on one page, in order */
.view + .view {
  margin-top: var(--s-8);
}

.js .view + .view {
  margin-top: 0;
}

.view-head {
  padding-top: var(--s-6);
}

.view-head h2,
.next > h2,
.best > h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.view-lede {
  margin: var(--s-2) 0 0;
  max-width: 62ch;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-3);
  margin-top: var(--s-2);
}

.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Badges and buttons ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 22px;
  padding: 0 var(--s-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-decoration: none;
}

.badge[data-state="some"] {
  color: var(--text);
}

.badge[data-state="done"] {
  background: var(--accent-wash);
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
}

.btn:hover {
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.stars {
  color: var(--text-2);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-weight: 400;
  vertical-align: 0.12em;
}

.stars::after {
  color: var(--line-strong);
}

.s1::before { content: "★"; }
.s1::after { content: "★★★★"; }
.s2::before { content: "★★"; }
.s2::after { content: "★★★"; }
.s3::before { content: "★★★"; }
.s3::after { content: "★★"; }
.s4::before { content: "★★★★"; }
.s4::after { content: "★"; }
.s5::before { content: "★★★★★"; }

/* Citations: one quiet chip per cluster; tapping anywhere on it lists all its sources */

.cites {
  position: relative;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.cites::after {
  /* a larger tap target without moving the text */
  content: "";
  position: absolute;
  inset: -9px -3px;
}

.cites a {
  color: inherit;
  text-decoration: none;
}

.cites a + a {
  margin-left: 0.4em;
}

.cites:hover,
.cites:hover a {
  color: var(--accent);
}

/* ---------- Prose inside hubs, card guides and Reference ---------- */

:is(.hub-intro, .hub-guide, .ref-sec, .c-guide-body, .why-order) :is(p, ul, ol) {
  margin: 0 0 var(--s-3);
}

:is(.hub-intro, .hub-guide, .ref-sec, .c-guide-body, .hub-runs) :is(ul, ol) {
  padding-left: 1.25em;
}

:is(.hub-intro, .hub-guide, .ref-sec, .c-guide-body) li {
  margin: 0 0 var(--s-2);
  padding-left: 0.15em;
}

:is(.hub-intro, .hub-guide, .ref-sec, .c-guide-body) li > :is(ul, ol) {
  margin: var(--s-2) 0 var(--s-1);
}

:is(.hub-intro, .hub-guide, .ref-sec, .c-guide-body) li::marker {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

:is(.hub-intro, .hub-guide, .ref-sec) :is(p, li) {
  max-width: 68ch;
}

:is(.hub-intro, .hub-guide) h3,
.hub-runs > h3 {
  margin: var(--s-7) 0 var(--s-3);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.25;
}

.hub-intro h3 {
  margin-top: var(--s-5);
}

:is(.hub-guide, .ref-sec, .c-guide-body) h4 {
  margin: var(--s-5) 0 var(--s-2);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.35;
}

/* ---------- Tables ---------- */

.table-wrap {
  margin: var(--s-3) 0 var(--s-5);
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table-wrap--narrow {
  max-width: 28rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.45;
}

th,
td {
  padding: 8px var(--s-3) 8px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: break-word;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

thead th {
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--text-3);
  border-bottom-color: var(--line);
}

tbody th {
  font-weight: 650;
  color: var(--text);
}

tbody tr:last-child > * {
  border-bottom: 0;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 47.99rem) {
  .t-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .t-stack,
  .t-stack tbody,
  .t-stack tr,
  .t-stack th,
  .t-stack td {
    display: block;
  }

  .t-stack tr {
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .t-stack tbody tr:last-child {
    border-bottom: 0;
  }

  .t-stack th,
  .t-stack td {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .t-stack td {
    position: relative;
    margin-top: 4px;
    padding-left: 6.5rem;
  }

  .t-stack td[data-label]::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 6rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-3);
  }
}

/* ---------- Plan: masthead ---------- */

.masthead {
  position: relative;
  padding: var(--s-5) 0 var(--s-3);
}

.masthead::before {
  /* the room vignette: a lit patch that fades out before any edge */
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--gutter)) -40px;
  background: radial-gradient(closest-side at 40% 32%, oklch(0.235 0.022 40), oklch(0.235 0.022 40 / 0));
  pointer-events: none;
}

.kicker {
  margin: 0 0 var(--s-1);
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--text-3);
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 1.04;
  letter-spacing: -0.012em;
  color: var(--text);
  font-variant-numeric: lining-nums tabular-nums;
}

.deck {
  margin: var(--s-2) 0 0;
  max-width: 34rem;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.progress {
  margin-top: var(--s-4);
}

.progress-line {
  margin: 0 0 var(--s-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.progress-line strong {
  font-size: var(--fs-md);
  color: var(--text);
}

.progress-pct {
  margin-left: var(--s-1);
  color: var(--text-3);
}

.progress-ticked {
  margin-left: var(--s-1);
  color: var(--accent);
  white-space: nowrap;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 700ms var(--ease-out);
}

.progress-meta {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.wall {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 3px;
}

.tile {
  aspect-ratio: 1;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-2);
  transition: opacity 300ms var(--ease-out), filter 300ms var(--ease-out), transform 150ms var(--ease-out);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile.is-done {
  opacity: 0.22;
  filter: grayscale(1);
}

.tile.is-ticked:not(.is-steam) {
  opacity: 0.45;
  filter: grayscale(0.6);
}

@media (hover: hover) and (pointer: fine) {
  .tile {
    cursor: pointer;
  }

  .tile:hover {
    transform: translateY(-2px);
  }
}

@media (pointer: coarse) {
  .tile {
    pointer-events: none;
  }
}

/* ---------- Plan: next up (the 9 steps) ---------- */

.next {
  margin-top: var(--s-6);
}

.steps {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
}

.step {
  position: relative;
}

.step::before {
  /* the thread between the step numbers */
  content: "";
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}

.step:first-child::before {
  top: 24px;
}

.step:last-child::before {
  bottom: calc(100% - 24px);
}

.step > details > summary {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  list-style: none;
  cursor: pointer;
  border-radius: var(--r-lg);
}

.step > details > summary::-webkit-details-marker {
  display: none;
}

.step > details > summary:hover .step-what {
  color: var(--text);
}

.step-n {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  font-variant-numeric: lining-nums;
}

.step-what {
  padding-top: 4px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-2);
}

.step-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-right: 24px;
}

.step > details > summary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.step > details[open] > summary::after {
  transform: translateY(3px) rotate(-135deg);
}

.step-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.step-side:not(:has(.step-tag:not(:empty), .badge)) {
  display: none;
}

.step-tag:empty {
  display: none;
}

.step-tag {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--text-2);
}

.step-body {
  padding: 0 var(--s-3) var(--s-4) calc(32px + var(--s-3) + var(--s-3));
}

.step-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px var(--s-3);
  margin: 0;
  font-size: var(--fs-sm);
}

.step-facts > div {
  display: contents;
}

.step-facts dt {
  color: var(--text-3);
}

.step-facts dd {
  margin: 0;
  color: var(--text-2);
}

.step-hubs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.mini-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.mini-chip.is-done {
  color: var(--text-3);
}

.step-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 650;
  text-decoration: none;
}

.step-open::after {
  content: "\2192";
  content: "\2192" / "";
  margin-left: 0.35em;
}

/* the current step is the one thing to look at */
.step.is-now > details {
  position: relative;
  z-index: 1;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.step.is-now .step-n {
  border-color: var(--accent);
  color: var(--accent);
}

.step.is-now .step-what {
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
}

.step.is-now .step-tag {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.step.is-now::before,
.step.is-now + .step::before {
  background: var(--line-soft);
}

.step.is-done .step-n {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-3);
}

.step.is-folded {
  display: none;
}

.step-fold-btn {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 48px;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-lg);
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}

.step-fold-btn:hover {
  color: var(--text-2);
}

.step-n--fold {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
}

.step-fold-more {
  padding-right: var(--s-1);
  color: var(--accent);
  font-weight: 650;
}

.step.is-done .step-what {
  color: var(--text-3);
}

.step.is-done > details:not([open]) .step-what {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.step.is-done > details:not([open]) .step-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.step.is-done .step-tag {
  color: var(--text-3);
  border-color: var(--line-soft);
}

.step .step-side .badge[data-state="done"] {
  display: none;
}

/* ---------- Plan: best value for the effort ---------- */

.best {
  margin-top: var(--s-7);
}

.best-list {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.best-row a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  background: var(--surface);
}

.best-row a:hover {
  background: var(--surface-2);
}

.best-icon,
.rank-icon,
.rank-icon img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2);
}

.best-body,
.rank-body {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.best-name,
.rank-name {
  font-weight: 650;
  color: var(--text);
}

.best-where {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.best-val,
.rank-score {
  min-width: 2ch;
  font-size: var(--fs-md);
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.best-empty {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

[data-tier="S"] {
  --tier: var(--t-s);
}

[data-tier="A"] {
  --tier: var(--t-a);
}

[data-tier="B"] {
  --tier: var(--t-b);
}

[data-tier="C"] {
  --tier: var(--t-c);
}

[data-tier="D"] {
  --tier: var(--t-d);
}

[data-tier="N"] {
  --tier: var(--t-n);
}

.best-val,
.rank-score,
.val {
  color: var(--tier, var(--text-2));
}

.why-order {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
}

.why-order .lede {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* ---------- Play: hub chooser ---------- */

.chooser {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4) 0 var(--s-2);
}

.chooser-k {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 4px 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line);
}

.chip .badge {
  height: 22px;
  background: none;
  color: var(--text-3);
  font-weight: 600;
}

.chip .badge[data-state="done"] {
  color: var(--accent);
}

.chip[aria-current="true"] {
  border-color: var(--accent-line);
  background: var(--accent-wash);
}

.chip.is-done {
  color: var(--text-3);
}

/* ---------- Play: hub ---------- */

.hub-head {
  padding-top: var(--s-5);
}

.hub-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.hub-title h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: 1.12;
  letter-spacing: -0.005em;
}

.hub-sub {
  margin: var(--s-1) 0 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
}

.hub-lede,
.hub-note {
  margin: var(--s-2) 0 0;
  max-width: 62ch;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.hub-shared > h3 {
  margin: var(--s-6) 0 var(--s-2);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.25;
}

.hub-shared li {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-sm);
  max-width: 68ch;
}

.hub-intro {
  margin-top: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.hub-guide {
  margin-top: var(--s-2);
}

/* ---------- The achievement card ---------- */

.ach-list {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.ach {
  container-type: inline-size;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.ach-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  column-gap: 4px;
  padding: 10px 12px 10px 0;
}

.tick-hit {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -2px;
  cursor: pointer;
}

.tick {
  appearance: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-sunk);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.tick::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border-right: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  transform: rotate(45deg);
}

.tick:hover {
  border-color: var(--text-2);
}

/* ticked here, waiting for Steam: accent outline and check */
.tick:checked {
  border-color: var(--accent);
}

.tick:checked::after {
  border-color: var(--accent);
}

/* confirmed by Steam: solid accent */
.tick:checked:disabled {
  background: var(--accent);
  border-color: var(--accent);
  cursor: default;
  opacity: 1;
}

.tick:checked:disabled::after {
  border-color: var(--bg);
}

.ach-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2);
}

.ach-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon sum" "key key" "status status";
  align-items: start;
  column-gap: 10px;
  row-gap: 2px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-ctl);
  -webkit-tap-highlight-color: transparent;
}

.ach-toggle::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.ach-toggle[aria-expanded="true"]::after {
  transform: translateY(3px) rotate(-135deg);
}

.ach-toggle > .ach-icon {
  grid-area: icon;
}

.ach-title {
  grid-area: title;
  padding-right: 28px;
  line-height: 1.3;
}

.ach-name {
  margin-right: 0.45em;
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
}

.ach-toggle:hover .ach-name {
  color: var(--accent-strong);
}

.ach-sum {
  grid-area: sum;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text);
}

.tag {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.45;
  white-space: nowrap;
}

.ach-rw {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.45;
  white-space: nowrap;
}

.ach-key {
  grid-area: key;
  margin-top: 4px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-2);
}

.ach-key:empty,
.ach-status:empty {
  display: none;
}

.ach-status {
  grid-area: status;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-2);
}

.ach-detail {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-1) var(--s-4) var(--s-4) var(--s-4);
  border-top: 1px solid var(--line-soft);
  margin-top: 2px;
  padding-top: var(--s-3);
}

@container (min-width: 34rem) {
  .ach-detail {
    padding-left: 48px;
    padding-right: var(--s-5);
  }
}

.ach-detail p {
  margin: 0;
}

.c-cond {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.c-src .k {
  margin-right: 0.35em;
}

.c-sec > h4.k {
  margin: 0 0 4px;
  font-size: var(--fs-xs);
}

.c-tips ul,
.hub-shared ul {
  margin: 0;
  padding-left: 1.1em;
  list-style: disc;
}

.c-tips li,
.c-cond,
.c-rw-sum,
.rank-why,
.step-what {
  max-width: 68ch;
}

.c-tips li.c-shared {
  list-style: none;
  margin-left: -1.1em;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.c-shared a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  text-decoration: none;
}

.c-tips li {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.c-tips li::marker {
  color: var(--text-3);
}

.c-tips li:last-child {
  margin-bottom: 0;
}

.tip-reddit {
  color: var(--text-2);
}

a.src-tag {
  margin-left: 0.25em;
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-decoration-color: var(--line);
}

.c-guide > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-sm);
}

.c-guide > summary::-webkit-details-marker {
  display: none;
}

.c-guide > summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.c-guide[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.c-guide > summary:hover {
  border-color: var(--line-strong);
}

.c-guide-l {
  font-weight: 650;
  color: var(--accent);
}

.c-guide-t {
  color: var(--text-3);
}

.c-guide-body {
  padding: var(--s-3) 0 0;
  font-size: var(--fs-sm);
}

.c-guide-body > :last-child {
  margin-bottom: 0;
}

.c-guide-body ul {
  list-style: disc;
}

.c-guide-body ul ul {
  list-style: circle;
}

.c-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px var(--s-3);
  margin: 0 0 var(--s-3);
}

.c-facts > div {
  display: contents;
}

.c-facts dt {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding-top: 0.2em;
}

.c-facts dd {
  margin: 0;
}

.c-related {
  font-size: var(--fs-sm);
}

.c-rw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--s-2);
}

.rw-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.val {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
}

.val span {
  font-weight: 500;
  color: var(--text-3);
}

.c-rw-sum {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.c-src {
  font-size: var(--fs-xs);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.c-src a {
  color: var(--text-3);
  text-decoration-color: var(--line);
}

.c-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* a done card shrinks to one line and sinks to the end of its list */
.ach.is-done {
  background: transparent;
}

.ach.is-done .ach-row {
  padding: 4px 12px 4px 0;
  align-items: center;
}

.ach.is-done .ach-name {
  color: var(--text-2);
  font-weight: 600;
}

.ach.is-done .ach-icon {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  filter: grayscale(0.85);
  opacity: 0.55;
}

.ach.is-done .ach-toggle {
  grid-template-areas: "icon title" "icon status";
}

.ach.is-done :is(.stars, .ach-sum, .ach-key) {
  display: none;
}

.ach.is-done .ach-toggle {
  align-content: center;
  align-items: center;
}

.ach.is-done .ach-toggle::after {
  top: 50%;
  margin-top: -6px;
}

/* ---------- Play: runs of a Tainted character ---------- */

.hub-runs > h3 {
  margin-top: var(--s-5);
  margin-bottom: var(--s-1);
}

.hub-runs > .fine {
  margin: 0 0 var(--s-3);
  font-size: var(--fs-xs);
}

.hruns {
  list-style: none;
  margin: 0;
  padding: 0 !important;
  border-top: 1px solid var(--line-soft);
}

.hrun {
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--line-soft);
}

.hrun-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.run-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: var(--fs-base);
}

.hrun-name {
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
}

.hrun-head .badge {
  margin-left: auto;
}

.hrun-head .hrun-btn:not([hidden]) + .badge {
  margin-left: var(--s-1);
}

.hrun-gets {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(9em, max-content) minmax(0, 1fr);
  gap: 3px var(--s-3);
  margin: var(--s-1) 0 0;
  padding: 0 0 0 calc(30px + var(--s-3)) !important;
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.hrun-gets li {
  display: contents;
}

.hrun-marks {
  color: var(--text-2);
}

.ach-link.is-done {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
}

.hrun.is-done .run-letter {
  border-color: var(--line);
  color: var(--text-3);
}

.hrun.is-done .hrun-name {
  color: var(--text-3);
}

.hrun-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 4px 0 12px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
}

.hrun-btn::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.hrun-btn[aria-expanded="true"]::after {
  transform: translateY(1px) rotate(-135deg);
}

.hrun-btn + .badge {
  margin-left: 0;
}

.hrun-route {
  margin: var(--s-2) 0 var(--s-1) calc(30px + var(--s-3));
}

.hrun-clone {
  font-size: var(--fs-sm);
}

.hrun-fallback {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-xs);
}

/* ---------- Reference: the run template and the post-it ---------- */

.ref-sec {
  margin-top: var(--s-7);
}

.ref-sec > h3 {
  margin: 0 0 var(--s-3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: 1.15;
}

.sec-lede {
  color: var(--text-2);
}

.runs {
  list-style: none;
  margin: var(--s-3) 0 var(--s-3) !important;
  padding: 0 !important;
  border-top: 1px solid var(--line-soft);
}

.ref-sec .runs > li {
  max-width: none;
  margin: 0;
  padding: var(--s-4) 0 var(--s-5);
  border-bottom: 1px solid var(--line-soft);
}

.run-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}

.run-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 600;
}

.run-body {
  display: grid;
  gap: var(--s-3);
}

.route {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0 !important;
  padding: 0 !important;
  row-gap: 4px;
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.route li {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none;
}

.route li + li::before {
  content: "\2192";
  content: "\2192" / "";
  margin: 0 0.45em;
  color: var(--text-3);
}

.run-note {
  margin: var(--s-2) 0 0 !important;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.postit {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  max-width: 24rem;
  padding: 7px;
  border-radius: 3px 3px 10px 3px;
  background: var(--paper);
  box-shadow: 0 2px 0 oklch(0.6 0.04 80), 0 10px 22px var(--shadow);
}

.pm {
  display: grid;
  place-items: center;
  min-height: 30px;
  padding: 2px 4px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  font-size: var(--fs-xs);
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  color: var(--ink-faint);
}

.pm--on {
  background: var(--ink);
  color: var(--paper);
}

.pm--also {
  border: 1.5px dashed var(--ink);
  color: var(--ink);
}

.run-marks-text {
  margin: var(--s-2) 0 0 !important;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.run-marks-text .k {
  margin-right: 0.35em;
}

.postit-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.postit-key .pm {
  display: inline-grid;
  min-height: 22px;
  padding: 0 6px;
  background-color: var(--paper);
}

.postit-key .pm--on {
  background: var(--ink);
  outline: 3px solid var(--paper);
}

.postit-key .pm--also {
  outline: 3px solid var(--paper);
}

.postit-key .pm + .pm {
  margin-left: var(--s-3);
}

/* ---------- Reference: sources ---------- */

.sec--sources h4 {
  margin-top: var(--s-5);
}

.src-list {
  list-style: none;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: var(--s-4);
  margin: 0 0 var(--s-4) !important;
  padding: 0 !important;
  font-size: var(--fs-sm);
}

.ref-sec .src-list li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  line-height: 1.45;
}

.src-code,
.src-lead {
  padding: 8px 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.src-lead {
  max-width: 9rem;
}

.src-links {
  padding: 8px 0;
  overflow-wrap: anywhere;
}

.src-list a[href^="http"] {
  padding-right: 0;
  background: none;
}

#about p {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* ---------- Rewards ---------- */

.rank-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-4);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--bg-sunk);
}

.seg label {
  position: relative;
  cursor: pointer;
}

.seg input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 0 var(--s-3);
  border-radius: 7px;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 38px;
  color: var(--text-3);
  white-space: nowrap;
}

.seg input:checked + span {
  background: var(--surface-3);
  color: var(--text);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.f-switch {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
}

.f-switch input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-sunk);
  cursor: pointer;
}

.f-switch input::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border-right: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  transform: rotate(45deg);
}

.f-switch input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.f-switch input:checked::after {
  border-color: var(--bg);
}

.rank {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.rank-h {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin: var(--s-5) 0 var(--s-1);
  font-weight: 650;
  color: var(--text-2);
}

.rank-h:first-child {
  margin-top: var(--s-2);
}

.rank-h-t {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--tier);
  font-family: var(--font-serif);
  font-size: var(--fs-base);
}

.rank-h-t:empty {
  display: none;
}

.rank-h .fine {
  font-size: var(--fs-xs);
  font-weight: 500;
}

.rank-link {
  display: grid;
  grid-template-columns: 2.1rem 40px minmax(0, 1fr);
  align-items: start;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-1);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
}

.rank-link:hover {
  background: var(--surface);
  color: inherit;
}

.rank-score {
  text-align: center;
  line-height: 1.25;
  padding-top: 1px;
}

.rank-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.rank-meta .tag {
  margin-left: 2px;
}

.rank-where {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.rank-reward {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.rank-why {
  margin-top: 2px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-2);
}

.rank-row.is-done .rank-link {
  opacity: 0.45;
}

.rank-row.is-done .rank-name {
  text-decoration: line-through;
}

.rank.hide-done .rank-row.is-done,
.rank-h.is-empty,
.rank[data-sort="easy"] .rank-h,
.rank[data-sort="rare"] .rank-h {
  display: none;
}

/* ---------- Search ---------- */

.s-form {
  padding-top: var(--s-5);
}

.s-form input {
  width: 100%;
  height: 52px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--bg-sunk);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-base);
}

.s-form input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.s-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-line);
}

.s-quick {
  margin-top: var(--s-4);
}

.s-quick .k {
  margin: 0 0 6px;
}

.q-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.q-chip {
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.q-chip:hover {
  border-color: var(--line);
}

.s-status {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.s-status:empty {
  display: none;
}

.s-h {
  margin: var(--s-5) 0 var(--s-1);
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--text-3);
}

.s-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.s-list a {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
}

.s-list a:hover {
  background: var(--surface);
}

.s-list img,
.s-ico {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: var(--surface-2);
}

.s-body {
  display: grid;
  min-width: 0;
  line-height: 1.4;
}

.s-title {
  font-weight: 650;
}

.s-where {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.s-snip {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.s-ach.is-done .s-title {
  color: var(--text-3);
  text-decoration: line-through;
}

.s-more {
  margin-top: var(--s-4);
}

.s-also {
  margin: var(--s-1) 0 0;
  padding: 0 var(--s-3);
  font-size: var(--fs-sm);
  line-height: 1.9;
  color: var(--text-3);
}

.s-also a {
  font-weight: 600;
}

.s-also a.is-done {
  color: var(--text-3);
  text-decoration: line-through;
}

.s-also-hub {
  font-size: var(--fs-xs);
}

/* ---------- Citation preview ---------- */

.cite-pop {
  position: absolute;
  inset: auto;
  margin: 0;
  width: max-content;
  max-width: min(22rem, calc(100vw - 36px));
  padding: var(--s-1) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.4;
  box-shadow: 0 14px 36px var(--shadow);
}

.cp-item {
  padding: 6px 0;
}

.cp-item + .cp-item,
.cp-all {
  border-top: 1px solid var(--line);
}

.cp-head {
  display: block;
  padding-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.cite-pop a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.cite-pop a.cp-all {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-2);
}

/* ---------- Footer, toast ---------- */

.foot {
  max-width: 46rem;
  margin: var(--s-8) auto 0;
  padding: var(--s-5) max(var(--gutter), env(safe-area-inset-right)) max(var(--s-7), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.foot p {
  margin: 0 0 var(--s-2);
  max-width: 70ch;
}

.foot a {
  color: var(--text-2);
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: fit-content;
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: 0 12px 32px var(--shadow);
}

.toast:empty {
  display: none;
}

.toast .btn {
  flex: none;
  min-height: 40px;
  padding: 0 var(--s-3);
}

/* ---------- Phones ---------- */

@media (max-width: 39.99rem) {
  .deck {
    display: none;
  }

  .masthead {
    padding-top: var(--s-4);
  }

  .progress {
    margin-top: var(--s-3);
  }

  .wall {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 2px;
    margin-top: var(--s-3);
  }

  .next {
    margin-top: var(--s-4);
  }

  .chooser {
    gap: 4px;
    padding: var(--s-3) 0 0;
  }

  .chooser-group {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-width: 0;
  }

  .chooser-k {
    flex: none;
    width: 3.75rem;
    margin: 0;
  }

  .chooser-more {
    display: none;
  }

  .chips {
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 10px, #000 calc(100% - 28px), transparent);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    padding: 2px 0;
    margin-right: calc(-1 * var(--gutter));
    padding-right: var(--gutter);
  }

  .chips::-webkit-scrollbar,
  .jump::-webkit-scrollbar {
    display: none;
  }

  .chips:not(.is-scrolled) {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }

  .jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: calc(-1 * var(--gutter));
    padding-right: var(--gutter);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }

  .jump a {
    flex: none;
  }

  .chip {
    flex: none;
    scroll-snap-align: start;
  }
}

/* ---------- Narrow phones ---------- */

@media (max-width: 22.5rem) {
  .tab {
    font-size: var(--fs-xs);
  }

  .tab-search {
    width: 44px;
  }

  .tab-search span {
    left: 13px;
  }
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 28px;
    --fs-h1: 3.5rem;
  }

  .masthead {
    padding-top: var(--s-7);
  }

  .wall {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 4px;
  }

  .view-head h2,
  .next > h2,
  .best > h2,
  .hub-title h2,
  .ref-sec > h3 {
    font-size: 2rem;
  }

  .run-body {
    grid-template-columns: minmax(0, 1fr) 15.5rem;
    gap: var(--s-5);
  }

  .postit {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-link {
    grid-template-columns: 2.4rem 40px minmax(0, 1fr);
  }
}

@media (min-width: 52rem) {
  .masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: var(--s-6);
    align-items: end;
  }

  .wall {
    margin: 0;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
  }
}

@media (min-width: 64rem) {
  :root {
    --bar-h: 0px;
  }

  .topbar {
    display: none;
  }

  .layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 46rem);
    grid-template-rows: auto auto;
    column-gap: 4.5rem;
    justify-content: center;
    padding: 0 2.5rem;
  }

  .side {
    grid-row: 1 / span 2;
    display: block;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100dvh;
    overflow-y: auto;
    padding: var(--s-7) 0 var(--s-6);
    scrollbar-width: thin;
  }

  main {
    grid-column: 2;
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .foot {
    grid-column: 2;
    max-width: none;
    margin: var(--s-9) 0 0;
    padding-left: 0;
    padding-right: 0;
  }

  .side-count {
    margin: 0 var(--s-3) var(--s-4);
    font-family: var(--font-serif);
    font-size: var(--fs-lg);
    line-height: 1.1;
    font-variant-numeric: lining-nums tabular-nums;
  }

  .side-sub {
    display: block;
    margin-top: var(--s-1);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    color: var(--text-3);
  }

  .side-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 36px;
    margin: 0 0 var(--s-3);
    padding: 4px var(--s-3) 4px 40px;
    border-radius: var(--r-ctl);
    color: var(--text-2);
    font-weight: 650;
    text-decoration: none;
  }

  .side-search:hover,
  .side-search[aria-current="page"] {
    background: var(--surface);
    color: var(--text);
  }

  .side-search kbd {
    margin-left: auto;
  }

  .side-search-i {
    left: 14px;
    top: 11px;
    width: 13px;
    height: 13px;
  }

  .side-search-i::after {
    left: 9px;
    top: 10px;
    width: 6px;
  }

  .side-list,
  .side-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .side-list > li > a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 4px var(--s-3);
    border-radius: var(--r-ctl);
    color: var(--text-2);
    font-weight: 650;
    text-decoration: none;
  }

  .side-list a:hover {
    background: var(--surface);
    color: var(--text);
  }

  .side-list > li > a[aria-current="page"] {
    color: var(--text);
    background: var(--surface);
  }

  .side-sub-list {
    margin: 2px 0 var(--s-3) var(--s-3);
  }

  .side-sub-list a {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 30px;
    padding: 2px var(--s-3);
    border-radius: var(--r-ctl);
    color: var(--text-3);
    font-size: var(--fs-sm);
    text-decoration: none;
  }

  [data-view="play"] .side-sub-list a[aria-current="true"] {
    color: var(--text);
    background: var(--surface);
  }

  .side-sub-list a.is-done {
    color: var(--text-3);
    opacity: 0.7;
  }

  .side-l {
    flex: 1;
    min-width: 0;
  }

  .side-sub-list .badge {
    height: 20px;
  }

  .side-k {
    margin: var(--s-2) 0 0;
    padding: 0 var(--s-3);
    font-size: var(--fs-xs);
    color: var(--text-3);
    opacity: 0.8;
  }

  /* the sidebar lists the hubs; the in-view chooser would repeat it */
  .js .chooser {
    display: none;
  }

  .hub-head,
  .view-head,
  .s-form {
    padding-top: var(--s-7);
  }
}

@media (min-width: 90rem) {
  .layout {
    column-gap: 6rem;
  }
}

/* Short landscape phones: keep the bar slim. */
@media (max-height: 31rem) and (max-width: 63.99rem) {
  :root {
    --bar-h: 44px;
  }
}

/* ---------- Preferences ---------- */

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

@media (forced-colors: active) {
  .bar > span {
    background: CanvasText;
  }

  .tick {
    border-color: CanvasText;
  }

  .tick:checked::after {
    border-color: CanvasText;
  }

  .tick:checked:disabled {
    background: CanvasText;
  }

  .tick:checked:disabled::after {
    border-color: Canvas;
  }

  .tab[aria-current="page"] span::after,
  .chip[aria-current="true"] {
    outline: 2px solid CanvasText;
  }

  .pm--on {
    forced-color-adjust: none;
    background: CanvasText;
    color: Canvas;
  }
}

/* ---- added after the Sol usefulness review: labels, boss plans, post-it checklists, plan widgets ---- */

/* confidence label after a tip: wiki / R+ patch / community / unconfirmed */
.cf {
  display: inline-block;
  margin-left: 0.2em;
  padding: 0 0.45em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-3);
  white-space: nowrap;
  vertical-align: 0.08em;
}
.cf.patch { color: var(--accent); border-color: var(--accent-line); }
.cf.community { color: var(--t-b); border-color: oklch(0.42 0.04 70); }
.cf.unconfirmed { color: var(--red); border-color: oklch(0.45 0.09 27); }
.ach-key .cf { font-size: 0.68rem; }

.c-plan {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-wash);
}
.bp {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bp li {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  max-width: 72ch;
}
.bp-k {
  display: inline-block;
  min-width: 4.6em;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-strong);
}
.bp-src {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.tip-none {
  list-style: none;
  margin-left: -1.1em;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.hub-basics {
  margin: var(--s-4, 16px) 0;
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--line-strong);
  background: var(--surface);
  border-radius: 0 14px 14px 0;
}
.hub-basics > h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.hub-basics ul {
  margin: 0;
  padding-left: 1.1em;
}
.hub-basics li {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  max-width: 68ch;
}

/* post-it checklist: 12 marks, ticked by hand */
.pk {
  margin: var(--s-3) 0;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
}
.pk > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  font-weight: 650;
}
.pk-count {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
}
.pk-count[data-state="done"] { color: var(--accent); }
.pk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 6px;
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
}
.pk-grid:empty { display: none; }
.pk-cell label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.pk-cell.pk--quiet label { border-style: dashed; }
.pk-cell:has(input:checked) label {
  border-color: var(--red);
  color: var(--text);
  background: oklch(0.25 0.04 27);
}
.pk-l { flex: 1; }
.pk-run {
  font-family: var(--font-mono);
  color: var(--text-3);
}
.pk-cb { accent-color: var(--red); }
.pk-other { margin-top: var(--s-6, 32px); }
.pk-other > h3 { font-size: var(--fs-md); }
.pk-rows { margin: 0; padding: 0; list-style: none; }
.pk-row { margin: 0 0 var(--s-3); }
.pk-name { font-weight: 650; font-size: var(--fs-sm); }

/* Run A gate */
.gate {
  margin: var(--s-4, 16px) 0;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--red);
  border-radius: 14px;
}
.gate ul, .hrun-gate ul { margin: var(--s-2) 0; padding-left: 1.1em; }
.gate li, .hrun-gate li { margin: 0 0 6px; font-size: var(--fs-sm); max-width: 72ch; }
.hrun-gate-li { list-style: none; }
.hrun-gate > summary {
  min-height: 36px;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--red);
}

/* plan: protocols and widgets */
.step-notes { margin: var(--s-2) 0; padding-left: 1.1em; }
.step-notes li { margin: 0 0 6px; font-size: var(--fs-sm); max-width: 68ch; }
.step-opens { display: flex; flex-wrap: wrap; gap: 0 var(--s-4, 16px); }
.dc, .aw { margin: var(--s-2) 0; }
.dc-list, .aw-list { margin: 0; padding: 0; list-style: none; }
.dc-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
}
.dc-l { flex: 1; font-weight: 650; font-size: var(--fs-sm); }
.dc-u { font-weight: 400; color: var(--text-3); font-size: var(--fs-xs); }
.dc-v { font-variant-numeric: tabular-nums; }
.dc-row.is-done .dc-v, .dc-row.is-full .dc-v { color: var(--accent); }
.dc-b {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
}
.dc-log { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-2) 0 !important; }
.aw-list li { min-height: 36px; display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
.aw-done { margin-top: var(--s-2); }
.aw-total { font-size: var(--fs-sm); }

.pickup {
  margin: var(--s-3) 0;
  padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--t-a);
  border-radius: 14px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.pickup p { margin: 0; }
.pickup[hidden] { display: none; }

/* ---------------------------------------------------------------- Achievements tab */
#achievements { --al-cols: minmax(11rem, .8fr) minmax(0, 1.3fr) minmax(0, 1fr); }

.al {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
}

.al-head,
.al-row {
  display: grid;
  grid-template-columns: var(--al-cols);
  gap: var(--s-4);
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line, rgba(255,255,255,.08));
}

.al-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg, #130d0b);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  padding-top: var(--s-2);
  padding-bottom: var(--s-2);
}

.al-c {
  min-width: 0;
  line-height: 1.45;
  color: var(--text-2);
}

.al-ach {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--s-2);
  align-items: start;
}

.al-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.al-name {
  margin: 0;
  font-weight: 650;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s-2);
}

.al-name a { color: inherit; }

.al-id {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
}

.al-k {
  display: none;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  margin-right: .4em;
}

.al-type {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.al-gives strong { color: var(--text); }

.al-none { color: var(--text-3); }

/* the guide column is 46rem: widen it for the table view only */
@media (min-width: 64rem) {
  .js[data-view="achievements"] .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .js[data-view="achievements"] main { max-width: 80rem; }
}

/* phones: keep the three columns, just tighter */
@media (max-width: 44rem) {
  #achievements { --al-cols: 5.6rem minmax(0, 1.25fr) minmax(0, 1fr); }
  .al-head, .al-row { gap: var(--s-2); padding-left: 0; padding-right: 0; }
  .al-row { font-size: var(--fs-xs); }
  .al-head { font-size: 10px; letter-spacing: .02em; top: var(--bar-h, 0); }
  .al-ach { grid-template-columns: 1fr; gap: 4px; align-content: start; }
  .al-icon { width: 24px; height: 24px; }
  .al-name { display: block; font-size: var(--fs-xs); line-height: 1.3; overflow-wrap: anywhere; }
  .al-name .stars { display: block; margin-top: 2px; }
  .al-id { display: block; }
  .al-c { line-height: 1.4; overflow-wrap: anywhere; }
}

/* five tabs do not fit a phone at the default size: tighter, never overlapping */
@media (max-width: 30rem) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 0 7px; font-size: 13px; }
}
