/* Badge system — showcase editor, hex grid, affiliate track */
.badges-page {
    padding-bottom: 2.5rem;
}

.badges-hero {
    margin-bottom: 1.25rem;
}

.badges-hero__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    justify-content: space-between;
}

.badges-hero__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    color: var(--accent, #4ade80);
    font-weight: 600;
}

.badges-hero__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.badges-hero__lede {
    margin: 0;
    max-width: 42rem;
    color: var(--text-muted, #94a3b8);
}

.badges-hero__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: 10rem;
}

.badges-progress {
    text-align: right;
}

.badges-progress__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.badges-progress__label {
    font-size: 0.8rem;
}

.badges-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .badges-layout {
        grid-template-columns: 1fr;
    }

    .badges-hero__aside {
        align-items: flex-start;
        text-align: left;
    }

    .badges-progress {
        text-align: left;
    }
}

.badges-panel {
    margin-bottom: 1.25rem;
}

.badges-panel__head {
    margin-bottom: 1rem;
}

.badges-panel__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badges-panel__title--compact {
    font-size: 1rem;
}

.badges-panel__lede {
    margin: 0;
}

.badges-panel__status {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.badges-showcase-form {
    width: 100%;
    max-width: 28rem;
}

.badges-showcase-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Sortable showcase list */
.badge-sort-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge-sort-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: default;
    touch-action: none;
}

.badge-sort-item--ghost {
    opacity: 0.45;
}

.badge-sort-item__handle {
    color: var(--text-muted, #94a3b8);
    cursor: grab;
    padding: 0.25rem;
    flex-shrink: 0;
}

.badge-sort-item__handle:active {
    cursor: grabbing;
}

.badge-sort-item__handle--disabled {
    width: 1.25rem;
    visibility: hidden;
}

.badge-sort-item__hex {
    position: relative;
    width: 44px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--badge-accent, #6b8cff) 35%, transparent), color-mix(in srgb, var(--badge-accent, #6b8cff) 12%, #1e293b));
    color: var(--badge-accent, #6b8cff);
    font-size: 1rem;
}

.badge-sort-item__hex--img {
    clip-path: none;
    background: none;
    width: 44px;
    height: auto;
}

.badge-sort-item__img {
    display: block;
    width: 44px;
    height: auto;
}

.badge-sort-item__lock {
    position: absolute;
    font-size: 0.75rem;
    color: #64748b;
}

.badge-sort-item__copy {
    flex: 1;
    min-width: 0;
}

.badge-sort-item__name {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-sort-item__meta {
    display: block;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hexagon badge (gallery + profile + affiliate) */
.opleak-badge {
    text-align: center;
    --badge-accent: #6b8cff;
}

.opleak-badge__hex {
    position: relative;
    width: 88px;
    height: 100px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(145deg, color-mix(in srgb, var(--badge-accent) 40%, #0f172a), color-mix(in srgb, var(--badge-accent) 15%, #1e293b));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.opleak-badge__hex--img {
    clip-path: none;
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
    max-width: 100%;
}

.opleak-badge__img {
    display: block;
    width: 88px;
    height: auto;
    margin: 0 auto;
}

.opleak-badge--sm .opleak-badge__hex {
    width: 56px;
    height: 64px;
    margin-bottom: 0.25rem;
}

.opleak-badge--sm .opleak-badge__img {
    width: 56px;
}

.opleak-badge--lg .opleak-badge__hex {
    width: 96px;
    height: 110px;
}

.opleak-badge--lg .opleak-badge__img {
    width: 96px;
}

.opleak-badge__icon {
    font-size: 1.75rem;
    color: var(--badge-accent);
    z-index: 1;
}

.opleak-badge--sm .opleak-badge__icon {
    font-size: 1.1rem;
}

.opleak-badge__lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2;
}

.opleak-badge--sm .opleak-badge__lock {
    font-size: 0.9rem;
}

.opleak-badge--locked .opleak-badge__hex:not(.opleak-badge__hex--img) {
    filter: grayscale(0.85);
    opacity: 0.72;
}

.opleak-badge--locked .opleak-badge__img {
    filter: grayscale(0.85) brightness(0.78);
    opacity: 0.72;
}

.opleak-badge--locked .opleak-badge__icon {
    opacity: 0.35;
}

.opleak-badge__tier {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    z-index: 3;
}

.opleak-badge__tier--overlay {
    bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.opleak-badge__name {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.opleak-badge__desc {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.35;
    max-width: 12rem;
    margin-left: auto;
    margin-right: auto;
}

/* Gallery grid */
.badges-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem 1rem;
    margin-top: 1rem;
}

.badges-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-top: 0.75rem;
}

.badges-cat-nav__link {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: inherit;
}

.badges-cat-nav__link.is-active {
    border-color: var(--accent, #4ade80);
    color: var(--accent, #4ade80);
}

/* Affiliate horizontal track */
.badges-affiliate-track {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.badges-affiliate-track .opleak-badge {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 64px;
}

.badges-affiliate-hint {
    margin: 0;
}

/* Profile showcase row */
.profile-badges {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-badges__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.profile-badges__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-badges__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: flex-end;
}

.profile-badges__row .opleak-badge--sm .opleak-badge__name {
    display: none;
}

.profile-badges__manage {
    font-size: 0.8rem;
}
