:root {
  --ink: #efe6d2;
  --ink-dim: #b9aa8c;
  --ink-faint: #a09074;
  --bg: #0e0a08;
  --card: #18110c;
  --card-hi: #221810;
  --line: #3d2f21;
  --blood: #a3201b;
  --blood-hi: #d2392f;
  --brass: #c79a4b;
  --brass-hi: #e8bf6a;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --head: "IM Fell English SC", Georgia, serif;
  --gothic: "UnifrakturMaguntia", Georgia, serif;
  --r: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  color: var(--ink); font: 17px/1.55 var(--body); font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(180deg, rgba(14, 10, 8, .78), rgba(14, 10, 8, .97) 420px), url(img/fankit/bg-forest.webp) top center / cover fixed, var(--bg);
}
#embers { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.top, main, .foot { position: relative; z-index: 1; }
main { flex: 1; min-height: 100vh; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 20px 40px; }
a { color: var(--brass-hi); }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
h1 { font: 400 clamp(30px, 4.4vw, 44px)/1.1 var(--head); margin: 18px 0 8px; color: #f6ecd6; letter-spacing: .01em; }
h2 { font: 400 clamp(22px, 2.6vw, 28px)/1.2 var(--head); margin: 28px 0 10px; color: var(--brass-hi); }
.lead { color: var(--ink-dim); font-size: 18px; margin: 0 0 14px; max-width: 760px; }
.tiny { color: var(--ink-faint); font-size: 14px; margin: 6px 0 10px; }

/* header + navigation */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px 20px;
  background: rgba(12, 9, 7, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 52px; height: auto; }
.brand b { display: block; font: 400 26px/1 var(--gothic); color: #f6ecd6; }
.brand small { display: block; color: var(--ink-faint); font-size: 13px; margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-dim); font: 500 17px var(--body); padding: 8px 14px; border-radius: var(--r);
  letter-spacing: .02em;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.nav a[aria-current=page] { color: #fff6e6; background: var(--blood); }

/* segmented filters / pills */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .seg a {
  background: var(--card); border: 1px solid var(--line); color: var(--ink-dim); text-decoration: none;
  padding: 7px 14px; border-radius: 999px; font: 500 15px var(--body);
}
.seg button:hover, .seg a:hover { color: var(--ink); border-color: var(--brass); }
.seg [aria-pressed=true], .seg [aria-current=true] { background: var(--blood); border-color: var(--blood-hi); color: #fff6e6; }

/* weapon cards (in-game arsenal style) */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 6px 0 4px; }
.filters input, .dlg-head input {
  background: var(--card); border: 1px solid var(--line); color: var(--ink); padding: 9px 14px; border-radius: 999px;
  font: 16px var(--body); min-width: 240px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.wcard {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, var(--card-hi), var(--card)); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, transform .15s;
}
.wcard:hover { border-color: var(--brass); transform: translateY(-2px); }
.wimg { display: grid; place-items: center; height: 64px; margin-bottom: 6px;
  background: radial-gradient(ellipse at center, rgba(199, 154, 75, .12), transparent 70%); }
.wimg img { max-height: 60px; width: auto; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .7)); }
.wname { font: 500 16px/1.2 var(--body); }
.wmeta { color: var(--ink-faint); font-size: 13px; }

/* weapon page */
.back { display: inline-block; margin-top: 14px; text-decoration: none; color: var(--ink-dim); }
.whead { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 24px; align-items: center; margin-top: 8px; }
.wbig { background: radial-gradient(ellipse at center, rgba(199, 154, 75, .16), transparent 70%); padding: 18px; text-align: center; }
.wbig img { width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .8)); }
.wtitle h1 { margin-top: 0; }
.ammo { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ammocard { display: block; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.ammocard span { display: block; color: var(--ink-faint); font-size: 14px; }
.ammocard[aria-current=true] { border-color: var(--blood-hi); box-shadow: inset 0 0 0 1px var(--blood-hi); }
.stats { display: grid; gap: 8px; margin: 18px 0 4px; max-width: 620px; }
.stat { display: grid; grid-template-columns: 140px 1fr 90px; gap: 12px; align-items: center; font-size: 15px; color: var(--ink-dim); }
.stat .bar { height: 8px; background: #241a12; border-radius: 4px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blood), var(--brass-hi)); }
.stat b { font-weight: 500; color: var(--ink); text-align: right; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cta { display: inline-block; margin-top: 14px; padding: 10px 18px; background: var(--blood); color: #fff6e6; text-decoration: none; border-radius: var(--r); font-weight: 500; }
.cta:hover { background: var(--blood-hi); }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 7px 10px; text-align: right; border-bottom: 1px solid rgba(61, 47, 33, .8); white-space: nowrap; }
th { color: var(--brass); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: rgba(163, 32, 27, .12); }
.scroll { overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; background: rgba(0, 0, 0, .35); border-radius: var(--r); }
.chart text { font: 12px var(--body); fill: var(--ink-faint); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0; font-size: 14px; color: var(--ink-dim); }
.legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; background: var(--c); vertical-align: middle; margin-right: 6px; }

/* aim guide */
.gunpick { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.gunbtn {
  display: flex; align-items: center; gap: 12px; min-width: 300px; padding: 8px 14px; text-align: left;
  background: linear-gradient(180deg, var(--card-hi), var(--card)); border: 1px solid var(--brass); border-radius: var(--r);
  text-transform: none; letter-spacing: 0;
}
.gunbtn img { width: 120px; height: auto; filter: drop-shadow(0 2px 3px #000); }
.gunbtn span { font: 500 17px/1.2 var(--body); color: var(--ink); }
.gunbtn small { display: block; color: var(--ink-faint); font-size: 13px; font-weight: 400; }
.gunbtn em { margin-left: auto; font-style: normal; color: var(--brass-hi); font-size: 14px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.preset { padding: 0; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; text-align: left; }
.preset img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .8; }
.preset span { display: block; padding: 6px 10px 8px; }
.preset b { color: var(--ink); display: block; font-weight: 500; font-size: 15px; line-height: 1.2; }
.preset small { color: var(--ink-faint); font-size: 13px; }
.preset:hover img, .preset[aria-pressed=true] img { opacity: 1; }
.preset[aria-pressed=true] { border-color: var(--blood-hi); }
.shot { position: relative; margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: #000; }
.shot img, .shot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shot img { object-fit: cover; }
.aimtxt { font: 700 32px var(--body); fill: #ff3b30; paint-order: stroke; stroke: #000; stroke-width: 6px; letter-spacing: .05em; }
.answer { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; margin: 14px 0 4px; }
.answer b { color: var(--brass-hi); font-weight: 500; }
.facts { color: var(--ink-dim); font-size: 15px; margin: 0; }

/* gun picker dialog */
dialog { width: min(1000px, 94vw); max-height: 86vh; padding: 0; background: var(--bg); color: var(--ink); border: 1px solid var(--brass); border-radius: 10px; }
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); }
.dlg-head { position: sticky; top: 0; display: flex; gap: 10px; padding: 12px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 1; }
.dlg-head input { flex: 1; }
.x { background: none; border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; font-size: 22px; }
#dgrid { padding: 12px; }

/* season */
.bullets { padding-left: 20px; color: var(--ink-dim); }
.bp { display: grid; gap: 4px; margin-top: 12px; }
.badge { font-size: 12px; text-align: center; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-dim); }
.badge.prem { border-color: var(--blood-hi); color: var(--blood-hi); }

/* about */
.method .engraving { float: right; width: min(380px, 42%); height: auto; margin: 0 0 12px 18px; filter: sepia(.5) brightness(.85); border-radius: var(--r); }
.method ul { padding-left: 20px; }
.method li { margin-bottom: 8px; }
.legal .foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; font-size: 14px; color: var(--ink-dim); clear: both; }
.legal h4 { font: 500 16px var(--body); color: var(--brass); margin: 0 0 4px; }
.legal p { margin: 0 0 8px; }

.foot { border-top: 1px solid var(--line); background: rgba(8, 6, 4, .96); padding: 18px 20px; text-align: center; font-size: 13px; color: var(--ink-faint); }
.foot p { margin: 0 0 4px; }

@media (max-width: 860px) {
  .whead, .cols { grid-template-columns: 1fr; }
  .stat { grid-template-columns: 110px 1fr 80px; }
}
@media (max-width: 720px) {
  .top { backdrop-filter: none; background: rgba(12, 9, 7, .97); }
  body { font-size: 16px; background-attachment: scroll; padding-bottom: 64px; }
  main { padding: 4px 14px 28px; }
  .top { padding: 8px 14px; }
  .brand img { width: 40px; }
  .brand b { font-size: 22px; }
  /* phone: app-style bottom tab bar */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; justify-content: space-around;
    background: rgba(12, 9, 7, .97); border-top: 1px solid var(--line); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
  .nav a { font-size: 14px; padding: 10px 6px; flex: 1; text-align: center; border-radius: 0; }
  .nav a[aria-current=page] { background: none; color: var(--blood-hi); box-shadow: inset 0 3px 0 var(--blood-hi); }
  .gunbtn { min-width: 0; width: 100%; }
  .gunpick { width: 100%; }
  .presets { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .filters input { min-width: 0; width: 100%; }
  .method .engraving { float: none; width: 100%; margin: 0 0 12px; }
  .aimtxt { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .wcard { transition: none; } }

/* cinematic view banners */
.vhero { position: relative; margin: 0 -20px 18px; padding: clamp(40px, 9vw, 110px) 20px 22px;
  background: linear-gradient(90deg, rgba(14, 10, 8, .92) 0%, rgba(14, 10, 8, .7) 45%, rgba(14, 10, 8, .15) 100%),
    linear-gradient(180deg, transparent 50%, var(--bg)), var(--h) center 30% / cover;
  border-bottom: 1px solid var(--line); animation: heroIn .7s ease-out both; }
.vhero h1 { color: #fff3dc; margin: 0 0 6px; font-size: clamp(36px, 6vw, 64px); text-shadow: 0 3px 18px rgba(0, 0, 0, .9); }
.vhero .lead { color: var(--ink); text-shadow: 0 1px 6px #000; }
.kicker { margin: 0; font: 500 14px var(--body); letter-spacing: .25em; text-transform: uppercase; color: var(--blood-hi); text-shadow: 0 1px 4px #000; }
@keyframes heroIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stat .bar i { transform-origin: left; animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.wcard { position: relative; overflow: hidden; }
.wcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(232, 191, 106, .14) 50%, transparent 60%);
  transform: translateX(-100%); transition: transform .5s; pointer-events: none; }
.wcard:hover::after { transform: translateX(100%); }
.wcard:hover { box-shadow: 0 6px 24px rgba(210, 57, 47, .25); }
.wcard:hover .wimg img { transform: scale(1.06); }
.wimg img { transition: transform .25s; }
.grid .wcard { animation: cardIn .4s ease-out both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
@media (max-width: 720px) { .vhero { margin: 0 -14px 14px; padding: 56px 14px 16px; } }
@media (prefers-reduced-motion: reduce) { .vhero, .grid .wcard, .stat .bar i { animation: none; } }

/* aim guide layout: stage + sidebar */
.vhero.slim { padding-top: clamp(28px, 5vw, 60px); padding-bottom: 14px; }
.vhero.slim .lead { margin-bottom: 0; }
.aimgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.side { display: grid; gap: 16px; position: sticky; top: 84px; }
.side .presets { grid-template-columns: 1fr; margin: 0; max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 4px; }
.side .preset { display: grid; grid-template-columns: 112px 1fr; align-items: center; }
.side .preset img { aspect-ratio: 16 / 9; }
.gunbtn { min-width: 0; width: 100%; padding: 12px 14px; box-shadow: 0 0 0 1px rgba(232, 191, 106, .2), 0 8px 24px rgba(0, 0, 0, .4); }
.gunbtn img { width: 130px; }
.gunbtn:hover { border-color: var(--brass-hi); box-shadow: 0 0 0 1px var(--brass-hi), 0 8px 24px rgba(210, 57, 47, .25); }
@media (max-width: 980px) {
  .aimgrid { grid-template-columns: 1fr; }
  .side { position: static; order: -1; }
  .side .presets { display: flex; overflow-x: auto; max-height: none; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .side .preset { flex: 0 0 200px; display: block; scroll-snap-align: start; }
}
.side .preset span { padding: 6px 10px; }
.side .preset b { font-size: 15px; }
.preset { transition: border-color .15s, transform .15s; }
.preset:hover { border-color: var(--brass); transform: translateX(2px); }

/* battle pass track */
.bp { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.bpcard { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .15s, border-color .15s; }
.bpcard:hover { transform: translateY(-3px); border-color: var(--brass); }
.bpcard.prem { border-color: rgba(210, 57, 47, .45); }
.bpcard.prem:hover { border-color: var(--blood-hi); box-shadow: 0 8px 26px rgba(210, 57, 47, .25); }
.bpart { aspect-ratio: 16 / 10; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(199, 154, 75, .15), #0b0806 75%); }
.bpart img { width: 100%; height: 100%; object-fit: cover; }
.bpart img[src$=".png"] { object-fit: contain; padding: 10px; filter: drop-shadow(0 4px 6px #000); }
.noart { padding: 12px; text-align: center; font: 400 18px var(--head); color: var(--brass-hi); }
.ribbon { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 2px 10px; border-radius: 999px; font: 700 11px var(--body);
  letter-spacing: .14em; text-transform: uppercase; background: rgba(0, 0, 0, .7); color: var(--ink-dim); border: 1px solid var(--line); }
.prem .ribbon { background: var(--blood); color: #fff6e6; border-color: var(--blood-hi); }
.bptext { padding: 8px 10px 0; }
.bptext b { display: block; font-weight: 500; line-height: 1.2; }
.bptext small { color: var(--ink-faint); font-size: 13px; }
.bpfoot { margin-top: auto; display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px 10px; font-size: 13px; color: var(--ink-faint); }
.bpfoot a { text-decoration: none; }
@media (max-width: 720px) { .bp { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.bpart { aspect-ratio: auto; height: 150px; overflow: hidden; }
.bpart img { max-height: 150px; }
/* in-game style ammo colours and slot pips */
.wmeta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.atag { font-size: 12px; padding: 0 7px; border-radius: 3px; border: 1px solid; line-height: 18px; }
.atag.compact { color: #ff6a5c; border-color: rgba(255, 106, 92, .5); }
.atag.medium { color: #6fc6ff; border-color: rgba(111, 198, 255, .5); }
.atag.long { color: #f2cf4a; border-color: rgba(242, 207, 74, .5); }
.atag.shell { color: #e9e2d0; border-color: rgba(233, 226, 208, .4); }
.atag.special, .atag.other { color: #c98bd8; border-color: rgba(201, 139, 216, .5); }
.pips { margin-left: auto; display: flex; gap: 2px; }
.pips i { width: 5px; height: 10px; background: var(--brass); opacity: .8; border-radius: 1px; }

/* same moment, other guns */
.others-h { font-size: 20px; margin: 22px 0 8px; }
.others { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.other { display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.other:hover { border-color: var(--brass); background: var(--card-hi); }
.oimg { grid-row: span 2; display: grid; place-items: center; }
.oimg img { width: 92px; height: auto; filter: drop-shadow(0 2px 3px #000); }
.oname { font-weight: 500; font-size: 15px; line-height: 1.2; }
.oname small { color: var(--ink-faint); font-weight: 400; margin-left: 6px; font-size: 12px; }
.oans { font-size: 14px; color: var(--ink-dim); }
.oans b { color: var(--brass-hi); font-weight: 500; }
.side .preset { grid-template-columns: 104px 1fr; align-items: center; }
.side .preset img { height: auto; align-self: center; aspect-ratio: 16 / 9; }
.side .preset span { padding: 4px 10px; }
.oimg img { max-height: 34px; width: auto; max-width: 92px; object-fit: contain; }
.other { min-height: 58px; }

.report { padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.report.older h2 { font-size: 20px; color: var(--ink-dim); }
.report details { margin: 6px 0; color: var(--ink-dim); font-size: 15px; }
.report summary { cursor: pointer; color: var(--brass); }
.wbig img { max-height: 150px; width: auto; max-width: 100%; }
/* one-column layouts must not grow to their widest child (the swipeable preset strip, wide tables) */
@media (max-width: 980px) { .aimgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .whead, .cols { grid-template-columns: minmax(0, 1fr); } }
.stage, .side, .cols > div { min-width: 0; }
.side > *, .gunpick { min-width: 0; }
dialog { height: min(760px, 86vh); }
