/* --- Badge trigger icon (sits next to avatar, like the Discord button) --- */

.badge-btn-small {
    width: 26px;
    height: 26px;
    display: inline-block;
    border-radius: 50%;
    background-size: 90%;
    background-position: center;
    background-repeat: no-repeat;
    cursor: default;
    position: relative;
    flex-shrink: 0;
}

/* Creator list: badge sits as a corner overlay on the avatar */
.creator-avatar-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.creator-avatar-wrap .badge-btn-small {
    position: absolute;
    bottom: -4px;
    left: -12px;
    width: 34px;
    height: 34px;
    margin-right: 0;
}

/* --- Popup base (shared position/animation, content differs below) --- */

.badge-detail-popup {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    z-index: 10000;
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.badge-detail-popup.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* --- Style A: named rows (icon + name + description visible), used on the Creator List --- */

.badge-detail-popup-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    min-width: 200px;
    max-width: 260px;
    padding: 10px;
}

.badge-popup-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-popup-row img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.badge-popup-row-info {
    display: flex;
    flex-direction: column;
}

.badge-popup-row-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}

.badge-popup-row-desc {
    font-size: 11px;
    color: #999;
}

/* --- Style B: icon-only grid, hover one icon to see its name+description. Used on project pages. --- */

.badge-detail-popup-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: max-content;
    max-width: 220px;
    padding: 10px;
}

.badge-mini-icon-wrap {
    position: relative;
    display: inline-block;
}

.badge-mini-icon-wrap img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 0 !important;
    display: block;
    cursor: default;
}

.badge-mini-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 200px;
    padding: 8px 10px;
    background: #141414;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: "Minecraft", Arial, sans-serif;
}

.badge-mini-icon-wrap:hover .badge-mini-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.badge-mini-tooltip-name {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #fff !important;
    text-shadow: none !important;
}

.badge-mini-tooltip-desc {
    font-size: 11px !important;
    color: #999 !important;
    font-weight: normal !important;
    text-shadow: none !important;
}

/* --- Profile page: badge selection list --- */

.badges-heading {
    font-size: 0.85rem;
    color: #ccc;
    text-shadow: 2px 2px 0 #000;
    margin: 0 0 0.25rem;
    font-weight: normal;
}

.badges-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.badges-hint {
    font-size: 0.8rem !important;
    color: #888 !important;
}

.badge-select-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.badge-select-card:hover {
    border-color: #444;
}

.badge-select-card.active {
    border-color: #6ab04c;
    cursor: default;
}

.badge-select-card img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.badge-select-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.badge-select-name {
    font-weight: 600;
    color: #ccc;
    font-size: 14px;
}

.badge-select-desc {
    font-size: 10px;
    color: #aaa;
    font-weight: normal;
}

.badge-select-current {
    background: #6ab04c;
    color: white !important;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    text-shadow: none !important;
}

.badge-toggle-expand {
    background: none !important;
    border: none !important;
    color: #6ab04c !important;
    cursor: pointer;
    font-size: 12px !important;
    padding: 4px 0 !important;
    text-align: left !important;
    text-shadow: none !important;
    width: auto !important;
    display: inline-block !important;
}

.badge-toggle-expand:hover {
    text-decoration: underline;
}

/* --- Admin panel: badge dropdown --- */

.badge-cell {
    position: relative;
}

.badge-dropdown-toggle {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    font-family: "Minecraft", Arial, sans-serif;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.badge-dropdown {
    display: none;
    position: fixed;
    z-index: 1000;
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 10px;
    padding: 8px;
    min-width: 85px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    flex-direction: column;
    gap: 4px;
}

.badge-dropdown.open {
    display: flex;
}

.badge-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
}

.badge-checkbox-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.badge-checkbox-label.locked {
    cursor: not-allowed;
}

.badge-checkbox-label.locked .badge-checkbox-icon {
    filter: grayscale(100%) opacity(0.5) !important;
}