:root {
  --bg: #0d0f11;
  --bg-soft: #131619;
  --ink: #f4f5f4;
  --muted: rgba(244, 245, 244, 0.58);
  --faint: rgba(244, 245, 244, 0.13);
  --line: rgba(244, 245, 244, 0.16);
  --blue: #4d95bd;
  --blue-bright: #75c8ec;
  --gold: #c7ae55;
  --legendary: #5c356f;
  --max: 1920px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.008) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
}

.masthead {
  position: relative;
  z-index: 20;
  height: 40px;
  padding: 0 clamp(20px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.16);
  background: rgba(9, 11, 13, .83);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 500;
}

.brand-mark {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1px solid rgba(255,255,255,.8);
  transform: rotate(45deg);
}

.brand-mark::before { top: 2px; }
.brand-mark::after { bottom: 2px; }
.brand-mark i { left: 2px; top: 6px; }

.mast-actions {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}

.glyph-button {
  width: 36px;
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  color: rgba(255,255,255,.78);
  transition: color .18s ease, background .18s ease;
}

.glyph-button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.search-glyph {
  width: 13px;
  height: 13px;
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.search-glyph::after {
  content: "";
  width: 6px;
  height: 1.5px;
  position: absolute;
  right: -5px;
  bottom: -2px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: left center;
}

.layers span,
.layers span::before,
.layers span::after {
  width: 14px;
  height: 9px;
  display: block;
  border: 1px solid currentColor;
  transform: rotate(30deg) skewX(-30deg) scaleY(.86);
}

.layers span { position: relative; margin-top: -4px; }
.layers span::before,
.layers span::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 4px;
}

.layers span::after { top: 8px; }
.gear-glyph { font-size: 17px; line-height: 1; }

.profile-strip {
  min-height: 112px;
  position: relative;
  padding: 0 clamp(20px, 3vw, 48px);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 40px;
  background:
    linear-gradient(90deg, rgba(69, 22, 28, .96), rgba(60, 28, 36, .80) 44%, rgba(35, 21, 26, .88)),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(255,255,255,.08) 22px 24px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}

.profile-strip::before {
  content: "";
  position: absolute;
  left: 28%;
  width: 310px;
  height: 112px;
  opacity: .18;
  background: repeating-linear-gradient(135deg, #fff 0 5px, transparent 5px 12px);
  clip-path: polygon(22% 0, 100% 0, 78% 100%, 0 100%);
}

.profile-identity {
  min-width: 275px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.class-orbit {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
}

.class-orbit::before,
.class-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
}

.class-orbit::before { inset: -9px; }
.class-orbit::after { inset: 7px; }

.class-orbit i {
  width: 24px;
  height: 24px;
  display: block;
  background: rgba(255,255,255,.88);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateY(-2px);
}

.eyebrow {
  margin: 0 0 5px;
  color: rgba(255,255,255,.57);
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
}

.guardian-name {
  margin: 0;
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: .6px;
}

.global-nav {
  align-self: stretch;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  white-space: nowrap;
}

.global-nav a {
  height: 54px;
  padding: 0 13px;
  display: grid;
  place-items: center;
  position: relative;
  color: rgba(255,255,255,.62);
  transition: color .18s ease, background .18s ease;
}

.global-nav a:hover,
.global-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.035);
}

.global-nav a.active::after {
  content: "";
  height: 3px;
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  background: #fff;
}

.inspection {
  animation: inspect-in .65s cubic-bezier(.2,.75,.25,1) both;
}

@keyframes inspect-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.weapon-banner {
  height: clamp(275px, 34vw, 430px);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  background: #171b20 url("assets/midnight-coup.jpg") center 51% / cover no-repeat;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.weapon-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9,11,14,.98) 0%, rgba(9,11,14,.80) 25%, rgba(9,11,14,.10) 59%, rgba(9,11,14,.14) 100%),
    linear-gradient(0deg, rgba(6,8,10,.78), transparent 42%);
}

.weapon-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 48%, rgba(255,255,255,.07) 48.2%, transparent 48.4%);
}

.banner-wash {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -70px 80px rgba(0,0,0,.28);
}

.weapon-identity,
.weapon-meta {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(34px, 4vw, 58px);
}

.weapon-identity {
  padding-left: clamp(24px, 4vw, 72px);
  display: flex;
  align-items: flex-start;
  gap: clamp(17px, 2vw, 28px);
}

.weapon-icon {
  width: clamp(72px, 8vw, 108px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.82);
  box-shadow: 0 12px 30px rgba(0,0,0,.36);
}

.weapon-copy h1 {
  margin: -4px 0 5px;
  font-size: clamp(36px, 5.2vw, 72px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -1.8px;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0,0,0,.42);
}

.weapon-type {
  margin: 0 0 14px;
  font-size: clamp(15px, 1.8vw, 24px);
  color: rgba(255,255,255,.76);
  text-transform: uppercase;
}

.weapon-type span { color: var(--gold); margin: 0 7px; }

.weapon-copy blockquote {
  margin: 0;
  max-width: 430px;
  color: rgba(255,255,255,.56);
  font-size: 14px;
  font-style: italic;
  letter-spacing: .5px;
}

.weapon-meta {
  padding-right: clamp(24px, 4vw, 72px);
  display: flex;
  gap: clamp(20px, 2.6vw, 42px);
}

.meta-item {
  min-width: 82px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-item > span:first-child {
  color: var(--blue-bright);
  font-size: 24px;
}

.meta-item > span:last-child {
  display: flex;
  flex-direction: column;
}

.meta-item b {
  font-size: 19px;
  font-weight: 400;
  line-height: 1.05;
}

.meta-item small {
  margin-top: 4px;
  color: rgba(255,255,255,.48);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.data-surface {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 48px clamp(24px, 3.5vw, 68px) 80px;
  display: grid;
  grid-template-columns: minmax(340px, 4fr) minmax(620px, 7fr);
  gap: clamp(42px, 5vw, 86px);
}

.section-heading {
  min-height: 31px;
  margin-bottom: 17px;
  padding-bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .2px;
}

.section-heading span {
  color: rgba(255,255,255,.35);
  font-size: 11px;
}

.stat-list { margin-bottom: 40px; }

.stat {
  min-height: 24px;
  display: grid;
  grid-template-columns: minmax(130px, 40%) 1fr;
  align-items: center;
  gap: 15px;
  color: rgba(255,255,255,.66);
  font-size: 13px;
}

.stat-track {
  height: 15px;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.055);
  overflow: hidden;
}

.stat-track i {
  width: var(--value);
  height: 100%;
  display: block;
  background: rgba(255,255,255,.91);
  transform-origin: left;
  animation: stat-grow .6s .25s ease-out both;
}

@keyframes stat-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.stat-track b {
  position: absolute;
  right: 5px;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 400;
  mix-blend-mode: difference;
}

.stat-number strong {
  color: #fff;
  font-size: 16px;
  font-weight: 400;
}

.selected-detail {
  min-height: 132px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 16px 16px;
}

.detail-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.detail-main {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: start;
}

.detail-main img {
  width: 52px;
  height: 52px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  background: #254e63;
}

.detail-main h3 {
  margin: 1px 0 6px;
  font-size: 17px;
  font-weight: 400;
}

.detail-main p {
  margin: 0;
  max-width: 440px;
  color: rgba(255,255,255,.48);
  font-size: 12px;
  line-height: 1.5;
}

.perk-heading { align-items: flex-end; }
.perk-heading > div:first-child { display: grid; gap: 3px; }

.state-key {
  display: flex;
  gap: 14px;
}

.state-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.state-key i {
  width: 12px;
  height: 12px;
  display: inline-block;
  position: relative;
  border-radius: 50%;
}

.key-selected { border: 2px solid #fff; }
.key-recommended { border: 1px solid var(--gold); }
.key-recommended::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: -3px;
  right: -2px;
  background: var(--gold);
  transform: rotate(45deg);
}

.perk-pool {
  display: grid;
  gap: 9px;
}

.perk-row {
  min-height: 69px;
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,.105);
}

.perk-row::after {
  content: "";
  position: absolute;
  left: 118px;
  right: 0;
  top: 9px;
  bottom: 9px;
  opacity: .58;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 15px 15px;
}

.perk-label {
  position: relative;
  z-index: 2;
  color: rgba(255,255,255,.47);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.perk-options {
  min-width: 0;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.perk-options::-webkit-scrollbar { display: none; }

.perk-button {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50%;
  background: rgba(32, 78, 104, .88);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.perk-button::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid transparent;
  border-radius: inherit;
  transition: border-color .18s ease, transform .18s ease;
  transform: scale(.9);
}

.perk-button img {
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  border-radius: inherit;
  filter: brightness(1.18);
  pointer-events: none;
}

.perk-button:hover,
.perk-button:focus-visible {
  z-index: 3;
  transform: scale(1.08);
  background: #39799b;
  border-color: #fff;
}

.perk-button.is-selected {
  background: #3b88b0;
  border-color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}

.perk-button.is-selected::before {
  border-color: #fff;
  transform: scale(1);
}

.perk-button.is-recommended {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(199,174,85,.45);
}

.perk-button.is-recommended::after {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  top: -5px;
  right: 1px;
  z-index: 3;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg);
  transform: rotate(45deg);
}

.perk-button.is-selected.is-recommended::before {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--gold);
}

.roll-section { margin-top: 46px; }
.roll-status {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .4px;
}

.roll-list { display: grid; gap: 5px; }

.roll-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 122px 1fr 22px;
  align-items: center;
  text-align: left;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.11);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.roll-button:hover {
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.roll-button.is-active {
  background: linear-gradient(90deg, rgba(199,174,85,.25), rgba(255,255,255,.055) 54%);
  box-shadow: inset 3px 0 0 var(--gold), inset 0 0 0 1px rgba(199,174,85,.32);
}

.roll-title {
  display: grid;
  gap: 4px;
  color: #fff;
  font-size: 14px;
}

.roll-title small {
  color: rgba(255,255,255,.38);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.roll-perks {
  display: flex;
  gap: 8px;
  color: rgba(255,255,255,.66);
  font-size: 12px;
}

.roll-perks span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: rgba(255,255,255,.22);
}

.roll-arrow {
  color: rgba(255,255,255,.3);
  font-size: 20px;
}

.roll-button.is-active .roll-arrow { color: var(--gold); }

.action-bar {
  min-height: 62px;
  padding: 0 clamp(24px, 3.5vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255,255,255,.11);
  background: #08090a;
  color: rgba(255,255,255,.47);
}

.action-bar p {
  margin: 0;
  font-size: 11px;
}

.action-bar > div {
  display: flex;
  align-items: center;
  gap: 24px;
}

.action-bar button,
.action-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: rgba(255,255,255,.76);
  font-size: 12px;
}

.control-key {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.58);
  font-size: 9px;
}

.perk-tooltip {
  max-width: 240px;
  padding: 8px 10px;
  position: fixed;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translate(10px, 10px);
  background: rgba(15,17,19,.97);
  border-top: 3px solid var(--blue);
  box-shadow: 0 14px 30px rgba(0,0,0,.48), inset 0 0 0 1px rgba(255,255,255,.12);
  color: rgba(255,255,255,.68);
  font-size: 11px;
  line-height: 1.4;
  transition: opacity .12s ease;
}

.perk-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.perk-tooltip.visible { opacity: 1; }

@media (max-width: 1260px) {
  .profile-strip { display: block; min-height: 128px; padding-top: 14px; }
  .profile-identity { height: 61px; }
  .class-orbit { width: 48px; height: 48px; flex-basis: 48px; }
  .class-orbit i { width: 18px; height: 18px; }
  .global-nav { height: 53px; overflow-x: auto; scrollbar-width: none; }
  .global-nav::-webkit-scrollbar { display: none; }
  .global-nav a:first-child { padding-left: 0; }
  .data-surface { grid-template-columns: minmax(300px, 2fr) minmax(570px, 3.4fr); gap: 44px; }
  .weapon-meta .hide-small { display: none; }
}

@media (max-width: 980px) {
  .weapon-banner { height: 380px; align-items: flex-end; }
  .weapon-banner::before { background: linear-gradient(90deg, rgba(9,11,14,.96), rgba(9,11,14,.48) 52%, rgba(9,11,14,.12)), linear-gradient(0deg, rgba(6,8,10,.82), transparent 52%); }
  .weapon-identity { margin-bottom: 38px; }
  .weapon-meta { position: absolute; right: 0; top: 26px; margin: 0; }
  .data-surface { grid-template-columns: 1fr; }
  .weapon-readout { display: grid; grid-template-columns: 1fr 1fr; column-gap: 42px; }
  .weapon-readout > .section-heading { grid-column: 1 / -1; }
  .selected-detail { border-top: 0; padding: 10px 0 0 20px; border-left: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .masthead { padding: 0 16px; }
  .profile-strip { padding-left: 20px; padding-right: 0; }
  .profile-identity { gap: 14px; }
  .guardian-name { font-size: 20px; }
  .global-nav { margin-right: 0; padding-right: 20px; }
  .global-nav a { height: 48px; padding: 0 10px; font-size: 13px; }
  .weapon-banner { height: 390px; background-position: 63% center; }
  .weapon-banner::before { background: linear-gradient(90deg, rgba(9,11,14,.93), rgba(9,11,14,.44) 78%, rgba(9,11,14,.22)), linear-gradient(0deg, rgba(6,8,10,.93), transparent 65%); }
  .weapon-identity { width: 100%; padding: 0 20px; margin-bottom: 28px; align-items: flex-end; }
  .weapon-icon { width: 64px; border-width: 2px; }
  .weapon-copy { min-width: 0; }
  .weapon-copy h1 { margin-top: 0; font-size: clamp(30px, 10vw, 45px); letter-spacing: -1px; }
  .weapon-copy .eyebrow { font-size: 9px; }
  .weapon-copy blockquote { display: none; }
  .weapon-meta { left: 20px; right: auto; top: 20px; padding: 0; gap: 19px; }
  .meta-item { min-width: 0; }
  .meta-item > span:first-child { font-size: 19px; }
  .meta-item b { font-size: 15px; }
  .data-surface { padding: 34px 20px 55px; gap: 42px; }
  .weapon-readout { display: block; }
  .stat { grid-template-columns: 142px 1fr; }
  .selected-detail { margin-top: 32px; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .perk-heading { align-items: flex-start; flex-direction: column; }
  .state-key { width: 100%; justify-content: flex-start; }
  .perk-row { grid-template-columns: 86px 1fr; }
  .perk-row::after { left: 86px; }
  .perk-options { padding: 5px 5px 5px 0; }
  .perk-button { width: 46px; height: 46px; flex-basis: 46px; }
  .roll-section { margin-top: 36px; }
  .roll-button { grid-template-columns: 86px 1fr 16px; padding: 11px; }
  .roll-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 9px; }
  .roll-perks span::after { display: none; }
  .action-bar { min-height: 88px; padding: 15px 20px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .action-bar > div { width: 100%; justify-content: space-between; gap: 12px; }
}

@media (max-width: 420px) {
  .mast-actions .glyph-button:nth-child(2) { display: none; }
  .weapon-banner { height: 360px; }
  .weapon-icon { display: none; }
  .weapon-identity { gap: 0; }
  .weapon-type { font-size: 14px; }
  .weapon-meta { gap: 17px; }
  .stat { grid-template-columns: 128px 1fr; gap: 9px; font-size: 12px; }
  .perk-row { grid-template-columns: 72px 1fr; }
  .perk-row::after { left: 72px; }
  .perk-label { font-size: 9px; }
  .roll-button { grid-template-columns: 74px 1fr 10px; }
  .roll-title { font-size: 12px; }
  .roll-perks { font-size: 10px; }
}

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