.selection-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.history-link {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.end-history-link {
  margin-top: 14px;
}
.pause-footer {
  flex-wrap: wrap;
}
#run-history {
  color: var(--cream, #f2eedc);
  background: #182c29;
  border: 1px solid #596451;
  border-radius: 22px;
  padding: 24px;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  box-sizing: border-box;
  box-shadow: 0 24px 100px #0009;
  overscroll-behavior: contain;
}
#run-history::backdrop {
  background: #071512c9;
  backdrop-filter: blur(4px);
}
.history-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.history-heading h2 {
  margin: 5px 0 0;
  font-size: 32px;
  letter-spacing: -1px;
}
.history-heading .eyebrow {
  font-size: 9px;
}
#close-run-history {
  flex-shrink: 0;
  font-size: 26px;
}
#run-history-note {
  color: #a8b9ac;
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 18px;
}
.history-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 0;
  margin-bottom: 18px;
  border-block: 1px solid #a5b99122;
}
.history-overview div {
  display: grid;
  text-align: center;
  gap: 5px;
}
.history-overview b {
  font-size: 24px;
  color: #f2d28a;
}
.history-overview span {
  font-size: 11px;
  color: #b3c0b2;
}
.run-list {
  display: grid;
  gap: 14px;
}
.run-entry {
  border: 1px solid #94b29533;
  border-radius: 14px;
  background: linear-gradient(120deg, #243931, #1c302d);
  padding: 16px;
}
.run-entry[data-outcome="victory"] {
  border-color: #e9c97788;
}
.run-identity {
  display: flex;
  gap: 14px;
  align-items: center;
}
.run-identity img {
  width: 64px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.run-identity h3 {
  margin: 3px 0;
  font-size: 21px;
  line-height: 1.2;
}
.run-identity p {
  margin: 4px 0;
  color: #c5cfbe;
  font-size: 12px;
}
.run-identity time {
  font-size: 10px;
  color: #9bac9c;
}
.run-outcome {
  color: #e3bd9a;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 9px;
  font-weight: 700;
}
[data-outcome="victory"] .run-outcome {
  color: #f6d582;
}
.run-rarity {
  color: var(--rarity);
  margin-left: 6px;
  white-space: nowrap;
}
.run-measures {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 1fr 0.8fr;
  gap: 6px;
  margin: 14px 0 10px;
}
.run-measures dt {
  color: #a4b69f;
  font-size: 10px;
  margin-bottom: 5px;
}
.run-measures dd {
  font-size: 20px;
  font-weight: 650;
  margin: 0;
}
.run-measures small {
  font-size: 10px;
  color: #a2b19b;
  font-weight: 400;
}
.run-distance {
  height: 4px;
  background: #111f1b;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.run-distance i {
  display: block;
  height: 100%;
  background: #b2c895;
  border-radius: inherit;
}
[data-outcome="victory"] .run-distance i {
  background: #f2cd7a;
}
.run-entry summary {
  cursor: pointer;
  color: #d6c99a;
  font-size: 12px;
  padding: 6px 0;
}
.run-details {
  border-top: 1px solid #94b29522;
  margin-top: 9px;
  padding-top: 10px;
}
.run-details p {
  color: #bdcabb;
  font-size: 12px;
  line-height: 1.5;
  margin: 5px 0 10px;
}
.run-details .run-origin {
  font-size: 11px;
  text-transform: capitalize;
}
.run-abilities {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin: 15px 0;
}
.run-abilities div {
  padding: 8px 3px;
  text-align: center;
  background: #10231f66;
  border-radius: 5px;
}
.run-abilities dt {
  font-size: 9px;
  color: #b5c0a8;
}
.run-abilities dd {
  margin: 4px 0 0;
  font-size: 17px;
}
.run-abilities small {
  display: block;
  color: #8ea18e;
  font-size: 8px;
  margin-top: 4px;
}
.run-gear {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.run-gear li {
  font-size: 12px;
  color: #d9ddcc;
}
.run-gear span {
  display: block;
  font-size: 9px;
  color: #9caf98;
  margin-top: 3px;
}
.history-empty {
  text-align: center;
  padding: 36px 16px 46px;
}
.history-empty > span {
  color: #e8cc88;
  font-size: 48px;
}
.history-empty h3 {
  font-size: 22px;
  margin: 12px 0;
}
.history-empty p {
  color: #a9bba8;
  font-size: 13px;
  line-height: 1.7;
  max-width: 340px;
  margin: auto;
}
@media (max-width: 600px) {
  .selection-nav-links {
    gap: 12px;
  }
  .selection-nav-links .handbook-link {
    font-size: 11px;
  }
  #run-history {
    padding: 18px;
    border-radius: 16px;
    max-height: calc(100dvh - 24px);
  }
  .run-entry {
    padding: 12px;
  }
  .run-identity {
    gap: 10px;
  }
  .run-measures dd {
    font-size: 18px;
  }
  .run-rarity {
    display: block;
    margin: 4px 0 0;
  }
  .history-heading h2 {
    font-size: 28px;
  }
}
@media (max-width: 360px) {
  .selection-nav-links {
    gap: 9px;
  }
  .selection-nav-links .handbook-link {
    font-size: 10px;
  }
  .selection-nav .brand {
    font-size: 13px;
  }
  .selection-nav .brand img {
    width: 24px;
    height: 24px;
  }
  .run-measures small {
    display: block;
  }
  .run-identity img {
    width: 50px;
  }
  .run-abilities {
    grid-template-columns: repeat(3, 1fr);
  }
}

.history-heading {
  position: sticky;
  top: -24px;
  margin: -24px -24px 0;
  padding: 24px 24px 14px;
  background: #182c29;
  z-index: 2;
}
.history-link {
  min-height: 36px;
}
#run-history button,
#run-history summary {
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 600px) {
  .history-heading {
    top: -18px;
    margin: -18px -18px 0;
    padding: 18px 18px 12px;
  }
}
