:root {
  color-scheme: dark;
  --steel: #353c40;
  --frame: #5f696e;
  --text: #eef3f5;
  --muted: #b8c3c9;
  --blue: #9bd4f1;
  --gold: #f6d27b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: .75rem; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 14rem, #253340, transparent 49rem),
    repeating-linear-gradient(135deg, #13171a 0 2px, #14191c 2px 3px);
  font: 1rem/1.35 "Segoe UI", Tahoma, sans-serif;
}

a { color: var(--blue); }
a:hover { color: #e5f8ff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button, select { font: inherit; }
h1, h2, p, dl, dd { margin: 0; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; inset: .75rem auto auto .75rem; z-index: 2; padding: .5rem 1rem; background: #101d28; }

.masthead { background: #070809; border-bottom: 1px solid #30373b; }
.masthead-inner, .record { width: min(68rem, calc(100% - 2.5rem)); margin-inline: auto; }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 1.9rem;
  padding-inline: .1rem;
  font-size: .8125rem;
}
.back { text-decoration: none; }
.back:hover { text-decoration: underline; }
.back span { color: #869299; margin-inline: .25rem; }
.system { color: #aebbc2; text-align: end; }

.record {
  background: #242a2e;
  border-inline: 1px solid #465156;
  box-shadow: 0 0 30px #0009;
}
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .3rem .9rem;
  padding: .75rem 1.2rem .5rem;
  border-bottom: 3px solid #050607;
  background:
    radial-gradient(ellipse at 82% 100%, #bd873940, transparent 52%),
    linear-gradient(105deg, #101820, #22364e 50%, #30281d);
}
.hero-ranks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr)) minmax(0, 1.3fr);
  place-items: center;
  justify-self: center;
  gap: clamp(.15rem, 1vw, .65rem);
  width: min(100%, 50rem);
}
.hero-ranks img { display: block; width: min(100%, 3.5rem); height: auto; }
.hero-ranks img:nth-child(-n+4) { opacity: .6; }
.hero-ranks img:nth-child(n+5):nth-child(-n+8) { opacity: .82; }
.hero-ranks img:last-child { width: min(100%, 4.5rem); filter: drop-shadow(0 0 .55rem #edb95280); }
.brand { display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.65rem;
  border: 1px solid #859aa8;
  background: linear-gradient(145deg, #4b6577, #151f28 57%);
  box-shadow: inset 0 0 0 3px #141e28, 0 2px 4px #000a;
}
.brand-mark::before {
  width: 73%;
  height: 48%;
  border: 2px solid #c0e0ed;
  border-radius: 50%;
  box-shadow: 0 0 8px #73a3bb8c, inset 0 0 8px #73a3bb8c;
  transform: rotate(-31deg);
  content: "";
}
.brand-name { color: #edf3f7; font-size: 1.55rem; font-weight: 700; letter-spacing: .12em; line-height: 1; text-transform: uppercase; }
.brand-caption { margin-top: .15rem; color: var(--blue); font-size: .8125rem; }
h1 { color: #e4edf5; font-size: clamp(1.35rem, 3.6vw, 2.4rem); font-weight: 400; line-height: 1.05; text-align: end; text-shadow: 0 2px 4px #000; }
.profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(12.5rem, 16rem);
  align-items: center;
  gap: .85rem;
  min-height: 6.35rem;
  margin: .55rem .6rem 0;
  padding: .65rem .8rem;
  border: 1px solid #486e99;
  box-shadow: inset 0 1px #9bb6d654, inset 0 -1px #141d38;
  background:
    repeating-linear-gradient(125deg, transparent 0 30px, #acc9f211 31px, transparent 32px 43px),
    linear-gradient(105deg, #18315b, #244e82 53%, #122a4c);
}
.emblem {
  --emblem-light: #f3db83;
  --emblem-dark: #bd852b;
  display: grid;
  place-items: center;
  width: 4.4rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, #3c6491, #172951 76%);
  border: 1px solid #819dc4;
  box-shadow: inset 0 0 0 3px #22375b, 0 2px 5px #0a1223;
}
/* The player's portrait (art/portraits/<id>.webp, the game's own render of their armour) in place of the emblem. */
.emblem.portrait { width: 5rem; aspect-ratio: 3 / 4; background: #000; overflow: hidden; }
.emblem img { display: block; width: 100%; height: 100%; }
.emblem span {
  position: relative;
  width: 68%;
  height: 68%;
  background: linear-gradient(var(--emblem-light), var(--emblem-dark));
  clip-path: polygon(50% 0, 61% 24%, 86% 12%, 100% 27%, 80% 43%, 85% 69%, 50% 100%, 15% 69%, 20% 43%, 0 27%, 14% 12%, 39% 24%);
}
.emblem span::after {
  position: absolute;
  inset: 20% 23% 21%;
  content: "";
  background: #1e365e;
  clip-path: polygon(50% 0, 64% 36%, 100% 42%, 75% 59%, 50% 100%, 25% 59%, 0 42%, 36% 36%);
}
.eyebrow { color: #c2ddf5; font-size: .75rem; letter-spacing: .065em; text-transform: uppercase; }
.profile h2 { margin: .08rem 0 .15rem; font-size: 1.55rem; line-height: 1.05; }
.rank { color: #fff1ce; font-size: .875rem; font-weight: 600; }
.rank-art { display: block; width: 3.75rem; height: 3.75rem; object-fit: contain; filter: drop-shadow(0 2px 3px #0a1424); }
.progression { display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin-top: .15rem; }
.progression div { display: flex; align-items: baseline; gap: .3rem; font-size: .8125rem; }
.progression dt { color: #c1d3ee; }
.progression dd { font-weight: 600; }
.profile-controls {
  grid-column: 4;
  display: grid;
  gap: .25rem;
  padding: .5rem .55rem;
  border: 1px solid #5276a1;
  background: #0d203bc4;
}
.profile-controls label { color: #cfdef0; font-size: .8125rem; }
/* Plain text links, the way Bungie.net's 2007 leaderboards sorted. */
.career-sort { color: #8fa6bd; font-size: .6875rem; }
.career-sort button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: none;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.career-sort button:hover { color: #e5f8ff; }
.career-sort button[aria-pressed="true"] { color: #fff; font-weight: 700; text-decoration: none; cursor: default; }

select {
  appearance: none;
  min-height: 1.85rem;
  padding: .2rem 1.5rem .2rem .42rem;
  border: 1px solid #0d1216;
  border-radius: 0;
  color: #101820;
  background:
    linear-gradient(45deg, transparent 50%, #17252e 51%) right 10px center / 5px 5px no-repeat,
    linear-gradient(135deg, #17252e 50%, transparent 51%) right 5px center / 5px 5px no-repeat,
    linear-gradient(#f9fbfc, #c1cbd0);
  font-size: .875rem;
}
option { background: #eef2f5; color: #101820; }

.dashboard { padding: 0 .6rem .6rem; }
.record-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  margin: 0 -.6rem .5rem;
  padding: .45rem .6rem 0;
  border-bottom: 1px solid #688499;
  background: linear-gradient(#111619, #090b0d);
}
.record-nav a {
  padding: .35rem .9rem;
  border: 1px solid #456b86;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#1a4d6a, #102e43 50%, #091723 51%, #0c1924);
  box-shadow: inset 0 1px #77b3d54d;
  font-size: .875rem;
  text-decoration: none;
}
.record-nav a:hover, .record-nav a[aria-current="location"] { border-color: #8aa5b8; color: #fff; background: linear-gradient(#434e55, #1e2429); }

.filters {
  margin-bottom: .55rem;
  padding: .4rem;
  border: 1px solid var(--frame);
  box-shadow: inset 0 1px #7980864d;
  background: #353b3f;
}
.map-filter {
  display: grid;
  grid-template-columns: minmax(14rem, .38fr) minmax(0, 1fr);
  min-height: 4rem;
  padding: .25rem;
  gap: .5rem;
  border: 1px solid #6a7176;
  box-shadow: inset 0 2px #030404;
  background: #151819;
}
.filter-selects { display: grid; align-content: center; gap: .22rem; padding-inline: .15rem; }
.filter-selects label { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); align-items: center; gap: .35rem; color: #d4dce0; font-size: .875rem; }
.filter-selects select { width: 100%; }
.map-strip {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(6rem, calc((100% - .48rem) / 4));
  align-self: center;
  gap: .16rem;
  min-width: 0;
  overflow-x: auto;
  padding: .16rem;
  background: #0b0c0d;
  scrollbar-color: #667987 #1a2024;
  scrollbar-width: thin;
}
.map-thumb {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #646e72;
  color: #fff;
  background: #151819;
  cursor: pointer;
}
.map-thumb img { display: block; width: 100%; height: clamp(2.9rem, 6vw, 4.1rem); object-fit: cover; }
.map-thumb span {
  position: absolute;
  inset: auto 0 0;
  padding: .15rem .25rem .11rem;
  background: linear-gradient(transparent, #080c10e8 45%);
  font-size: .75rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000;
}
.map-thumb:hover, .map-thumb[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.map-thumb:focus-visible { outline-offset: -3px; }
.playlist-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .5rem; margin: .3rem .1rem 0; color: #dde3e6; font-size: .875rem; }
.scope { display: flex; flex-wrap: wrap; gap: .2rem; }
.scope label { position: relative; cursor: pointer; }
.scope input { position: absolute; opacity: 0; }
.scope span {
  display: block;
  padding: .22rem .52rem;
  border: 1px solid transparent;
  color: inherit;
}
.ranked { color: var(--gold); }
.social { color: var(--blue); }
.scope input:checked + span { border-color: #7c8990; background: linear-gradient(#353d43, #1b2023); box-shadow: inset 0 1px #64717c69; }
.scope input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.scope label:hover span { text-decoration: underline; }

.section-heading, .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .2rem .8rem;
  padding: .32rem .55rem;
  border-bottom: 1px solid #62686a;
  box-shadow: inset 0 1px #858e9352;
  background: linear-gradient(#3d4346, #272b2d 48%, #1a1d1e 49%, #0e1011);
}
.section-heading { flex-wrap: wrap; border: 1px solid var(--frame); }
.section-heading h2, .panel-head h2 { font-size: .975rem; font-weight: 600; line-height: 1.2; }
.section-heading p, .panel-head p { color: var(--muted); font-size: .8125rem; }
.panel-head p { margin-top: .05rem; }
.panel-total { color: var(--gold); font-size: .8125rem; text-align: end; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: .6rem;
  border: 1px solid #5d686d;
  border-top: 0;
  background: #111618;
}
.metrics div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .12rem .25rem;
  min-height: 2rem;
  padding: .25rem .45rem;
  background: linear-gradient(#3d4549, #31383c);
}
.metrics dt { color: #d7dfe3; font-size: .8125rem; }
.metrics dd { color: #fff; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: start; gap: .55rem; }
.career-column { display: grid; gap: .5rem; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--frame); background: var(--steel); }
.playlist-table th, .playlist-table td { padding-block: .21rem; }
.playlist-table thead th { text-align: right; }
.playlist-table thead th:first-child { text-align: left; }
.playlist-table th[scope="row"] { color: #e1e8eb; background: transparent; }
.playlist-table td { text-align: right; }
/* Playlist Skill: the level, with a bar to 50 under the playlist's name. */
.skill-table .skill-name { display: block; }
.skill-table .weapon-track { width: 100%; }
.skill-table td.ranked { font-weight: 700; }
.weapon-legend { display: flex; gap: .65rem; padding: .25rem .48rem 0; font-size: .75rem; }
.weapon-legend span::before {
  display: inline-block;
  width: .62rem;
  height: .37rem;
  margin-right: .25rem;
  border: 1px solid currentColor;
  background: currentColor;
  content: "";
}
.weapons { display: grid; gap: .18rem; padding: .26rem .35rem 0; }
.weapon-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.7rem minmax(3rem, auto);
  gap: .38rem;
  align-items: center;
  min-height: 2.34rem;
  padding: .13rem .35rem;
  border: 1px solid #51595e;
  box-shadow: inset 0 2px #090b0c;
  background: linear-gradient(100deg, #272a2c, #171819 58%, #222426);
  font-size: .875rem;
}
.weapon-row strong, .weapon-share { text-align: right; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.weapon-share { display: grid; font-size: .75rem; line-height: 1.15; }
.weapon-name, .weapon-track, .weapon-fill { display: block; }
.weapon-track { margin: .11rem 0; height: .22rem; background: #31383d; }
.weapon-fill { height: 100%; }
.weapon-track.ranked .weapon-fill { background: linear-gradient(#fff1ac, #dba835 54%, #8f6119); }
.weapon-track.social .weapon-fill { background: linear-gradient(#c1e5ff, #579ed0 54%, #26618e); }

.weapon-icon {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 1.25rem;
}
.weapon-icon:empty::before {
  width: .34rem;
  height: .34rem;
  background: #8295a0;
  transform: rotate(45deg);
  content: "";
}
.weapon-glyph {
  display: block;
  max-width: 100%;
  max-height: 1.25rem;
  object-fit: contain;
  filter: grayscale(1) sepia(1) saturate(2) hue-rotate(155deg) brightness(1.55);
}

.panel-button {
  min-height: 1.9rem;
  width: 100%;
  border: 0;
  color: var(--blue);
  background: none;
  font-size: .875rem;
  cursor: pointer;
}
.panel-button:hover { color: #e4f4ff; background: #252f37; text-decoration: underline; }
.panel-button:focus-visible { outline-offset: -3px; }

#medals { container-type: inline-size; }
.medal-legend { display: flex; gap: .7rem; padding: .35rem .55rem 0; font-size: .75rem; }
.medal-groups { display: grid; gap: .55rem; padding: .35rem; }
.medal-group h3 { margin: 0 0 .22rem; padding: 0 .18rem; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.medals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .23rem; margin: 0; padding: 0; list-style: none; }
@container (min-width: 27rem) {
  .medals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.medals li {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 3.3rem;
  padding: .19rem .35rem;
  border: 1px solid #586064;
  box-shadow: inset 0 2px #08090a, inset 0 -1px #373d41;
  background: linear-gradient(107deg, #111314, #1b1d1e 55%, #292d2f);
}

.medal-art {
  display: block;
  flex: none;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.medal-name { display: block; font-size: .8125rem; font-weight: 600; line-height: 1.15; }
.medal-values { display: grid; margin-top: .12rem; color: var(--muted); font-size: .75rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.medal-unavailable { font-style: italic; }

.history { margin-top: .6rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: .35rem .55rem; border-bottom: 1px solid #191c1e; }
th { color: #d7e3e9; background: #20272b; }
th.ranked { color: var(--gold); }
th.social { color: var(--blue); }
td { color: #ecf1f3; }
td time { display: block; color: var(--muted); font-size: .75rem; }
.history :is(td, th):nth-child(n+4) { text-align: right; }
tbody tr:nth-child(even) { background: #2c3337; }
tbody tr:last-child > * { border-bottom: 0; }
.result { display: inline-block; min-width: 3rem; padding: .05rem .3rem; text-align: center; border: 1px solid; }
.result.win { color: #d7ecbb; background: #283526; border-color: #5c774d; }
.result.loss { color: #f4c3b1; background: #3a2726; border-color: #875b50; }
.empty, .js-note { padding: .55rem; color: var(--muted); }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .75rem;
  padding: .45rem .7rem;
  border-block: 1px solid #465156;
  background: #131719;
  color: var(--muted);
  font-size: .75rem;
}
.art-credits { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.footer-disclaimer { flex-basis: 100%; }
.footer-disclaimer q { font-style: italic; }

@media (max-width: 43rem) {
  .masthead-inner, .record { width: calc(100% - 1rem); }
  .hero { padding-inline: .65rem; }
  .profile { grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem .65rem; margin-inline: .4rem; }
  .rank-art { width: 2.6rem; height: 2.6rem; }
  .profile-controls { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .career-sort { grid-column: 1 / -1; }
  .dashboard { padding-inline: .4rem; }
  .record-nav { margin-inline: -.4rem; padding-inline: .4rem; }
  .map-filter { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 28rem) {
  .masthead-inner, .record { width: 100%; }
  .masthead-inner { padding-inline: .55rem; }
  .brand-mark { width: 2rem; height: 2rem; }
  .brand-name { font-size: 1.25rem; }
  .record-nav a { padding-inline: .45rem; }
  .metrics div { align-items: start; flex-direction: column; }
  .weapon-row { grid-template-columns: 1.8rem minmax(0, 1fr) 2.5rem minmax(2.5rem, auto); }
}
