.attribute-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
}

.attribute-overlay.hidden {
    display: none;
}

.attribute-wrapper {
    box-sizing: border-box;
    width: min(560px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    background: #11161d;
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 14px;
    color: #f5f5f5;
    box-shadow: 0 18px 44px rgba(0,0,0,0.65);
}

.attribute-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.attribute-overlay-header h2 {
    margin: 0;
    font-size: 20px;
}

#close-attributes {
    width: 30px;
    height: 30px;
    border: 1px solid #555;
    border-radius: 5px;
    background: #1d242d;
    color: #fff;
    cursor: pointer;
}

.attribute-distribution-list {
    display: grid;
    gap: 8px;
}

.attribute-distribution-row {
    display: grid;
    grid-template-columns: 38px 1fr 34px 132px 34px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    background: #171f28;
}

.attribute-distribution-row img {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    object-fit: cover;
}

.attribute-distribution-name {
    font-weight: 700;
}

.attribute-minus,
.attribute-plus {
    width: 34px;
    height: 34px;
    border: 1px solid #4d5a66;
    border-radius: 6px;
    background: #202b36;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.attribute-minus:disabled,
.attribute-plus:disabled,
#save-attributes:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.attribute-value {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.attribute-added {
    color: #65d985;
}

.attribute-total {
    color: #9fc9ff;
}

.attribute-error {
    min-height: 20px;
    margin-top: 10px;
    color: #ff8080;
}

.attribute-overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.attribute-overlay-actions button {
    padding: 8px 12px;
    border: 1px solid #52606d;
    border-radius: 6px;
    background: #223040;
    color: #fff;
    cursor: pointer;
}

#save-attributes {
    border-color: #d4af37;
    background: #3a3020;
}

@media (max-width: 600px) {
    .attribute-overlay-header {
        flex-wrap: wrap;
    }

    .attribute-distribution-row {
        grid-template-columns: 28px minmax(0, 1fr) 32px 80px 32px;
        gap: 4px;
        padding: 6px;
    }

    .attribute-distribution-row img {
        width: 28px;
        height: 28px;
    }

    .attribute-minus,
    .attribute-plus {
        width: 32px;
    }
}

