:root {
  color-scheme: dark;
  --base: #161616;
  --subtle: #1c1c1c;
  --surface: #232323;
  --surface-hover: #292929;
  --line: #343434;
  --border: #414141;
  --muted: #a0a0a0;
  --text: #eeeeee;
  --accent: #149cff;
  --accent-soft: #0d3754;
  --legendary: #6a4878;
  --gold: #d7ba58;
  --green: #66d2a3;
  --radius: 11px;
  --shadow: 0 20px 60px rgb(0 0 0 / 28%);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--base); color: var(--text); font-size: 14px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header {
  height: 64px; padding: 0 max(20px, calc((100vw - 1500px) / 2)); display: flex; align-items: stretch;
  position: sticky; top: 0; z-index: 50; background: rgb(22 22 22 / 92%); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: .11em; margin-right: 40px; }
.brand svg { width: 27px; fill: var(--accent); }
.brand b { color: var(--muted); font-size: 9px; border: 1px solid var(--border); padding: 3px 5px; border-radius: 4px; letter-spacing: .06em; }
.global-nav { display: flex; align-items: stretch; gap: 4px; }
.global-nav a { color: var(--muted); text-decoration: none; padding: 0 16px; display: flex; align-items: center; text-transform: uppercase; font-size: 11px; font-weight: 650; letter-spacing: .08em; border-bottom: 2px solid transparent; }
.global-nav a:hover { color: var(--text); background: var(--subtle); }
.global-nav a.active { color: var(--text); border-color: var(--accent); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-button, .icon-button { height: 34px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.search-button { width: 210px; padding: 0 9px; text-align: left; }
.search-button svg, .icon-button svg, .button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-button kbd { margin-left: auto; background: var(--subtle); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: 10px; }
.icon-button { width: 34px; justify-content: center; }

main { max-width: 1500px; margin: 0 auto; padding: 0 28px 80px; }
.breadcrumbs { height: 52px; display: flex; align-items: center; gap: 10px; color: #777; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.breadcrumbs i { color: #464646; }
.breadcrumbs strong { color: var(--muted); }

.weapon-hero { min-height: 410px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: minmax(330px, .76fr) minmax(560px, 1.4fr); background: linear-gradient(135deg, #29222d, #1a1b1e 58%, #141719); box-shadow: var(--shadow); position: relative; }
.weapon-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 48%, rgb(255 255 255 / 3%) 48.2%, transparent 48.4%), repeating-linear-gradient(90deg, transparent 0 89px, rgb(255 255 255 / 2%) 90px); }
.identity { padding: clamp(34px, 4vw, 62px); z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.rarity, .eyebrow { display: block; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .15em; margin-bottom: 11px; }
.rarity { color: #c6a7d1; }
h1 { font-size: clamp(35px, 4vw, 62px); letter-spacing: -.045em; line-height: .93; margin: 0 0 14px; max-width: 500px; }
.identity > p { margin: 0; color: #c4c4c4; font-weight: 550; }
.identity > p i { color: #666; margin: 0 8px; }
blockquote { margin: 40px 0 30px; padding-left: 15px; border-left: 2px solid var(--legendary); color: var(--muted); font-style: italic; line-height: 1.6; }
.hero-actions { display: flex; gap: 8px; }
.button { height: 38px; padding: 0 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 650; }
.button:hover { background: var(--surface-hover); border-color: #5b5b5b; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #06121a; }
.button.primary:hover { filter: brightness(1.12); }
.weapon-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 380px; overflow: hidden; }
.weapon-art::after { content: ""; width: 500px; height: 500px; position: absolute; border: 1px solid rgb(255 255 255 / 6%); border-radius: 50%; box-shadow: 0 0 0 80px rgb(255 255 255 / 1%), 0 0 0 160px rgb(255 255 255 / 1%); }
.cannon { width: min(95%, 860px); height: auto; z-index: 2; transform: rotate(-1deg); animation: settle .75s cubic-bezier(.2,.75,.25,1) both; }
@keyframes settle { from { opacity: 0; transform: translateX(30px) rotate(-1deg); } }
.power { position: absolute; right: 28px; top: 25px; z-index: 3; text-align: right; }
.power span { display: block; color: var(--muted); letter-spacing: .14em; font-size: 8px; font-weight: 750; }
.power strong { font-size: 25px; color: var(--gold); }
.watermark { position: absolute; right: 28px; bottom: 23px; color: #6f6f6f; font-size: 8px; letter-spacing: .17em; font-weight: 700; z-index: 3; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; margin-top: 18px; align-items: start; min-width: 0; }
.workspace > *, .editor-column, .stats-column { min-width: 0; }
.editor-column, .stats-card, .frame-card, .legend-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--subtle); }
.editor-column { padding: clamp(20px, 3vw, 34px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h2, .stats-header h2 { margin: 0; letter-spacing: -.02em; font-size: 22px; }
.section-heading .eyebrow, .stats-header .eyebrow { margin-bottom: 6px; }
.section-copy { color: var(--muted); margin: 9px 0 25px; }
.mode-toggle { display: flex; background: var(--base); border: 1px solid var(--line); padding: 3px; border-radius: 6px; }
.mode-toggle button { color: var(--muted); background: none; border: 0; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; }
.mode-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px #000; }

.perk-grid { display: grid; grid-template-columns: repeat(5, minmax(106px, 1fr)); gap: 16px; align-items: start; }
.perk-column { min-width: 0; }
.perk-column > header { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.perk-column > header b { color: #666; font-size: 9px; }
.perk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.perk-column:last-child .perk-list { grid-template-columns: 1fr; }
.perk { aspect-ratio: 1; min-width: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: #9b9b9b; display: grid; place-items: center; cursor: pointer; position: relative; transition: 130ms ease; padding: 10px; }
.perk svg { width: 75%; height: 75%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.perk::after { content: attr(data-name); position: absolute; z-index: 10; left: 50%; bottom: calc(100% + 9px); transform: translate(-50%, 4px); width: max-content; max-width: 190px; padding: 7px 9px; color: var(--text); background: #090909; border: 1px solid var(--border); border-radius: 5px; font-size: 10px; line-height: 1.25; opacity: 0; pointer-events: none; transition: 120ms ease; box-shadow: 0 8px 25px #000; }
.perk:hover { color: var(--text); border-color: #616161; transform: translateY(-1px); }
.perk:hover::after, .perk:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.perk.recommended { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgb(215 186 88 / 16%); }
.perk.recommended::before { content: ""; width: 5px; height: 5px; position: absolute; top: 5px; right: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.perk.selected { background: var(--accent-soft); border-color: var(--accent); color: #e7f6ff; box-shadow: inset 0 0 0 1px rgb(20 156 255 / 20%), 0 0 14px rgb(20 156 255 / 10%); }
.perk.selected::before { content: "✓"; position: absolute; top: 3px; right: 5px; color: var(--accent); font-size: 10px; font-weight: 800; }

.selection-strip { min-height: 54px; margin-top: 20px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--base); }
.selection-strip span { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.selection-strip strong { font-size: 11px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-strip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 10px; }
.selection-strip button:hover { color: var(--text); }

.recommended-block { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.section-heading.compact { margin-bottom: 16px; }
.roll-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.roll-tabs button { min-width: 0; padding: 14px 15px; text-align: left; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.roll-tabs button:hover { border-color: var(--border); background: var(--surface-hover); }
.roll-tabs button[aria-selected="true"] { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); color: var(--text); }
.roll-tabs span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.roll-tabs strong { font-size: 13px; }
.roll-tabs small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-detail { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.roll-detail > div { position: relative; padding: 14px 10px 14px 41px; border-right: 1px solid var(--line); min-width: 0; }
.roll-detail > div:last-child { border: 0; }
.roll-detail span { position: absolute; left: 12px; top: 18px; color: #555; font-size: 11px; font-weight: 700; }
.roll-detail small { display: block; color: var(--muted); font-size: 7px; font-weight: 750; letter-spacing: .12em; margin-bottom: 5px; }
.roll-detail strong { display: block; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.stats-column { display: grid; gap: 12px; position: sticky; top: 82px; }
.stats-card { padding: 23px; }
.stats-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.rpm { color: var(--text); font-size: 20px; text-align: right; }
.rpm small { display: block; color: var(--muted); font-size: 7px; letter-spacing: .12em; }
.stat-row { display: grid; grid-template-columns: 115px 1fr 27px; align-items: center; gap: 10px; margin: 13px 0; }
.stat-row label { color: #b8b8b8; font-size: 10px; }
.bar { height: 4px; background: #353535; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #a5a5a5, #e2e2e2); transform-origin: left; animation: bar-in .7s ease both; }
@keyframes bar-in { from { transform: scaleX(0); } }
.stat-row strong { text-align: right; font-size: 11px; }
.magazine-stat { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.magazine-stat span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.magazine-stat strong { font-size: 19px; }
.frame-card { padding: 18px; display: flex; gap: 14px; }
.frame-card svg { width: 37px; flex: 0 0 auto; fill: var(--gold); }
.frame-card span { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.frame-card strong { display: block; margin: 4px 0; font-size: 12px; }
.frame-card p { color: var(--muted); font-size: 10px; line-height: 1.4; margin: 0; }
.legend-card { padding: 13px 15px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 9px; }
.legend-card span { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.selected { background: var(--accent); }.dot.recommended { background: var(--gold); }.dot.available { border: 1px solid #777; }

footer { min-height: 68px; border-top: 1px solid var(--line); color: #707070; display: flex; justify-content: space-between; align-items: center; padding: 0 max(28px, calc((100vw - 1444px) / 2)); font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; background: #ececec; color: #151515; border-radius: 6px; padding: 10px 15px; font-size: 11px; font-weight: 650; transition: 180ms ease; pointer-events: none; box-shadow: 0 8px 30px #000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .global-nav a { padding: 0 10px; }
  .search-button { width: 38px; justify-content: center; }.search-button span,.search-button kbd { display: none; }
  .weapon-hero { grid-template-columns: .8fr 1.2fr; }
  .workspace { grid-template-columns: 1fr 310px; }
  .perk-grid { grid-template-columns: repeat(4, 1fr); }.perk-column:last-child { grid-column: span 4; }.perk-column:last-child .perk-list { grid-template-columns: repeat(7, 1fr); }
  .roll-detail { grid-template-columns: repeat(2, 1fr); }.roll-detail > div:nth-child(2) { border-right: 0; }.roll-detail > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .site-header { height: auto; min-height: 58px; padding: 0 15px; flex-wrap: wrap; }
  .brand { margin-right: 0; min-height: 58px; }.brand span { font-size: 12px; }.brand b { display: none; }
  .header-tools { min-height: 58px; }.global-nav { order: 3; width: calc(100% + 30px); margin: 0 -15px; height: 42px; overflow-x: auto; border-top: 1px solid var(--line); }
  .global-nav a { flex: 1; justify-content: center; min-width: 80px; font-size: 9px; }
  main { padding: 0 12px 55px; }.breadcrumbs { height: 42px; overflow: hidden; white-space: nowrap; }
  .weapon-hero { display: flex; flex-direction: column; min-height: 0; }
  .identity { padding: 28px 23px 0; }.identity > p { font-size: 11px; }h1 { font-size: 40px; }
  blockquote { margin: 22px 0; }.hero-actions { position: absolute; z-index: 5; bottom: 18px; left: 20px; }
  .weapon-art { min-height: 270px; }.power { top: 20px; right: 18px; }.watermark { right: 18px; bottom: 15px; }.cannon { width: 110%; }
  .workspace { grid-template-columns: minmax(0, 1fr); width: 100%; }.editor-column { padding: 20px 14px; overflow: hidden; }
  .stats-column { position: static; grid-row: 1; }.stats-card { padding: 20px; }.frame-card,.legend-card { display: none; }
  .perk-grid { grid-template-columns: repeat(2, 1fr); gap: 15px 12px; }.perk-column:last-child { grid-column: span 2; }.perk-column:last-child .perk-list { grid-template-columns: repeat(4, 1fr); }
  .selection-strip { grid-template-columns: 1fr auto; }.selection-strip span { grid-column: span 2; }.selection-strip strong { font-size: 9px; }
  .roll-tabs { grid-template-columns: 1fr; }.roll-tabs button { display: grid; grid-template-columns: 80px 1fr; align-items: center; }.roll-tabs button small { grid-column: 2; }
  .roll-detail { grid-template-columns: 1fr 1fr; }
  footer { padding: 18px; display: grid; gap: 7px; }
}

@media (max-width: 410px) {
  .icon-button { display: none; }.perk-list { gap: 5px; }.perk { padding: 7px; }.weapon-art { min-height: 240px; }.hero-actions .button:last-child { display: none; }
}

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