/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
    --bg:           #0b0c0e;
    --bg-card:      #14161a;
    --bg-card-hover:#1c1f25;
    --bg-filter:    #11131a;
    --gold:         #c8a54a;
    --gold-dim:     #8a6e2a;
    --text:         #d4cebc;
    --text-dim:     #7a7468;
    --border:       #2a2c34;
    --border-gold:  #3a3018;
    --light-color:  #4a7a3a;
    --medium-color: #8a7020;
    --heavy-color:  #7a3a2a;
    --pill-passive: #1e2d3d;
    --pill-feature: #1e2e1a;
    --font-head:    'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body:    'Barlow', Arial, sans-serif;
}

/* ── Reset / Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

#app {
    min-height: 100vh;
    background: var(--bg);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #e8c060; text-decoration: underline; }

.ext-link-icon { font-size: 0.75em; vertical-align: 0.1em; margin-right: 0.2em; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

.app-main {
    flex: 1;
    padding: 0 1.5rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.app-header {
    background: #0d0e12;
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 52px;
}

.brand {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand:hover { color: #e8c060; text-decoration: none; }
.brand-eagle { font-size: 1.1rem; opacity: 0.7; }

.header-nav { display: flex; gap: 1.5rem; }
.header-nav .nav-link {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.header-nav .nav-link:hover { color: var(--text); text-decoration: none; }
.header-nav .nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }
.nav-version {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.6;
    align-self: center;
}

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
    background: var(--bg-filter);
    border: 1px solid var(--border);
    border-radius: 4px;
    position: sticky;
    top: 52px;
    z-index: 60;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.filter-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-start; }

.filter-select {
    background: #0d0e12;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%237a7468' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
    transition: border-color 0.15s;
}
.filter-select:focus { outline: none; border-color: var(--gold-dim); }
.filter-select option { background: #0d0e12; }

/* ── Active Filters / Pills ─────────────────────────────────────────────── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}
.passive-pill {
    background: var(--pill-passive);
    border-color: #2a3d52;
    color: #9abcd4;
}
.feature-pill {
    background: var(--pill-feature);
    border-color: #2a3e1a;
    color: #7ab46a;
}
.pill-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.85;
}
.pill-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 0.15rem;
    opacity: 0.6;
    transition: opacity 0.1s;
}
.pill-remove:hover { opacity: 1; }

.clear-all {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    font-family: var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.clear-all:hover { color: var(--text); border-color: var(--text-dim); }

/* ── Selected Armor Bar ─────────────────────────────────────────────────── */
.selected-armor-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.3rem;
    min-width: 0;
}

.selected-armor-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.selected-armor-scroll::-webkit-scrollbar { height: 4px; }
.selected-armor-scroll::-webkit-scrollbar-track { background: transparent; }
.selected-armor-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.selected-armor-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.compare-btn {
    background: rgba(200, 165, 74, 0.15);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    border-radius: 3px;
    padding: 0.35rem 0.75rem;
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.compare-btn:hover {
    background: rgba(200, 165, 74, 0.28);
    border-color: var(--gold);
    color: #e8c060;
}

/* ── Armor Compare Tile ─────────────────────────────────────────────────── */
.armor-compare-tile {
    position: relative;
    width: 64px;
    flex-shrink: 0;
}

.compare-tile-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 3px;
    background: #0d0e12;
    display: block;
    border: 1px solid var(--border);
}

.compare-tile-name {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 0.2rem;
    white-space: normal;
    word-break: break-word;
    width: 64px;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.compare-tile-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: rgba(42, 16, 16, 0.85);
    border: 1px solid #5a2020;
    border-radius: 50%;
    color: #cc6666;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    z-index: 1;
}
.compare-tile-remove:hover {
    background: rgba(90, 24, 24, 0.95);
    border-color: #ff6666;
    color: #fff;
}

/* ── Compare Modal ──────────────────────────────────────────────────────── */
.compare-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.compare-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.9);
    min-width: 360px;
}

.compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.compare-modal-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.compare-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 2px;
    line-height: 1;
    transition: color 0.1s;
}
.compare-modal-close:hover { color: var(--text); }

.compare-table-wrap {
    overflow-x: auto;
    padding: 1rem;
}

.compare-table {
    border-collapse: collapse;
    width: 100%;
}

.compare-table th,
.compare-table td {
    padding: 0.45rem 0.65rem;
    text-align: center;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.compare-col-label {
    font-family: var(--font-head);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: left !important;
    white-space: nowrap;
    background: var(--bg-filter) !important;
}

.compare-col-header {
    min-width: 140px;
    background: var(--bg-filter);
}

.compare-label-img-cell {
    vertical-align: bottom !important;
}

.compare-col-img-wrap {
    position: relative;
    width: 120px;
    margin: 0 auto 0.3rem;
}

.compare-col-img-wrap img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 3px;
    background: #0d0e12;
    display: block;
    border: 1px solid var(--border);
}

.compare-col-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #2a1010;
    border: 1px solid #5a2020;
    border-radius: 50%;
    color: #cc6666;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    z-index: 1;
}
.compare-col-remove:hover {
    background: #5a1818;
    border-color: #ff6666;
    color: #fff;
}

.compare-col-header .col-name {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.compare-stat-cell {
    font-family: var(--font-head);
    font-size: 1.05rem;
    color: var(--text);
}
.compare-stat-cell.stat-high { color: #6aaa5a; font-weight: 700; }
.compare-stat-cell.stat-low  { color: #c05040; font-weight: 700; }

.compare-passive-cell {
    font-size: 1rem;
    color: var(--gold);
    font-family: var(--font-head);
}

.compare-text-cell {
    font-size: 1rem;
    color: var(--text);
    font-family: var(--font-head);
    letter-spacing: 0.03em;
}

.compare-desc-cell {
    font-size: 1rem;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    text-align: left !important;
    min-width: 140px;
    max-width: 240px;
}

.compare-tags-cell {
    vertical-align: middle;
}

.compare-tags-cell .feature-tag {
    display: inline-block;
    margin: 0.1rem 0.1rem;
    cursor: default;
}

.compare-empty {
    color: var(--text-dim);
    font-size: 1rem;
}

/* ── Search Input ───────────────────────────────────────────────────────── */
.search-wrap {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}
.search-input {
    background: #0d0e12;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.4rem 1.8rem 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    min-width: 220px;
    transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--gold-dim); }
.search-input::placeholder { color: var(--text-dim); }
.search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.1s, color 0.1s;
}
.search-clear:hover { opacity: 1; color: var(--text); }

/* ── Custom Passive Dropdown ────────────────────────────────────────────── */
.passive-dropdown {
    position: relative;
    min-width: 200px;
}
.passive-dropdown-trigger {
    background: #0d0e12;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.4rem 1.8rem 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: border-color 0.15s;
    position: relative;
    white-space: nowrap;
}
.passive-dropdown-trigger:focus,
.passive-dropdown.open .passive-dropdown-trigger { outline: none; border-color: var(--gold-dim); }
.dropdown-arrow {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.7rem;
    pointer-events: none;
}
.passive-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    background: #0d0e12;
    border: 1px solid var(--border);
    border-radius: 3px;
    min-width: 100%;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.passive-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s, color 0.1s;
}
.passive-option:last-child { border-bottom: none; }
.passive-option:hover { background: #1c1f25; color: var(--gold); }
.passive-opt-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
}
.dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
}

/* ── Filter Toggles ─────────────────────────────────────────────────────── */
.filter-toggle {
    background: #0d0e12;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.filter-toggle:hover { color: var(--text); border-color: var(--text-dim); }
.filter-toggle.active {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(200, 165, 74, 0.08);
}

/* ── Weight Class Sections ──────────────────────────────────────────────── */
.weight-section { margin-bottom: 2.5rem; }

.weight-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}
.weight-heading-row:hover .weight-heading { opacity: 0.85; }

.weight-count {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dim);
    padding: 0.3rem 0 0.4rem;
}

.weight-heading {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.3rem 0 0.4rem;
    position: relative;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.15s;
}

.weight-collapse-icon {
    font-size: 1.1rem;
    opacity: 0.7;
    flex-shrink: 0;
}
.weight-heading::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 60px;
    height: 2px;
}
.weight-heading.light { color: #6aaa5a; }
.weight-heading.light::before { background: var(--light-color); }
.weight-heading.medium { color: #c8a030; }
.weight-heading.medium::before { background: var(--medium-color); }
.weight-heading.heavy { color: #c05040; }
.weight-heading.heavy::before { background: var(--heavy-color); }

/* ── Armor Grid ─────────────────────────────────────────────────────────── */
.armor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* ── Armor Tile ─────────────────────────────────────────────────────────── */
.armor-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: visible;
    position: relative;
    transition: border-color 0.15s, background 0.15s, outline-color 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: row;
}
.armor-tile.menu-open { z-index: 5; }
.armor-tile:hover {
    border-color: var(--gold-dim);
    background: var(--bg-card-hover);
}
.armor-tile.selected {
    outline: 3px solid #e8c060;
    border-color: #e8c060;
    background: #1c1a10;
    box-shadow: 0 0 12px rgba(232, 192, 96, 0.2);
}
.armor-tile.selected:hover {
    outline-color: #f0cc70;
    border-color: #f0cc70;
    background: #201e14;
}

.armor-img-wrap {
    background: #0d0e12;
    width: 110px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 3px 0 0 3px;
    position: relative;
}
.armor-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.armor-info {
    padding: 0.25rem 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    position: relative;
}

/* ── Tile Header (name + menu button) ───────────────────────────────────── */
.tile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
}
.tile-header .armor-name { flex: 1; min-width: 0; }

/* ── Tile Menu Overlay (closes menu on outside click) ───────────────────── */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
}

/* ── Tile Menu ───────────────────────────────────────────────────────────── */
.tile-menu-wrap {
    position: relative;
    flex-shrink: 0;
}
.tile-menu-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.1s, background 0.1s;
    display: flex;
    align-items: center;
}
.tile-menu-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.tile-menu-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    z-index: 20;
    background: #0d0e12;
    border: 1px solid var(--border);
    border-radius: 3px;
    min-width: 170px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.7);
}
.tile-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.tile-menu-item:last-child { border-bottom: none; }
.tile-menu-item:hover { background: #1c1f25; color: var(--gold); text-decoration: none; }

/* ── Owned Indicators ───────────────────────────────────────────────────── */
.owned-badge {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    z-index: 2;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.12s;
}
.owned-badge:not(:disabled) { cursor: pointer; }
.owned-badge:not(:disabled):hover { transform: scale(1.18); }
.owned-badge.is-owned { color: #4aaa3a; }
.owned-badge.is-unowned { color: rgba(200, 200, 200, 0.35); }
.owned-badge:not(:disabled).is-unowned:hover { color: rgba(200, 200, 200, 0.7); }

/* ── Tile Actions & Info Button ─────────────────────────────────────────── */
.tile-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.15rem;
}
.tile-info-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.1rem 0.15rem;
    border-radius: 2px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.1s;
}
.tile-info-btn:hover { color: var(--gold); }

/* ── Detail Modal ───────────────────────────────────────────────────────── */
.detail-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.detail-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}
.detail-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 2px;
    line-height: 1;
    transition: color 0.1s;
    z-index: 1;
}
.detail-modal-close:hover { color: var(--text); }
.detail-modal-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}
.detail-img-wrap {
    flex-shrink: 0;
    width: 180px;
    background: #0d0e12;
    border-radius: 4px;
    overflow: hidden;
}
.detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-content { flex: 1; min-width: 0; }
.detail-name {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-family: var(--font-head);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.detail-weight {
    font-family: var(--font-head);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}
.detail-passive-name {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 0.25rem;
}
.detail-passive-desc {
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 0.6rem;
}
.detail-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.detail-stat {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--text);
}
.detail-stat .stat-label { color: var(--text-dim); margin-right: 0.15rem; }
.detail-stat.stat-high { color: #6aaa5a; font-weight: 700; }
.detail-stat.stat-low  { color: #c05040; font-weight: 700; }
.detail-wiki-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--gold);
    text-decoration: none;
    font-family: var(--font-head);
    letter-spacing: 0.04em;
}
.detail-wiki-link:hover { color: #e8c060; text-decoration: underline; }
.detail-warbond {
    color: var(--text-dim);
    margin-top: 0.35rem;
    font-family: var(--font-head);
    letter-spacing: 0.04em;
}

/* ── Filter right-align helper ──────────────────────────────────────────── */
.filter-spacer { flex: 1; min-width: 0.5rem; }

/* ── Comparison Panel ───────────────────────────────────────────────────── */
.comparison-panel {
    background: var(--bg-filter);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
.comp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.comp-label {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.comp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.comp-armor {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.5rem;
}
.comp-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 2px;
    background: #0d0e12;
    flex-shrink: 0;
}
.comp-details { flex: 1; min-width: 0; }
.comp-name {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.comp-passive {
    font-size: 0.8rem;
    color: var(--gold);
    font-family: var(--font-head);
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comp-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.comp-stat {
    font-family: var(--font-head);
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: 0.02em;
}
.comp-stat .stat-label { font-size: 0.85rem; color: var(--text-dim); margin-right: 0.15rem; }

.armor-name {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text);
    line-height: 1.2;
}

.armor-passive {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    width: fit-content;
    border-radius: 2px;
    transition: opacity 0.15s;
}
.passive-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}
.passive-name {
    font-size: 1.25rem;
    color: var(--gold);
    font-family: var(--font-head);
    letter-spacing: 0.02em;
}

.armor-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.stat {
    font-family: var(--font-head);
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: 0.02em;
}
.stat-label {
    font-size: 1.0rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    margin-right: 0.2rem;
}
.stat-val { }
.stat-val.stat-high { color: #6aaa5a; font-weight: 700; }
.stat-val.stat-low  { color: #c05040; font-weight: 700; }

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.feature-tag {
    font-size: 1.0rem;
    font-family: var(--font-head);
    letter-spacing: 0.05em;
    color: #7ab46a;
    background: rgba(74, 130, 58, 0.12);
    border: 1px solid rgba(74, 130, 58, 0.25);
    border-radius: 2px;
    padding: 0.05rem 0.3rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.feature-tag:hover {
    background: rgba(74, 130, 58, 0.25);
    border-color: rgba(74, 130, 58, 0.5);
}
.armor-passive:hover { opacity: 0.75; }

/* ── Passive Description ────────────────────────────────────────────────── */
.passive-desc-br,
.passive-desc-pre {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.45;
}
.passive-desc-pre {
    font-family: var(--font-body);
    white-space: pre;
    margin: 0;
}

/* ── No Results ─────────────────────────────────────────────────────────── */
.no-results {
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4rem 0;
}

/* ── Unsorted page ──────────────────────────────────────────────────────── */
.unsorted-hint {
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.5;
    padding: 1.5rem 1rem 2rem;
    max-width: 680px;
}
.unsorted-hint p { margin-bottom: 0.5em; }
.unsorted-hint ol { padding-left: 1.5em; margin-top: 0.25em; }
.unsorted-hint li { margin-bottom: 0.4em; }
.unsorted-hint a { color: var(--gold); }

/* ── Unsorted tile banner ───────────────────────────────────────────────── */
.unsorted-banner {
    flex: 1;
    padding: 0.2rem 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    font-family: var(--font-head);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c8a820;
    background: rgba(200, 168, 32, 0.1);
    border: 1px solid rgba(200, 168, 32, 0.4);
    border-radius: 2px;
    text-decoration: none;
}
.unsorted-banner:hover {
    background: rgba(200, 168, 32, 0.18);
    color: #e0bc30;
    text-decoration: none;
}

/* ── Loading ────────────────────────────────────────────────────────────── */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 0;
}
.loading-text {
    font-family: var(--font-head);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── About Page ─────────────────────────────────────────────────────────── */
.about-page {
    max-width: 680px;
    padding: 2rem 0;
}
.about-heading {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-gold);
}
.about-section {
    margin-bottom: 2rem;
}
.about-section h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
.about-section p, .about-section li { color: var(--text); line-height: 1.7; }
.about-section ul { padding-left: 1.25rem; }
.about-section li { margin-bottom: 0.4rem; }
.about-section code { font-size: 0.875em; color: var(--gold-dim); }

.unsorted-weight {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 1rem 0 0.4rem;
}
.unsorted-weight.light  { color: #6aaa5a; }
.unsorted-weight.medium { color: #c8a030; }
.unsorted-weight.heavy  { color: #c05040; }

/* ── Blazor Error UI ────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #3a1010;
    border-top: 1px solid #6a2020;
    color: #ffaaaa;
    display: none;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
#blazor-error-ui .reload { color: #ffaaaa; font-weight: 600; margin-left: 0.5rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ── WASM Loading Progress ──────────────────────────────────────────────── */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 0 auto 1rem;
}

#app:has(.loading-progress) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-progress circle {
    fill: none;
    stroke: var(--gold-dim);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--gold);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, 'Loading');
    color: var(--text-dim);
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    text-align: center;
}
