/* Catalogue public des objets — alimenté par ItemDatabase.js. */

html,
body.items-guide-body {
    min-height: 100%;
    height: auto;
    overflow: visible;
}

body.items-guide-body {
    color: #141216;
    background-color: #f7f7f8;
    background-image: linear-gradient(rgba(17, 17, 17, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 17, 0.055) 1px, transparent 1px);
    background-size: 28px 28px;
}

.items-guide-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(48px, 7vw, 84px) 0 72px;
}

.items-intro {
    max-width: 820px;
    margin: 0 auto 38px;
    text-align: center;
}

.items-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 11px;
    background: #fde68a;
    border: 2px solid #111;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.items-intro h1 {
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    font-weight: 1000;
    letter-spacing: -0.065em;
    line-height: 0.95;
}

.items-intro > p:nth-of-type(2) {
    max-width: 660px;
    margin: 22px auto 0;
    color: #57515b;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.65;
}

.catalogue-summary {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.catalogue-summary span {
    min-width: 116px;
    padding: 10px 14px;
    background: #fff;
    border: 2px solid #111;
    border-radius: 9px;
    box-shadow: 3px 3px 0 #111;
    color: #666;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.catalogue-summary strong {
    color: #111;
    font-size: 1rem;
}

.category-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.category-link {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 7px;
    padding: 10px;
    color: #111;
    background: #fff;
    border: 2px solid #111;
    border-radius: 9px;
    box-shadow: 3px 3px 0 #111;
    font: inherit;
    font-size: 0.72rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.category-link > span { font-size: 1.1rem; }
.category-link strong { overflow: hidden; text-overflow: ellipsis; }
.category-link small {
    min-width: 22px;
    padding: 3px 5px;
    background: #e4e4e7;
    border: 1.5px solid #111;
    border-radius: 999px;
    font-weight: 900;
    text-align: center;
}

.category-link:hover,
.category-link.is-active {
    background: #fef3c7;
}

.category-link.is-active {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #111;
}

.catalogue-tools {
    position: sticky;
    top: 80px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 2.5px solid #111;
    border-radius: 12px;
    box-shadow: 4px 4px 0 #111;
    backdrop-filter: blur(10px);
}

.catalogue-filter-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.catalogue-tools > .item-search {
    min-width: 180px;
}

.catalogue-filter-actions {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.item-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    background: #f4f4f5;
    border: 2px solid #111;
    border-radius: 8px;
}

.item-search > span { font-size: 1.35rem; font-weight: 900; }

.item-search input {
    width: 100%;
    padding: 9px 0;
    color: #111;
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
}

.level-filter,
.class-filter {
    min-width: 142px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 4px 8px;
    background: #ecfeff;
    border: 2px solid #111;
    border-radius: 8px;
}

.level-filter span,
.class-filter span {
    color: #52525b;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.level-filter select,
.class-filter select {
    min-width: 0;
    color: #111;
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.rarity-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.rarity-filter {
    padding: 7px 9px;
    color: #4e4850;
    background: #fff;
    border: 2px solid #111;
    border-radius: 999px;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 900;
    cursor: pointer;
}

.rarity-filter.is-active {
    color: #111;
    background: var(--filter-color, #fde68a);
    box-shadow: 2px 2px 0 #111;
}

.catalogue-reset {
    padding: 7px 10px;
    color: #111;
    background: #fee2e2;
    border: 2px solid #111;
    border-radius: 8px;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 900;
    cursor: pointer;
}

.catalogue-reset:disabled {
    opacity: 0.38;
    cursor: default;
}

.catalogue-result {
    margin: 22px 0 12px;
    color: #68616c;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: right;
    text-transform: uppercase;
}

.item-categories { display: grid; gap: 44px; }

.catalogue-item[hidden],
.item-category[hidden] {
    display: none;
}

.item-category {
    scroll-margin-top: 155px;
}

.category-heading {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: #fff;
    border: 2.5px solid #111;
    border-radius: 12px;
    box-shadow: 4px 4px 0 #111;
}

.category-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    background: #fef3c7;
    border: 2px solid #111;
    border-radius: 10px;
    font-size: 1.6rem;
}

.category-heading p {
    color: #777;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.category-heading h2 {
    margin-top: 2px;
    font-size: 1.55rem;
    font-weight: 1000;
    letter-spacing: -0.035em;
}

.category-count {
    padding: 6px 9px;
    background: #e4e4e7;
    border: 1.5px solid #111;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.catalogue-item {
    --rarity-color: #94a3b8;
    --rarity-bg: #f1f5f9;
    --rarity-border: #64748b;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 16px;
    background: #fff;
    border: 2.5px solid #111;
    border-top: 8px solid var(--rarity-color);
    border-radius: 12px;
    box-shadow: 5px 5px 0 #111;
}

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

.item-big-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--rarity-bg);
    border: 2px solid var(--rarity-border);
    border-radius: 10px;
    font-size: 1.55rem;
}
.item-big-icon.atlas-icon { background-color: transparent; }

.item-heading { min-width: 0; }

.item-rarity {
    color: var(--rarity-border);
    font-size: 0.6rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.item-heading h3 {
    margin-top: 3px;
    font-size: 1rem;
    font-weight: 1000;
    line-height: 1.16;
}

.item-value {
    padding: 4px 6px;
    background: #fef3c7;
    border: 1.5px solid #111;
    border-radius: 6px;
    font-size: 0.64rem;
    font-weight: 900;
    white-space: nowrap;
}

.item-description {
    margin-top: 13px;
    color: #57515b;
    font-size: 0.79rem;
    line-height: 1.5;
}

.item-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 14px;
    list-style: none;
}

.item-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 3px;
    background: #f4f4f5;
    border: 1.5px solid #111;
    border-radius: 6px;
}

.item-stats span { color: #777; font-size: 0.52rem; font-weight: 900; }
.item-stats .item-stat-icon { width: 24px; height: 24px; }
.item-stats strong { margin-top: 2px; font-size: 0.75rem; }
.item-stats .stat-strength strong,
.item-stats .stat-endurance strong { color: #b91c1c; }
.item-stats .stat-dexterity strong,
.item-stats .stat-agility strong { color: #15803d; }
.item-stats .stat-intelligence strong,
.item-stats .stat-mental strong { color: #7e22ce; }

.item-no-stats {
    margin-top: 14px;
    padding: 7px;
    color: #777;
    background: #f4f4f5;
    border: 1px dashed #a1a1aa;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    color: #68616c;
    font-size: 0.62rem;
    font-weight: 850;
}

.catalogue-empty {
    margin-top: 30px;
    padding: 28px;
    background: #fff;
    border: 2.5px dashed #111;
    border-radius: 12px;
    color: #666;
    font-weight: 850;
    text-align: center;
}

.items-guide-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 24px 20px;
    background: #fff;
    border-top: 3px solid #111;
    color: #666;
    font-size: 0.76rem;
    text-align: center;
}

.items-guide-footer a { color: #111; font-weight: 900; }

@media (max-width: 1000px) {
    .catalogue-tools { grid-template-columns: 1fr; }
    .rarity-filters { justify-content: flex-start; }
    .catalogue-filter-actions { justify-content: space-between; }
    .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
    .items-guide-main { width: min(100% - 20px, 1180px); padding-top: 38px; }
    .category-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalogue-tools { position: static; }
    .level-filter,
    .class-filter { min-width: 0; }
    .catalogue-filter-actions { align-items: flex-start; flex-direction: column; }
    .items-grid { grid-template-columns: 1fr; }
    .category-heading { padding: 11px; }
    .category-icon { width: 44px; height: 44px; }
    .category-heading h2 { font-size: 1.2rem; }
    .category-count { font-size: 0.58rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
