.thm-remote-badges-title {
    margin-bottom: 12px;
    font-weight: 600;
}

.thm-remote-badges-grid {
    display: grid;
    grid-template-columns: repeat(6, 180px);
    justify-content: start;
    gap: 14px;
}

.thm-remote-badge-button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 180px;
    height: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thm-remote-badge-button img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
    transition: transform .2s ease, filter .2s ease;
}

.thm-remote-badge-button:hover img,
.thm-remote-badge-button:focus-visible img {
    transform: scale(1.04);
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.16));
}

.thm-remote-badge-button:focus-visible {
    outline: 2px solid #111;
    outline-offset: 4px;
}

.thm-remote-badges-empty {
    text-align: center;
    padding: 10px 0;
}

.thm-badge-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.thm-badge-modal-overlay[hidden] {
    display: none;
}

.thm-badge-modal {
    position: relative;
    background: #fff;
    width: min(460px, 100%);
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,.2);
}

.thm-badge-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.thm-badge-modal-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
}

.thm-badge-modal-title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.15;
}

.thm-badge-modal-rarity {
    font-weight: 600;
    margin-bottom: 12px;
}

.thm-badge-modal-criteria,
.thm-badge-modal-note {
    margin-top: 10px;
    color: #333;
}

.thm-badge-modal-label {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 1280px) {
    .thm-remote-badges-grid {
        grid-template-columns: repeat(4, 180px);
    }
}

@media (max-width: 900px) {
    .thm-remote-badges-grid {
        grid-template-columns: repeat(3, 180px);
    }
}

@media (max-width: 680px) {
    .thm-remote-badges-grid {
        grid-template-columns: repeat(2, 180px);
    }
}

@media (max-width: 420px) {
    .thm-remote-badges-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
        gap: 10px;
    }

    .thm-remote-badge-button,
    .thm-remote-badge-button img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}
