/* Pal Tier List (Intelligence wiki). Classic tier-list look: one colored,
   labeled row per tier (S gold down to D grey), Pals as a wrap of clickable
   art+name chips. All rules namespaced under .intel-container so nothing leaks
   into the rest of the site. Rankings are editorial data from palworld.gg.
   Theme note: the Intelligence shell is dark; colors chosen for AA-legible
   text on the dark panel and on each tier's tinted row background. */

/* --- Category switcher -------------------------------------------------- */
.intel-container .tl-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.intel-container .tl-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 220, 180, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #f2e6d6;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.intel-container .tl-cat:hover { background: rgba(255, 255, 255, 0.09); }
.intel-container .tl-cat.is-active {
    background: linear-gradient(180deg, rgba(255, 180, 70, 0.28), rgba(255, 140, 50, 0.18));
    border-color: rgba(255, 190, 90, 0.7);
    color: #fff;
}
.intel-container .tl-cat:focus-visible {
    outline: 2px solid #ffcf3f;
    outline-offset: 2px;
}

.intel-container .tl-cat-blurb {
    margin: 0 0 1.1rem;
    color: rgba(240, 224, 205, 0.72);
    font-size: 0.92rem;
}

/* --- Tier rows ---------------------------------------------------------- */
.intel-container .tl-rows { display: flex; flex-direction: column; gap: 0.75rem; }

.intel-container .tl-row {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 0.75rem;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.intel-container .tl-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.9rem;
    line-height: 1;
    color: #1a1206;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
    letter-spacing: 0.02em;
}

/* Accessible tier ramp — dark, high-contrast letter on a saturated block. */
.intel-container .tl-tier-s .tl-label { background: linear-gradient(180deg, #ffd257, #ff9d2e); }
.intel-container .tl-tier-a .tl-label { background: linear-gradient(180deg, #ffb057, #ff7a3d); }
.intel-container .tl-tier-b .tl-label { background: linear-gradient(180deg, #ffe06a, #f6c343); }
.intel-container .tl-tier-c .tl-label { background: linear-gradient(180deg, #8fe08f, #5cc46f); }
.intel-container .tl-tier-d .tl-label { background: linear-gradient(180deg, #9fc3e6, #6f9fce); }

.intel-container .tl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem;
    min-width: 0;
}
.intel-container .tl-tier-empty {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
    color: rgba(240, 224, 205, 0.4);
    font-size: 0.85rem;
}

/* --- Pal chip ----------------------------------------------------------- */
.intel-container .tl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 200px;
    padding: 0.3rem 0.7rem 0.3rem 0.35rem;
    border-radius: 999px;
    background: rgba(15, 12, 8, 0.55);
    border: 1px solid rgba(255, 220, 180, 0.16);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.1;
    transition: background 0.13s ease, border-color 0.13s ease, transform 0.13s ease;
    min-width: 0;
}
.intel-container a.tl-chip:hover {
    background: rgba(40, 32, 20, 0.85);
    border-color: rgba(255, 200, 110, 0.6);
    transform: translateY(-1px);
}
.intel-container a.tl-chip:focus-visible {
    outline: 2px solid #ffcf3f;
    outline-offset: 2px;
}
.intel-container .tl-chip.is-static { cursor: default; opacity: 0.92; }

.intel-container .tl-chip-art {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.intel-container .tl-chip-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.intel-container .tl-chip-art .tl-chip-ph {
    color: rgba(255, 220, 180, 0.5);
    font-size: 0.85rem;
}
.intel-container .tl-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intel-container .tl-credit {
    margin-top: 1.6rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(240, 224, 205, 0.6);
    font-size: 0.82rem;
}
.intel-container .tl-credit a { color: #ffcf3f; }

.intel-container .tl-empty {
    padding: 1.5rem;
    text-align: center;
    color: rgba(240, 224, 205, 0.55);
}

/* --- Mobile: stack the tier label above its chips ----------------------- */
@media (max-width: 560px) {
    .intel-container .tl-row {
        grid-template-columns: 1fr;
    }
    .intel-container .tl-label {
        justify-content: flex-start;
        padding: 0.3rem 0.75rem;
        font-size: 1.25rem;
    }
    .intel-container .tl-chip { max-width: 100%; }
}
