:root {
    color-scheme: dark;
    --bg: #101113;
    --panel: #17191d;
    --panel-2: #1d2025;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(215, 181, 109, 0.42);
    --text: #f2f0e8;
    --muted: #b9b4aa;
    --green: #8ebf9f;
    --cyan: #8fb6c8;
    --amber: #d7b56d;
    --red: #d97979;
}

* {
    box-sizing: border-box;
}

body.weapon-tool {
    margin: 0;
    min-height: 100vh;
    font-family: "Outfit", Arial, sans-serif;
    background: #101113;
    color: var(--text);
}

.weapon-topbar {
    min-height: 74px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 17, 19, 0.96);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
}

.page-nav {
    display: flex;
    gap: 8px;
}

.nav-button,
.compare-head button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 14px;
    color: var(--text);
    background: #1b1d20;
    text-decoration: none;
    font-weight: 800;
}

.nav-button:hover,
.nav-button:focus-visible,
.compare-head button:hover,
.compare-head button:focus-visible {
    border-color: rgba(215, 181, 109, 0.62);
    background: #24272b;
}

.tool-heading span,
.control-strip span,
.summary-grid span,
.weapon-name span,
.compare-card span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    margin-top: 2px;
    font-size: 1.25rem;
}

.weapon-shell {
    width: min(1500px, calc(100vw - 28px));
    margin: 0 auto;
    padding: 18px 0 56px;
    display: grid;
    gap: 14px;
}

.metric-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
}

.metric-tab {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 8px;
    color: var(--muted);
    background: #17191d;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    cursor: pointer;
}

.metric-tab:hover,
.metric-tab:focus-visible,
.metric-tab.active {
    color: #101113;
    border-color: rgba(215, 181, 109, 0.72);
    background: var(--amber);
}

.purpose-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.32fr) minmax(520px, 1fr) minmax(260px, 0.45fr);
    gap: 10px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid rgba(215, 181, 109, 0.32);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(215, 181, 109, 0.12), rgba(143, 182, 200, 0.07)),
        var(--panel);
}

.purpose-strip[hidden] {
    display: none;
}

.purpose-title {
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 0 2px;
}

.purpose-title span,
.purpose-tab {
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.purpose-title span {
    color: var(--muted);
    font-size: 0.72rem;
}

.purpose-title h2 {
    font-size: 1.08rem;
    line-height: 1.05;
}

.purpose-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.purpose-tab {
    min-width: 0;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 0 8px;
    color: var(--muted);
    background: #111317;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.05;
    cursor: pointer;
}

.purpose-tab:hover,
.purpose-tab:focus-visible,
.purpose-tab.active {
    color: #101113;
    border-color: rgba(143, 182, 200, 0.72);
    background: var(--cyan);
}

.purpose-strip p {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.22;
}

.control-strip {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(170px, 0.65fr) minmax(320px, 1.45fr);
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.control-strip label {
    display: grid;
    gap: 6px;
}

select,
input[type="search"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 12px;
    color: var(--text);
    background: #111317;
    font: inherit;
    font-weight: 700;
}

.toggle-row {
    min-height: 40px;
    display: flex !important;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #111317;
    white-space: nowrap;
}

.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

.map-compare-strip {
    display: grid;
    grid-template-columns: minmax(170px, 0.35fr) minmax(520px, 1fr);
    gap: 10px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid rgba(143, 182, 200, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(143, 182, 200, 0.1), rgba(215, 181, 109, 0.06)),
        var(--panel);
}

.map-compare-toggle {
    height: 100%;
}

.map-compare-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.map-compare-controls label {
    display: grid;
    gap: 6px;
}

.map-compare-controls span,
.map-compare-head span,
.map-compare-table th span,
.map-compare-weapon span,
.map-compare-side-head span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.summary-grid div,
.compare-tray,
.weapon-card-board,
.table-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.summary-grid div {
    min-height: 70px;
    padding: 12px;
}

.summary-grid b {
    display: block;
    margin-top: 4px;
    font-size: 1.2rem;
}

.compare-tray {
    padding: 12px;
}

.compare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.compare-head h2 {
    font-size: 1rem;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.compare-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #111317;
}

.compare-card b {
    display: block;
    margin: 3px 0 10px;
}

.compare-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.compare-stats div {
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

.compare-stats em {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-size: 0.75rem;
}

.compare-stats strong {
    display: block;
    margin-top: 2px;
}

.weapon-card-board {
    position: relative;
    overflow: hidden;
    padding: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        #14161a;
}

.weapon-card-board[hidden] {
    display: none;
}

.weapon-card-board::before {
    content: "";
    position: absolute;
    inset: -80px -40px auto -40px;
    height: 180px;
    pointer-events: none;
    opacity: 0.52;
    filter: blur(18px);
    background:
        linear-gradient(100deg, transparent 0 12%, rgba(215, 181, 109, 0.14) 28%, transparent 46%),
        linear-gradient(70deg, transparent 0 18%, rgba(142, 191, 159, 0.11) 38%, transparent 62%);
}

.weapon-card-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.weapon-card-head span,
.weapon-card-title span,
.weapon-card-metric span,
.card-stat span,
.preview-hero-copy span,
.preview-stat span,
.attachment-tile small,
.preview-loot span,
.preview-loot small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.weapon-card-head h2 {
    margin-top: 2px;
    font-size: 1.05rem;
}

.weapon-card-head p {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.weapon-card-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.weapon-card {
    display: grid;
    grid-template-rows: 168px 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        #111317;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.weapon-card-media {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(215, 181, 109, 0.12), transparent 45%),
        linear-gradient(25deg, rgba(142, 191, 159, 0.12), transparent 52%),
        #0d0f12;
}

.weapon-card-media .preview-image-target {
    position: absolute;
    inset: 0;
    min-height: 0;
    padding: 16px 14px 14px 60px;
}

.weapon-card-media .preview-image-target img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    object-fit: contain;
}

.weapon-card-media::after,
.preview-hero-image::after {
    content: "";
    position: absolute;
    inset: auto -20% -35% -20%;
    height: 85%;
    pointer-events: none;
    opacity: 0.48;
    filter: blur(16px);
    background:
        repeating-linear-gradient(92deg, transparent 0 22px, rgba(255, 255, 255, 0.06) 28px, transparent 48px),
        linear-gradient(0deg, rgba(215, 181, 109, 0.16), transparent 68%);
}

.weapon-rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    min-width: 44px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(215, 181, 109, 0.62);
    border-radius: 7px;
    color: #101113;
    background: var(--amber);
    font-weight: 900;
    z-index: 4;
}

.weapon-card-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.weapon-card-title {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
}

.weapon-card-title h3 {
    margin: 2px 0 0;
    font-size: 1.18rem;
    line-height: 1.05;
}

.weapon-card-title small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.card-compare {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.card-compare input {
    width: 15px;
    height: 15px;
    accent-color: var(--amber);
}

.weapon-card-metric {
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid rgba(215, 181, 109, 0.28);
    border-radius: 7px;
    background: rgba(215, 181, 109, 0.06);
}

.weapon-card-metric div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.weapon-card-metric b {
    font-size: 1rem;
}

.weapon-card-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.card-stat {
    min-width: 0;
    padding: 8px 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
}

.card-stat b {
    display: block;
    margin-top: 2px;
    font-size: 0.88rem;
    white-space: nowrap;
}

.weapon-card-note {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.weapon-card-note span,
.detail-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    padding: 0 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.76rem;
    font-weight: 800;
}

.preview-button {
    min-height: 38px;
    border: 1px solid rgba(215, 181, 109, 0.58);
    border-radius: 7px;
    color: #101113;
    background: var(--amber);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.preview-button:hover,
.preview-button:focus-visible {
    border-color: rgba(242, 240, 232, 0.8);
    background: #e4c57e;
}

.preview-image-target {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-target img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.42));
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    min-height: 86px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: var(--muted);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 8px, transparent 8px 16px),
        rgba(255, 255, 255, 0.025);
}

.preview-placeholder span {
    color: var(--amber);
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.preview-placeholder small {
    font-size: 0.75rem;
    font-weight: 800;
}

.empty-card,
.empty-inline {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.table-card {
    overflow: hidden;
}

.table-status {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.table-status.warn {
    color: var(--amber);
}

.table-scroll {
    overflow: auto;
    max-height: calc(100vh - 325px);
}

.table-x-scroll {
    position: fixed;
    left: max(14px, calc((100vw - 1500px) / 2));
    right: max(14px, calc((100vw - 1500px) / 2));
    bottom: env(safe-area-inset-bottom, 0);
    z-index: 60;
    height: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #15171b;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.42);
    scrollbar-color: var(--amber) #262a30;
    scrollbar-width: auto;
}

.table-x-scroll-inner {
    height: 1px;
}

.table-x-scroll::-webkit-scrollbar {
    height: 14px;
}

.table-x-scroll::-webkit-scrollbar-track {
    background: #262a30;
}

.table-x-scroll::-webkit-scrollbar-thumb {
    border: 2px solid #262a30;
    border-radius: 999px;
    background: var(--amber);
}

.weapon-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.93rem;
}

.weapon-table th,
.weapon-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    vertical-align: middle;
    text-align: left;
}

.weapon-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    color: var(--muted);
    background: #15171b;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.weapon-table tbody tr {
    background: #14161a;
}

.weapon-table tbody tr:nth-child(even) {
    background: #171a1e;
}

.weapon-table tbody tr:hover {
    background: #20242a;
}

.weapon-table .empty-cell {
    height: 120px;
    color: var(--muted);
    text-align: center;
}

.check-col {
    left: 0;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

.row-check {
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

.rank-cell {
    left: 50px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    color: var(--amber);
    font-weight: 900;
}

.weapon-name {
    left: 114px;
    width: 324px;
    min-width: 324px;
    max-width: 324px;
    box-shadow: 10px 0 14px rgba(0, 0, 0, 0.18);
}

.weapon-table .check-col,
.weapon-table .rank-cell,
.weapon-table .weapon-name {
    position: sticky;
    z-index: 6;
}

.weapon-table th.check-col,
.weapon-table th.rank-cell,
.weapon-table th.weapon-name {
    z-index: 14;
    background: #15171b;
}

.weapon-table tbody tr .check-col,
.weapon-table tbody tr .rank-cell,
.weapon-table tbody tr .weapon-name {
    background: #14161a;
}

.weapon-table tbody tr:nth-child(even) .check-col,
.weapon-table tbody tr:nth-child(even) .rank-cell,
.weapon-table tbody tr:nth-child(even) .weapon-name {
    background: #171a1e;
}

.weapon-table tbody tr:hover .check-col,
.weapon-table tbody tr:hover .rank-cell,
.weapon-table tbody tr:hover .weapon-name {
    background: #20242a;
}

.map-compare-card {
    overflow: hidden;
    border: 1px solid rgba(143, 182, 200, 0.48);
    border-top-color: rgba(215, 181, 109, 0.58);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(143, 182, 200, 0.13), rgba(215, 181, 109, 0.055) 34%, rgba(11, 16, 18, 0.95) 68%),
        #0d1113;
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.map-compare-head {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(143, 182, 200, 0.28);
    background:
        linear-gradient(90deg, rgba(143, 182, 200, 0.22), rgba(215, 181, 109, 0.12)),
        #10171a;
}

.map-compare-head h2 {
    margin-top: 2px;
    font-size: 1.1rem;
}

.map-compare-head p {
    color: var(--muted);
    font-weight: 800;
    text-align: right;
}

.map-compare-scroll {
    overflow: auto;
    max-height: calc(100vh - 330px);
    background:
        linear-gradient(180deg, rgba(13, 20, 23, 0.95), rgba(9, 12, 14, 0.98)),
        #0b0f11;
}

.map-compare-table {
    width: 100%;
    min-width: 1240px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.92rem;
}

.map-compare-table th,
.map-compare-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(143, 182, 200, 0.12);
    border-right: 1px solid rgba(143, 182, 200, 0.09);
    vertical-align: top;
    text-align: left;
}

.map-compare-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background:
        linear-gradient(180deg, rgba(22, 32, 36, 0.98), rgba(13, 18, 21, 0.98)),
        #10171a;
}

.map-compare-table th b {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.12;
}

.map-compare-table th small {
    display: block;
    margin-top: 3px;
    color: var(--amber);
    font-weight: 900;
}

.map-compare-table tbody tr {
    background: rgba(11, 17, 20, 0.96);
}

.map-compare-table tbody tr:nth-child(even) {
    background: rgba(15, 24, 28, 0.96);
}

.map-compare-table tbody tr:hover {
    background: rgba(28, 40, 46, 0.98);
}

.map-compare-table .empty-cell {
    height: 120px;
    color: var(--muted);
    text-align: center;
    vertical-align: middle;
}

.map-compare-weapon-col {
    position: sticky;
    left: 0;
    z-index: 6;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    background:
        linear-gradient(90deg, rgba(14, 21, 24, 0.99), rgba(15, 23, 27, 0.96)),
        #0e1518;
    box-shadow: 14px 0 24px rgba(0, 0, 0, 0.36);
}

.map-compare-table th.map-compare-weapon-col {
    z-index: 12;
    background:
        linear-gradient(180deg, rgba(23, 34, 38, 0.99), rgba(12, 18, 21, 0.99)),
        #10171a;
}

.map-compare-table tbody tr:nth-child(even) .map-compare-weapon-col {
    background:
        linear-gradient(90deg, rgba(17, 27, 31, 0.99), rgba(17, 25, 29, 0.96)),
        #111a1e;
}

.map-compare-table tbody tr:hover .map-compare-weapon-col {
    background:
        linear-gradient(90deg, rgba(31, 44, 50, 0.99), rgba(27, 39, 45, 0.97)),
        #1b272d;
}

.map-compare-weapon {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.map-compare-weapon b {
    display: block;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.12;
}

.map-compare-weapon small {
    display: block;
    margin-top: 6px;
    color: var(--amber);
    font-weight: 900;
    line-height: 1.18;
}

.map-compare-side {
    display: grid;
    gap: 10px;
}

.map-compare-side-head {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(143, 182, 200, 0.18);
    border-radius: 7px;
    background:
        linear-gradient(135deg, rgba(143, 182, 200, 0.08), rgba(255, 255, 255, 0.025)),
        rgba(8, 12, 14, 0.72);
}

.map-compare-side-head b {
    color: var(--text);
    font-size: 1.02rem;
}

.map-compare-side-head small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.22;
}

.map-diff-list {
    display: grid;
    gap: 8px;
}

.map-diff-row {
    display: grid;
    grid-template-columns: 58px minmax(120px, 0.55fr) minmax(150px, 1fr);
    gap: 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.03);
}

.map-diff-row > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    border-radius: 999px;
    color: #101113;
    background: var(--cyan);
    font-size: 0.65rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-diff-row.loot-diff > span {
    background: var(--amber);
}

.map-diff-row b {
    color: var(--text);
    line-height: 1.16;
}

.map-diff-value {
    min-height: 28px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.86rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.map-diff-value.left-change {
    border-color: rgba(59, 213, 255, 0.82);
    background: rgba(0, 126, 190, 0.42);
    box-shadow: inset 0 0 0 1px rgba(59, 213, 255, 0.24);
}

.map-diff-value.right-change {
    border-color: rgba(255, 117, 84, 0.9);
    background: rgba(174, 45, 36, 0.5);
    box-shadow: inset 0 0 0 1px rgba(255, 117, 84, 0.22);
}

.map-diff-empty {
    padding: 10px;
    border: 1px dashed rgba(215, 181, 109, 0.5);
    border-radius: 7px;
    color: var(--amber);
    background: rgba(215, 181, 109, 0.08);
    font-weight: 900;
}

.missing-map-canvas {
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 36%),
        #000;
    text-align: center;
}

.missing-map-canvas b {
    font-size: 1.05rem;
}

.missing-map-canvas span {
    color: #b8b8b8;
    font-weight: 800;
}

.ammo-cell {
    min-width: 130px;
    max-width: 220px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.25;
}

.wide-cell {
    min-width: 190px;
}

.spread-cell {
    min-width: 76px;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    white-space: nowrap;
}

.damage-cell {
    min-width: 118px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.damage-pair {
    display: grid;
    gap: 3px;
    line-height: 1.1;
}

.damage-pair b {
    color: var(--green);
    font-size: 0.88rem;
}

.damage-pair small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.damage-pair.kill b,
.damage-pair.kill small {
    color: var(--red);
}

.damage-pair.uncon b,
.damage-pair.uncon small {
    color: var(--amber);
}

.loot-col {
    min-width: 170px;
}

.weapon-name b {
    display: block;
    font-size: 1rem;
}

.weapon-name small,
.loot-pill small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.type-pill,
.loot-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 9px;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.loot-pill {
    border-radius: 7px;
    white-space: normal;
    align-items: flex-start;
    flex-direction: column;
    padding: 6px 8px;
}

.loot-pill.active {
    border-color: rgba(142, 191, 159, 0.5);
    color: var(--green);
}

.weapon-cell-button {
    width: 100%;
    min-height: 70px;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.weapon-cell-button:hover b,
.weapon-cell-button:focus-visible b {
    color: var(--amber);
}

.weapon-cell-button:focus-visible {
    outline: 2px solid rgba(215, 181, 109, 0.72);
    outline-offset: 3px;
    border-radius: 7px;
}

.weapon-cell-preview {
    width: 82px;
    height: 58px;
    min-width: 82px;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background:
        linear-gradient(135deg, rgba(215, 181, 109, 0.08), transparent 54%),
        #0d0f12;
}

.weapon-cell-preview .preview-image-target {
    height: 100%;
    min-height: 0;
}

.weapon-cell-preview .preview-image-target img {
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.42));
}

.weapon-cell-preview .preview-placeholder {
    min-height: 0;
    gap: 1px;
}

.weapon-cell-preview .preview-placeholder span {
    font-size: 0.9rem;
}

.weapon-cell-preview .preview-placeholder small {
    display: none;
}

.weapon-cell-copy {
    min-width: 0;
    display: block;
}

.metric-cell {
    min-width: 170px;
}

.metric-value {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 900;
}

.metric-bar {
    height: 7px;
    margin-top: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.metric-bar i {
    display: block;
    height: 100%;
    width: var(--bar, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--amber), var(--green));
}

.muted {
    color: var(--muted);
}

body.preview-open {
    overflow: hidden;
}

.weapon-preview-panel[hidden] {
    display: none;
}

.weapon-preview-panel {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
}

.weapon-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 7, 0.76);
    backdrop-filter: blur(8px);
}

.weapon-preview-card {
    position: relative;
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid rgba(215, 181, 109, 0.38);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
        #111317;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.68);
}

.weapon-preview-card::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 0;
    pointer-events: none;
    box-shadow: 0 0 70px 34px rgba(215, 181, 109, 0.08);
}

.preview-close {
    position: sticky;
    top: 12px;
    float: right;
    z-index: 5;
    width: 40px;
    height: 40px;
    margin: 12px 12px -52px 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    color: var(--text);
    background: rgba(17, 19, 23, 0.94);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.preview-close:hover,
.preview-close:focus-visible {
    border-color: rgba(215, 181, 109, 0.7);
    color: var(--amber);
}

.preview-hero {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
    min-height: 360px;
}

.preview-hero-image {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    background:
        linear-gradient(120deg, rgba(215, 181, 109, 0.18), transparent 42%),
        linear-gradient(24deg, rgba(142, 191, 159, 0.14), transparent 56%),
        #0b0d10;
}

.preview-hero-image .preview-image-target {
    min-height: 360px;
}

.preview-hero-image .preview-image-target img {
    padding: 28px;
}

.preview-hero-copy {
    display: grid;
    align-content: center;
    gap: 14px;
    padding: 54px 46px 34px 34px;
}

.preview-map-context {
    display: grid;
    gap: 4px;
    max-width: 520px;
    padding: 12px 14px;
    border: 1px solid rgba(215, 181, 109, 0.55);
    border-left: 4px solid var(--amber);
    border-radius: 7px;
    background:
        linear-gradient(90deg, rgba(215, 181, 109, 0.18), rgba(215, 181, 109, 0.04)),
        rgba(8, 10, 12, 0.72);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.preview-map-context span,
.preview-map-context em {
    color: var(--muted);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.preview-map-context b {
    color: #fff7df;
    font-size: 1.14rem;
    line-height: 1.05;
}

.preview-hero-copy h2 {
    font-size: 2.3rem;
    line-height: 0.98;
}

.preview-hero-copy p {
    color: var(--muted);
    font-weight: 800;
}

.preview-primary-stats,
.preview-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.preview-stat {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
}

.preview-stat b {
    display: block;
    margin-top: 3px;
    font-size: 1rem;
    line-height: 1.08;
}

.preview-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 14px 14px;
}

.preview-section {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.preview-section.wide {
    grid-column: 1 / -1;
}

.preview-section h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.preview-section .subhead {
    margin-top: 14px;
}

.preview-loot {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(142, 191, 159, 0.46);
    border-radius: 7px;
    color: var(--green);
    background: rgba(142, 191, 159, 0.08);
}

.preview-loot span,
.preview-loot small {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.preview-loot.missing {
    border-color: rgba(215, 181, 109, 0.4);
    color: var(--amber);
    background: rgba(215, 181, 109, 0.08);
}

.detail-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.muted-chip {
    color: var(--muted);
}

.preview-damage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
}

.preview-damage-row {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
}

.preview-damage-row span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.preview-damage-row b {
    color: var(--green);
}

.preview-damage-row small {
    color: var(--muted);
    font-weight: 800;
}

.preview-damage-row.kill b,
.preview-damage-row.kill small {
    color: var(--red);
}

.preview-damage-row.uncon b,
.preview-damage-row.uncon small {
    color: var(--amber);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
}

.attachment-tile {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(8, 10, 12, 0.48);
}

.attachment-tile .preview-image-target {
    height: 116px;
    min-height: 116px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background:
        linear-gradient(135deg, rgba(215, 181, 109, 0.08), transparent 50%),
        #0d0f12;
}

.attachment-tile .preview-image-target img {
    padding: 10px;
}

.attachment-tile > div:last-child {
    display: grid;
    gap: 3px;
    padding: 9px;
}

.attachment-tile b {
    font-size: 0.9rem;
    line-height: 1.1;
}

@media (max-width: 1000px) {
    .weapon-topbar {
        flex-wrap: wrap;
    }

    .page-nav {
        order: 3;
        width: 100%;
    }

    .control-strip,
    .map-compare-strip,
    .purpose-strip,
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .purpose-tabs,
    .purpose-strip p {
        grid-column: 1 / -1;
    }

    .purpose-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .map-compare-toggle {
        grid-column: 1 / -1;
    }

    .map-compare-controls {
        grid-column: 1 / -1;
    }

    .metric-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .preview-hero {
        grid-template-columns: 1fr;
    }

    .preview-detail-grid {
        grid-template-columns: 1fr;
    }

    .preview-primary-stats,
    .preview-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-label {
        grid-column: 1 / -1;
    }

    .table-scroll {
        max-height: none;
    }

    .map-compare-scroll {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .weapon-shell {
        width: min(100vw - 18px, 1500px);
    }

    .control-strip,
    .map-compare-strip,
    .map-compare-controls,
    .purpose-strip,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .purpose-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-compare-head {
        align-items: flex-start;
        display: grid;
    }

    .map-compare-head p {
        text-align: left;
    }

    .map-compare-table {
        min-width: 980px;
    }

    .map-compare-weapon-col {
        width: 240px;
        min-width: 240px;
        max-width: 240px;
    }

    .map-diff-row {
        grid-template-columns: 1fr;
    }

    .metric-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weapon-card-head {
        display: grid;
    }

    .weapon-card-grid {
        grid-template-columns: 1fr;
    }

    .weapon-card-stats,
    .preview-primary-stats,
    .preview-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weapon-preview-panel {
        padding: 10px;
    }

    .weapon-preview-card {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .preview-hero-copy {
        padding: 24px 14px 14px;
    }

    .preview-hero-copy h2 {
        font-size: 1.75rem;
    }

    .toggle-row {
        justify-content: flex-start;
    }
}
