/* ---------------------------------------------------------------------------
   catalogue-record.css — one record at a time: the spec sheet, the compare
   view, the colophon, and the toast that floats over them.

   The sheet is a card laid on the desk, a shade lighter than the paper. Its
   only colour is the game's own: the band across the top and the colour
   proof in the facts. Its type is looser than the ledger's: the ledger is
   for scanning, the sheet for reading.
--------------------------------------------------------------------------- */

.sheet {
  grid-area: sheet;
  position: relative;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper-hi);
  border-inline-start: 1px solid var(--rule);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.sheet__bar {
  display: none;
}

/* --- buttons ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

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

.btn--play {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn--play:hover {
  background: #33302a;
}

.btn--play svg {
  width: 12px;
  height: 12px;
}

.btn__key {
  margin-inline-start: 2px;
  border-color: rgba(250, 248, 243, 0.3);
  background: transparent;
  color: rgba(250, 248, 243, 0.78);
  font-size: 10.5px;
}

.btn--quiet {
  color: var(--ink-2);
}

.btn--fave[aria-pressed='true'] svg {
  fill: currentColor;
}

.btn--mark[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.btn--small {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

/* --- the record ------------------------------------------------------------------ */

.record__band {
  height: 9px;
  background: linear-gradient(90deg, var(--g-deep) 0%, var(--g-ink) 18%, var(--g-glow) 52%, var(--g-light) 86%);
}

.record__top {
  padding: 16px var(--pad) 0;
}

.record__eyebrow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 12px;
}

.record__no {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

.record__kind {
  margin-inline-start: auto;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* The plate: the cover on a mat, as a print is hung. */
.record__mat {
  padding: 7px;
  border: 1px solid var(--rule);
  background: var(--paper-lo);
}

/* Width and height attributes reserve the space; CSS sets the shape. */
.record__cover,
.record__frame img,
.cmp__cover,
.likeness__item img {
  height: auto;
}

.record__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--g-deep);
}

.record__frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.record__frame {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper-lo);
}

.record__frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0.86;
}

.record__frame:hover img,
.record__frame[aria-pressed='true'] img {
  opacity: 1;
}

.record__frame[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.record__name {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.016em;
  font-variation-settings: 'opsz' 60;
  text-wrap: balance;
}

.record__tagline {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink-2);
  text-wrap: balance;
}

.record__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.record__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 12px;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.quiet-link svg {
  width: 14px;
  height: 14px;
}

.quiet-link:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.record__section {
  padding: 18px var(--pad) 0;
}

.record__section:last-child {
  padding-bottom: 36px;
}

/* A section head is a label with a rule running out to the margin. */
.record__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.record__head::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule);
}

.record__desc {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-2);
  text-wrap: pretty;
}

.record__note {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
}

.record__note b {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

cite {
  font-style: italic;
}

/* The facts, two columns: small capitals on the left, values on the right. */
.facts {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  font-size: 13.5px;
}

.facts__row {
  display: contents;
}

.facts dt,
.facts dd {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.facts dt {
  padding-top: 9px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.facts dd {
  min-width: 0;
  color: var(--ink);
  line-height: 1.5;
}

.facts dd code {
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.facts__aside {
  color: var(--ink-3);
  font-size: 12px;
}

.facts dd .xref + .xref::before {
  content: ', ';
  display: inline-block;
  white-space: pre;
  color: var(--ink-3);
  text-decoration: none;
}

.controls {
  line-height: 1.85;
  color: var(--ink-2);
}

.controls kbd {
  margin: 0 1px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  padding: 1px 7px 2px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-2);
}

button.tag:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.is-static {
  font-size: 11.5px;
}

/* A colour proof: the game's four lit colours and the colour it ships. */
.proof {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.proof__chip {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgba(27, 25, 22, 0.12);
}

.proof code {
  margin-inline-start: 8px;
}

/* The other attempts, as a small table. */
.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.mini th,
.mini td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: start;
  font-weight: 400;
  white-space: nowrap;
}

.mini thead th {
  padding-top: 0;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom-color: var(--rule);
}

.mini tbody th {
  max-width: 0;
  width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini td {
  color: var(--ink-2);
}

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

.mini tr.is-here > * {
  background: var(--cursor);
}

.mini tr.is-here > :first-child {
  box-shadow: inset 3px 0 0 var(--ink);
}

.mini__here {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.mini__here,
.mini__link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini__link {
  font-family: var(--serif);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.mini__link:hover {
  text-decoration-color: var(--ink);
}

/* What else is like it. */
.likeness {
  display: grid;
  gap: 2px;
}

.likeness__item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  padding: 5px 6px;
  margin: 0 -6px;
  width: calc(100% + 12px);
  border-radius: 5px;
}

.likeness__item:hover {
  background: var(--hover);
}

.likeness__item img {
  grid-row: 1 / 3;
  width: 52px;
  height: 39px !important;
  object-fit: cover;
  border-radius: 2px;
  border-bottom: 3px solid var(--swatch);
  box-shadow: 0 0 0 1px rgba(27, 25, 22, 0.1);
}

.likeness__name {
  align-self: end;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 520;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.likeness__meta {
  align-self: start;
  font-size: 11.5px;
  color: var(--ink-3);
}

.builds__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.builds__play {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- the colophon: the front matter, when no record is open --------------------------- */

.colophon {
  padding: 30px var(--pad) 36px;
}

/* A short ink rule over the kicker, as a chapter opens. */
.colophon::before {
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  margin-bottom: 14px;
  background: var(--ink);
}

.colophon__title {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 60;
}

.colophon__lede {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.colophon__start {
  margin: 18px 0 26px;
}

.keys {
  display: grid;
  gap: 0;
}

.keys__row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.keys dt {
  white-space: nowrap;
}

.keys kbd + kbd {
  margin-inline-start: 3px;
}

.keys__or {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
}

.keys dd {
  color: var(--ink-2);
}

.colophon__note {
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* --- compare --------------------------------------------------------------------------- */

body.is-comparing .figures,
body.is-comparing .records {
  display: none;
}

.compare {
  padding: 16px var(--pad) 40px;
}

.compare__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
}

.compare__title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.compare__count {
  margin-inline-start: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}

.compare__note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-3);
}

.diff-key {
  display: inline-block;
  width: 22px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.compare__close {
  margin-inline-start: auto;
}

.compare__close kbd {
  margin-inline-start: 2px;
}

/* Positioned, so it also clips what is absolutely placed inside it, such as
   the words that are there only for screen readers. */
.compare__scroll {
  position: relative;
  overflow-x: auto;
  scrollbar-width: thin;
}

.cmp {
  width: 100%;
  min-width: calc(110px + var(--cols) * 200px);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cmp th,
.cmp td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: start;
  vertical-align: top;
  font-weight: 400;
}

/* The labels stay put while the columns scroll past them. */
.cmp__corner,
.cmp__label {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  width: 110px;
  background: var(--paper);
}

.cmp__label {
  padding-top: 10px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cmp tbody tr:hover > * {
  background: var(--hover);
}

.cmp__game {
  padding: 0 12px 14px;
  border-bottom: 1px solid var(--ink) !important;
  vertical-align: bottom;
}

.cmp__game > * {
  display: block;
}

.cmp__band {
  height: 6px;
  margin: 0 -12px 10px;
  background: linear-gradient(90deg, var(--g-deep) 0%, var(--g-glow) 55%, var(--g-light) 90%);
}

.cmp__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--g-deep);
}

.cmp__name {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 520;
  line-height: 1.15;
  text-align: start;
}

.cmp__name:hover {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.cmp__tagline {
  margin-top: 3px;
  min-height: 1.3em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-3);
}

.cmp__actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.cmp td.is-different {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.cmp tbody tr:hover > td.is-different {
  background: #dce2f3;
}

.cmp td code {
  font-size: 11.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.cmp .prose {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Amounts from zero; dates as a mark on the catalogue's timeline. */
.amount,
.when {
  display: grid;
  gap: 5px;
}

.amount__bar {
  height: 6px;
  max-width: 160px;
  background: linear-gradient(var(--ink-2), var(--ink-2)) no-repeat left / max(2px, calc(var(--v) * 100%)) 100%;
  border-start-start-radius: 0; border-start-end-radius: 2px; border-end-end-radius: 2px; border-end-start-radius: 0;
}
.amount__bar:dir(rtl) {
  background-position: right;
}


.when__line {
  position: relative;
  height: 10px;
  max-width: 160px;
  border-bottom: 1px solid var(--rule);
}

.when__line::after {
  content: '';
  position: absolute;
  bottom: -4px;
  inset-inline-start: calc(var(--at) * 100% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
}

/* --- toast --------------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%; /* centred: stays physical */
  bottom: 24px;
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(27, 25, 22, 0.25);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- one column: the record as a page of its own ------------------------------------------ */

/* A narrow sheet keeps its three actions on one line. */
@media (min-width: 1200px) and (max-width: 1499px) {
  .record__actions .btn__key {
    display: none;
  }
}

@media (max-width: 1199px) {
  body.is-reading {
    overflow: hidden;
  }

  body.is-reading .sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
  }

  .sheet__bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 50px;
    padding: 0 var(--pad);
    border-bottom: 1px solid var(--rule);
    background: var(--paper-hi);
  }

  .sheet__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding-block: 0 0; padding-inline: 4px 10px;
    margin-inline-start: -4px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
  }

  .sheet__back svg {
    width: 18px;
    height: 18px;
  }

  .sheet__back:hover {
    background: var(--hover);
  }

  .sheet__bar-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--serif);
    font-size: 15px;
    color: var(--ink-3);
  }

  .sheet .record,
  .sheet .colophon {
    max-width: 720px;
    margin: 0 auto;
  }

  .record__name {
    font-size: 32px;
  }
}

@media (max-width: 560px) {
  .btn__key {
    display: none;
  }

  .compare {
    padding: 14px var(--pad) 32px;
  }

  .compare__close kbd {
    display: none;
  }

  .cmp {
    min-width: calc(84px + var(--cols) * 168px);
  }

  .cmp__corner,
  .cmp__label {
    width: 84px;
    padding-inline-start: 0 !important;
    padding-inline-end: 8px !important;
  }
}
